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,411 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - Task Channel
|
|
3
|
+
*
|
|
4
|
+
* Specialized channel for task assignment and completion messages.
|
|
5
|
+
* Coordinates task distribution and status updates across agents.
|
|
6
|
+
*
|
|
7
|
+
* @module coordination/v2/messaging/channels/task-channel
|
|
8
|
+
*/ import { MessagePriority } from '../../core/message.js';
|
|
9
|
+
/**
|
|
10
|
+
* Task priority levels for execution ordering.
|
|
11
|
+
*/ export var TaskPriority = /*#__PURE__*/ function(TaskPriority) {
|
|
12
|
+
/** Critical task requiring immediate execution */ TaskPriority[TaskPriority["CRITICAL"] = 10] = "CRITICAL";
|
|
13
|
+
/** High priority task */ TaskPriority[TaskPriority["HIGH"] = 8] = "HIGH";
|
|
14
|
+
/** Normal priority task (default) */ TaskPriority[TaskPriority["NORMAL"] = 5] = "NORMAL";
|
|
15
|
+
/** Low priority background task */ TaskPriority[TaskPriority["LOW"] = 2] = "LOW";
|
|
16
|
+
return TaskPriority;
|
|
17
|
+
}({});
|
|
18
|
+
/**
|
|
19
|
+
* Task status for lifecycle tracking.
|
|
20
|
+
*/ export var TaskStatus = /*#__PURE__*/ function(TaskStatus) {
|
|
21
|
+
/** Task assigned but not started */ TaskStatus["ASSIGNED"] = "assigned";
|
|
22
|
+
/** Task currently executing */ TaskStatus["IN_PROGRESS"] = "in_progress";
|
|
23
|
+
/** Task completed successfully */ TaskStatus["COMPLETED"] = "completed";
|
|
24
|
+
/** Task failed with error */ TaskStatus["FAILED"] = "failed";
|
|
25
|
+
/** Task cancelled before completion */ TaskStatus["CANCELLED"] = "cancelled";
|
|
26
|
+
return TaskStatus;
|
|
27
|
+
}({});
|
|
28
|
+
/**
|
|
29
|
+
* Task channel validation error.
|
|
30
|
+
*/ export class TaskChannelError extends Error {
|
|
31
|
+
constructor(message){
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = 'TaskChannelError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Task Channel Implementation.
|
|
38
|
+
*
|
|
39
|
+
* Specialized messaging channel for task coordination with:
|
|
40
|
+
* - Type-safe task assignment/completion payloads
|
|
41
|
+
* - Priority-based task routing
|
|
42
|
+
* - Progress tracking support
|
|
43
|
+
* - Task lifecycle management
|
|
44
|
+
* - Integration with dependency graph
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const taskChannel = new TaskChannel(messageBroker);
|
|
49
|
+
*
|
|
50
|
+
* // Assign task to agent
|
|
51
|
+
* await taskChannel.publishTaskAssignment({
|
|
52
|
+
* taskId: 'task-1',
|
|
53
|
+
* agentId: 'agent-1',
|
|
54
|
+
* description: 'Process user data',
|
|
55
|
+
* priority: TaskPriority.HIGH,
|
|
56
|
+
* input: { userId: '123' }
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* // Report task completion
|
|
60
|
+
* await taskChannel.publishTaskCompletion({
|
|
61
|
+
* taskId: 'task-1',
|
|
62
|
+
* agentId: 'agent-1',
|
|
63
|
+
* status: TaskStatus.COMPLETED,
|
|
64
|
+
* result: { processed: true }
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/ export class TaskChannel {
|
|
68
|
+
/** Base topic for all task messages */ static BASE_TOPIC = 'task';
|
|
69
|
+
/** Topic for task assignments */ static ASSIGNMENT_TOPIC = 'task.assignment';
|
|
70
|
+
/** Topic for task completions */ static COMPLETION_TOPIC = 'task.completion';
|
|
71
|
+
/** Topic for task progress */ static PROGRESS_TOPIC = 'task.progress';
|
|
72
|
+
broker;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new task channel instance.
|
|
75
|
+
*
|
|
76
|
+
* @param broker - Message broker for publishing/subscribing
|
|
77
|
+
*/ constructor(broker){
|
|
78
|
+
if (!broker) {
|
|
79
|
+
throw new TaskChannelError('Message broker is required');
|
|
80
|
+
}
|
|
81
|
+
this.broker = broker;
|
|
82
|
+
}
|
|
83
|
+
// ============================================
|
|
84
|
+
// Publishing - Task Assignments
|
|
85
|
+
// ============================================
|
|
86
|
+
/**
|
|
87
|
+
* Publishes a task assignment to an agent.
|
|
88
|
+
*
|
|
89
|
+
* @param config - Task assignment configuration
|
|
90
|
+
* @returns Promise resolving to published message
|
|
91
|
+
* @throws {TaskChannelError} If validation fails
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* await taskChannel.publishTaskAssignment({
|
|
96
|
+
* taskId: 'task-1',
|
|
97
|
+
* agentId: 'agent-1',
|
|
98
|
+
* description: 'Analyze dataset',
|
|
99
|
+
* priority: TaskPriority.HIGH,
|
|
100
|
+
* input: { datasetId: 'ds-123' },
|
|
101
|
+
* timeout: 60000
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/ async publishTaskAssignment(config) {
|
|
105
|
+
this.validateTaskAssignment(config);
|
|
106
|
+
const payload = {
|
|
107
|
+
taskId: config.taskId,
|
|
108
|
+
agentId: config.agentId,
|
|
109
|
+
description: config.description,
|
|
110
|
+
priority: config.priority ?? 5,
|
|
111
|
+
input: config.input,
|
|
112
|
+
timeout: config.timeout,
|
|
113
|
+
timestamp: Date.now(),
|
|
114
|
+
metadata: config.metadata
|
|
115
|
+
};
|
|
116
|
+
const topic = `${TaskChannel.ASSIGNMENT_TOPIC}.${config.agentId}`;
|
|
117
|
+
const priority = this.mapTaskPriorityToMessagePriority(payload.priority);
|
|
118
|
+
const messageConfig = {
|
|
119
|
+
topic,
|
|
120
|
+
payload,
|
|
121
|
+
priority,
|
|
122
|
+
recipientId: config.agentId,
|
|
123
|
+
metadata: {
|
|
124
|
+
channel: 'task',
|
|
125
|
+
type: 'assignment',
|
|
126
|
+
taskId: config.taskId,
|
|
127
|
+
agentId: config.agentId
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
return this.broker.publish(messageConfig);
|
|
131
|
+
}
|
|
132
|
+
// ============================================
|
|
133
|
+
// Publishing - Task Completions
|
|
134
|
+
// ============================================
|
|
135
|
+
/**
|
|
136
|
+
* Publishes a task completion event.
|
|
137
|
+
*
|
|
138
|
+
* @param config - Task completion configuration
|
|
139
|
+
* @returns Promise resolving to published message
|
|
140
|
+
* @throws {TaskChannelError} If validation fails
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* await taskChannel.publishTaskCompletion({
|
|
145
|
+
* taskId: 'task-1',
|
|
146
|
+
* agentId: 'agent-1',
|
|
147
|
+
* status: TaskStatus.COMPLETED,
|
|
148
|
+
* result: { output: 'success' },
|
|
149
|
+
* duration: 5000
|
|
150
|
+
* });
|
|
151
|
+
* ```
|
|
152
|
+
*/ async publishTaskCompletion(config) {
|
|
153
|
+
this.validateTaskCompletion(config);
|
|
154
|
+
const payload = {
|
|
155
|
+
taskId: config.taskId,
|
|
156
|
+
agentId: config.agentId,
|
|
157
|
+
status: config.status,
|
|
158
|
+
result: config.result,
|
|
159
|
+
duration: config.duration,
|
|
160
|
+
timestamp: Date.now(),
|
|
161
|
+
metadata: config.metadata
|
|
162
|
+
};
|
|
163
|
+
const topic = `${TaskChannel.COMPLETION_TOPIC}.${config.taskId}`;
|
|
164
|
+
const priority = config.status === "failed" ? MessagePriority.HIGH : MessagePriority.NORMAL;
|
|
165
|
+
const messageConfig = {
|
|
166
|
+
topic,
|
|
167
|
+
payload,
|
|
168
|
+
priority,
|
|
169
|
+
senderId: config.agentId,
|
|
170
|
+
metadata: {
|
|
171
|
+
channel: 'task',
|
|
172
|
+
type: 'completion',
|
|
173
|
+
taskId: config.taskId,
|
|
174
|
+
status: config.status
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
return this.broker.publish(messageConfig);
|
|
178
|
+
}
|
|
179
|
+
// ============================================
|
|
180
|
+
// Publishing - Task Progress
|
|
181
|
+
// ============================================
|
|
182
|
+
/**
|
|
183
|
+
* Publishes a task progress update.
|
|
184
|
+
*
|
|
185
|
+
* @param config - Task progress configuration
|
|
186
|
+
* @returns Promise resolving to published message
|
|
187
|
+
* @throws {TaskChannelError} If validation fails
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* await taskChannel.publishTaskProgress({
|
|
192
|
+
* taskId: 'task-1',
|
|
193
|
+
* agentId: 'agent-1',
|
|
194
|
+
* progress: 50,
|
|
195
|
+
* message: 'Processing halfway complete'
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
198
|
+
*/ async publishTaskProgress(config) {
|
|
199
|
+
this.validateTaskProgress(config);
|
|
200
|
+
const payload = {
|
|
201
|
+
taskId: config.taskId,
|
|
202
|
+
agentId: config.agentId,
|
|
203
|
+
progress: config.progress,
|
|
204
|
+
message: config.message,
|
|
205
|
+
timestamp: Date.now(),
|
|
206
|
+
metadata: config.metadata
|
|
207
|
+
};
|
|
208
|
+
const topic = `${TaskChannel.PROGRESS_TOPIC}.${config.taskId}`;
|
|
209
|
+
const messageConfig = {
|
|
210
|
+
topic,
|
|
211
|
+
payload,
|
|
212
|
+
priority: MessagePriority.LOW,
|
|
213
|
+
senderId: config.agentId,
|
|
214
|
+
metadata: {
|
|
215
|
+
channel: 'task',
|
|
216
|
+
type: 'progress',
|
|
217
|
+
taskId: config.taskId
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
return this.broker.publish(messageConfig);
|
|
221
|
+
}
|
|
222
|
+
// ============================================
|
|
223
|
+
// Subscribing
|
|
224
|
+
// ============================================
|
|
225
|
+
/**
|
|
226
|
+
* Subscribes to task assignments for a specific agent.
|
|
227
|
+
*
|
|
228
|
+
* @param agentId - Agent ID to monitor
|
|
229
|
+
* @param handler - Callback function for assignments
|
|
230
|
+
* @returns Subscription handle
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const sub = await taskChannel.subscribeToAssignments('agent-1', async (payload) => {
|
|
235
|
+
* console.log(`Received task: ${payload.taskId}`);
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
238
|
+
*/ async subscribeToAssignments(agentId, handler) {
|
|
239
|
+
this.validateId(agentId, 'Agent ID');
|
|
240
|
+
return this.broker.subscribe({
|
|
241
|
+
topic: `${TaskChannel.ASSIGNMENT_TOPIC}.${agentId}`,
|
|
242
|
+
handler: async (message)=>{
|
|
243
|
+
await handler(message.payload);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Subscribes to all task assignments.
|
|
249
|
+
*
|
|
250
|
+
* @param handler - Callback function for assignments
|
|
251
|
+
* @returns Subscription handle
|
|
252
|
+
*/ async subscribeToAllAssignments(handler) {
|
|
253
|
+
return this.broker.subscribe({
|
|
254
|
+
topic: `${TaskChannel.ASSIGNMENT_TOPIC}.*`,
|
|
255
|
+
handler: async (message)=>{
|
|
256
|
+
await handler(message.payload);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Subscribes to task completions for a specific task.
|
|
262
|
+
*
|
|
263
|
+
* @param taskId - Task ID to monitor
|
|
264
|
+
* @param handler - Callback function for completions
|
|
265
|
+
* @returns Subscription handle
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```typescript
|
|
269
|
+
* const sub = await taskChannel.subscribeToCompletion('task-1', async (payload) => {
|
|
270
|
+
* console.log(`Task completed with status: ${payload.status}`);
|
|
271
|
+
* });
|
|
272
|
+
* ```
|
|
273
|
+
*/ async subscribeToCompletion(taskId, handler) {
|
|
274
|
+
this.validateId(taskId, 'Task ID');
|
|
275
|
+
return this.broker.subscribe({
|
|
276
|
+
topic: `${TaskChannel.COMPLETION_TOPIC}.${taskId}`,
|
|
277
|
+
handler: async (message)=>{
|
|
278
|
+
await handler(message.payload);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Subscribes to all task completions.
|
|
284
|
+
*
|
|
285
|
+
* @param handler - Callback function for completions
|
|
286
|
+
* @returns Subscription handle
|
|
287
|
+
*/ async subscribeToAllCompletions(handler) {
|
|
288
|
+
return this.broker.subscribe({
|
|
289
|
+
topic: `${TaskChannel.COMPLETION_TOPIC}.*`,
|
|
290
|
+
handler: async (message)=>{
|
|
291
|
+
await handler(message.payload);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Subscribes to task progress updates for a specific task.
|
|
297
|
+
*
|
|
298
|
+
* @param taskId - Task ID to monitor
|
|
299
|
+
* @param handler - Callback function for progress updates
|
|
300
|
+
* @returns Subscription handle
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```typescript
|
|
304
|
+
* const sub = await taskChannel.subscribeToProgress('task-1', async (payload) => {
|
|
305
|
+
* console.log(`Task progress: ${payload.progress}%`);
|
|
306
|
+
* });
|
|
307
|
+
* ```
|
|
308
|
+
*/ async subscribeToProgress(taskId, handler) {
|
|
309
|
+
this.validateId(taskId, 'Task ID');
|
|
310
|
+
return this.broker.subscribe({
|
|
311
|
+
topic: `${TaskChannel.PROGRESS_TOPIC}.${taskId}`,
|
|
312
|
+
handler: async (message)=>{
|
|
313
|
+
await handler(message.payload);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
// ============================================
|
|
318
|
+
// Validation
|
|
319
|
+
// ============================================
|
|
320
|
+
/**
|
|
321
|
+
* Validates task assignment configuration.
|
|
322
|
+
*/ validateTaskAssignment(config) {
|
|
323
|
+
this.validateId(config.taskId, 'Task ID');
|
|
324
|
+
this.validateId(config.agentId, 'Agent ID');
|
|
325
|
+
if (!config.description || typeof config.description !== 'string') {
|
|
326
|
+
throw new TaskChannelError('Task description must be a non-empty string');
|
|
327
|
+
}
|
|
328
|
+
if (config.priority !== undefined && !Object.values(TaskPriority).includes(config.priority)) {
|
|
329
|
+
throw new TaskChannelError(`Invalid task priority: ${config.priority}`);
|
|
330
|
+
}
|
|
331
|
+
if (config.timeout !== undefined) {
|
|
332
|
+
if (typeof config.timeout !== 'number' || config.timeout <= 0) {
|
|
333
|
+
throw new TaskChannelError('Timeout must be a positive number');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Validates task completion configuration.
|
|
339
|
+
*/ validateTaskCompletion(config) {
|
|
340
|
+
this.validateId(config.taskId, 'Task ID');
|
|
341
|
+
this.validateId(config.agentId, 'Agent ID');
|
|
342
|
+
if (!Object.values(TaskStatus).includes(config.status)) {
|
|
343
|
+
throw new TaskChannelError(`Invalid task status: ${config.status}`);
|
|
344
|
+
}
|
|
345
|
+
if (config.duration !== undefined) {
|
|
346
|
+
if (typeof config.duration !== 'number' || config.duration < 0) {
|
|
347
|
+
throw new TaskChannelError('Duration must be a non-negative number');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Validates task progress configuration.
|
|
353
|
+
*/ validateTaskProgress(config) {
|
|
354
|
+
this.validateId(config.taskId, 'Task ID');
|
|
355
|
+
this.validateId(config.agentId, 'Agent ID');
|
|
356
|
+
if (typeof config.progress !== 'number' || config.progress < 0 || config.progress > 100) {
|
|
357
|
+
throw new TaskChannelError('Progress must be a number between 0 and 100');
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Validates an ID field.
|
|
362
|
+
*/ validateId(id, fieldName) {
|
|
363
|
+
if (!id || typeof id !== 'string') {
|
|
364
|
+
throw new TaskChannelError(`${fieldName} must be a non-empty string`);
|
|
365
|
+
}
|
|
366
|
+
if (id.length > 256) {
|
|
367
|
+
throw new TaskChannelError(`${fieldName} exceeds 256 characters`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
// ============================================
|
|
371
|
+
// Utility Methods
|
|
372
|
+
// ============================================
|
|
373
|
+
/**
|
|
374
|
+
* Maps task priority to message priority.
|
|
375
|
+
*/ mapTaskPriorityToMessagePriority(taskPriority) {
|
|
376
|
+
switch(taskPriority){
|
|
377
|
+
case 10:
|
|
378
|
+
return MessagePriority.CRITICAL;
|
|
379
|
+
case 8:
|
|
380
|
+
return MessagePriority.HIGH;
|
|
381
|
+
case 5:
|
|
382
|
+
return MessagePriority.NORMAL;
|
|
383
|
+
case 2:
|
|
384
|
+
return MessagePriority.LOW;
|
|
385
|
+
default:
|
|
386
|
+
return MessagePriority.NORMAL;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Gets the base topic for all task messages.
|
|
391
|
+
*/ static getBaseTopic() {
|
|
392
|
+
return TaskChannel.BASE_TOPIC;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Gets the topic for task assignments.
|
|
396
|
+
*/ static getAssignmentTopic() {
|
|
397
|
+
return TaskChannel.ASSIGNMENT_TOPIC;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Gets the topic for task completions.
|
|
401
|
+
*/ static getCompletionTopic() {
|
|
402
|
+
return TaskChannel.COMPLETION_TOPIC;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Gets the topic for task progress.
|
|
406
|
+
*/ static getProgressTopic() {
|
|
407
|
+
return TaskChannel.PROGRESS_TOPIC;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
//# sourceMappingURL=task-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.ts"],"names":["MessagePriority","TaskPriority","TaskStatus","TaskChannelError","Error","message","name","TaskChannel","BASE_TOPIC","ASSIGNMENT_TOPIC","COMPLETION_TOPIC","PROGRESS_TOPIC","broker","publishTaskAssignment","config","validateTaskAssignment","payload","taskId","agentId","description","priority","input","timeout","timestamp","Date","now","metadata","topic","mapTaskPriorityToMessagePriority","messageConfig","recipientId","channel","type","publish","publishTaskCompletion","validateTaskCompletion","status","result","duration","HIGH","NORMAL","senderId","publishTaskProgress","validateTaskProgress","progress","LOW","subscribeToAssignments","handler","validateId","subscribe","subscribeToAllAssignments","subscribeToCompletion","subscribeToAllCompletions","subscribeToProgress","undefined","Object","values","includes","id","fieldName","length","taskPriority","CRITICAL","getBaseTopic","getAssignmentTopic","getCompletionTopic","getProgressTopic"],"mappings":"AAAA;;;;;;;CAOC,GAED,SAAiCA,eAAe,QAAQ,wBAAwB;AAGhF;;CAEC,GACD,OAAO,IAAA,AAAKC,sCAAAA;IACV,gDAAgD;IAGhD,uBAAuB;IAGvB,mCAAmC;IAGnC,iCAAiC;WAVvBA;MAYX;AAED;;CAEC,GACD,OAA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YACN;gBACE,OAAO7D,gBAAgB8D,QAAQ;YACjC;gBACE,OAAO9D,gBAAgBuC,IAAI;YAC7B;gBACE,OAAOvC,gBAAgBwC,MAAM;YAC/B;gBACE,OAAOxC,gBAAgB6C,GAAG;YAC5B;gBACE,OAAO7C,gBAAgBwC,MAAM;QACjC;IACF;IAEA;;GAEC,GACD,OAAOuB,eAAuB;QAC5B,OAAOxD,YAAYC,UAAU;IAC/B;IAEA;;GAEC,GACD,OAAOwD,qBAA6B;QAClC,OAAOzD,YAAYE,gBAAgB;IACrC;IAEA;;GAEC,GACD,OAAOwD,qBAA6B;QAClC,OAAO1D,YAAYG,gBAAgB;IACrC;IAEA;;GAEC,GACD,OAAOwD,mBAA2B;QAChC,OAAO3D,YAAYI,cAAc;IACnC;AACF"}
|
package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - Messaging Module
|
|
3
|
+
*
|
|
4
|
+
* Channel-based message bus architecture with event-driven pub/sub pattern.
|
|
5
|
+
*
|
|
6
|
+
* @module coordination/v2/messaging
|
|
7
|
+
*/ // Core message bus
|
|
8
|
+
export { MessageBus, MessageBusEvent } from './message-bus.js';
|
|
9
|
+
// Channel abstraction
|
|
10
|
+
export { Channel, ChannelEvent, BackpressurePolicy } from './channel.js';
|
|
11
|
+
// Message router
|
|
12
|
+
export { MessageRouter, ChannelType, RouterEvent } from './message-router.js';
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/messaging/index.ts"],"names":["MessageBus","MessageBusEvent","Channel","ChannelEvent","BackpressurePolicy","MessageRouter","ChannelType","RouterEvent"],"mappings":"AAAA;;;;;;CAMC,GAED,mBAAmB;AACnB,SAASA,UAAU,EAAEC,eAAe,QAAqD,mBAAmB;AAE5G,sBAAsB;AACtB,SACEC,OAAO,EACPC,YAAY,EACZC,kBAAkB,QAIb,eAAe;AAEtB,iBAAiB;AACjB,SACEC,aAAa,EACbC,WAAW,EACXC,WAAW,QAIN,sBAAsB"}
|