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,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - Topic Manager
|
|
3
|
+
*
|
|
4
|
+
* Efficient topic pattern matching with wildcard support for message routing.
|
|
5
|
+
* Implements O(log n) pattern matching using a radix tree (trie) structure.
|
|
6
|
+
*
|
|
7
|
+
* Supported wildcards:
|
|
8
|
+
* - `*` - Matches single level (e.g., "agent.*" matches "agent.status" but not "agent.status.online")
|
|
9
|
+
* - `**` - Matches multiple levels (e.g., "agent.**" matches "agent.status.online")
|
|
10
|
+
*
|
|
11
|
+
* @module coordination/v2/core/topic-manager
|
|
12
|
+
*/ /**
|
|
13
|
+
* Topic Manager - Efficient wildcard pattern matching for message routing.
|
|
14
|
+
*
|
|
15
|
+
* Performance:
|
|
16
|
+
* - register(): O(m) where m is pattern length
|
|
17
|
+
* - deregister(): O(m) where m is pattern length
|
|
18
|
+
* - match(): O(log n) where n is number of registered patterns
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const manager = new TopicManager();
|
|
23
|
+
*
|
|
24
|
+
* // Register patterns
|
|
25
|
+
* const id1 = manager.register('task.*');
|
|
26
|
+
* const id2 = manager.register('agent.**');
|
|
27
|
+
* const id3 = manager.register('task.completed');
|
|
28
|
+
*
|
|
29
|
+
* // Match topics
|
|
30
|
+
* manager.match('task.completed'); // Returns [id1, id3]
|
|
31
|
+
* manager.match('agent.status.online'); // Returns [id2]
|
|
32
|
+
* manager.match('unmatched'); // Returns []
|
|
33
|
+
* ```
|
|
34
|
+
*/ export class TopicManager {
|
|
35
|
+
/** Root node of the pattern tree */ root;
|
|
36
|
+
/** Pattern registrations by ID */ registrations;
|
|
37
|
+
/** Match statistics */ stats;
|
|
38
|
+
/** Next registration ID counter */ nextId;
|
|
39
|
+
constructor(){
|
|
40
|
+
this.root = this.createNode('', null);
|
|
41
|
+
this.registrations = new Map();
|
|
42
|
+
this.stats = {
|
|
43
|
+
totalMatches: 0,
|
|
44
|
+
totalMatchTime: 0
|
|
45
|
+
};
|
|
46
|
+
this.nextId = 1;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Registers a topic pattern for matching.
|
|
50
|
+
*
|
|
51
|
+
* @param pattern - Topic pattern (supports *, **)
|
|
52
|
+
* @returns Unique registration ID
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const id = manager.register('task.*.completed');
|
|
57
|
+
* ```
|
|
58
|
+
*/ register(pattern) {
|
|
59
|
+
if (!pattern || typeof pattern !== 'string') {
|
|
60
|
+
throw new Error('Pattern must be a non-empty string');
|
|
61
|
+
}
|
|
62
|
+
const id = `topic-${this.nextId++}`;
|
|
63
|
+
const segments = this.parsePattern(pattern);
|
|
64
|
+
// Build pattern tree
|
|
65
|
+
let currentNode = this.root;
|
|
66
|
+
for(let i = 0; i < segments.length; i++){
|
|
67
|
+
const segment = segments[i];
|
|
68
|
+
const wildcard = this.getWildcardType(segment);
|
|
69
|
+
if (!currentNode.children.has(segment)) {
|
|
70
|
+
currentNode.children.set(segment, this.createNode(segment, wildcard));
|
|
71
|
+
}
|
|
72
|
+
currentNode = currentNode.children.get(segment);
|
|
73
|
+
}
|
|
74
|
+
// Add subscription ID to final node
|
|
75
|
+
currentNode.subscriptionIds.add(id);
|
|
76
|
+
currentNode.pattern = pattern;
|
|
77
|
+
// Store registration
|
|
78
|
+
this.registrations.set(id, {
|
|
79
|
+
id,
|
|
80
|
+
pattern,
|
|
81
|
+
createdAt: Date.now(),
|
|
82
|
+
matchCount: 0
|
|
83
|
+
});
|
|
84
|
+
return id;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Deregisters a topic pattern.
|
|
88
|
+
*
|
|
89
|
+
* @param id - Registration ID from register()
|
|
90
|
+
* @returns True if deregistered, false if ID not found
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const id = manager.register('task.*');
|
|
95
|
+
* manager.deregister(id); // true
|
|
96
|
+
* manager.deregister(id); // false (already removed)
|
|
97
|
+
* ```
|
|
98
|
+
*/ deregister(id) {
|
|
99
|
+
const registration = this.registrations.get(id);
|
|
100
|
+
if (!registration) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const segments = this.parsePattern(registration.pattern);
|
|
104
|
+
this.removeFromTree(this.root, segments, id, 0);
|
|
105
|
+
this.registrations.delete(id);
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Matches a topic against all registered patterns.
|
|
110
|
+
* Returns all registration IDs that match the topic.
|
|
111
|
+
*
|
|
112
|
+
* @param topic - Topic to match (e.g., "task.completed")
|
|
113
|
+
* @returns Array of registration IDs that match
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const ids = manager.match('task.completed');
|
|
118
|
+
* // Returns: ['topic-1', 'topic-5']
|
|
119
|
+
* ```
|
|
120
|
+
*/ match(topic) {
|
|
121
|
+
const startTime = performance.now();
|
|
122
|
+
if (!topic || typeof topic !== 'string') {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
const segments = this.parsePattern(topic);
|
|
126
|
+
const matchedIds = new Set();
|
|
127
|
+
this.matchRecursive(this.root, segments, 0, matchedIds);
|
|
128
|
+
// Update statistics
|
|
129
|
+
const endTime = performance.now();
|
|
130
|
+
this.stats.totalMatches++;
|
|
131
|
+
this.stats.totalMatchTime += endTime - startTime;
|
|
132
|
+
// Update match counts
|
|
133
|
+
for (const id of Array.from(matchedIds)){
|
|
134
|
+
const registration = this.registrations.get(id);
|
|
135
|
+
if (registration) {
|
|
136
|
+
registration.matchCount++;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return Array.from(matchedIds);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Gets all registered patterns.
|
|
143
|
+
*
|
|
144
|
+
* @returns Array of topic registrations
|
|
145
|
+
*/ getRegistrations() {
|
|
146
|
+
return Array.from(this.registrations.values());
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Gets a specific registration by ID.
|
|
150
|
+
*
|
|
151
|
+
* @param id - Registration ID
|
|
152
|
+
* @returns Registration or undefined if not found
|
|
153
|
+
*/ getRegistration(id) {
|
|
154
|
+
return this.registrations.get(id);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Gets topic matching statistics.
|
|
158
|
+
*
|
|
159
|
+
* @returns Statistics object
|
|
160
|
+
*/ getStats() {
|
|
161
|
+
const patterns = Array.from(this.registrations.values());
|
|
162
|
+
// Count by wildcard type
|
|
163
|
+
const patternsByWildcard = {
|
|
164
|
+
exact: 0,
|
|
165
|
+
single: 0,
|
|
166
|
+
multi: 0
|
|
167
|
+
};
|
|
168
|
+
for (const reg of patterns){
|
|
169
|
+
if (reg.pattern.includes('**')) {
|
|
170
|
+
patternsByWildcard.multi++;
|
|
171
|
+
} else if (reg.pattern.includes('*')) {
|
|
172
|
+
patternsByWildcard.single++;
|
|
173
|
+
} else {
|
|
174
|
+
patternsByWildcard.exact++;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Top patterns
|
|
178
|
+
const topPatterns = patterns.sort((a, b)=>b.matchCount - a.matchCount).slice(0, 10).map((reg)=>({
|
|
179
|
+
pattern: reg.pattern,
|
|
180
|
+
matchCount: reg.matchCount
|
|
181
|
+
}));
|
|
182
|
+
return {
|
|
183
|
+
totalPatterns: patterns.length,
|
|
184
|
+
totalMatches: this.stats.totalMatches,
|
|
185
|
+
avgMatchTimeMs: this.stats.totalMatches > 0 ? this.stats.totalMatchTime / this.stats.totalMatches : 0,
|
|
186
|
+
patternsByWildcard,
|
|
187
|
+
topPatterns
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Clears all registrations and resets statistics.
|
|
192
|
+
*/ clear() {
|
|
193
|
+
this.root = this.createNode('', null);
|
|
194
|
+
this.registrations.clear();
|
|
195
|
+
this.stats = {
|
|
196
|
+
totalMatches: 0,
|
|
197
|
+
totalMatchTime: 0
|
|
198
|
+
};
|
|
199
|
+
this.nextId = 1;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Creates a new pattern node.
|
|
203
|
+
*/ createNode(segment, wildcard) {
|
|
204
|
+
return {
|
|
205
|
+
segment,
|
|
206
|
+
children: new Map(),
|
|
207
|
+
wildcard,
|
|
208
|
+
subscriptionIds: new Set(),
|
|
209
|
+
pattern: ''
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Parses a pattern or topic into segments.
|
|
214
|
+
*
|
|
215
|
+
* @param pattern - Pattern string (e.g., "task.*.completed")
|
|
216
|
+
* @returns Array of segments (e.g., ["task", "*", "completed"])
|
|
217
|
+
*/ parsePattern(pattern) {
|
|
218
|
+
return pattern.split('.').filter((s)=>s.length > 0);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Determines wildcard type for a segment.
|
|
222
|
+
*
|
|
223
|
+
* @param segment - Pattern segment
|
|
224
|
+
* @returns Wildcard type or null for exact match
|
|
225
|
+
*/ getWildcardType(segment) {
|
|
226
|
+
if (segment === '**') {
|
|
227
|
+
return 'multi';
|
|
228
|
+
} else if (segment === '*') {
|
|
229
|
+
return 'single';
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Recursively matches topic segments against pattern tree.
|
|
235
|
+
*
|
|
236
|
+
* @param node - Current pattern node
|
|
237
|
+
* @param segments - Topic segments to match
|
|
238
|
+
* @param index - Current segment index
|
|
239
|
+
* @param matchedIds - Accumulator for matched registration IDs
|
|
240
|
+
*/ matchRecursive(node, segments, index, matchedIds) {
|
|
241
|
+
// If we've consumed all segments, collect subscription IDs
|
|
242
|
+
if (index >= segments.length) {
|
|
243
|
+
for (const id of Array.from(node.subscriptionIds)){
|
|
244
|
+
matchedIds.add(id);
|
|
245
|
+
}
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const segment = segments[index];
|
|
249
|
+
// 1. Try exact match
|
|
250
|
+
if (node.children.has(segment)) {
|
|
251
|
+
this.matchRecursive(node.children.get(segment), segments, index + 1, matchedIds);
|
|
252
|
+
}
|
|
253
|
+
// 2. Try single-level wildcard (*)
|
|
254
|
+
if (node.children.has('*')) {
|
|
255
|
+
this.matchRecursive(node.children.get('*'), segments, index + 1, matchedIds);
|
|
256
|
+
}
|
|
257
|
+
// 3. Try multi-level wildcard (**)
|
|
258
|
+
if (node.children.has('**')) {
|
|
259
|
+
const multiNode = node.children.get('**');
|
|
260
|
+
// Multi-level wildcard matches:
|
|
261
|
+
// - Current segment + continue matching (consumes one level)
|
|
262
|
+
// - Remaining segments (consumes all levels)
|
|
263
|
+
// - Zero segments (at end of topic)
|
|
264
|
+
// Match current segment and continue
|
|
265
|
+
for(let i = index; i <= segments.length; i++){
|
|
266
|
+
// Collect IDs if this is a terminal node
|
|
267
|
+
for (const id of Array.from(multiNode.subscriptionIds)){
|
|
268
|
+
matchedIds.add(id);
|
|
269
|
+
}
|
|
270
|
+
// Continue matching children if segments remain
|
|
271
|
+
if (i < segments.length) {
|
|
272
|
+
for (const [childSegment, childNode] of Array.from(multiNode.children.entries())){
|
|
273
|
+
if (childSegment === segments[i] || childSegment === '*') {
|
|
274
|
+
this.matchRecursive(childNode, segments, i + 1, matchedIds);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Removes a subscription ID from the pattern tree.
|
|
283
|
+
*
|
|
284
|
+
* @param node - Current node
|
|
285
|
+
* @param segments - Pattern segments
|
|
286
|
+
* @param id - Subscription ID to remove
|
|
287
|
+
* @param index - Current segment index
|
|
288
|
+
* @returns True if node should be removed (empty)
|
|
289
|
+
*/ removeFromTree(node, segments, id, index) {
|
|
290
|
+
if (index >= segments.length) {
|
|
291
|
+
// Reached the end of the pattern, remove ID
|
|
292
|
+
node.subscriptionIds.delete(id);
|
|
293
|
+
return node.subscriptionIds.size === 0 && node.children.size === 0;
|
|
294
|
+
}
|
|
295
|
+
const segment = segments[index];
|
|
296
|
+
const childNode = node.children.get(segment);
|
|
297
|
+
if (!childNode) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
const shouldRemoveChild = this.removeFromTree(childNode, segments, id, index + 1);
|
|
301
|
+
if (shouldRemoveChild) {
|
|
302
|
+
node.children.delete(segment);
|
|
303
|
+
}
|
|
304
|
+
// Node can be removed if it has no subscriptions and no children
|
|
305
|
+
return node.subscriptionIds.size === 0 && node.children.size === 0;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Validates that the pattern tree is well-formed (for testing).
|
|
309
|
+
*
|
|
310
|
+
* @returns True if tree is valid
|
|
311
|
+
*/ validateTree() {
|
|
312
|
+
return this.validateNode(this.root);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Recursively validates a pattern node.
|
|
316
|
+
*/ validateNode(node) {
|
|
317
|
+
// Check wildcard consistency
|
|
318
|
+
if (node.wildcard) {
|
|
319
|
+
const expectedSegment = node.wildcard === 'single' ? '*' : '**';
|
|
320
|
+
if (node.segment !== expectedSegment && node.segment !== '') {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// Validate children
|
|
325
|
+
for (const [segment, childNode] of Array.from(node.children.entries())){
|
|
326
|
+
if (childNode.segment !== segment) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
if (!this.validateNode(childNode)) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return true;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
//# sourceMappingURL=topic-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.ts"],"names":["TopicManager","root","registrations","stats","nextId","createNode","Map","totalMatches","totalMatchTime","register","pattern","Error","id","segments","parsePattern","currentNode","i","length","segment","wildcard","getWildcardType","children","has","set","get","subscriptionIds","add","createdAt","Date","now","matchCount","deregister","registration","removeFromTree","delete","match","topic","startTime","performance","matchedIds","Set","matchRecursive","endTime","Array","from","getRegistrations","values","getRegistration","getStats","patterns","patternsByWildcard","exact","single","multi","reg","includes","topPatterns","sort","a","b","slice","map","totalPatterns","avgMatchTimeMs","clear","split","filter","s","node","index","multiNode","childSegment","childNode","entries","size","shouldRemoveChild","validateTree","validateNode","expectedSegment"],"mappings":"AAAA;;;;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