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.
Files changed (286) hide show
  1. package/.claude/commands/parse-epic.js +180 -0
  2. package/.claude/settings.local.json +2 -1
  3. package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +37 -2
  4. package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +45 -0
  5. package/.claude-flow-novice/dist/mcp/transports/base.js +5 -0
  6. package/.claude-flow-novice/dist/mcp/transports/base.js.map +1 -0
  7. package/.claude-flow-novice/dist/mcp/transports/http.js +414 -0
  8. package/.claude-flow-novice/dist/mcp/transports/http.js.map +1 -0
  9. package/.claude-flow-novice/dist/mcp/transports/stdio.js +217 -0
  10. package/.claude-flow-novice/dist/mcp/transports/stdio.js.map +1 -0
  11. package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js +129 -0
  12. package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js.map +1 -0
  13. package/.claude-flow-novice/dist/src/cli/index.js +3 -0
  14. package/.claude-flow-novice/dist/src/cli/index.js.map +1 -1
  15. package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js +266 -0
  16. package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js.map +1 -0
  17. package/.claude-flow-novice/dist/src/communication/message-bus.js +105 -2
  18. package/.claude-flow-novice/dist/src/communication/message-bus.js.map +1 -1
  19. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +1 -1
  20. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -1
  21. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js +632 -0
  22. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js.map +1 -0
  23. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js +11 -0
  24. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js.map +1 -0
  25. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js +318 -0
  26. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js.map +1 -0
  27. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js +234 -0
  28. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js.map +1 -0
  29. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js +347 -0
  30. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js.map +1 -0
  31. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js +13 -0
  32. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js.map +1 -0
  33. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js +173 -0
  34. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js.map +1 -0
  35. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js +526 -0
  36. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js.map +1 -0
  37. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js +443 -0
  38. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js.map +1 -0
  39. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js +366 -0
  40. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js.map +1 -0
  41. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js +287 -0
  42. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js.map +1 -0
  43. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js +364 -0
  44. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js.map +1 -0
  45. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js +492 -0
  46. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js.map +1 -0
  47. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js +786 -0
  48. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js.map +1 -0
  49. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js +16 -0
  50. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js.map +1 -0
  51. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js +342 -0
  52. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js.map +1 -0
  53. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js +601 -0
  54. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
  55. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js +9 -0
  56. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js.map +1 -0
  57. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js +413 -0
  58. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js.map +1 -0
  59. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js +471 -0
  60. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js.map +1 -0
  61. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js +379 -0
  62. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js.map +1 -0
  63. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js +335 -0
  64. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js.map +1 -0
  65. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js +211 -0
  66. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js.map +1 -0
  67. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js +33 -0
  68. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js.map +1 -0
  69. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js +920 -0
  70. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js.map +1 -0
  71. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js +385 -0
  72. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js.map +1 -0
  73. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js +138 -0
  74. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js.map +1 -0
  75. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js +478 -0
  76. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js.map +1 -0
  77. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js +358 -0
  78. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js.map +1 -0
  79. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js +588 -0
  80. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js.map +1 -0
  81. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js +153 -0
  82. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js.map +1 -0
  83. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js +360 -0
  84. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js.map +1 -0
  85. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js +337 -0
  86. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js.map +1 -0
  87. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js +424 -0
  88. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js.map +1 -0
  89. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js +9 -0
  90. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js.map +1 -0
  91. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js +669 -0
  92. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js.map +1 -0
  93. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js +451 -0
  94. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js.map +1 -0
  95. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js +271 -0
  96. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js.map +1 -0
  97. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js +335 -0
  98. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js.map +1 -0
  99. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js +439 -0
  100. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js.map +1 -0
  101. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js +92 -0
  102. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js.map +1 -0
  103. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js +21 -0
  104. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js.map +1 -0
  105. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js +223 -0
  106. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js.map +1 -0
  107. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js +436 -0
  108. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js.map +1 -0
  109. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js +278 -0
  110. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js.map +1 -0
  111. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js +317 -0
  112. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js.map +1 -0
  113. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js +273 -0
  114. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js.map +1 -0
  115. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js +15 -0
  116. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js.map +1 -0
  117. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js +512 -0
  118. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js.map +1 -0
  119. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js +67 -0
  120. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js.map +1 -0
  121. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js +557 -0
  122. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js.map +1 -0
  123. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js +14 -0
  124. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js.map +1 -0
  125. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js +212 -0
  126. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js.map +1 -0
  127. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js +552 -0
  128. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js.map +1 -0
  129. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js +635 -0
  130. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js.map +1 -0
  131. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js +28 -0
  132. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js.map +1 -0
  133. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js +9 -0
  134. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js.map +1 -0
  135. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js +25 -0
  136. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js.map +1 -0
  137. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js +14 -0
  138. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js.map +1 -0
  139. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js +308 -0
  140. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js.map +1 -0
  141. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js +439 -0
  142. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js.map +1 -0
  143. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js +540 -0
  144. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js.map +1 -0
  145. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js +367 -0
  146. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js.map +1 -0
  147. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js +14 -0
  148. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js.map +1 -0
  149. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js +518 -0
  150. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js.map +1 -0
  151. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js +377 -0
  152. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js.map +1 -0
  153. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js +371 -0
  154. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js.map +1 -0
  155. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js +355 -0
  156. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js.map +1 -0
  157. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js +424 -0
  158. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js.map +1 -0
  159. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js +16 -0
  160. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js.map +1 -0
  161. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js +295 -0
  162. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js.map +1 -0
  163. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js +411 -0
  164. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js.map +1 -0
  165. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js +14 -0
  166. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js.map +1 -0
  167. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js +387 -0
  168. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js.map +1 -0
  169. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js +589 -0
  170. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js.map +1 -0
  171. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js +444 -0
  172. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js.map +1 -0
  173. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js +560 -0
  174. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js.map +1 -0
  175. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js +335 -0
  176. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js.map +1 -0
  177. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js +104 -0
  178. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js.map +1 -0
  179. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js +847 -0
  180. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js.map +1 -0
  181. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js +470 -0
  182. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js.map +1 -0
  183. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js +450 -0
  184. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js.map +1 -0
  185. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js +13 -0
  186. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js.map +1 -0
  187. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js +625 -0
  188. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js.map +1 -0
  189. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js +545 -0
  190. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js.map +1 -0
  191. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js +740 -0
  192. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js.map +1 -0
  193. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js +415 -0
  194. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js.map +1 -0
  195. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js +615 -0
  196. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js.map +1 -0
  197. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js +547 -0
  198. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js.map +1 -0
  199. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js +342 -0
  200. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js.map +1 -0
  201. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js +259 -0
  202. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js.map +1 -0
  203. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js +273 -0
  204. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js.map +1 -0
  205. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js +8 -0
  206. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js.map +1 -0
  207. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js +310 -0
  208. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js.map +1 -0
  209. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js +218 -0
  210. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js.map +1 -0
  211. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js +9 -0
  212. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js.map +1 -0
  213. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js +6 -0
  214. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js.map +1 -0
  215. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js +145 -0
  216. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js.map +1 -0
  217. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js +122 -0
  218. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js.map +1 -0
  219. package/.claude-flow-novice/dist/src/coordination/config-translator.js +17 -43
  220. package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -1
  221. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +34 -76
  222. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -1
  223. package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js +172 -0
  224. package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js.map +1 -0
  225. package/.claude-flow-novice/dist/src/coordination/shared/core/index.js +7 -0
  226. package/.claude-flow-novice/dist/src/coordination/shared/core/index.js.map +1 -0
  227. package/.claude-flow-novice/dist/src/coordination/shared/index.js +19 -0
  228. package/.claude-flow-novice/dist/src/coordination/shared/index.js.map +1 -0
  229. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js +24 -0
  230. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js.map +1 -0
  231. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js +7 -0
  232. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js.map +1 -0
  233. package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js +920 -0
  234. package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js.map +1 -0
  235. package/.claude-flow-novice/dist/src/coordination/shared/message.js +138 -0
  236. package/.claude-flow-novice/dist/src/coordination/shared/message.js.map +1 -0
  237. package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js +259 -0
  238. package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js.map +1 -0
  239. package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js +17 -0
  240. package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js.map +1 -0
  241. package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js +19 -0
  242. package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js.map +1 -0
  243. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js +357 -0
  244. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js.map +1 -0
  245. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js +679 -0
  246. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js.map +1 -0
  247. package/.claude-flow-novice/dist/src/coordination/shared/types/index.js +7 -0
  248. package/.claude-flow-novice/dist/src/coordination/shared/types/index.js.map +1 -0
  249. package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js +10 -0
  250. package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js.map +1 -0
  251. package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js +52 -2
  252. package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -1
  253. package/.claude-flow-novice/dist/src/mcp/mcp-server-novice.js +37 -2
  254. package/.claude-flow-novice/dist/src/mcp/session-manager.js +3 -1
  255. package/.claude-flow-novice/dist/src/mcp/session-manager.js.map +1 -1
  256. package/.claude-flow-novice/dist/src/providers/provider-manager.js +36 -3
  257. package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -1
  258. package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js +65 -41
  259. package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js.map +1 -1
  260. package/.claude-flow-novice/dist/src/web/api/server.js +1 -1
  261. package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -1
  262. package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js +30 -0
  263. package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js.map +1 -1
  264. package/.claude-flow-novice/metrics.db-shm +0 -0
  265. package/.claude-flow-novice/metrics.db-wal +0 -0
  266. package/config/.env.example +178 -0
  267. package/config/DEPLOYMENT_GUIDE.md +692 -0
  268. package/config/README-CONFIG.md +331 -0
  269. package/config/coordination-config.sh +327 -0
  270. package/config/docker/env.development +53 -0
  271. package/config/docker/env.production +83 -0
  272. package/config/docker/env.staging +70 -0
  273. package/config/k8s/configmap-development.yaml +60 -0
  274. package/config/k8s/configmap-production.yaml +85 -0
  275. package/config/k8s/configmap-staging.yaml +76 -0
  276. package/config/k8s/secret-production.yaml +62 -0
  277. package/config/k8s/secret-staging.yaml +36 -0
  278. package/package.json +2 -2
  279. package/scripts/monitoring/alert-monitor.sh +220 -0
  280. package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
  281. package/scripts/monitoring/quick-test-alerting.sh +118 -0
  282. package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
  283. package/scripts/monitoring/rate-limiting-monitor.sh +380 -0
  284. package/scripts/monitoring/view-alerts.sh +307 -0
  285. package/scripts/test-zai-api.cjs +2 -2
  286. package/src/slash-commands/parse-epic.js +1 -1
