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,547 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - State Machine Integration
|
|
3
|
+
*
|
|
4
|
+
* Connects Phase 01 state machine with Phase 02 dependency graph and task scheduler.
|
|
5
|
+
* Provides bidirectional event-driven synchronization between agent states and task execution.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Event-driven integration (no polling)
|
|
9
|
+
* - Bidirectional sync: scheduler events → state machine, state transitions → graph updates
|
|
10
|
+
* - Dependency-aware state transitions (block if dependencies not met)
|
|
11
|
+
* - Combined metrics from both systems
|
|
12
|
+
* - Deadlock prevention and detection
|
|
13
|
+
*
|
|
14
|
+
* @module coordination/v2/sdk/state-machine-integration
|
|
15
|
+
*/ import { EventEmitter } from 'node:events';
|
|
16
|
+
import { AgentState } from '../../shared/core/agent-state.js';
|
|
17
|
+
import { DependencyNodeStatus } from '../core/dependency-node.js';
|
|
18
|
+
import { TaskScheduler } from '../core/task-scheduler.js';
|
|
19
|
+
import { Logger } from '../../../core/logger.js';
|
|
20
|
+
/**
|
|
21
|
+
* StateMachineDependencyIntegration - Connects state machine with dependency graph
|
|
22
|
+
*
|
|
23
|
+
* Responsibilities:
|
|
24
|
+
* 1. Sync scheduler events to state machine transitions
|
|
25
|
+
* 2. Sync state machine transitions to graph status updates
|
|
26
|
+
* 3. Enforce dependency-aware state transitions
|
|
27
|
+
* 4. Provide unified metrics and monitoring
|
|
28
|
+
* 5. Handle deadlock detection and recovery
|
|
29
|
+
*
|
|
30
|
+
* Event flow:
|
|
31
|
+
* - Task scheduled → Agent transitions to IDLE
|
|
32
|
+
* - Task assigned → Agent transitions to WORKING
|
|
33
|
+
* - Agent COMPLETED → Scheduler marks task completed
|
|
34
|
+
* - Agent ERROR → Scheduler marks task failed
|
|
35
|
+
* - Agent BLOCKED → Graph updates node status to BLOCKED
|
|
36
|
+
*/ export class StateMachineDependencyIntegration extends EventEmitter {
|
|
37
|
+
logger;
|
|
38
|
+
config;
|
|
39
|
+
scheduler;
|
|
40
|
+
isRunning;
|
|
41
|
+
syncErrors;
|
|
42
|
+
deadlocksDetected;
|
|
43
|
+
deadlocksResolved;
|
|
44
|
+
totalStateTransitions;
|
|
45
|
+
failedTransitions;
|
|
46
|
+
transitionRetries;
|
|
47
|
+
eventHandlerCleanup;
|
|
48
|
+
constructor(config){
|
|
49
|
+
super();
|
|
50
|
+
this.logger = new Logger({
|
|
51
|
+
level: 'info',
|
|
52
|
+
format: 'text',
|
|
53
|
+
destination: 'console'
|
|
54
|
+
});
|
|
55
|
+
this.config = {
|
|
56
|
+
...config,
|
|
57
|
+
autoSync: config.autoSync ?? true,
|
|
58
|
+
enableDeadlockRecovery: config.enableDeadlockRecovery ?? true,
|
|
59
|
+
maxTransitionRetries: config.maxTransitionRetries ?? 3
|
|
60
|
+
};
|
|
61
|
+
// Initialize scheduler with dependency resolver
|
|
62
|
+
const resolver = {
|
|
63
|
+
resolve: async (taskId)=>{
|
|
64
|
+
const node = this.config.dependencyGraph.getNode(taskId);
|
|
65
|
+
if (!node) {
|
|
66
|
+
return {
|
|
67
|
+
taskId,
|
|
68
|
+
readyTasks: [],
|
|
69
|
+
blockedBy: [],
|
|
70
|
+
cycles: []
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const dependencies = this.config.dependencyGraph.getDependencies(taskId);
|
|
74
|
+
const blockedBy = [];
|
|
75
|
+
for (const depId of Array.from(dependencies)){
|
|
76
|
+
const depNode = this.config.dependencyGraph.getNode(depId);
|
|
77
|
+
if (depNode && depNode.status !== DependencyNodeStatus.COMPLETED) {
|
|
78
|
+
blockedBy.push(depId);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const cycleResult = this.config.dependencyGraph.detectCycles();
|
|
82
|
+
return {
|
|
83
|
+
taskId,
|
|
84
|
+
readyTasks: blockedBy.length === 0 ? [
|
|
85
|
+
taskId
|
|
86
|
+
] : [],
|
|
87
|
+
blockedBy,
|
|
88
|
+
cycles: cycleResult.cycles
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
checkDependenciesReady: async (taskId)=>{
|
|
92
|
+
return this.areDependenciesMet(taskId);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this.scheduler = new TaskScheduler(this.config.dependencyGraph, this.config.schedulerConfig);
|
|
96
|
+
this.isRunning = false;
|
|
97
|
+
this.syncErrors = 0;
|
|
98
|
+
this.deadlocksDetected = 0;
|
|
99
|
+
this.deadlocksResolved = 0;
|
|
100
|
+
this.totalStateTransitions = 0;
|
|
101
|
+
this.failedTransitions = 0;
|
|
102
|
+
this.transitionRetries = new Map();
|
|
103
|
+
this.eventHandlerCleanup = [];
|
|
104
|
+
if (this.config.autoSync) {
|
|
105
|
+
this.setupEventHandlers();
|
|
106
|
+
}
|
|
107
|
+
this.logger.info('StateMachineDependencyIntegration initialized', {
|
|
108
|
+
autoSync: this.config.autoSync,
|
|
109
|
+
enableDeadlockRecovery: this.config.enableDeadlockRecovery,
|
|
110
|
+
maxTransitionRetries: this.config.maxTransitionRetries
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// ============================================
|
|
114
|
+
// Event Handler Setup (Bidirectional Sync)
|
|
115
|
+
// ============================================
|
|
116
|
+
/**
|
|
117
|
+
* Setup bidirectional event handlers for integration
|
|
118
|
+
*/ setupEventHandlers() {
|
|
119
|
+
// 1. Task assigned → Transition agent to WORKING
|
|
120
|
+
const onTaskAssigned = async (event)=>{
|
|
121
|
+
try {
|
|
122
|
+
const node = event.task; // TaskAssignedEvent includes the full task object
|
|
123
|
+
// Check dependencies before transitioning
|
|
124
|
+
if (!this.areDependenciesMet(event.taskId)) {
|
|
125
|
+
this.logger.warn('Cannot assign task - dependencies not met', {
|
|
126
|
+
taskId: event.taskId,
|
|
127
|
+
agentId: node.agentId
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
await this.config.stateMachine.transition(node.agentId, AgentState.WORKING, {
|
|
132
|
+
metadata: {
|
|
133
|
+
taskId: event.taskId,
|
|
134
|
+
startedAt: new Date()
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
// Update graph status
|
|
138
|
+
this.config.dependencyGraph.updateStatus(event.taskId, DependencyNodeStatus.EXECUTING);
|
|
139
|
+
this.logger.debug('Agent transitioned to WORKING after task assigned', {
|
|
140
|
+
agentId: node.agentId,
|
|
141
|
+
taskId: event.taskId
|
|
142
|
+
});
|
|
143
|
+
} catch (error) {
|
|
144
|
+
this.handleSyncError('task:assigned', error);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
// 3. Agent COMPLETED → Mark task completed in scheduler
|
|
148
|
+
const onStateTransition = async (event)=>{
|
|
149
|
+
try {
|
|
150
|
+
this.totalStateTransitions++;
|
|
151
|
+
// Find task for this agent
|
|
152
|
+
const node = this.findTaskForAgent(event.agentId);
|
|
153
|
+
if (!node) {
|
|
154
|
+
this.logger.debug('State transition for agent without task', {
|
|
155
|
+
agentId: event.agentId
|
|
156
|
+
});
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (event.toState === AgentState.COMPLETED) {
|
|
160
|
+
// Mark task completed
|
|
161
|
+
this.scheduler.onTaskCompleted(node.taskId);
|
|
162
|
+
// Update graph status
|
|
163
|
+
this.config.dependencyGraph.updateStatus(node.taskId, DependencyNodeStatus.COMPLETED);
|
|
164
|
+
this.logger.debug('Task marked completed after agent state change', {
|
|
165
|
+
agentId: event.agentId,
|
|
166
|
+
taskId: node.taskId
|
|
167
|
+
});
|
|
168
|
+
} else if (event.toState === AgentState.ERROR) {
|
|
169
|
+
// Mark task failed
|
|
170
|
+
const error = new Error(`Agent ${event.agentId} entered ERROR state`);
|
|
171
|
+
await this.handleTaskFailure(node.taskId, error);
|
|
172
|
+
this.logger.debug('Task marked failed after agent error', {
|
|
173
|
+
agentId: event.agentId,
|
|
174
|
+
taskId: node.taskId
|
|
175
|
+
});
|
|
176
|
+
} else if (event.toState === AgentState.BLOCKED) {
|
|
177
|
+
// Update graph status to BLOCKED
|
|
178
|
+
this.config.dependencyGraph.updateStatus(node.taskId, DependencyNodeStatus.FAILED);
|
|
179
|
+
this.logger.debug('Task marked blocked after agent state change', {
|
|
180
|
+
agentId: event.agentId,
|
|
181
|
+
taskId: node.taskId
|
|
182
|
+
});
|
|
183
|
+
} else if (event.toState === AgentState.WAITING) {
|
|
184
|
+
// Task waiting for dependencies
|
|
185
|
+
this.config.dependencyGraph.updateStatus(node.taskId, DependencyNodeStatus.PENDING);
|
|
186
|
+
this.logger.debug('Task marked waiting after agent state change', {
|
|
187
|
+
agentId: event.agentId,
|
|
188
|
+
taskId: node.taskId
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
} catch (error) {
|
|
192
|
+
this.handleSyncError('state:transition', error);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
// 3. Task completed → Update graph status (scheduler handles dependents automatically)
|
|
196
|
+
const onTaskCompleted = async (event)=>{
|
|
197
|
+
try {
|
|
198
|
+
this.logger.debug('Task completed event received', {
|
|
199
|
+
taskId: event.taskId
|
|
200
|
+
});
|
|
201
|
+
// Graph status is already updated by the scheduler
|
|
202
|
+
// No additional action needed here
|
|
203
|
+
} catch (error) {
|
|
204
|
+
this.handleSyncError('task:completed', error);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
// 4. Task failed → Handle failure
|
|
208
|
+
const onTaskFailed = async (event)=>{
|
|
209
|
+
try {
|
|
210
|
+
this.logger.warn('Task failed event received', {
|
|
211
|
+
taskId: event.taskId,
|
|
212
|
+
error: event.error.message,
|
|
213
|
+
retryCount: event.retryCount
|
|
214
|
+
});
|
|
215
|
+
// If retries exhausted, mark as failed in state machine
|
|
216
|
+
if (event.retryCount >= this.config.schedulerConfig.retryLimit) {
|
|
217
|
+
const node = this.config.dependencyGraph.getNode(event.taskId);
|
|
218
|
+
if (node) {
|
|
219
|
+
await this.config.stateMachine.transition(node.agentId, AgentState.ERROR, {
|
|
220
|
+
metadata: {
|
|
221
|
+
error: event.error.message
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
} catch (error) {
|
|
227
|
+
this.handleSyncError('task:failed', error);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
// Register event handlers
|
|
231
|
+
this.scheduler.on('task:assigned', onTaskAssigned);
|
|
232
|
+
this.scheduler.on('task:completed', onTaskCompleted);
|
|
233
|
+
this.scheduler.on('task:failed', onTaskFailed);
|
|
234
|
+
this.config.stateMachine.on('state:transition', onStateTransition);
|
|
235
|
+
// Store cleanup functions
|
|
236
|
+
this.eventHandlerCleanup.push(()=>this.scheduler.off('task:assigned', onTaskAssigned), ()=>this.scheduler.off('task:completed', onTaskCompleted), ()=>this.scheduler.off('task:failed', onTaskFailed), ()=>this.config.stateMachine.off('state:transition', onStateTransition));
|
|
237
|
+
this.logger.debug('Event handlers registered for integration');
|
|
238
|
+
}
|
|
239
|
+
// ============================================
|
|
240
|
+
// Dependency-Aware State Transitions
|
|
241
|
+
// ============================================
|
|
242
|
+
/**
|
|
243
|
+
* Transition agent to new state with dependency checking
|
|
244
|
+
*
|
|
245
|
+
* Validates that dependencies are met before allowing transition to WORKING state.
|
|
246
|
+
* Prevents agents from starting work when dependencies are not satisfied.
|
|
247
|
+
*
|
|
248
|
+
* @param agentId - Agent ID
|
|
249
|
+
* @param newState - Target state
|
|
250
|
+
* @param metadata - Optional metadata
|
|
251
|
+
* @throws Error if dependencies not met or transition invalid
|
|
252
|
+
*/ async transitionWithDependencyCheck(agentId, newState, metadata) {
|
|
253
|
+
// Find task for agent
|
|
254
|
+
const node = this.findTaskForAgent(agentId);
|
|
255
|
+
if (!node) {
|
|
256
|
+
throw new Error(`No task found for agent ${agentId} in dependency graph`);
|
|
257
|
+
}
|
|
258
|
+
const taskId = node.taskId;
|
|
259
|
+
// Block transition to WORKING if dependencies not met
|
|
260
|
+
if (newState === AgentState.WORKING) {
|
|
261
|
+
if (!this.areDependenciesMet(taskId)) {
|
|
262
|
+
const blockedBy = this.getBlockingDependencies(taskId);
|
|
263
|
+
throw new Error(`Cannot start task ${taskId}: dependencies not satisfied. Blocked by: ${blockedBy.join(', ')}`);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Attempt transition with retry logic
|
|
267
|
+
const retryCount = this.transitionRetries.get(agentId) || 0;
|
|
268
|
+
try {
|
|
269
|
+
await this.config.stateMachine.transition(agentId, newState, {
|
|
270
|
+
metadata
|
|
271
|
+
});
|
|
272
|
+
// Reset retry count on success
|
|
273
|
+
this.transitionRetries.delete(agentId);
|
|
274
|
+
this.logger.debug('State transition completed with dependency check', {
|
|
275
|
+
agentId,
|
|
276
|
+
taskId,
|
|
277
|
+
newState
|
|
278
|
+
});
|
|
279
|
+
} catch (error) {
|
|
280
|
+
this.failedTransitions++;
|
|
281
|
+
if (retryCount < this.config.maxTransitionRetries) {
|
|
282
|
+
this.transitionRetries.set(agentId, retryCount + 1);
|
|
283
|
+
this.logger.warn('State transition failed, will retry', {
|
|
284
|
+
agentId,
|
|
285
|
+
taskId,
|
|
286
|
+
newState,
|
|
287
|
+
retryCount: retryCount + 1,
|
|
288
|
+
maxRetries: this.config.maxTransitionRetries,
|
|
289
|
+
error: error instanceof Error ? error.message : String(error)
|
|
290
|
+
});
|
|
291
|
+
// Retry after short delay
|
|
292
|
+
await new Promise((resolve)=>setTimeout(resolve, 100 * (retryCount + 1)));
|
|
293
|
+
return this.transitionWithDependencyCheck(agentId, newState, metadata);
|
|
294
|
+
} else {
|
|
295
|
+
this.logger.error('State transition failed after max retries', {
|
|
296
|
+
agentId,
|
|
297
|
+
taskId,
|
|
298
|
+
newState,
|
|
299
|
+
retryCount,
|
|
300
|
+
error: error instanceof Error ? error.message : String(error)
|
|
301
|
+
});
|
|
302
|
+
throw error;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Check if all dependencies for a task are met
|
|
308
|
+
*
|
|
309
|
+
* @param taskId - Task ID to check
|
|
310
|
+
* @returns True if all dependencies are completed
|
|
311
|
+
*/ areDependenciesMet(taskId) {
|
|
312
|
+
const dependencies = this.config.dependencyGraph.getDependencies(taskId);
|
|
313
|
+
for (const depId of Array.from(dependencies)){
|
|
314
|
+
const depNode = this.config.dependencyGraph.getNode(depId);
|
|
315
|
+
if (!depNode || depNode.status !== DependencyNodeStatus.COMPLETED) {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get list of blocking dependencies for a task
|
|
323
|
+
*
|
|
324
|
+
* @param taskId - Task ID
|
|
325
|
+
* @returns Array of task IDs that are blocking execution
|
|
326
|
+
*/ getBlockingDependencies(taskId) {
|
|
327
|
+
const dependencies = this.config.dependencyGraph.getDependencies(taskId);
|
|
328
|
+
const blockedBy = [];
|
|
329
|
+
for (const depId of Array.from(dependencies)){
|
|
330
|
+
const depNode = this.config.dependencyGraph.getNode(depId);
|
|
331
|
+
if (!depNode || depNode.status !== DependencyNodeStatus.COMPLETED) {
|
|
332
|
+
blockedBy.push(depId);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return blockedBy;
|
|
336
|
+
}
|
|
337
|
+
// ============================================
|
|
338
|
+
// Scheduler Control
|
|
339
|
+
// ============================================
|
|
340
|
+
/**
|
|
341
|
+
* Start integrated scheduling
|
|
342
|
+
* Begins processing tasks from the scheduler
|
|
343
|
+
*/ start() {
|
|
344
|
+
if (this.isRunning) {
|
|
345
|
+
this.logger.warn('Integration already running');
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
this.isRunning = true;
|
|
349
|
+
this.logger.info('StateMachineDependencyIntegration started');
|
|
350
|
+
this.emit('integration:started');
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Stop integrated scheduling
|
|
354
|
+
* Stops processing new tasks
|
|
355
|
+
*/ stop() {
|
|
356
|
+
if (!this.isRunning) {
|
|
357
|
+
this.logger.warn('Integration not running');
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
this.isRunning = false;
|
|
361
|
+
this.logger.info('StateMachineDependencyIntegration stopped');
|
|
362
|
+
this.emit('integration:stopped');
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Check if integration is running
|
|
366
|
+
*/ isActive() {
|
|
367
|
+
return this.isRunning;
|
|
368
|
+
}
|
|
369
|
+
// ============================================
|
|
370
|
+
// Metrics and Monitoring
|
|
371
|
+
// ============================================
|
|
372
|
+
/**
|
|
373
|
+
* Get combined metrics from state machine and scheduler
|
|
374
|
+
*
|
|
375
|
+
* @returns Integration metrics including both systems
|
|
376
|
+
*/ getMetrics() {
|
|
377
|
+
// Get scheduler metrics
|
|
378
|
+
const schedulerMetrics = this.scheduler.getMetrics();
|
|
379
|
+
// Count agents by state
|
|
380
|
+
const stateCounts = {
|
|
381
|
+
idle: 0,
|
|
382
|
+
working: 0,
|
|
383
|
+
waiting: 0,
|
|
384
|
+
helping: 0,
|
|
385
|
+
blocked: 0,
|
|
386
|
+
paused: 0,
|
|
387
|
+
completed: 0,
|
|
388
|
+
terminated: 0,
|
|
389
|
+
error: 0
|
|
390
|
+
};
|
|
391
|
+
const allStates = this.config.stateMachine.getAllStates();
|
|
392
|
+
for (const [agentId, state] of Array.from(allStates.entries())){
|
|
393
|
+
stateCounts[state]++;
|
|
394
|
+
}
|
|
395
|
+
// Get graph statistics
|
|
396
|
+
const graphStats = this.config.dependencyGraph.getStatistics();
|
|
397
|
+
return {
|
|
398
|
+
scheduler: {
|
|
399
|
+
totalTasks: schedulerMetrics.totalTasks,
|
|
400
|
+
completed: schedulerMetrics.completed,
|
|
401
|
+
running: schedulerMetrics.running,
|
|
402
|
+
ready: schedulerMetrics.ready,
|
|
403
|
+
blocked: schedulerMetrics.blocked,
|
|
404
|
+
waiting: graphStats.blockedNodeCount
|
|
405
|
+
},
|
|
406
|
+
stateMachine: stateCounts,
|
|
407
|
+
health: {
|
|
408
|
+
syncErrors: this.syncErrors,
|
|
409
|
+
deadlocksDetected: this.deadlocksDetected,
|
|
410
|
+
deadlocksResolved: this.deadlocksResolved,
|
|
411
|
+
totalStateTransitions: this.totalStateTransitions,
|
|
412
|
+
failedTransitions: this.failedTransitions
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Get current system health status
|
|
418
|
+
*
|
|
419
|
+
* @returns Health status object
|
|
420
|
+
*/ getHealthStatus() {
|
|
421
|
+
const metrics = this.getMetrics();
|
|
422
|
+
const issues = [];
|
|
423
|
+
// Check for high sync error rate
|
|
424
|
+
if (metrics.health.syncErrors > 10) {
|
|
425
|
+
issues.push(`High sync error count: ${metrics.health.syncErrors}`);
|
|
426
|
+
}
|
|
427
|
+
// Check for unresolved deadlocks
|
|
428
|
+
const unresolvedDeadlocks = metrics.health.deadlocksDetected - metrics.health.deadlocksResolved;
|
|
429
|
+
if (unresolvedDeadlocks > 0) {
|
|
430
|
+
issues.push(`Unresolved deadlocks: ${unresolvedDeadlocks}`);
|
|
431
|
+
}
|
|
432
|
+
// Check for high failure rate
|
|
433
|
+
const failureRate = metrics.health.totalStateTransitions > 0 ? metrics.health.failedTransitions / metrics.health.totalStateTransitions : 0;
|
|
434
|
+
if (failureRate > 0.1) {
|
|
435
|
+
issues.push(`High transition failure rate: ${(failureRate * 100).toFixed(1)}%`);
|
|
436
|
+
}
|
|
437
|
+
// Check for blocked tasks
|
|
438
|
+
if (metrics.scheduler.blocked > 5) {
|
|
439
|
+
issues.push(`High blocked task count: ${metrics.scheduler.blocked}`);
|
|
440
|
+
}
|
|
441
|
+
return {
|
|
442
|
+
healthy: issues.length === 0,
|
|
443
|
+
issues,
|
|
444
|
+
metrics
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
// ============================================
|
|
448
|
+
// Helper Methods
|
|
449
|
+
// ============================================
|
|
450
|
+
/**
|
|
451
|
+
* Find task node for a given agent ID
|
|
452
|
+
*/ findTaskForAgent(agentId) {
|
|
453
|
+
for (const node of this.config.dependencyGraph.getAllNodes()){
|
|
454
|
+
if (node.agentId === agentId) {
|
|
455
|
+
return node;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return undefined;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Handle task failure
|
|
462
|
+
*/ async handleTaskFailure(taskId, error) {
|
|
463
|
+
const node = this.config.dependencyGraph.getNode(taskId);
|
|
464
|
+
if (!node) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
// Update graph status
|
|
468
|
+
this.config.dependencyGraph.updateStatus(taskId, DependencyNodeStatus.FAILED);
|
|
469
|
+
// Update metadata with error (cast to impl for mutation)
|
|
470
|
+
const nodeImpl = node;
|
|
471
|
+
nodeImpl.setMetadata('error', error.message);
|
|
472
|
+
nodeImpl.setMetadata('failedAt', new Date().toISOString());
|
|
473
|
+
this.logger.error('Task failed', {
|
|
474
|
+
taskId,
|
|
475
|
+
agentId: node.agentId,
|
|
476
|
+
error: error.message
|
|
477
|
+
});
|
|
478
|
+
this.emit('integration:task-failed', {
|
|
479
|
+
taskId,
|
|
480
|
+
agentId: node.agentId,
|
|
481
|
+
error: error.message
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Handle synchronization errors
|
|
486
|
+
*/ handleSyncError(eventType, error) {
|
|
487
|
+
this.syncErrors++;
|
|
488
|
+
this.logger.error('Integration sync error', {
|
|
489
|
+
eventType,
|
|
490
|
+
error: error instanceof Error ? error.message : String(error),
|
|
491
|
+
totalErrors: this.syncErrors
|
|
492
|
+
});
|
|
493
|
+
this.emit('integration:sync-error', {
|
|
494
|
+
eventType,
|
|
495
|
+
error: error instanceof Error ? error.message : String(error)
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Attempt to recover from deadlock
|
|
500
|
+
*/ async attemptDeadlockRecovery(cycles) {
|
|
501
|
+
this.logger.info('Attempting deadlock recovery', {
|
|
502
|
+
cycles
|
|
503
|
+
});
|
|
504
|
+
// Strategy: Break smallest cycle by failing lowest priority task
|
|
505
|
+
for (const cycle of cycles){
|
|
506
|
+
if (cycle.length === 0) continue;
|
|
507
|
+
// Find lowest priority task in cycle
|
|
508
|
+
let lowestPriorityTask;
|
|
509
|
+
let lowestPriority = Infinity;
|
|
510
|
+
for (const taskId of cycle){
|
|
511
|
+
const node = this.config.dependencyGraph.getNode(taskId);
|
|
512
|
+
if (node && node.priority < lowestPriority) {
|
|
513
|
+
lowestPriority = node.priority;
|
|
514
|
+
lowestPriorityTask = taskId;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (lowestPriorityTask) {
|
|
518
|
+
this.logger.info('Breaking deadlock by failing low priority task', {
|
|
519
|
+
taskId: lowestPriorityTask,
|
|
520
|
+
priority: lowestPriority
|
|
521
|
+
});
|
|
522
|
+
const error = new Error(`Task failed to break deadlock cycle: ${cycle.join(' -> ')}`);
|
|
523
|
+
await this.handleTaskFailure(lowestPriorityTask, error);
|
|
524
|
+
this.deadlocksResolved++;
|
|
525
|
+
break; // Only break one cycle per recovery attempt
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Cleanup integration resources
|
|
531
|
+
*/ async cleanup() {
|
|
532
|
+
this.logger.info('Cleaning up StateMachineDependencyIntegration');
|
|
533
|
+
// Stop scheduler
|
|
534
|
+
this.stop();
|
|
535
|
+
// Remove event handlers
|
|
536
|
+
for (const cleanup of this.eventHandlerCleanup){
|
|
537
|
+
cleanup();
|
|
538
|
+
}
|
|
539
|
+
this.eventHandlerCleanup = [];
|
|
540
|
+
// Clear internal state
|
|
541
|
+
this.transitionRetries.clear();
|
|
542
|
+
this.removeAllListeners();
|
|
543
|
+
this.logger.info('StateMachineDependencyIntegration cleanup complete');
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
//# sourceMappingURL=state-machine-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.ts"],"names":["EventEmitter","AgentState","DependencyNodeStatus","TaskScheduler","Logger","StateMachineDependencyIntegration","logger","config","scheduler","isRunning","syncErrors","deadlocksDetected","deadlocksResolved","totalStateTransitions","failedTransitions","transitionRetries","eventHandlerCleanup","level","format","destination","autoSync","enableDeadlockRecovery","maxTransitionRetries","resolver","resolve","taskId","node","dependencyGraph","getNode","readyTasks","blockedBy","cycles","dependencies","getDependencies","depId","Array","from","depNode","status","COMPLETED","push","cycleResult","detectCycles","length","checkDependenciesReady","areDependenciesMet","schedulerConfig","Map","setupEventHandlers","info","onTaskAssigned","event","task","warn","agentId","stateMachine","transition","WORKING","metadata","startedAt","Date","updateStatus","EXECUTING","debug","error","handleSyncError","onStateTransition","findTaskForAgent","toState","onTaskCompleted","ERROR","Error","handleTaskFailure","BLOCKED","FAILED","WAITING","PENDING","onTaskFailed","message","retryCount","retryLimit","on","off","transitionWithDependencyCheck","newState","getBlockingDependencies","join","get","delete","set","maxRetries","String","Promise","setTimeout","start","emit","stop","isActive","getMetrics","schedulerMetrics","stateCounts","idle","working","waiting","helping","blocked","paused","completed","terminated","allStates","getAllStates","state","entries","graphStats","getStatistics","totalTasks","running","ready","blockedNodeCount","health","getHealthStatus","metrics","issues","unresolvedDeadlocks","failureRate","toFixed","healthy","getAllNodes","undefined","nodeImpl","setMetadata","toISOString","eventType","totalErrors","attemptDeadlockRecovery","cycle","lowestPriorityTask","lowestPriority","Infinity","priority","cleanup","clear","removeAllListeners"],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GAED,SAASA,YAAY,QAAQ,cAAc;AAE3C,SAASC,UAAU,QAAQ,mCAAmC;AAE9D,SAA6CC,oBAAoB,QAAQ,6BAA6B;AAEtG,SACEC,aAAa,QAKR,4BAA4B;AACnC,SAASC,MAAM,QAAQ,0BAA0B;AAmFjD;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMC,0CAA0CL;IACpCM,OAAe;IACfC,OAAoC;IACpCC,UAAyB;IAElCC,UAAmB;IACnBC,WAAmB;IACnBC,kBAA0B;IAC1BC,kBAA0B;IAC1BC,sBAA8B;IAC9BC,kBAA0B;IAE1BC,kBAAuC;IACvCC,oBAAoC;IAE5C,YAAYT,MAAyB,CAAE;QACrC,KAAK;QAEL,IAAI,CAACD,MAAM,GAAG,IAAIF,OAAO;YACvBa,OAAO;YACPC,QAAQ;YACRC,aAAa;QACf;QAEA,IAAI,CAACZ,MAAM,GAAG;YACZ,GAAGA,MAAM;YACTa,UAAUb,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