claude-flow-novice 1.6.4 → 1.6.5
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/commands/parse-epic.js +180 -0
- package/.claude/settings.local.json +2 -1
- package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +37 -2
- package/.claude-flow-novice/dist/mcp/transports/base.js +5 -0
- package/.claude-flow-novice/dist/mcp/transports/base.js.map +1 -0
- package/.claude-flow-novice/dist/mcp/transports/http.js +414 -0
- package/.claude-flow-novice/dist/mcp/transports/http.js.map +1 -0
- package/.claude-flow-novice/dist/mcp/transports/stdio.js +217 -0
- package/.claude-flow-novice/dist/mcp/transports/stdio.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js +129 -0
- package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/index.js +3 -0
- package/.claude-flow-novice/dist/src/cli/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js +266 -0
- package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/message-bus.js +105 -2
- package/.claude-flow-novice/dist/src/communication/message-bus.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +1 -1
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js +632 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js +11 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js +318 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js +234 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js +347 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js +13 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js +173 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js +526 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js +443 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js +366 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js +287 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js +364 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js +492 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js +786 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js +342 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js +601 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js +413 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js +471 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js +379 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js +211 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js +33 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js +920 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js +385 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js +138 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js +478 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js +358 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js +588 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js +153 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js +360 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js +337 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js +669 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js +451 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js +271 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js +439 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js +92 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js +21 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js +223 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js +436 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js +278 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js +317 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js +273 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js +15 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js +512 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js +67 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js +557 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js +212 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js +552 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js +635 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js +28 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js +25 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js +308 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js +439 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js +540 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js +367 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js +518 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js +377 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js +371 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js +355 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js +295 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js +411 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js +387 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js +589 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js +444 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js +560 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js +104 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js +847 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js +470 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js +450 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js +13 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js +625 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js +545 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js +740 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js +415 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js +615 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js +547 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js +342 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js +259 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js +273 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js +8 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js +310 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js +218 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js +6 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js +145 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js +122 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/config-translator.js +17 -43
- package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +34 -76
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js +172 -0
- package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/core/index.js +7 -0
- package/.claude-flow-novice/dist/src/coordination/shared/core/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/index.js +19 -0
- package/.claude-flow-novice/dist/src/coordination/shared/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js +24 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js +7 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js +920 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message.js +138 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js +259 -0
- package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js +17 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js +19 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js +357 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js +679 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/index.js +7 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js +10 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js +52 -2
- package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -1
- package/.claude-flow-novice/dist/src/mcp/mcp-server-novice.js +37 -2
- package/.claude-flow-novice/dist/src/mcp/session-manager.js +3 -1
- package/.claude-flow-novice/dist/src/mcp/session-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/provider-manager.js +36 -3
- package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js +65 -41
- package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js.map +1 -1
- package/.claude-flow-novice/dist/src/web/api/server.js +1 -1
- package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -1
- package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js +30 -0
- package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js.map +1 -1
- package/.claude-flow-novice/metrics.db-shm +0 -0
- package/.claude-flow-novice/metrics.db-wal +0 -0
- package/package.json +2 -2
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/view-alerts.sh +307 -0
- package/scripts/test-zai-api.cjs +2 -2
- package/src/slash-commands/parse-epic.js +1 -1
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - Message Bus Integration
|
|
3
|
+
*
|
|
4
|
+
* Integrates lightweight message broker with State Machine (Phase 01) and
|
|
5
|
+
* Dependency Graph (Phase 02). Provides event-driven message flow for agent
|
|
6
|
+
* coordination and task lifecycle management.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - State transition → Message publishing (e.g., IDLE→WORKING → "agent.state.working")
|
|
10
|
+
* - Task lifecycle → Message publishing (e.g., "task.assigned.{taskId}")
|
|
11
|
+
* - Message-driven state transitions (bidirectional communication)
|
|
12
|
+
* - Request/reply pattern for synchronous operations
|
|
13
|
+
* - Topic-based pub/sub with wildcard support
|
|
14
|
+
* - Priority-based message delivery
|
|
15
|
+
*
|
|
16
|
+
* @module coordination/v2/sdk/message-bus-integration
|
|
17
|
+
*/ import { EventEmitter } from 'node:events';
|
|
18
|
+
import { AgentState } from '../../shared/core/agent-state.js';
|
|
19
|
+
import { MessagePriority, MessageUtils } from '../core/message.js';
|
|
20
|
+
import { Logger } from '../../../core/logger.js';
|
|
21
|
+
/**
|
|
22
|
+
* MessageBusIntegration - Event-driven message bus for agent coordination
|
|
23
|
+
*
|
|
24
|
+
* Responsibilities:
|
|
25
|
+
* 1. Publish messages on state transitions (IDLE→WORKING → "agent.state.working")
|
|
26
|
+
* 2. Publish messages on task lifecycle (assigned → "task.assigned.{taskId}")
|
|
27
|
+
* 3. Subscribe to messages and trigger state transitions
|
|
28
|
+
* 4. Support request/reply for synchronous operations
|
|
29
|
+
* 5. Provide unified metrics and monitoring
|
|
30
|
+
*
|
|
31
|
+
* Event flow examples:
|
|
32
|
+
* - Agent transitions IDLE→WORKING → Publish "agent.state.working" message
|
|
33
|
+
* - Task assigned → Publish "task.assigned.{taskId}" message
|
|
34
|
+
* - Message "agent.command.pause" received → Trigger PAUSED state transition
|
|
35
|
+
* - Message "task.command.retry" received → Retry failed task
|
|
36
|
+
*/ export class MessageBusIntegration extends EventEmitter {
|
|
37
|
+
logger;
|
|
38
|
+
config;
|
|
39
|
+
subscriptions;
|
|
40
|
+
pendingMessages;
|
|
41
|
+
messageQueue;
|
|
42
|
+
replyHandlers;
|
|
43
|
+
isProcessing;
|
|
44
|
+
processingInterval;
|
|
45
|
+
metrics;
|
|
46
|
+
eventHandlerCleanup;
|
|
47
|
+
constructor(config){
|
|
48
|
+
super();
|
|
49
|
+
this.logger = new Logger({
|
|
50
|
+
level: 'info',
|
|
51
|
+
format: 'text',
|
|
52
|
+
destination: 'console'
|
|
53
|
+
});
|
|
54
|
+
this.config = {
|
|
55
|
+
...config,
|
|
56
|
+
autoPublishStateTransitions: config.autoPublishStateTransitions ?? true,
|
|
57
|
+
autoPublishTaskEvents: config.autoPublishTaskEvents ?? true,
|
|
58
|
+
enableMessageDrivenTransitions: config.enableMessageDrivenTransitions ?? true,
|
|
59
|
+
maxPendingMessages: config.maxPendingMessages ?? 1000,
|
|
60
|
+
defaultRequestTimeout: config.defaultRequestTimeout ?? 30000
|
|
61
|
+
};
|
|
62
|
+
this.subscriptions = new Map();
|
|
63
|
+
this.pendingMessages = [];
|
|
64
|
+
this.messageQueue = new Map();
|
|
65
|
+
this.replyHandlers = new Map();
|
|
66
|
+
this.isProcessing = false;
|
|
67
|
+
this.eventHandlerCleanup = [];
|
|
68
|
+
this.metrics = {
|
|
69
|
+
totalPublished: 0,
|
|
70
|
+
totalDelivered: 0,
|
|
71
|
+
totalFailed: 0,
|
|
72
|
+
totalSubscriptions: 0,
|
|
73
|
+
messagesByTopic: {},
|
|
74
|
+
messagesByPriority: {},
|
|
75
|
+
avgDeliveryTime: 0,
|
|
76
|
+
stateTransitionMessages: 0,
|
|
77
|
+
taskLifecycleMessages: 0,
|
|
78
|
+
messageDrivenTransitions: 0,
|
|
79
|
+
activeRequests: 0,
|
|
80
|
+
requestTimeouts: 0
|
|
81
|
+
};
|
|
82
|
+
this.setupEventHandlers();
|
|
83
|
+
this.logger.info('MessageBusIntegration initialized', {
|
|
84
|
+
autoPublishStateTransitions: this.config.autoPublishStateTransitions,
|
|
85
|
+
autoPublishTaskEvents: this.config.autoPublishTaskEvents,
|
|
86
|
+
enableMessageDrivenTransitions: this.config.enableMessageDrivenTransitions
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// ============================================
|
|
90
|
+
// Event Handler Setup (Bidirectional Sync)
|
|
91
|
+
// ============================================
|
|
92
|
+
/**
|
|
93
|
+
* Setup event handlers for state machine and scheduler integration
|
|
94
|
+
*/ setupEventHandlers() {
|
|
95
|
+
// 1. State transition → Publish message
|
|
96
|
+
if (this.config.autoPublishStateTransitions) {
|
|
97
|
+
const onStateTransition = async (event)=>{
|
|
98
|
+
try {
|
|
99
|
+
// Publish state transition message
|
|
100
|
+
const topic = `agent.state.${event.toState.toLowerCase()}`;
|
|
101
|
+
await this.publish({
|
|
102
|
+
topic,
|
|
103
|
+
payload: {
|
|
104
|
+
agentId: event.agentId,
|
|
105
|
+
sessionId: event.sessionId,
|
|
106
|
+
fromState: event.fromState,
|
|
107
|
+
toState: event.toState,
|
|
108
|
+
timestamp: event.timestamp,
|
|
109
|
+
checkpointId: event.checkpointId,
|
|
110
|
+
metadata: event.metadata
|
|
111
|
+
},
|
|
112
|
+
priority: MessagePriority.HIGH,
|
|
113
|
+
senderId: event.agentId
|
|
114
|
+
});
|
|
115
|
+
this.metrics.stateTransitionMessages++;
|
|
116
|
+
this.logger.debug('Published state transition message', {
|
|
117
|
+
topic,
|
|
118
|
+
agentId: event.agentId,
|
|
119
|
+
transition: `${event.fromState} → ${event.toState}`
|
|
120
|
+
});
|
|
121
|
+
} catch (error) {
|
|
122
|
+
this.logger.error('Failed to publish state transition message', {
|
|
123
|
+
error: error instanceof Error ? error.message : String(error)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
this.config.stateMachine.on('state:transition', onStateTransition);
|
|
128
|
+
this.eventHandlerCleanup.push(()=>this.config.stateMachine.off('state:transition', onStateTransition));
|
|
129
|
+
}
|
|
130
|
+
// 2. Task assigned → Publish message
|
|
131
|
+
if (this.config.autoPublishTaskEvents) {
|
|
132
|
+
const onTaskAssigned = async (event)=>{
|
|
133
|
+
try {
|
|
134
|
+
const topic = `task.assigned.${event.taskId}`;
|
|
135
|
+
await this.publish({
|
|
136
|
+
topic,
|
|
137
|
+
payload: {
|
|
138
|
+
taskId: event.taskId,
|
|
139
|
+
agentId: event.task.agentId,
|
|
140
|
+
priority: event.task.priority,
|
|
141
|
+
timestamp: Date.now()
|
|
142
|
+
},
|
|
143
|
+
priority: MessagePriority.HIGH
|
|
144
|
+
});
|
|
145
|
+
this.metrics.taskLifecycleMessages++;
|
|
146
|
+
this.logger.debug('Published task assigned message', {
|
|
147
|
+
topic,
|
|
148
|
+
taskId: event.taskId,
|
|
149
|
+
agentId: event.task.agentId
|
|
150
|
+
});
|
|
151
|
+
} catch (error) {
|
|
152
|
+
this.logger.error('Failed to publish task assigned message', {
|
|
153
|
+
error: error instanceof Error ? error.message : String(error)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
this.config.taskScheduler.on('task:assigned', onTaskAssigned);
|
|
158
|
+
this.eventHandlerCleanup.push(()=>this.config.taskScheduler.off('task:assigned', onTaskAssigned));
|
|
159
|
+
}
|
|
160
|
+
// 3. Task completed → Publish message
|
|
161
|
+
if (this.config.autoPublishTaskEvents) {
|
|
162
|
+
const onTaskCompleted = async (event)=>{
|
|
163
|
+
try {
|
|
164
|
+
const topic = `task.completed.${event.taskId}`;
|
|
165
|
+
await this.publish({
|
|
166
|
+
topic,
|
|
167
|
+
payload: {
|
|
168
|
+
taskId: event.taskId,
|
|
169
|
+
timestamp: Date.now()
|
|
170
|
+
},
|
|
171
|
+
priority: MessagePriority.NORMAL
|
|
172
|
+
});
|
|
173
|
+
this.metrics.taskLifecycleMessages++;
|
|
174
|
+
this.logger.debug('Published task completed message', {
|
|
175
|
+
topic,
|
|
176
|
+
taskId: event.taskId
|
|
177
|
+
});
|
|
178
|
+
} catch (error) {
|
|
179
|
+
this.logger.error('Failed to publish task completed message', {
|
|
180
|
+
error: error instanceof Error ? error.message : String(error)
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
this.config.taskScheduler.on('task:completed', onTaskCompleted);
|
|
185
|
+
this.eventHandlerCleanup.push(()=>this.config.taskScheduler.off('task:completed', onTaskCompleted));
|
|
186
|
+
}
|
|
187
|
+
// 4. Task failed → Publish message
|
|
188
|
+
if (this.config.autoPublishTaskEvents) {
|
|
189
|
+
const onTaskFailed = async (event)=>{
|
|
190
|
+
try {
|
|
191
|
+
const topic = `task.failed.${event.taskId}`;
|
|
192
|
+
await this.publish({
|
|
193
|
+
topic,
|
|
194
|
+
payload: {
|
|
195
|
+
taskId: event.taskId,
|
|
196
|
+
error: event.error.message,
|
|
197
|
+
retryCount: event.retryCount,
|
|
198
|
+
timestamp: Date.now()
|
|
199
|
+
},
|
|
200
|
+
priority: MessagePriority.HIGH
|
|
201
|
+
});
|
|
202
|
+
this.metrics.taskLifecycleMessages++;
|
|
203
|
+
this.logger.debug('Published task failed message', {
|
|
204
|
+
topic,
|
|
205
|
+
taskId: event.taskId,
|
|
206
|
+
retryCount: event.retryCount
|
|
207
|
+
});
|
|
208
|
+
} catch (error) {
|
|
209
|
+
this.logger.error('Failed to publish task failed message', {
|
|
210
|
+
error: error instanceof Error ? error.message : String(error)
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
this.config.taskScheduler.on('task:failed', onTaskFailed);
|
|
215
|
+
this.eventHandlerCleanup.push(()=>this.config.taskScheduler.off('task:failed', onTaskFailed));
|
|
216
|
+
}
|
|
217
|
+
this.logger.debug('Event handlers registered for message bus integration');
|
|
218
|
+
}
|
|
219
|
+
// ============================================
|
|
220
|
+
// Publish/Subscribe Pattern
|
|
221
|
+
// ============================================
|
|
222
|
+
/**
|
|
223
|
+
* Publish a message to the bus
|
|
224
|
+
*
|
|
225
|
+
* @param config - Message configuration
|
|
226
|
+
* @returns Published message
|
|
227
|
+
*/ async publish(config) {
|
|
228
|
+
// Validate configuration
|
|
229
|
+
MessageUtils.validateConfig(config);
|
|
230
|
+
// Check backpressure
|
|
231
|
+
if (this.pendingMessages.length >= this.config.maxPendingMessages) {
|
|
232
|
+
throw new Error(`Message bus backpressure: ${this.pendingMessages.length} pending messages (max: ${this.config.maxPendingMessages})`);
|
|
233
|
+
}
|
|
234
|
+
// Create message
|
|
235
|
+
const message = {
|
|
236
|
+
id: MessageUtils.generateMessageId(),
|
|
237
|
+
topic: config.topic,
|
|
238
|
+
payload: config.payload,
|
|
239
|
+
priority: MessageUtils.normalizePriority(config.priority),
|
|
240
|
+
timestamp: Date.now(),
|
|
241
|
+
replyTo: config.replyTo,
|
|
242
|
+
correlationId: config.correlationId,
|
|
243
|
+
senderId: config.senderId,
|
|
244
|
+
recipientId: config.recipientId,
|
|
245
|
+
deliverySemantics: config.deliverySemantics,
|
|
246
|
+
metadata: config.metadata
|
|
247
|
+
};
|
|
248
|
+
// Add to priority queue
|
|
249
|
+
const priority = message.priority;
|
|
250
|
+
if (!this.messageQueue.has(priority)) {
|
|
251
|
+
this.messageQueue.set(priority, []);
|
|
252
|
+
}
|
|
253
|
+
this.messageQueue.get(priority).push(message);
|
|
254
|
+
// Update metrics
|
|
255
|
+
this.metrics.totalPublished++;
|
|
256
|
+
this.metrics.messagesByTopic[message.topic] = (this.metrics.messagesByTopic[message.topic] || 0) + 1;
|
|
257
|
+
this.metrics.messagesByPriority[priority] = (this.metrics.messagesByPriority[priority] || 0) + 1;
|
|
258
|
+
this.logger.debug('Message published', {
|
|
259
|
+
messageId: message.id,
|
|
260
|
+
topic: message.topic,
|
|
261
|
+
priority: message.priority
|
|
262
|
+
});
|
|
263
|
+
// Trigger immediate processing
|
|
264
|
+
this.processMessages();
|
|
265
|
+
return message;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Subscribe to messages on a topic
|
|
269
|
+
*
|
|
270
|
+
* @param config - Subscription configuration
|
|
271
|
+
* @returns Subscription handle
|
|
272
|
+
*/ subscribe(config) {
|
|
273
|
+
const subscriptionRecord = {
|
|
274
|
+
id: `sub-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
275
|
+
topic: config.topic,
|
|
276
|
+
handler: config.handler,
|
|
277
|
+
filter: config.filter,
|
|
278
|
+
priority: config.priority ?? 0,
|
|
279
|
+
createdAt: Date.now()
|
|
280
|
+
};
|
|
281
|
+
// Add to subscriptions map
|
|
282
|
+
if (!this.subscriptions.has(config.topic)) {
|
|
283
|
+
this.subscriptions.set(config.topic, []);
|
|
284
|
+
}
|
|
285
|
+
const topicSubscriptions = this.subscriptions.get(config.topic);
|
|
286
|
+
topicSubscriptions.push(subscriptionRecord);
|
|
287
|
+
// Sort by priority (highest first)
|
|
288
|
+
topicSubscriptions.sort((a, b)=>b.priority - a.priority);
|
|
289
|
+
this.metrics.totalSubscriptions++;
|
|
290
|
+
this.logger.debug('Subscription created', {
|
|
291
|
+
subscriptionId: subscriptionRecord.id,
|
|
292
|
+
topic: config.topic
|
|
293
|
+
});
|
|
294
|
+
// Return subscription handle
|
|
295
|
+
return {
|
|
296
|
+
id: subscriptionRecord.id,
|
|
297
|
+
topic: config.topic,
|
|
298
|
+
createdAt: subscriptionRecord.createdAt,
|
|
299
|
+
unsubscribe: ()=>this.unsubscribe(subscriptionRecord.id, config.topic)
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Unsubscribe from a topic
|
|
304
|
+
*
|
|
305
|
+
* @param subscriptionId - Subscription ID
|
|
306
|
+
* @param topic - Topic to unsubscribe from
|
|
307
|
+
*/ unsubscribe(subscriptionId, topic) {
|
|
308
|
+
const topicSubscriptions = this.subscriptions.get(topic);
|
|
309
|
+
if (!topicSubscriptions) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const index = topicSubscriptions.findIndex((sub)=>sub.id === subscriptionId);
|
|
313
|
+
if (index !== -1) {
|
|
314
|
+
topicSubscriptions.splice(index, 1);
|
|
315
|
+
this.metrics.totalSubscriptions--;
|
|
316
|
+
this.logger.debug('Subscription removed', {
|
|
317
|
+
subscriptionId,
|
|
318
|
+
topic
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
// Remove topic if no subscriptions left
|
|
322
|
+
if (topicSubscriptions.length === 0) {
|
|
323
|
+
this.subscriptions.delete(topic);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// ============================================
|
|
327
|
+
// Request/Reply Pattern
|
|
328
|
+
// ============================================
|
|
329
|
+
/**
|
|
330
|
+
* Send a request and wait for reply
|
|
331
|
+
*
|
|
332
|
+
* @param topic - Request topic
|
|
333
|
+
* @param payload - Request payload
|
|
334
|
+
* @param options - Request options
|
|
335
|
+
* @returns Reply promise
|
|
336
|
+
*/ async request(topic, payload, options) {
|
|
337
|
+
const correlationId = options?.correlationId || MessageUtils.generateCorrelationId();
|
|
338
|
+
const timeout = options?.timeout || this.config.defaultRequestTimeout;
|
|
339
|
+
const priority = options?.priority ?? MessagePriority.NORMAL;
|
|
340
|
+
// Create reply promise
|
|
341
|
+
const replyPromise = new Promise((resolve, reject)=>{
|
|
342
|
+
const timeoutHandle = setTimeout(()=>{
|
|
343
|
+
this.replyHandlers.delete(correlationId);
|
|
344
|
+
this.metrics.requestTimeouts++;
|
|
345
|
+
this.metrics.activeRequests--;
|
|
346
|
+
reject(new Error(`Request timeout after ${timeout}ms`));
|
|
347
|
+
}, timeout);
|
|
348
|
+
this.replyHandlers.set(correlationId, {
|
|
349
|
+
resolve: resolve,
|
|
350
|
+
reject,
|
|
351
|
+
timeout: timeoutHandle
|
|
352
|
+
});
|
|
353
|
+
this.metrics.activeRequests++;
|
|
354
|
+
});
|
|
355
|
+
// Publish request message
|
|
356
|
+
await this.publish({
|
|
357
|
+
topic,
|
|
358
|
+
payload,
|
|
359
|
+
priority,
|
|
360
|
+
correlationId,
|
|
361
|
+
replyTo: `reply.${correlationId}`
|
|
362
|
+
});
|
|
363
|
+
return replyPromise;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Send a reply to a request
|
|
367
|
+
*
|
|
368
|
+
* @param request - Original request message
|
|
369
|
+
* @param payload - Reply payload
|
|
370
|
+
* @param success - Success status
|
|
371
|
+
* @param error - Error message if failed
|
|
372
|
+
*/ async reply(request, payload, success = true, error) {
|
|
373
|
+
if (!request.replyTo) {
|
|
374
|
+
throw new Error('Request message does not have replyTo topic');
|
|
375
|
+
}
|
|
376
|
+
const replyMessage = MessageUtils.createReply(request, payload, success, error);
|
|
377
|
+
await this.publish({
|
|
378
|
+
topic: request.replyTo,
|
|
379
|
+
payload: replyMessage,
|
|
380
|
+
correlationId: request.correlationId || request.id,
|
|
381
|
+
priority: MessagePriority.HIGH
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
// ============================================
|
|
385
|
+
// Message Processing
|
|
386
|
+
// ============================================
|
|
387
|
+
/**
|
|
388
|
+
* Process pending messages (internal)
|
|
389
|
+
*/ async processMessages() {
|
|
390
|
+
if (this.isProcessing) {
|
|
391
|
+
return; // Already processing
|
|
392
|
+
}
|
|
393
|
+
this.isProcessing = true;
|
|
394
|
+
try {
|
|
395
|
+
// Process messages by priority (highest first)
|
|
396
|
+
const priorities = Array.from(this.messageQueue.keys()).sort((a, b)=>b - a);
|
|
397
|
+
for (const priority of priorities){
|
|
398
|
+
const messages = this.messageQueue.get(priority);
|
|
399
|
+
if (!messages || messages.length === 0) {
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
// Process all messages at this priority level
|
|
403
|
+
while(messages.length > 0){
|
|
404
|
+
const message = messages.shift();
|
|
405
|
+
await this.deliverMessage(message);
|
|
406
|
+
}
|
|
407
|
+
// Remove empty priority queues
|
|
408
|
+
this.messageQueue.delete(priority);
|
|
409
|
+
}
|
|
410
|
+
} finally{
|
|
411
|
+
this.isProcessing = false;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Deliver message to subscribers
|
|
416
|
+
*/ async deliverMessage(message) {
|
|
417
|
+
const startTime = Date.now();
|
|
418
|
+
let delivered = false;
|
|
419
|
+
try {
|
|
420
|
+
// Find matching subscriptions (exact match + wildcard patterns)
|
|
421
|
+
const matchingSubscriptions = [];
|
|
422
|
+
for (const [pattern, subs] of Array.from(this.subscriptions.entries())){
|
|
423
|
+
if (MessageUtils.matchesTopic(message.topic, pattern)) {
|
|
424
|
+
matchingSubscriptions.push(...subs);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
// Handle reply messages
|
|
428
|
+
if (message.correlationId && this.replyHandlers.has(message.correlationId)) {
|
|
429
|
+
const handler = this.replyHandlers.get(message.correlationId);
|
|
430
|
+
clearTimeout(handler.timeout);
|
|
431
|
+
this.replyHandlers.delete(message.correlationId);
|
|
432
|
+
this.metrics.activeRequests--;
|
|
433
|
+
handler.resolve(message.payload);
|
|
434
|
+
delivered = true;
|
|
435
|
+
}
|
|
436
|
+
// Deliver to all matching handlers
|
|
437
|
+
for (const sub of matchingSubscriptions){
|
|
438
|
+
// Apply filter if present
|
|
439
|
+
if (sub.filter && !sub.filter(message)) {
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
try {
|
|
443
|
+
await sub.handler(message);
|
|
444
|
+
delivered = true;
|
|
445
|
+
} catch (error) {
|
|
446
|
+
this.logger.error('Message handler error', {
|
|
447
|
+
subscriptionId: sub.id,
|
|
448
|
+
topic: message.topic,
|
|
449
|
+
error: error instanceof Error ? error.message : String(error)
|
|
450
|
+
});
|
|
451
|
+
this.metrics.totalFailed++;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (delivered) {
|
|
455
|
+
this.metrics.totalDelivered++;
|
|
456
|
+
}
|
|
457
|
+
// Update average delivery time
|
|
458
|
+
const deliveryTime = Date.now() - startTime;
|
|
459
|
+
this.metrics.avgDeliveryTime = (this.metrics.avgDeliveryTime * (this.metrics.totalDelivered - 1) + deliveryTime) / this.metrics.totalDelivered;
|
|
460
|
+
} catch (error) {
|
|
461
|
+
this.logger.error('Message delivery error', {
|
|
462
|
+
messageId: message.id,
|
|
463
|
+
topic: message.topic,
|
|
464
|
+
error: error instanceof Error ? error.message : String(error)
|
|
465
|
+
});
|
|
466
|
+
this.metrics.totalFailed++;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
// ============================================
|
|
470
|
+
// Message-Driven State Transitions
|
|
471
|
+
// ============================================
|
|
472
|
+
/**
|
|
473
|
+
* Register message-driven state transition handlers
|
|
474
|
+
*
|
|
475
|
+
* Allows external systems to trigger state transitions via messages.
|
|
476
|
+
* Example: Publish "agent.command.pause" → Agent transitions to PAUSED
|
|
477
|
+
*/ registerMessageDrivenHandlers() {
|
|
478
|
+
if (!this.config.enableMessageDrivenTransitions) {
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
// Handle agent command messages
|
|
482
|
+
this.subscribe({
|
|
483
|
+
topic: 'agent.command.*',
|
|
484
|
+
handler: async (message)=>{
|
|
485
|
+
const { agentId, command } = message.payload;
|
|
486
|
+
try {
|
|
487
|
+
let newState;
|
|
488
|
+
switch(command){
|
|
489
|
+
case 'pause':
|
|
490
|
+
newState = AgentState.PAUSED;
|
|
491
|
+
break;
|
|
492
|
+
case 'resume':
|
|
493
|
+
newState = AgentState.WORKING;
|
|
494
|
+
break;
|
|
495
|
+
case 'terminate':
|
|
496
|
+
newState = AgentState.TERMINATED;
|
|
497
|
+
break;
|
|
498
|
+
default:
|
|
499
|
+
this.logger.warn('Unknown agent command', {
|
|
500
|
+
command
|
|
501
|
+
});
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
if (newState) {
|
|
505
|
+
await this.config.stateMachine.transition(agentId, newState, {
|
|
506
|
+
metadata: {
|
|
507
|
+
triggeredBy: 'message',
|
|
508
|
+
messageId: message.id
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
this.metrics.messageDrivenTransitions++;
|
|
512
|
+
this.logger.debug('Message-driven state transition executed', {
|
|
513
|
+
agentId,
|
|
514
|
+
command,
|
|
515
|
+
newState
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
} catch (error) {
|
|
519
|
+
this.logger.error('Failed to execute message-driven state transition', {
|
|
520
|
+
agentId,
|
|
521
|
+
command,
|
|
522
|
+
error: error instanceof Error ? error.message : String(error)
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
this.logger.info('Message-driven state transition handlers registered');
|
|
528
|
+
}
|
|
529
|
+
// ============================================
|
|
530
|
+
// Lifecycle Management
|
|
531
|
+
// ============================================
|
|
532
|
+
/**
|
|
533
|
+
* Start message bus processing
|
|
534
|
+
*/ start() {
|
|
535
|
+
if (this.processingInterval) {
|
|
536
|
+
this.logger.warn('Message bus already started');
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
// Start periodic processing (fallback for low-traffic scenarios)
|
|
540
|
+
this.processingInterval = setInterval(()=>{
|
|
541
|
+
this.processMessages();
|
|
542
|
+
}, 100); // Process every 100ms
|
|
543
|
+
this.logger.info('Message bus started');
|
|
544
|
+
this.emit('message-bus:started');
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Stop message bus processing
|
|
548
|
+
*/ stop() {
|
|
549
|
+
if (this.processingInterval) {
|
|
550
|
+
clearInterval(this.processingInterval);
|
|
551
|
+
this.processingInterval = undefined;
|
|
552
|
+
}
|
|
553
|
+
// Clear pending reply handlers
|
|
554
|
+
for (const [correlationId, handler] of Array.from(this.replyHandlers.entries())){
|
|
555
|
+
clearTimeout(handler.timeout);
|
|
556
|
+
handler.reject(new Error('Message bus stopped'));
|
|
557
|
+
}
|
|
558
|
+
this.replyHandlers.clear();
|
|
559
|
+
this.logger.info('Message bus stopped');
|
|
560
|
+
this.emit('message-bus:stopped');
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Check if message bus is running
|
|
564
|
+
*/ isActive() {
|
|
565
|
+
return this.processingInterval !== undefined;
|
|
566
|
+
}
|
|
567
|
+
// ============================================
|
|
568
|
+
// Metrics and Monitoring
|
|
569
|
+
// ============================================
|
|
570
|
+
/**
|
|
571
|
+
* Get message bus metrics
|
|
572
|
+
*/ getMetrics() {
|
|
573
|
+
return {
|
|
574
|
+
...this.metrics
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Get health status
|
|
579
|
+
*/ getHealthStatus() {
|
|
580
|
+
const metrics = this.getMetrics();
|
|
581
|
+
const issues = [];
|
|
582
|
+
// Check for high failure rate
|
|
583
|
+
const failureRate = metrics.totalPublished > 0 ? metrics.totalFailed / metrics.totalPublished : 0;
|
|
584
|
+
if (failureRate > 0.1) {
|
|
585
|
+
issues.push(`High message failure rate: ${(failureRate * 100).toFixed(1)}%`);
|
|
586
|
+
}
|
|
587
|
+
// Check for backpressure
|
|
588
|
+
const pendingCount = this.pendingMessages.length;
|
|
589
|
+
if (pendingCount > this.config.maxPendingMessages * 0.8) {
|
|
590
|
+
issues.push(`High pending message count: ${pendingCount} (80% of max)`);
|
|
591
|
+
}
|
|
592
|
+
// Check for high request timeout rate
|
|
593
|
+
const requestCount = metrics.activeRequests + metrics.requestTimeouts;
|
|
594
|
+
const timeoutRate = requestCount > 0 ? metrics.requestTimeouts / requestCount : 0;
|
|
595
|
+
if (timeoutRate > 0.2) {
|
|
596
|
+
issues.push(`High request timeout rate: ${(timeoutRate * 100).toFixed(1)}%`);
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
healthy: issues.length === 0,
|
|
600
|
+
issues,
|
|
601
|
+
metrics
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Cleanup message bus
|
|
606
|
+
*/ async cleanup() {
|
|
607
|
+
this.logger.info('Cleaning up message bus integration');
|
|
608
|
+
// Stop processing
|
|
609
|
+
this.stop();
|
|
610
|
+
// Remove event handlers
|
|
611
|
+
for (const cleanup of this.eventHandlerCleanup){
|
|
612
|
+
cleanup();
|
|
613
|
+
}
|
|
614
|
+
this.eventHandlerCleanup = [];
|
|
615
|
+
// Clear subscriptions
|
|
616
|
+
this.subscriptions.clear();
|
|
617
|
+
// Clear pending messages
|
|
618
|
+
this.pendingMessages = [];
|
|
619
|
+
this.messageQueue.clear();
|
|
620
|
+
this.removeAllListeners();
|
|
621
|
+
this.logger.info('Message bus integration cleanup complete');
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
//# sourceMappingURL=message-bus-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.ts"],"names":["EventEmitter","AgentState","MessagePriority","MessageUtils","Logger","MessageBusIntegration","logger","config","subscriptions","pendingMessages","messageQueue","replyHandlers","isProcessing","processingInterval","metrics","eventHandlerCleanup","level","format","destination","autoPublishStateTransitions","autoPublishTaskEvents","enableMessageDrivenTransitions","maxPendingMessages","defaultRequestTimeout","Map","totalPublished","totalDelivered","totalFailed","totalSubscriptions","messagesByTopic","messagesByPriority","avgDeliveryTime","stateTransitionMessages","taskLifecycleMessages","messageDrivenTransitions","activeRequests","requestTimeouts","setupEventHandlers","info","onStateTransition","event","topic","toState","toLowerCase","publish","payload","agentId","sessionId","fromState","timestamp","checkpointId","metadata","priority","HIGH","senderId","debug","transition","error","Error","message","String","stateMachine","on","push","off","onTaskAssigned","taskId","task","Date","now","taskScheduler","onTaskCompleted","NORMAL","onTaskFailed","retryCount","validateConfig","length","id","generateMessageId","normalizePriority","replyTo","correlationId","recipientId","deliverySemantics","has","set","get","messageId","processMessages","subscribe","subscriptionRecord","Math","random","toString","substr","handler","filter","createdAt","topicSubscriptions","sort","a","b","subscriptionId","unsubscribe","index","findIndex","sub","splice","delete","request","options","generateCorrelationId","timeout","replyPromise","Promise","resolve","reject","timeoutHandle","setTimeout","reply","success","replyMessage","createReply","priorities","Array","from","keys","messages","shift","deliverMessage","startTime","delivered","matchingSubscriptions","pattern","subs","entries","matchesTopic","clearTimeout","deliveryTime","registerMessageDrivenHandlers","command","newState","PAUSED","WORKING","TERMINATED","warn","triggeredBy","start","setInterval","emit","stop","clearInterval","undefined","clear","isActive","getMetrics","getHealthStatus","issues","failureRate","toFixed","pendingCount","requestCount","timeoutRate","healthy","cleanup","removeAllListeners"],"mappings":"AAAA;;;;;;;;;;;;;;;;CAgBC,GAED,SAASA,YAAY,QAAQ,cAAc;AAE3C,SAASC,UAAU,QAAQ,mCAAmC;AAS9D,SAGEC,eAAe,EAQfC,YAAY,QACP,qBA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