claude-flow-novice 1.6.4 → 1.6.6
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/mcp-server-sdk.js +45 -0
- 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/config/.env.example +178 -0
- package/config/DEPLOYMENT_GUIDE.md +692 -0
- package/config/README-CONFIG.md +331 -0
- package/config/coordination-config.sh +327 -0
- package/config/docker/env.development +53 -0
- package/config/docker/env.production +83 -0
- package/config/docker/env.staging +70 -0
- package/config/k8s/configmap-development.yaml +60 -0
- package/config/k8s/configmap-production.yaml +85 -0
- package/config/k8s/configmap-staging.yaml +76 -0
- package/config/k8s/secret-production.yaml +62 -0
- package/config/k8s/secret-staging.yaml +36 -0
- package/package.json +2 -2
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
- package/scripts/monitoring/quick-test-alerting.sh +118 -0
- package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
- package/scripts/monitoring/rate-limiting-monitor.sh +380 -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,615 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Coordination V2 - Session Pool Optimizer
|
|
3
|
+
*
|
|
4
|
+
* Optimized session pool for 50+ concurrent agents with:
|
|
5
|
+
* - Connection pooling and reuse
|
|
6
|
+
* - LRU eviction for idle sessions
|
|
7
|
+
* - Auto-scaling based on load
|
|
8
|
+
* - Resource limits and throttling
|
|
9
|
+
* - Health checks and auto-recovery
|
|
10
|
+
*
|
|
11
|
+
* @module coordination/v2/sdk/session-pool-optimizer
|
|
12
|
+
*/ import { EventEmitter } from 'node:events';
|
|
13
|
+
import { Logger } from '../../../core/logger.js';
|
|
14
|
+
import { generateId } from '../../../utils/helpers.js';
|
|
15
|
+
import { AgentState } from '../../shared/core/agent-state.js';
|
|
16
|
+
/**
|
|
17
|
+
* Session Pool Optimizer - High-performance session management for 50+ agents.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const pool = new SessionPoolOptimizer({
|
|
22
|
+
* maxPoolSize: 60,
|
|
23
|
+
* minPoolSize: 10,
|
|
24
|
+
* autoScaleThreshold: 80
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* await pool.initialize();
|
|
28
|
+
*
|
|
29
|
+
* // Acquire session
|
|
30
|
+
* const session = await pool.acquireSession({ agentId: 'agent-1', priority: 8 });
|
|
31
|
+
*
|
|
32
|
+
* // Release session (returns to pool for reuse)
|
|
33
|
+
* await pool.releaseSession(session.sessionId);
|
|
34
|
+
*
|
|
35
|
+
* // Cleanup
|
|
36
|
+
* await pool.shutdown();
|
|
37
|
+
* ```
|
|
38
|
+
*/ export class SessionPoolOptimizer extends EventEmitter {
|
|
39
|
+
logger;
|
|
40
|
+
config;
|
|
41
|
+
sessionPool;
|
|
42
|
+
activeSessions;
|
|
43
|
+
agentSessions;
|
|
44
|
+
requestCounts;
|
|
45
|
+
healthCheckTimer;
|
|
46
|
+
evictionTimer;
|
|
47
|
+
metrics;
|
|
48
|
+
initialized = false;
|
|
49
|
+
startTime;
|
|
50
|
+
constructor(config){
|
|
51
|
+
super();
|
|
52
|
+
this.logger = new Logger({
|
|
53
|
+
level: 'info',
|
|
54
|
+
format: 'text',
|
|
55
|
+
destination: 'console'
|
|
56
|
+
});
|
|
57
|
+
this.config = {
|
|
58
|
+
maxPoolSize: config?.maxPoolSize ?? 60,
|
|
59
|
+
minPoolSize: config?.minPoolSize ?? 10,
|
|
60
|
+
maxIdleTimeMs: config?.maxIdleTimeMs ?? 300000,
|
|
61
|
+
healthCheckIntervalMs: config?.healthCheckIntervalMs ?? 30000,
|
|
62
|
+
autoScaleThreshold: config?.autoScaleThreshold ?? 80,
|
|
63
|
+
autoScaleStep: config?.autoScaleStep ?? 10,
|
|
64
|
+
connectionTimeoutMs: config?.connectionTimeoutMs ?? 5000,
|
|
65
|
+
throttleLimit: config?.throttleLimit ?? 10,
|
|
66
|
+
enableReuse: config?.enableReuse ?? true,
|
|
67
|
+
enableAutoRecovery: config?.enableAutoRecovery ?? true
|
|
68
|
+
};
|
|
69
|
+
this.sessionPool = new Map();
|
|
70
|
+
this.activeSessions = new Set();
|
|
71
|
+
this.agentSessions = new Map();
|
|
72
|
+
this.requestCounts = new Map();
|
|
73
|
+
this.metrics = this.initializeMetrics();
|
|
74
|
+
this.startTime = Date.now();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Initialize the session pool optimizer.
|
|
78
|
+
*/ async initialize() {
|
|
79
|
+
if (this.initialized) {
|
|
80
|
+
this.logger.warn('SessionPoolOptimizer already initialized');
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.logger.info('Initializing session pool optimizer', {
|
|
84
|
+
maxPoolSize: this.config.maxPoolSize,
|
|
85
|
+
minPoolSize: this.config.minPoolSize,
|
|
86
|
+
autoScaleThreshold: this.config.autoScaleThreshold
|
|
87
|
+
});
|
|
88
|
+
// Pre-warm pool with minimum sessions
|
|
89
|
+
await this.warmPool();
|
|
90
|
+
// Start health checks
|
|
91
|
+
this.startHealthChecks();
|
|
92
|
+
// Start eviction timer
|
|
93
|
+
this.startEvictionTimer();
|
|
94
|
+
this.initialized = true;
|
|
95
|
+
this.emit('pool:initialized', {
|
|
96
|
+
poolSize: this.sessionPool.size
|
|
97
|
+
});
|
|
98
|
+
this.logger.info('Session pool optimizer initialized', {
|
|
99
|
+
preWarmedSessions: this.sessionPool.size
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Acquire a session from the pool or create new one.
|
|
104
|
+
*
|
|
105
|
+
* @param request - Session request with agent ID and priority
|
|
106
|
+
* @returns Pooled session
|
|
107
|
+
* @throws Error if pool is at capacity or throttle limit exceeded
|
|
108
|
+
*/ async acquireSession(request) {
|
|
109
|
+
if (!this.initialized) {
|
|
110
|
+
throw new Error('SessionPoolOptimizer not initialized. Call initialize() first.');
|
|
111
|
+
}
|
|
112
|
+
// Check throttle limit
|
|
113
|
+
if (!this.checkThrottleLimit(request.agentId)) {
|
|
114
|
+
throw new Error(`Agent ${request.agentId} exceeded throttle limit (${this.config.throttleLimit} req/s)`);
|
|
115
|
+
}
|
|
116
|
+
// Check if agent already has an active session
|
|
117
|
+
const existingSessionId = this.agentSessions.get(request.agentId);
|
|
118
|
+
if (existingSessionId && this.activeSessions.has(existingSessionId)) {
|
|
119
|
+
const pooledSession = this.sessionPool.get(existingSessionId);
|
|
120
|
+
if (pooledSession) {
|
|
121
|
+
pooledSession.lastAccessTime = Date.now();
|
|
122
|
+
pooledSession.reuseCount++;
|
|
123
|
+
this.metrics.totalReuses++;
|
|
124
|
+
this.logger.debug('Reusing existing session', {
|
|
125
|
+
agentId: request.agentId,
|
|
126
|
+
sessionId: existingSessionId,
|
|
127
|
+
reuseCount: pooledSession.reuseCount
|
|
128
|
+
});
|
|
129
|
+
return pooledSession;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Try to reuse idle session
|
|
133
|
+
if (this.config.enableReuse) {
|
|
134
|
+
const reusedSession = this.findReusableSession(request);
|
|
135
|
+
if (reusedSession) {
|
|
136
|
+
return reusedSession;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Create new session if under capacity
|
|
140
|
+
if (this.sessionPool.size < this.config.maxPoolSize) {
|
|
141
|
+
return await this.createSession(request);
|
|
142
|
+
}
|
|
143
|
+
// Pool at capacity - check auto-scaling
|
|
144
|
+
const utilization = this.calculateUtilization();
|
|
145
|
+
if (utilization >= this.config.autoScaleThreshold) {
|
|
146
|
+
await this.autoScale();
|
|
147
|
+
return await this.createSession(request);
|
|
148
|
+
}
|
|
149
|
+
// Evict LRU session to make space
|
|
150
|
+
this.evictLRU();
|
|
151
|
+
return await this.createSession(request);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Release a session back to the pool.
|
|
155
|
+
*
|
|
156
|
+
* @param sessionId - Session ID to release
|
|
157
|
+
* @returns True if released successfully
|
|
158
|
+
*/ async releaseSession(sessionId) {
|
|
159
|
+
const pooledSession = this.sessionPool.get(sessionId);
|
|
160
|
+
if (!pooledSession) {
|
|
161
|
+
this.logger.warn('Session not found in pool', {
|
|
162
|
+
sessionId
|
|
163
|
+
});
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
// Mark as idle
|
|
167
|
+
this.activeSessions.delete(sessionId);
|
|
168
|
+
pooledSession.lastAccessTime = Date.now();
|
|
169
|
+
// Update metrics
|
|
170
|
+
this.updateMetrics();
|
|
171
|
+
this.logger.debug('Session released to pool', {
|
|
172
|
+
sessionId,
|
|
173
|
+
agentId: pooledSession.agentId,
|
|
174
|
+
reuseCount: pooledSession.reuseCount
|
|
175
|
+
});
|
|
176
|
+
this.emit('session:released', {
|
|
177
|
+
sessionId,
|
|
178
|
+
agentId: pooledSession.agentId
|
|
179
|
+
});
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Remove a session from the pool.
|
|
184
|
+
*
|
|
185
|
+
* @param sessionId - Session ID to remove
|
|
186
|
+
* @returns True if removed successfully
|
|
187
|
+
*/ async removeSession(sessionId) {
|
|
188
|
+
const pooledSession = this.sessionPool.get(sessionId);
|
|
189
|
+
if (!pooledSession) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
// Remove from all indices
|
|
193
|
+
this.sessionPool.delete(sessionId);
|
|
194
|
+
this.activeSessions.delete(sessionId);
|
|
195
|
+
this.agentSessions.delete(pooledSession.agentId);
|
|
196
|
+
// Update metrics
|
|
197
|
+
this.metrics.totalEvicted++;
|
|
198
|
+
this.updateMetrics();
|
|
199
|
+
this.logger.debug('Session removed from pool', {
|
|
200
|
+
sessionId,
|
|
201
|
+
agentId: pooledSession.agentId
|
|
202
|
+
});
|
|
203
|
+
this.emit('session:removed', {
|
|
204
|
+
sessionId,
|
|
205
|
+
agentId: pooledSession.agentId
|
|
206
|
+
});
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Pin a session to prevent eviction.
|
|
211
|
+
*
|
|
212
|
+
* @param sessionId - Session ID to pin
|
|
213
|
+
*/ pinSession(sessionId) {
|
|
214
|
+
const pooledSession = this.sessionPool.get(sessionId);
|
|
215
|
+
if (pooledSession) {
|
|
216
|
+
pooledSession.metadata.isPinned = true;
|
|
217
|
+
this.logger.debug('Session pinned', {
|
|
218
|
+
sessionId
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Unpin a session to allow eviction.
|
|
224
|
+
*
|
|
225
|
+
* @param sessionId - Session ID to unpin
|
|
226
|
+
*/ unpinSession(sessionId) {
|
|
227
|
+
const pooledSession = this.sessionPool.get(sessionId);
|
|
228
|
+
if (pooledSession) {
|
|
229
|
+
pooledSession.metadata.isPinned = false;
|
|
230
|
+
this.logger.debug('Session unpinned', {
|
|
231
|
+
sessionId
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get pool metrics.
|
|
237
|
+
*
|
|
238
|
+
* @returns Current pool metrics
|
|
239
|
+
*/ getMetrics() {
|
|
240
|
+
this.updateMetrics();
|
|
241
|
+
return {
|
|
242
|
+
...this.metrics
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Get all sessions in the pool.
|
|
247
|
+
*
|
|
248
|
+
* @returns Array of pooled sessions
|
|
249
|
+
*/ getSessions() {
|
|
250
|
+
return Array.from(this.sessionPool.values());
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Get session by ID.
|
|
254
|
+
*
|
|
255
|
+
* @param sessionId - Session ID
|
|
256
|
+
* @returns Pooled session if found
|
|
257
|
+
*/ getSession(sessionId) {
|
|
258
|
+
return this.sessionPool.get(sessionId);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Shutdown the session pool optimizer.
|
|
262
|
+
*/ async shutdown() {
|
|
263
|
+
if (!this.initialized) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
this.logger.info('Shutting down session pool optimizer', {
|
|
267
|
+
poolSize: this.sessionPool.size,
|
|
268
|
+
activeSessions: this.activeSessions.size
|
|
269
|
+
});
|
|
270
|
+
// Emit shutdown event BEFORE removing listeners
|
|
271
|
+
this.emit('pool:shutdown');
|
|
272
|
+
// Stop timers
|
|
273
|
+
if (this.healthCheckTimer) {
|
|
274
|
+
clearInterval(this.healthCheckTimer);
|
|
275
|
+
this.healthCheckTimer = undefined;
|
|
276
|
+
}
|
|
277
|
+
if (this.evictionTimer) {
|
|
278
|
+
clearInterval(this.evictionTimer);
|
|
279
|
+
this.evictionTimer = undefined;
|
|
280
|
+
}
|
|
281
|
+
// Clear all data
|
|
282
|
+
this.sessionPool.clear();
|
|
283
|
+
this.activeSessions.clear();
|
|
284
|
+
this.agentSessions.clear();
|
|
285
|
+
this.requestCounts.clear();
|
|
286
|
+
this.removeAllListeners();
|
|
287
|
+
this.initialized = false;
|
|
288
|
+
this.logger.info('Session pool optimizer shut down');
|
|
289
|
+
}
|
|
290
|
+
// ============================================
|
|
291
|
+
// Private Methods
|
|
292
|
+
// ============================================
|
|
293
|
+
/**
|
|
294
|
+
* Initialize pool metrics.
|
|
295
|
+
*/ initializeMetrics() {
|
|
296
|
+
return {
|
|
297
|
+
currentPoolSize: 0,
|
|
298
|
+
activeSessions: 0,
|
|
299
|
+
idleSessions: 0,
|
|
300
|
+
unhealthySessions: 0,
|
|
301
|
+
utilizationPercent: 0,
|
|
302
|
+
totalCreated: 0,
|
|
303
|
+
totalEvicted: 0,
|
|
304
|
+
totalReuses: 0,
|
|
305
|
+
averageLifetimeMs: 0,
|
|
306
|
+
healthCheckPassRate: 100,
|
|
307
|
+
requestRate: 0,
|
|
308
|
+
autoScaleEvents: 0
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Pre-warm the pool with minimum sessions.
|
|
313
|
+
*/ async warmPool() {
|
|
314
|
+
const warmCount = this.config.minPoolSize;
|
|
315
|
+
for(let i = 0; i < warmCount; i++){
|
|
316
|
+
const sessionId = generateId('session');
|
|
317
|
+
const agentId = `warm-agent-${i}`;
|
|
318
|
+
const pooledSession = {
|
|
319
|
+
sessionId,
|
|
320
|
+
agentId,
|
|
321
|
+
session: this.createAgentSession(sessionId, agentId),
|
|
322
|
+
lastAccessTime: Date.now(),
|
|
323
|
+
createdTime: Date.now(),
|
|
324
|
+
reuseCount: 0,
|
|
325
|
+
health: 'healthy',
|
|
326
|
+
lastHealthCheck: Date.now(),
|
|
327
|
+
metadata: {
|
|
328
|
+
priority: 5,
|
|
329
|
+
isPinned: false,
|
|
330
|
+
tags: [
|
|
331
|
+
'warmed'
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
this.sessionPool.set(sessionId, pooledSession);
|
|
336
|
+
}
|
|
337
|
+
this.logger.info('Pool pre-warmed', {
|
|
338
|
+
sessionCount: warmCount
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Create a new agent session object.
|
|
343
|
+
*/ createAgentSession(sessionId, agentId) {
|
|
344
|
+
return {
|
|
345
|
+
sessionId,
|
|
346
|
+
agentId,
|
|
347
|
+
state: AgentState.IDLE,
|
|
348
|
+
isPaused: false,
|
|
349
|
+
checkpoints: [],
|
|
350
|
+
priority: 5,
|
|
351
|
+
metadata: {}
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Create a new session in the pool.
|
|
356
|
+
*/ async createSession(request) {
|
|
357
|
+
const sessionId = generateId('session');
|
|
358
|
+
const now = Date.now();
|
|
359
|
+
const pooledSession = {
|
|
360
|
+
sessionId,
|
|
361
|
+
agentId: request.agentId,
|
|
362
|
+
session: this.createAgentSession(sessionId, request.agentId),
|
|
363
|
+
lastAccessTime: now,
|
|
364
|
+
createdTime: now,
|
|
365
|
+
reuseCount: 0,
|
|
366
|
+
health: 'healthy',
|
|
367
|
+
lastHealthCheck: now,
|
|
368
|
+
metadata: {
|
|
369
|
+
priority: request.priority,
|
|
370
|
+
isPinned: false,
|
|
371
|
+
tags: [],
|
|
372
|
+
context: request.metadata
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
// Add to pool
|
|
376
|
+
this.sessionPool.set(sessionId, pooledSession);
|
|
377
|
+
this.activeSessions.add(sessionId);
|
|
378
|
+
this.agentSessions.set(request.agentId, sessionId);
|
|
379
|
+
// Update metrics
|
|
380
|
+
this.metrics.totalCreated++;
|
|
381
|
+
this.updateMetrics();
|
|
382
|
+
this.logger.debug('Session created', {
|
|
383
|
+
sessionId,
|
|
384
|
+
agentId: request.agentId,
|
|
385
|
+
poolSize: this.sessionPool.size
|
|
386
|
+
});
|
|
387
|
+
this.emit('session:created', {
|
|
388
|
+
sessionId,
|
|
389
|
+
agentId: request.agentId
|
|
390
|
+
});
|
|
391
|
+
return pooledSession;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Find a reusable idle session.
|
|
395
|
+
*/ findReusableSession(request) {
|
|
396
|
+
// Find healthy idle sessions sorted by LRU
|
|
397
|
+
const idleSessions = Array.from(this.sessionPool.values()).filter((s)=>!this.activeSessions.has(s.sessionId) && s.health === 'healthy').sort((a, b)=>a.lastAccessTime - b.lastAccessTime);
|
|
398
|
+
if (idleSessions.length === 0) {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
// Reuse oldest idle session
|
|
402
|
+
const session = idleSessions[0];
|
|
403
|
+
// Update session metadata
|
|
404
|
+
session.agentId = request.agentId;
|
|
405
|
+
session.lastAccessTime = Date.now();
|
|
406
|
+
session.reuseCount++;
|
|
407
|
+
session.metadata.priority = request.priority;
|
|
408
|
+
session.metadata.context = request.metadata;
|
|
409
|
+
// Update indices
|
|
410
|
+
this.activeSessions.add(session.sessionId);
|
|
411
|
+
this.agentSessions.set(request.agentId, session.sessionId);
|
|
412
|
+
// Update metrics
|
|
413
|
+
this.metrics.totalReuses++;
|
|
414
|
+
this.updateMetrics();
|
|
415
|
+
this.logger.debug('Session reused', {
|
|
416
|
+
sessionId: session.sessionId,
|
|
417
|
+
agentId: request.agentId,
|
|
418
|
+
reuseCount: session.reuseCount
|
|
419
|
+
});
|
|
420
|
+
this.emit('session:reused', {
|
|
421
|
+
sessionId: session.sessionId,
|
|
422
|
+
agentId: request.agentId
|
|
423
|
+
});
|
|
424
|
+
return session;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Evict least recently used session.
|
|
428
|
+
*/ evictLRU() {
|
|
429
|
+
// Find evictable sessions (not pinned, not active)
|
|
430
|
+
const evictable = Array.from(this.sessionPool.values()).filter((s)=>!s.metadata.isPinned && !this.activeSessions.has(s.sessionId)).sort((a, b)=>a.lastAccessTime - b.lastAccessTime);
|
|
431
|
+
if (evictable.length === 0) {
|
|
432
|
+
this.logger.warn('No evictable sessions found');
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
// Evict oldest
|
|
436
|
+
const session = evictable[0];
|
|
437
|
+
this.removeSession(session.sessionId);
|
|
438
|
+
this.logger.info('Session evicted (LRU)', {
|
|
439
|
+
sessionId: session.sessionId,
|
|
440
|
+
agentId: session.agentId,
|
|
441
|
+
idleTimeMs: Date.now() - session.lastAccessTime
|
|
442
|
+
});
|
|
443
|
+
this.emit('session:evicted', {
|
|
444
|
+
sessionId: session.sessionId,
|
|
445
|
+
reason: 'lru'
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Start health check timer.
|
|
450
|
+
*/ startHealthChecks() {
|
|
451
|
+
this.healthCheckTimer = setInterval(()=>{
|
|
452
|
+
this.performHealthChecks();
|
|
453
|
+
}, this.config.healthCheckIntervalMs);
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Perform health checks on all sessions.
|
|
457
|
+
*/ performHealthChecks() {
|
|
458
|
+
const now = Date.now();
|
|
459
|
+
let healthyCount = 0;
|
|
460
|
+
let totalChecked = 0;
|
|
461
|
+
for (const session of Array.from(this.sessionPool.values())){
|
|
462
|
+
totalChecked++;
|
|
463
|
+
// Simple health check: session age and reuse count
|
|
464
|
+
const age = now - session.createdTime;
|
|
465
|
+
const isHealthy = age < 3600000 && session.reuseCount < 100; // 1 hour, 100 reuses
|
|
466
|
+
session.lastHealthCheck = now;
|
|
467
|
+
session.health = isHealthy ? 'healthy' : 'degraded';
|
|
468
|
+
if (isHealthy) {
|
|
469
|
+
healthyCount++;
|
|
470
|
+
}
|
|
471
|
+
// Auto-recovery for degraded sessions
|
|
472
|
+
if (!isHealthy && this.config.enableAutoRecovery && !this.activeSessions.has(session.sessionId)) {
|
|
473
|
+
this.removeSession(session.sessionId);
|
|
474
|
+
this.logger.info('Unhealthy session removed', {
|
|
475
|
+
sessionId: session.sessionId
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
// Update metrics
|
|
480
|
+
this.metrics.healthCheckPassRate = totalChecked > 0 ? healthyCount / totalChecked * 100 : 100;
|
|
481
|
+
this.emit('health:checked', {
|
|
482
|
+
totalChecked,
|
|
483
|
+
healthyCount,
|
|
484
|
+
passRate: this.metrics.healthCheckPassRate
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Start eviction timer for idle sessions.
|
|
489
|
+
*/ startEvictionTimer() {
|
|
490
|
+
this.evictionTimer = setInterval(()=>{
|
|
491
|
+
this.evictIdleSessions();
|
|
492
|
+
}, this.config.maxIdleTimeMs / 2); // Check at half interval
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Evict idle sessions exceeding max idle time.
|
|
496
|
+
*/ evictIdleSessions() {
|
|
497
|
+
const now = Date.now();
|
|
498
|
+
const sessionsToEvict = [];
|
|
499
|
+
for (const session of Array.from(this.sessionPool.values())){
|
|
500
|
+
// Skip active and pinned sessions
|
|
501
|
+
if (this.activeSessions.has(session.sessionId) || session.metadata.isPinned) {
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
// Check idle time
|
|
505
|
+
const idleTime = now - session.lastAccessTime;
|
|
506
|
+
if (idleTime > this.config.maxIdleTimeMs) {
|
|
507
|
+
sessionsToEvict.push(session.sessionId);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
// Evict but maintain minimum pool size
|
|
511
|
+
for (const sessionId of sessionsToEvict){
|
|
512
|
+
if (this.sessionPool.size > this.config.minPoolSize) {
|
|
513
|
+
this.removeSession(sessionId);
|
|
514
|
+
this.logger.info('Idle session evicted', {
|
|
515
|
+
sessionId
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (sessionsToEvict.length > 0) {
|
|
520
|
+
this.emit('sessions:evicted', {
|
|
521
|
+
count: sessionsToEvict.length,
|
|
522
|
+
reason: 'idle'
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Calculate pool utilization percentage.
|
|
528
|
+
*/ calculateUtilization() {
|
|
529
|
+
return this.activeSessions.size / this.sessionPool.size * 100;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Auto-scale the pool based on utilization.
|
|
533
|
+
*/ async autoScale() {
|
|
534
|
+
const utilization = this.calculateUtilization();
|
|
535
|
+
if (utilization >= this.config.autoScaleThreshold) {
|
|
536
|
+
const newSize = Math.min(this.config.maxPoolSize, this.sessionPool.size + this.config.autoScaleStep);
|
|
537
|
+
const toAdd = newSize - this.sessionPool.size;
|
|
538
|
+
if (toAdd > 0) {
|
|
539
|
+
// Add new warm sessions
|
|
540
|
+
for(let i = 0; i < toAdd; i++){
|
|
541
|
+
const sessionId = generateId('session');
|
|
542
|
+
const agentId = `autoscale-${Date.now()}-${i}`;
|
|
543
|
+
const pooledSession = {
|
|
544
|
+
sessionId,
|
|
545
|
+
agentId,
|
|
546
|
+
session: this.createAgentSession(sessionId, agentId),
|
|
547
|
+
lastAccessTime: Date.now(),
|
|
548
|
+
createdTime: Date.now(),
|
|
549
|
+
reuseCount: 0,
|
|
550
|
+
health: 'healthy',
|
|
551
|
+
lastHealthCheck: Date.now(),
|
|
552
|
+
metadata: {
|
|
553
|
+
priority: 5,
|
|
554
|
+
isPinned: false,
|
|
555
|
+
tags: [
|
|
556
|
+
'autoscaled'
|
|
557
|
+
]
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
this.sessionPool.set(sessionId, pooledSession);
|
|
561
|
+
}
|
|
562
|
+
this.metrics.autoScaleEvents++;
|
|
563
|
+
this.logger.info('Pool auto-scaled', {
|
|
564
|
+
previousSize: this.sessionPool.size - toAdd,
|
|
565
|
+
newSize: this.sessionPool.size,
|
|
566
|
+
utilization
|
|
567
|
+
});
|
|
568
|
+
this.emit('pool:autoscaled', {
|
|
569
|
+
previousSize: this.sessionPool.size - toAdd,
|
|
570
|
+
newSize: this.sessionPool.size,
|
|
571
|
+
utilization
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Check if agent is within throttle limit.
|
|
578
|
+
*/ checkThrottleLimit(agentId) {
|
|
579
|
+
const now = Date.now();
|
|
580
|
+
const windowMs = 1000; // 1 second
|
|
581
|
+
// Get request timestamps for agent
|
|
582
|
+
let timestamps = this.requestCounts.get(agentId) || [];
|
|
583
|
+
// Remove timestamps outside window
|
|
584
|
+
timestamps = timestamps.filter((ts)=>now - ts < windowMs);
|
|
585
|
+
// Check limit
|
|
586
|
+
if (timestamps.length >= this.config.throttleLimit) {
|
|
587
|
+
return false;
|
|
588
|
+
}
|
|
589
|
+
// Add current request
|
|
590
|
+
timestamps.push(now);
|
|
591
|
+
this.requestCounts.set(agentId, timestamps);
|
|
592
|
+
return true;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Update pool metrics.
|
|
596
|
+
*/ updateMetrics() {
|
|
597
|
+
const unhealthyCount = Array.from(this.sessionPool.values()).filter((s)=>s.health !== 'healthy').length;
|
|
598
|
+
const totalLifetime = Array.from(this.sessionPool.values()).reduce((sum, s)=>sum + (Date.now() - s.createdTime), 0);
|
|
599
|
+
this.metrics.currentPoolSize = this.sessionPool.size;
|
|
600
|
+
this.metrics.activeSessions = this.activeSessions.size;
|
|
601
|
+
this.metrics.idleSessions = this.sessionPool.size - this.activeSessions.size;
|
|
602
|
+
this.metrics.unhealthySessions = unhealthyCount;
|
|
603
|
+
this.metrics.utilizationPercent = this.calculateUtilization();
|
|
604
|
+
this.metrics.averageLifetimeMs = this.sessionPool.size > 0 ? totalLifetime / this.sessionPool.size : 0;
|
|
605
|
+
// Calculate request rate
|
|
606
|
+
const now = Date.now();
|
|
607
|
+
let totalRequests = 0;
|
|
608
|
+
for (const timestamps of Array.from(this.requestCounts.values())){
|
|
609
|
+
totalRequests += timestamps.filter((ts)=>now - ts < 1000).length;
|
|
610
|
+
}
|
|
611
|
+
this.metrics.requestRate = totalRequests;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
//# sourceMappingURL=session-pool-optimizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.ts"],"names":["EventEmitter","Logger","generateId","AgentState","SessionPoolOptimizer","logger","config","sessionPool","activeSessions","agentSessions","requestCounts","healthCheckTimer","evictionTimer","metrics","initialized","startTime","level","format","destination","maxPoolSize","minPoolSize","maxIdleTimeMs","healthCheckIntervalMs","autoScaleThreshold","autoScaleStep","connectionTimeoutMs","throttleLimit","enableReuse","enableAutoRecovery","Map","Set","initializeMetrics","Date","now","initialize","warn","info","warmPool","startHealthChecks","startEvictionTimer","emit","poolSize","size","preWarmedSessions","acquireSession","request","Error","checkThrottleLimit","agentId","existingSessionId","get","has","pooledSession","lastAccessTime","reuseCount","totalReuses","debug","sessionId","reusedSession","findReusableSession","createSession","utilization","calculateUtilization","autoScale","evictLRU","releaseSession","delete","updateMetrics","removeSession","totalEvicted","pinSession","metadata","isPinned","unpinSession","getMetrics","getSessions","Array","from","values","getSession","shutdown","clearInterval","undefined","clear","removeAllListeners","currentPoolSize","idleSessions","unhealthySessions","utilizationPercent","totalCreated","averageLifetimeMs","healthCheckPassRate","requestRate","autoScaleEvents","warmCount","i","session","createAgentSession","createdTime","health","lastHealthCheck","priority","tags","set","sessionCount","state","IDLE","isPaused","checkpoints","context","add","filter","s","sort","a","b","length","evictable","idleTimeMs","reason","setInterval","performHealthChecks","healthyCount","totalChecked","age","isHealthy","passRate","evictIdleSessions","sessionsToEvict","idleTime","push","count","newSize","Math","min","toAdd","previousSize","windowMs","timestamps","ts","unhealthyCount","totalLifetime","reduce","sum","totalRequests"],"mappings":"AAAA;;;;;;;;;;;CAWC,GAED,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,MAAM,QAAQ,0BAA0B;AAC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