claude-flow-novice 1.6.3 → 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.json +12 -2
- package/.claude/settings.local.json +4 -2
- 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/index.js +3 -0
- package/.claude-flow-novice/dist/src/coordination/index.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/coordination/v1-transparency/interfaces/v1-transparency-system.js +12 -0
- package/.claude-flow-novice/dist/src/coordination/v1-transparency/interfaces/v1-transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v1-transparency/v1-to-v2-bridge.js +433 -0
- package/.claude-flow-novice/dist/src/coordination/v1-transparency/v1-to-v2-bridge.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v1-transparency/v1-transparency-adapter.js +1468 -0
- package/.claude-flow-novice/dist/src/coordination/v1-transparency/v1-transparency-adapter.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/monitoring/apm/apm-integration.js +5 -0
- package/.claude-flow-novice/dist/src/monitoring/apm/apm-integration.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/provider-manager.js +41 -6
- package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/tiered-router.js +9 -17
- package/.claude-flow-novice/dist/src/providers/tiered-router.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 +0 -0
- package/.claude-flow-novice/metrics.db-shm +0 -0
- package/.claude-flow-novice/metrics.db-wal +0 -0
- package/CLAUDE.md +72 -0
- package/config/hooks/post-edit-pipeline.js +68 -118
- package/config/hooks/pre-tool-memory-safety.js +209 -0
- package/package.json +7 -4
- package/scripts/cleanup-idle-sessions.sh +59 -0
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/view-alerts.sh +307 -0
- package/scripts/test-provider-routing.cjs +7 -9
- package/scripts/test-zai-api.cjs +2 -2
- package/src/slash-commands/parse-epic.js +1 -1
- package/wiki/Provider-Routing.md +57 -69
- package/MEMORY_LEAK_ROOT_CAUSE.md +0 -149
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - Dependency Graph Implementation
|
|
3
|
+
*
|
|
4
|
+
* DAG-based dependency graph with Tarjan's algorithm for cycle detection,
|
|
5
|
+
* topological sorting, and efficient dependency resolution.
|
|
6
|
+
*
|
|
7
|
+
* Performance targets:
|
|
8
|
+
* - Build graph: <50ms for 1000 nodes
|
|
9
|
+
* - Cycle detection: <100ms for 1000 nodes (O(V+E) complexity)
|
|
10
|
+
* - Topological sort: O(V+E) complexity
|
|
11
|
+
*
|
|
12
|
+
* @module coordination/v2/core/dependency-graph
|
|
13
|
+
*/ import { DependencyNodeStatus } from './dependency-node.js';
|
|
14
|
+
/**
|
|
15
|
+
* Graph validation error.
|
|
16
|
+
*/ export class DependencyGraphError extends Error {
|
|
17
|
+
constructor(message){
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = 'DependencyGraphError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Dependency Graph Implementation.
|
|
24
|
+
*
|
|
25
|
+
* Manages task dependencies using a Directed Acyclic Graph (DAG) structure
|
|
26
|
+
* with support for:
|
|
27
|
+
* - O(1) node lookup via Map-based storage
|
|
28
|
+
* - Tarjan's algorithm for cycle detection (O(V+E))
|
|
29
|
+
* - Kahn's algorithm for topological sorting (O(V+E))
|
|
30
|
+
* - Efficient dependency and dependent queries
|
|
31
|
+
* - Graph statistics and validation
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const graph = new DependencyGraph();
|
|
36
|
+
*
|
|
37
|
+
* const nodeA = new DependencyNodeImpl({ id: 'a', agentId: 'agent-1', taskId: 'task-a' });
|
|
38
|
+
* const nodeB = new DependencyNodeImpl({ id: 'b', agentId: 'agent-1', taskId: 'task-b' });
|
|
39
|
+
*
|
|
40
|
+
* graph.addNode(nodeA);
|
|
41
|
+
* graph.addNode(nodeB);
|
|
42
|
+
* graph.addDependency('b', 'a'); // B depends on A
|
|
43
|
+
*
|
|
44
|
+
* const order = graph.getTopologicalOrder(); // ['a', 'b']
|
|
45
|
+
* const cycles = graph.detectCycles(); // { hasCycle: false, cycles: [] }
|
|
46
|
+
* ```
|
|
47
|
+
*/ export class DependencyGraph {
|
|
48
|
+
nodes;
|
|
49
|
+
adjacencyList;
|
|
50
|
+
reverseAdjacencyList;
|
|
51
|
+
config;
|
|
52
|
+
completedTasks;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new dependency graph.
|
|
55
|
+
*
|
|
56
|
+
* @param config - Graph configuration options
|
|
57
|
+
*/ constructor(config){
|
|
58
|
+
this.nodes = new Map();
|
|
59
|
+
this.adjacencyList = new Map();
|
|
60
|
+
this.reverseAdjacencyList = new Map();
|
|
61
|
+
this.completedTasks = new Set();
|
|
62
|
+
this.config = {
|
|
63
|
+
allowDuplicateEdges: config?.allowDuplicateEdges ?? false,
|
|
64
|
+
autoValidate: config?.autoValidate ?? true,
|
|
65
|
+
maxSize: config?.maxSize ?? 10000
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
// ============================================
|
|
69
|
+
// Node Management
|
|
70
|
+
// ============================================
|
|
71
|
+
/**
|
|
72
|
+
* Adds a node to the graph.
|
|
73
|
+
*
|
|
74
|
+
* @param node - Dependency node to add
|
|
75
|
+
* @throws {DependencyGraphError} If node already exists or max size exceeded
|
|
76
|
+
*/ addNode(node) {
|
|
77
|
+
if (this.nodes.has(node.id)) {
|
|
78
|
+
throw new DependencyGraphError(`Node with ID '${node.id}' already exists`);
|
|
79
|
+
}
|
|
80
|
+
if (this.nodes.size >= this.config.maxSize) {
|
|
81
|
+
throw new DependencyGraphError(`Graph size limit reached (max: ${this.config.maxSize})`);
|
|
82
|
+
}
|
|
83
|
+
this.nodes.set(node.id, node);
|
|
84
|
+
this.adjacencyList.set(node.id, new Set());
|
|
85
|
+
this.reverseAdjacencyList.set(node.id, new Set());
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Removes a node from the graph.
|
|
89
|
+
*
|
|
90
|
+
* @param nodeId - ID of the node to remove
|
|
91
|
+
* @returns True if node was removed, false if not found
|
|
92
|
+
*/ removeNode(nodeId) {
|
|
93
|
+
const node = this.nodes.get(nodeId);
|
|
94
|
+
if (!node) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
// Remove all edges involving this node
|
|
98
|
+
const dependencies = this.adjacencyList.get(nodeId) || new Set();
|
|
99
|
+
const dependents = this.reverseAdjacencyList.get(nodeId) || new Set();
|
|
100
|
+
// Update reverse adjacency for dependencies
|
|
101
|
+
for (const depId of dependencies){
|
|
102
|
+
this.reverseAdjacencyList.get(depId)?.delete(nodeId);
|
|
103
|
+
}
|
|
104
|
+
// Update adjacency for dependents
|
|
105
|
+
for (const dependentId of dependents){
|
|
106
|
+
this.adjacencyList.get(dependentId)?.delete(nodeId);
|
|
107
|
+
}
|
|
108
|
+
// Remove node and its adjacency lists
|
|
109
|
+
this.nodes.delete(nodeId);
|
|
110
|
+
this.adjacencyList.delete(nodeId);
|
|
111
|
+
this.reverseAdjacencyList.delete(nodeId);
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets a node by ID.
|
|
116
|
+
*
|
|
117
|
+
* @param nodeId - Node ID
|
|
118
|
+
* @returns Node if found, undefined otherwise
|
|
119
|
+
*/ getNode(nodeId) {
|
|
120
|
+
return this.nodes.get(nodeId);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Checks if a node exists in the graph.
|
|
124
|
+
*
|
|
125
|
+
* @param nodeId - Node ID to check
|
|
126
|
+
* @returns True if node exists
|
|
127
|
+
*/ hasNode(nodeId) {
|
|
128
|
+
return this.nodes.has(nodeId);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Gets all nodes in the graph.
|
|
132
|
+
*
|
|
133
|
+
* @returns Array of all nodes
|
|
134
|
+
*/ getAllNodes() {
|
|
135
|
+
return Array.from(this.nodes.values());
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Returns the number of nodes in the graph.
|
|
139
|
+
*/ size() {
|
|
140
|
+
return this.nodes.size;
|
|
141
|
+
}
|
|
142
|
+
// ============================================
|
|
143
|
+
// Edge Management (Dependencies)
|
|
144
|
+
// ============================================
|
|
145
|
+
/**
|
|
146
|
+
* Adds a dependency edge: from depends on to.
|
|
147
|
+
*
|
|
148
|
+
* @param fromId - ID of the node that has the dependency
|
|
149
|
+
* @param toId - ID of the node that is depended upon
|
|
150
|
+
* @throws {DependencyGraphError} If nodes don't exist or cycle would be created
|
|
151
|
+
*/ addDependency(fromId, toId) {
|
|
152
|
+
// Validate nodes exist
|
|
153
|
+
if (!this.nodes.has(fromId)) {
|
|
154
|
+
throw new DependencyGraphError(`Node '${fromId}' not found in graph`);
|
|
155
|
+
}
|
|
156
|
+
if (!this.nodes.has(toId)) {
|
|
157
|
+
throw new DependencyGraphError(`Node '${toId}' not found in graph`);
|
|
158
|
+
}
|
|
159
|
+
// Prevent self-dependencies
|
|
160
|
+
if (fromId === toId) {
|
|
161
|
+
throw new DependencyGraphError('Self-dependencies are not allowed');
|
|
162
|
+
}
|
|
163
|
+
// Check for duplicate edges
|
|
164
|
+
const existingDeps = this.adjacencyList.get(fromId);
|
|
165
|
+
if (existingDeps.has(toId) && !this.config.allowDuplicateEdges) {
|
|
166
|
+
throw new DependencyGraphError(`Dependency from '${fromId}' to '${toId}' already exists`);
|
|
167
|
+
}
|
|
168
|
+
// Add edge to adjacency lists
|
|
169
|
+
this.adjacencyList.get(fromId).add(toId);
|
|
170
|
+
this.reverseAdjacencyList.get(toId).add(fromId);
|
|
171
|
+
// Validate no cycles created (if auto-validate enabled)
|
|
172
|
+
if (this.config.autoValidate) {
|
|
173
|
+
const cycleResult = this.detectCycles();
|
|
174
|
+
if (cycleResult.hasCycle) {
|
|
175
|
+
// Rollback the edge
|
|
176
|
+
this.adjacencyList.get(fromId).delete(toId);
|
|
177
|
+
this.reverseAdjacencyList.get(toId).delete(fromId);
|
|
178
|
+
throw new DependencyGraphError(`Adding dependency would create cycle: ${JSON.stringify(cycleResult.cycles)}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Removes a dependency edge.
|
|
184
|
+
*
|
|
185
|
+
* @param fromId - Source node ID
|
|
186
|
+
* @param toId - Target node ID
|
|
187
|
+
* @returns True if edge was removed, false if not found
|
|
188
|
+
*/ removeDependency(fromId, toId) {
|
|
189
|
+
const removed = this.adjacencyList.get(fromId)?.delete(toId) ?? false;
|
|
190
|
+
if (removed) {
|
|
191
|
+
this.reverseAdjacencyList.get(toId)?.delete(fromId);
|
|
192
|
+
}
|
|
193
|
+
return removed;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Gets all dependencies for a node (nodes it depends on).
|
|
197
|
+
*
|
|
198
|
+
* @param nodeId - Node ID
|
|
199
|
+
* @returns Set of dependency node IDs
|
|
200
|
+
*/ getDependencies(nodeId) {
|
|
201
|
+
return new Set(this.adjacencyList.get(nodeId) || []);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Gets all dependents for a node (nodes that depend on it).
|
|
205
|
+
*
|
|
206
|
+
* @param nodeId - Node ID
|
|
207
|
+
* @returns Set of dependent node IDs
|
|
208
|
+
*/ getDependents(nodeId) {
|
|
209
|
+
return new Set(this.reverseAdjacencyList.get(nodeId) || []);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Gets the full dependency chain for a node (all transitive dependencies).
|
|
213
|
+
*
|
|
214
|
+
* @param nodeId - Node ID
|
|
215
|
+
* @returns Array of node IDs in dependency order
|
|
216
|
+
*/ getDependencyChain(nodeId) {
|
|
217
|
+
const visited = new Set();
|
|
218
|
+
const chain = [];
|
|
219
|
+
const dfs = (id)=>{
|
|
220
|
+
if (visited.has(id)) return;
|
|
221
|
+
visited.add(id);
|
|
222
|
+
const deps = this.adjacencyList.get(id) || new Set();
|
|
223
|
+
for (const depId of deps){
|
|
224
|
+
dfs(depId);
|
|
225
|
+
}
|
|
226
|
+
chain.push(id);
|
|
227
|
+
};
|
|
228
|
+
dfs(nodeId);
|
|
229
|
+
return chain;
|
|
230
|
+
}
|
|
231
|
+
// ============================================
|
|
232
|
+
// Cycle Detection (Tarjan's Algorithm)
|
|
233
|
+
// ============================================
|
|
234
|
+
/**
|
|
235
|
+
* Detects cycles using Tarjan's strongly connected components algorithm.
|
|
236
|
+
*
|
|
237
|
+
* This provides more robust cycle detection than simple DFS, identifying
|
|
238
|
+
* all strongly connected components in O(V+E) time.
|
|
239
|
+
*
|
|
240
|
+
* @returns Cycle detection result with all cycles and SCCs
|
|
241
|
+
*/ detectCycles() {
|
|
242
|
+
const index = new Map();
|
|
243
|
+
const lowLink = new Map();
|
|
244
|
+
const onStack = new Set();
|
|
245
|
+
const stack = [];
|
|
246
|
+
let currentIndex = 0;
|
|
247
|
+
const sccs = [];
|
|
248
|
+
const strongConnect = (nodeId)=>{
|
|
249
|
+
// Set depth index for node
|
|
250
|
+
index.set(nodeId, currentIndex);
|
|
251
|
+
lowLink.set(nodeId, currentIndex);
|
|
252
|
+
currentIndex++;
|
|
253
|
+
stack.push(nodeId);
|
|
254
|
+
onStack.add(nodeId);
|
|
255
|
+
// Consider successors (dependencies)
|
|
256
|
+
const dependencies = this.adjacencyList.get(nodeId) || new Set();
|
|
257
|
+
for (const depId of dependencies){
|
|
258
|
+
if (!index.has(depId)) {
|
|
259
|
+
// Successor has not been visited; recurse
|
|
260
|
+
strongConnect(depId);
|
|
261
|
+
lowLink.set(nodeId, Math.min(lowLink.get(nodeId), lowLink.get(depId)));
|
|
262
|
+
} else if (onStack.has(depId)) {
|
|
263
|
+
// Successor is on stack and hence in current SCC
|
|
264
|
+
lowLink.set(nodeId, Math.min(lowLink.get(nodeId), index.get(depId)));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// If nodeId is a root node, pop the stack and generate SCC
|
|
268
|
+
if (lowLink.get(nodeId) === index.get(nodeId)) {
|
|
269
|
+
const scc = [];
|
|
270
|
+
let w;
|
|
271
|
+
do {
|
|
272
|
+
w = stack.pop();
|
|
273
|
+
onStack.delete(w);
|
|
274
|
+
scc.push(w);
|
|
275
|
+
}while (w !== nodeId)
|
|
276
|
+
sccs.push(scc);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
// Run Tarjan's algorithm on all unvisited nodes
|
|
280
|
+
for (const nodeId of this.nodes.keys()){
|
|
281
|
+
if (!index.has(nodeId)) {
|
|
282
|
+
strongConnect(nodeId);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// SCCs with size > 1 are cycles
|
|
286
|
+
const cycles = sccs.filter((scc)=>scc.length > 1);
|
|
287
|
+
return {
|
|
288
|
+
hasCycle: cycles.length > 0,
|
|
289
|
+
cycles,
|
|
290
|
+
stronglyConnectedComponents: sccs
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
// ============================================
|
|
294
|
+
// Topological Sorting (Kahn's Algorithm)
|
|
295
|
+
// ============================================
|
|
296
|
+
/**
|
|
297
|
+
* Computes topological ordering using Kahn's algorithm.
|
|
298
|
+
*
|
|
299
|
+
* Returns nodes in dependency order (dependencies before dependents).
|
|
300
|
+
* Throws if graph contains cycles.
|
|
301
|
+
*
|
|
302
|
+
* @returns Array of node IDs in topological order
|
|
303
|
+
* @throws {DependencyGraphError} If graph contains cycles
|
|
304
|
+
*/ getTopologicalOrder() {
|
|
305
|
+
const inDegree = new Map();
|
|
306
|
+
const queue = [];
|
|
307
|
+
const result = [];
|
|
308
|
+
// Initialize in-degrees
|
|
309
|
+
for (const nodeId of this.nodes.keys()){
|
|
310
|
+
const deps = this.adjacencyList.get(nodeId);
|
|
311
|
+
inDegree.set(nodeId, deps.size);
|
|
312
|
+
if (deps.size === 0) {
|
|
313
|
+
queue.push(nodeId); // No dependencies
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// Process nodes with zero in-degree
|
|
317
|
+
while(queue.length > 0){
|
|
318
|
+
const nodeId = queue.shift();
|
|
319
|
+
result.push(nodeId);
|
|
320
|
+
// Reduce in-degree for dependents
|
|
321
|
+
const dependents = this.reverseAdjacencyList.get(nodeId) || new Set();
|
|
322
|
+
for (const dependentId of dependents){
|
|
323
|
+
const newInDegree = inDegree.get(dependentId) - 1;
|
|
324
|
+
inDegree.set(dependentId, newInDegree);
|
|
325
|
+
if (newInDegree === 0) {
|
|
326
|
+
queue.push(dependentId);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// If not all nodes processed, there's a cycle
|
|
331
|
+
if (result.length !== this.nodes.size) {
|
|
332
|
+
const cycleResult = this.detectCycles();
|
|
333
|
+
throw new DependencyGraphError(`Cannot compute topological order: graph contains cycles. ` + `Detected cycles: ${JSON.stringify(cycleResult.cycles)}`);
|
|
334
|
+
}
|
|
335
|
+
return result;
|
|
336
|
+
}
|
|
337
|
+
// ============================================
|
|
338
|
+
// Graph Queries
|
|
339
|
+
// ============================================
|
|
340
|
+
/**
|
|
341
|
+
* Gets all nodes that are ready for execution (no pending dependencies).
|
|
342
|
+
*
|
|
343
|
+
* @returns Array of nodes with all dependencies satisfied
|
|
344
|
+
*/ getReadyTasks() {
|
|
345
|
+
const ready = [];
|
|
346
|
+
for (const [nodeId, node] of this.nodes){
|
|
347
|
+
const deps = this.adjacencyList.get(nodeId);
|
|
348
|
+
// Check if all dependencies are completed
|
|
349
|
+
let allDepsCompleted = true;
|
|
350
|
+
for (const depId of deps){
|
|
351
|
+
const depNode = this.nodes.get(depId);
|
|
352
|
+
if (depNode?.status !== DependencyNodeStatus.COMPLETED) {
|
|
353
|
+
allDepsCompleted = false;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (allDepsCompleted && node.status === DependencyNodeStatus.READY) {
|
|
358
|
+
ready.push(node);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// Sort by priority (higher priority first)
|
|
362
|
+
return ready.sort((a, b)=>b.priority - a.priority);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Gets all nodes that are blocked on dependencies.
|
|
366
|
+
*
|
|
367
|
+
* @returns Array of nodes waiting for dependencies
|
|
368
|
+
*/ getBlockedTasks() {
|
|
369
|
+
const blocked = [];
|
|
370
|
+
for (const [nodeId, node] of this.nodes){
|
|
371
|
+
const deps = this.adjacencyList.get(nodeId);
|
|
372
|
+
if (deps.size > 0 && node.status === DependencyNodeStatus.PENDING) {
|
|
373
|
+
blocked.push(node);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return blocked;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Gets graph statistics for monitoring and debugging.
|
|
380
|
+
*
|
|
381
|
+
* @returns Object containing graph metrics
|
|
382
|
+
*/ getStatistics() {
|
|
383
|
+
let edgeCount = 0;
|
|
384
|
+
let maxInDegree = 0;
|
|
385
|
+
let maxOutDegree = 0;
|
|
386
|
+
let completedCount = 0;
|
|
387
|
+
for (const deps of this.adjacencyList.values()){
|
|
388
|
+
edgeCount += deps.size;
|
|
389
|
+
maxOutDegree = Math.max(maxOutDegree, deps.size);
|
|
390
|
+
}
|
|
391
|
+
for (const dependents of this.reverseAdjacencyList.values()){
|
|
392
|
+
maxInDegree = Math.max(maxInDegree, dependents.size);
|
|
393
|
+
}
|
|
394
|
+
for (const node of this.nodes.values()){
|
|
395
|
+
if (node.status === DependencyNodeStatus.COMPLETED) {
|
|
396
|
+
completedCount++;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
const nodeCount = this.nodes.size;
|
|
400
|
+
return {
|
|
401
|
+
nodeCount,
|
|
402
|
+
edgeCount,
|
|
403
|
+
maxInDegree,
|
|
404
|
+
maxOutDegree,
|
|
405
|
+
avgInDegree: nodeCount > 0 ? edgeCount / nodeCount : 0,
|
|
406
|
+
avgOutDegree: nodeCount > 0 ? edgeCount / nodeCount : 0,
|
|
407
|
+
readyNodeCount: this.getReadyTasks().length,
|
|
408
|
+
blockedNodeCount: this.getBlockedTasks().length,
|
|
409
|
+
completedNodeCount: completedCount
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Updates the status of a node in the graph.
|
|
414
|
+
*
|
|
415
|
+
* @param nodeId - ID of the node to update
|
|
416
|
+
* @param status - New status to set
|
|
417
|
+
* @throws {DependencyGraphError} If node not found
|
|
418
|
+
*/ updateStatus(nodeId, status) {
|
|
419
|
+
const node = this.nodes.get(nodeId);
|
|
420
|
+
if (!node) {
|
|
421
|
+
throw new DependencyGraphError(`Cannot update status: node '${nodeId}' not found`);
|
|
422
|
+
}
|
|
423
|
+
// Update node status using DependencyNodeImpl's updateStatus method
|
|
424
|
+
if ('updateStatus' in node && typeof node.updateStatus === 'function') {
|
|
425
|
+
node.updateStatus(status);
|
|
426
|
+
} else {
|
|
427
|
+
// Fallback: direct property update (for interfaces without updateStatus method)
|
|
428
|
+
node.status = status;
|
|
429
|
+
}
|
|
430
|
+
// Track completed tasks
|
|
431
|
+
if (status === DependencyNodeStatus.COMPLETED) {
|
|
432
|
+
this.completedTasks.add(nodeId);
|
|
433
|
+
} else {
|
|
434
|
+
this.completedTasks.delete(nodeId);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Clears all nodes and edges from the graph.
|
|
439
|
+
*/ clear() {
|
|
440
|
+
this.nodes.clear();
|
|
441
|
+
this.adjacencyList.clear();
|
|
442
|
+
this.reverseAdjacencyList.clear();
|
|
443
|
+
this.completedTasks.clear();
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Validates graph integrity.
|
|
447
|
+
*
|
|
448
|
+
* @returns Array of validation errors (empty if valid)
|
|
449
|
+
*/ validate() {
|
|
450
|
+
const errors = [];
|
|
451
|
+
// Check adjacency list consistency
|
|
452
|
+
for (const [nodeId, deps] of this.adjacencyList){
|
|
453
|
+
if (!this.nodes.has(nodeId)) {
|
|
454
|
+
errors.push(`Adjacency list contains non-existent node: ${nodeId}`);
|
|
455
|
+
}
|
|
456
|
+
for (const depId of deps){
|
|
457
|
+
if (!this.nodes.has(depId)) {
|
|
458
|
+
errors.push(`Node ${nodeId} depends on non-existent node: ${depId}`);
|
|
459
|
+
}
|
|
460
|
+
// Check reverse adjacency
|
|
461
|
+
const reverseDeps = this.reverseAdjacencyList.get(depId);
|
|
462
|
+
if (!reverseDeps?.has(nodeId)) {
|
|
463
|
+
errors.push(`Reverse adjacency missing for edge: ${nodeId} -> ${depId}`);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return errors;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
//# sourceMappingURL=dependency-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.ts"],"names":["DependencyNodeStatus","DependencyGraphError","Error","message","name","DependencyGraph","nodes","adjacencyList","reverseAdjacencyList","config","completedTasks","Map","Set","allowDuplicateEdges","autoValidate","maxSize","addNode","node","has","id","size","set","removeNode","nodeId","get","dependencies","dependents","depId","delete","dependentId","getNode","hasNode","getAllNodes","Array","from","values","addDependency","fromId","toId","existingDeps","add","cycleResult","detectCycles","hasCycle","JSON","stringify","cycles","removeDependency","removed","getDependencies","getDependents","getDependencyChain","visited","chain","dfs","deps","push","index","lowLink","onStack","stack","currentIndex","sccs","strongConnect","Math","min","scc","w","pop","keys","filter","length","stronglyConnectedComponents","getTopologicalOrder","inDegree","queue","result","shift","newInDegree","getReadyTasks","ready","allDepsCompleted","depNode","status","COMPLETED","READY","sort","a","b","priority","getBlockedTasks","blocked","PENDING","getStatistics","edgeCount","maxInDegree","maxOutDegree","completedCount","max","nodeCount","avgInDegree","avgOutDegree","readyNodeCount","blockedNodeCount","completedNodeCount","updateStatus","clear","validate","errors","reverseDeps"],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAED,SAA6CA,oBAAoB,QAAQ,uBAAuB;AAgBhG;;CAEC,GACD,OAAO,MAAMC,6BAA6BC;IACxC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA;QACN,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,MAAMC;IACHC,MAAmC;IACnCC,cAAwC;IACxCC,qBAA+C;IAC/CC,OAAwC;IACzCC,eAA4B;IAEnC;;;;GAIC,GACD,YAAYD,MAA8B,CAAE;QAC1C,IAAI,CAACH,KAAK,GAAG,IAAIK;QACjB,IAAI,CAACJ,aAAa,GAAG,IAAII;QACzB,IAAI,CAACH,oBAAoB,GAAG,IAAIG;QAChC,IAAI,CAACD,cAAc,GAAG,IAAIE;QAC1B,IAAI,CAACH,MAAM,GAAG;YACZI,qBAAqBJ,QAAQI,uBAAuB;YACpDC,cAAcL,QAAQK,gBAAgB;YACtCC,SAASN,QAAQM,WAAW;QAC9B;IACF;IAEA,+CAA+C;IAC/C,kBAAkB;IAClB,+CAA+C;IAE/C;;;;;GAKC,GACDC,QAAQC,IAAoB,EAAQ;QAClC,IAAI,IAAI,CAACX,KAAK,CAACY,GAAG,CA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