@@ -0,0 +1,371 @@
1
+ /**
2
+ * Agent Coordination V2 - Channel Abstraction
3
+ *
4
+ * Channel abstraction for isolated message communication paths.
5
+ * Provides ordering guarantees, backpressure handling, and channel-specific policies.
6
+ *
7
+ * Features:
8
+ * - Channel isolation (messages don't cross channels)
9
+ * - Message ordering guarantees per channel
10
+ * - Backpressure handling (subscriber overflow protection)
11
+ * - Configurable channel policies (drop, block, buffered)
12
+ * - Channel-specific statistics and monitoring
13
+ *
14
+ * @module coordination/v2/messaging/channel
15
+ */ import { EventEmitter } from 'events';
16
+ /**
17
+ * Channel backpressure policy.
18
+ * Defines behavior when channel capacity is exceeded.
19
+ */ export var BackpressurePolicy = /*#__PURE__*/ function(BackpressurePolicy) {
20
+ /** Drop oldest messages when full (default) */ BackpressurePolicy["DROP_OLDEST"] = "drop-oldest";
21
+ /** Drop newest messages when full */ BackpressurePolicy["DROP_NEWEST"] = "drop-newest";
22
+ /** Block publisher until space available */ BackpressurePolicy["BLOCK"] = "block";
23
+ /** Dynamically expand buffer (no limit) */ BackpressurePolicy["UNBOUNDED"] = "unbounded";
24
+ return BackpressurePolicy;
25
+ }({});
26
+ /**
27
+ * Channel events.
28
+ */ export var ChannelEvent = /*#__PURE__*/ function(ChannelEvent) {
29
+ /** Message published to channel */ ChannelEvent["MESSAGE_PUBLISHED"] = "message-published";
30
+ /** Message delivered to subscriber */ ChannelEvent["MESSAGE_DELIVERED"] = "message-delivered";
31
+ /** Message dropped due to backpressure */ ChannelEvent["MESSAGE_DROPPED"] = "message-dropped";
32
+ /** Channel capacity reached */ ChannelEvent["CAPACITY_REACHED"] = "capacity-reached";
33
+ /** Subscriber added */ ChannelEvent["SUBSCRIBER_ADDED"] = "subscriber-added";
34
+ /** Subscriber removed */ ChannelEvent["SUBSCRIBER_REMOVED"] = "subscriber-removed";
35
+ /** Channel error */ ChannelEvent["ERROR"] = "error";
36
+ return ChannelEvent;
37
+ }({});
38
+ /**
39
+ * Channel - Isolated message communication path.
40
+ *
41
+ * Provides:
42
+ * - Isolated message streams (no cross-channel contamination)
43
+ * - Ordering guarantees (FIFO within channel)
44
+ * - Backpressure handling (configurable policies)
45
+ * - Event-driven notifications
46
+ * - Performance monitoring
47
+ *
48
+ * Performance:
49
+ * - publish(): O(1) amortized
50
+ * - subscribe(): O(1)
51
+ * - deliver(): O(n) where n is subscriber count
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const channel = new Channel({
56
+ * channelId: 'coordination',
57
+ * name: 'Coordination Channel',
58
+ * capacity: 500,
59
+ * backpressurePolicy: BackpressurePolicy.DROP_OLDEST
60
+ * });
61
+ *
62
+ * // Subscribe to channel
63
+ * const sub = channel.subscribe(async (message) => {
64
+ * console.log('Received:', message.payload);
65
+ * });
66
+ *
67
+ * // Publish messages
68
+ * channel.publish({
69
+ * topic: 'agent.status',
70
+ * payload: { agentId: 'agent-1', status: 'online' },
71
+ * priority: 5
72
+ * });
73
+ * ```
74
+ */ export class Channel extends EventEmitter {
75
+ /** Channel configuration */ config;
76
+ /** Message buffer (FIFO queue) */ buffer;
77
+ /** Subscribed message handlers */ subscribers;
78
+ /** Next subscription ID counter */ nextSubscriptionId;
79
+ /** Channel statistics */ stats;
80
+ /** Channel creation timestamp */ createdAt;
81
+ /** Channel closed flag */ isClosed;
82
+ constructor(config){
83
+ super();
84
+ this.config = {
85
+ channelId: config.channelId,
86
+ name: config.name,
87
+ capacity: config.capacity ?? 1000,
88
+ backpressurePolicy: config.backpressurePolicy ?? "drop-oldest",
89
+ strictOrdering: config.strictOrdering ?? true,
90
+ priority: config.priority ?? 5,
91
+ enableStats: config.enableStats ?? true
92
+ };
93
+ this.buffer = [];
94
+ this.subscribers = new Map();
95
+ this.nextSubscriptionId = 1;
96
+ this.createdAt = Date.now();
97
+ this.isClosed = false;
98
+ this.stats = {
99
+ totalPublished: 0,
100
+ totalDelivered: 0,
101
+ totalDropped: 0,
102
+ peakBufferSize: 0,
103
+ latencies: [],
104
+ createdAt: this.createdAt
105
+ };
106
+ }
107
+ /**
108
+ * Get channel identifier.
109
+ */ get channelId() {
110
+ return this.config.channelId;
111
+ }
112
+ /**
113
+ * Get channel name.
114
+ */ get name() {
115
+ return this.config.name;
116
+ }
117
+ /**
118
+ * Get channel priority.
119
+ */ get priority() {
120
+ return this.config.priority;
121
+ }
122
+ /**
123
+ * Check if channel is closed.
124
+ */ get closed() {
125
+ return this.isClosed;
126
+ }
127
+ /**
128
+ * Publish a message to the channel.
129
+ *
130
+ * @param message - Message to publish
131
+ * @throws Error if channel is closed
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * channel.publish({
136
+ * id: 'msg-123',
137
+ * topic: 'task.completed',
138
+ * payload: { taskId: 'task-1' },
139
+ * priority: 5,
140
+ * timestamp: Date.now()
141
+ * });
142
+ * ```
143
+ */ publish(message) {
144
+ if (this.isClosed) {
145
+ throw new Error(`Channel ${this.config.channelId} is closed`);
146
+ }
147
+ // Check capacity and apply backpressure policy
148
+ if (this.buffer.length >= this.config.capacity) {
149
+ this.handleBackpressure(message);
150
+ return;
151
+ }
152
+ // Add to buffer (FIFO)
153
+ this.buffer.push(message);
154
+ // Update statistics
155
+ this.stats.totalPublished++;
156
+ this.stats.peakBufferSize = Math.max(this.stats.peakBufferSize, this.buffer.length);
157
+ // Emit event
158
+ this.emit("message-published", {
159
+ channelId: this.config.channelId,
160
+ messageId: message.id,
161
+ topic: message.topic,
162
+ bufferSize: this.buffer.length
163
+ });
164
+ // Auto-deliver if we have subscribers
165
+ if (this.subscribers.size > 0) {
166
+ setImmediate(()=>this.processBuffer());
167
+ }
168
+ }
169
+ /**
170
+ * Subscribe to channel messages.
171
+ *
172
+ * @param handler - Message handler function
173
+ * @param priority - Handler priority (default: 0)
174
+ * @returns Subscription handle
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * const sub = channel.subscribe(async (message) => {
179
+ * console.log('Received:', message.payload);
180
+ * }, 10);
181
+ * ```
182
+ */ subscribe(handler, priority = 0) {
183
+ if (this.isClosed) {
184
+ throw new Error(`Channel ${this.config.channelId} is closed`);
185
+ }
186
+ const subscriptionId = `${this.config.channelId}-sub-${this.nextSubscriptionId++}`;
187
+ this.subscribers.set(subscriptionId, {
188
+ handler,
189
+ priority,
190
+ messagesReceived: 0,
191
+ createdAt: Date.now()
192
+ });
193
+ // Emit event
194
+ this.emit("subscriber-added", {
195
+ channelId: this.config.channelId,
196
+ subscriptionId,
197
+ totalSubscribers: this.subscribers.size
198
+ });
199
+ return {
200
+ id: subscriptionId,
201
+ channelId: this.config.channelId,
202
+ topic: this.config.name,
203
+ createdAt: Date.now(),
204
+ messagesReceived: 0,
205
+ priority,
206
+ unsubscribe: ()=>this.unsubscribe(subscriptionId)
207
+ };
208
+ }
209
+ /**
210
+ * Unsubscribe from channel.
211
+ *
212
+ * @param subscriptionId - Subscription ID to remove
213
+ */ unsubscribe(subscriptionId) {
214
+ const removed = this.subscribers.delete(subscriptionId);
215
+ if (removed) {
216
+ this.emit("subscriber-removed", {
217
+ channelId: this.config.channelId,
218
+ subscriptionId,
219
+ totalSubscribers: this.subscribers.size
220
+ });
221
+ }
222
+ }
223
+ /**
224
+ * Process buffered messages and deliver to subscribers.
225
+ * Maintains FIFO ordering within channel.
226
+ *
227
+ * @returns Number of messages delivered
228
+ */ async processBuffer() {
229
+ if (this.isClosed || this.buffer.length === 0 || this.subscribers.size === 0) {
230
+ return 0;
231
+ }
232
+ let deliveredCount = 0;
233
+ // Get subscribers sorted by priority (highest first)
234
+ const sortedSubscribers = Array.from(this.subscribers.entries()).sort(([, a], [, b])=>b.priority - a.priority);
235
+ // Process messages in FIFO order (strict ordering)
236
+ while(this.buffer.length > 0){
237
+ const message = this.buffer.shift();
238
+ const startTime = performance.now();
239
+ // Deliver to all subscribers
240
+ for (const [subId, subscriber] of sortedSubscribers){
241
+ try {
242
+ await subscriber.handler(message);
243
+ subscriber.messagesReceived++;
244
+ deliveredCount++;
245
+ this.emit("message-delivered", {
246
+ channelId: this.config.channelId,
247
+ messageId: message.id,
248
+ subscriptionId: subId
249
+ });
250
+ } catch (error) {
251
+ this.emit("error", {
252
+ channelId: this.config.channelId,
253
+ subscriptionId: subId,
254
+ messageId: message.id,
255
+ error
256
+ });
257
+ }
258
+ }
259
+ // Update statistics
260
+ this.stats.totalDelivered++;
261
+ const latency = performance.now() - startTime;
262
+ this.stats.latencies.push(latency);
263
+ // Keep only last 1000 latencies for stats
264
+ if (this.stats.latencies.length > 1000) {
265
+ this.stats.latencies.shift();
266
+ }
267
+ }
268
+ return deliveredCount;
269
+ }
270
+ /**
271
+ * Handle backpressure when channel capacity is exceeded.
272
+ *
273
+ * @param newMessage - New message attempting to publish
274
+ */ handleBackpressure(newMessage) {
275
+ this.emit("capacity-reached", {
276
+ channelId: this.config.channelId,
277
+ capacity: this.config.capacity,
278
+ bufferSize: this.buffer.length
279
+ });
280
+ switch(this.config.backpressurePolicy){
281
+ case "drop-oldest":
282
+ // Remove oldest message and add new one
283
+ this.buffer.shift();
284
+ this.buffer.push(newMessage);
285
+ this.stats.totalDropped++;
286
+ this.emit("message-dropped", {
287
+ channelId: this.config.channelId,
288
+ reason: 'capacity-exceeded',
289
+ policy: "drop-oldest"
290
+ });
291
+ break;
292
+ case "drop-newest":
293
+ // Drop the new message
294
+ this.stats.totalDropped++;
295
+ this.emit("message-dropped", {
296
+ channelId: this.config.channelId,
297
+ messageId: newMessage.id,
298
+ reason: 'capacity-exceeded',
299
+ policy: "drop-newest"
300
+ });
301
+ break;
302
+ case "unbounded":
303
+ // Always accept (no capacity limit)
304
+ this.buffer.push(newMessage);
305
+ break;
306
+ case "block":
307
+ // NOTE: In async JS, blocking is simulated via rejection
308
+ throw new Error(`Channel ${this.config.channelId} capacity exceeded (${this.config.capacity}). ` + 'Message blocked due to BLOCK policy.');
309
+ default:
310
+ throw new Error(`Unknown backpressure policy: ${this.config.backpressurePolicy}`);
311
+ }
312
+ }
313
+ /**
314
+ * Get channel statistics.
315
+ *
316
+ * @returns Channel statistics
317
+ */ getStats() {
318
+ const avgLatencyMs = this.stats.latencies.length > 0 ? this.stats.latencies.reduce((sum, l)=>sum + l, 0) / this.stats.latencies.length : 0;
319
+ return {
320
+ channelId: this.config.channelId,
321
+ totalPublished: this.stats.totalPublished,
322
+ totalDelivered: this.stats.totalDelivered,
323
+ totalDropped: this.stats.totalDropped,
324
+ currentBufferSize: this.buffer.length,
325
+ peakBufferSize: this.stats.peakBufferSize,
326
+ totalSubscriptions: this.subscribers.size,
327
+ avgLatencyMs,
328
+ createdAt: this.stats.createdAt,
329
+ uptimeMs: Date.now() - this.createdAt
330
+ };
331
+ }
332
+ /**
333
+ * Get current buffer size.
334
+ */ getBufferSize() {
335
+ return this.buffer.length;
336
+ }
337
+ /**
338
+ * Get current subscriber count.
339
+ */ getSubscriberCount() {
340
+ return this.subscribers.size;
341
+ }
342
+ /**
343
+ * Clear all buffered messages.
344
+ * Does not affect active subscriptions.
345
+ */ clearBuffer() {
346
+ const droppedCount = this.buffer.length;
347
+ this.buffer = [];
348
+ this.stats.totalDropped += droppedCount;
349
+ }
350
+ /**
351
+ * Close the channel.
352
+ * Prevents new publications and deliveries, but does not clear buffer.
353
+ */ close() {
354
+ this.isClosed = true;
355
+ this.removeAllListeners();
356
+ }
357
+ /**
358
+ * Reset channel statistics.
359
+ */ resetStats() {
360
+ this.stats = {
361
+ totalPublished: 0,
362
+ totalDelivered: 0,
363
+ totalDropped: 0,
364
+ peakBufferSize: 0,
365
+ latencies: [],
366
+ createdAt: Date.now()
367
+ };
368
+ }
369
+ }
370
+
371
+ //# sourceMappingURL=channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.ts"],"names":["EventEmitter","BackpressurePolicy","ChannelEvent","Channel","config","buffer","subscribers","nextSubscriptionId","stats","createdAt","isClosed","channelId","name","capacity","backpressurePolicy","strictOrdering","priority","enableStats","Map","Date","now","totalPublished","totalDelivered","totalDropped","peakBufferSize","latencies","closed","publish","message","Error","length","handleBackpressure","push","Math","max","emit","messageId","id","topic","bufferSize","size","setImmediate","processBuffer","subscribe","handler","subscriptionId","set","messagesReceived","totalSubscribers","unsubscribe","removed","delete","deliveredCount","sortedSubscribers","Array","from","entries","sort","a","b","shift","startTime","performance","subId","subscriber","error","latency","newMessage","reason","policy","getStats","avgLatencyMs","reduce","sum","l","currentBufferSize","totalSubscriptions","uptimeMs","getBufferSize","getSubscriberCount","clearBuffer","droppedCount","close","removeAllListeners","resetStats"],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GAGD,SAASA,YAAY,QAAQ,SAAS;AAEtC;;;CAGC,GACD,OAAO,IAAA,AAAKC,4CAAAA;IACV,6CAA6C;IAG7C,mCAAmC;IAGnC,0CAA0C;IAG1C,yCAAyC;WAV/BA;MAYX;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