claude-flow-novice 1.6.4 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) 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/transports/base.js +5 -0
  5. package/.claude-flow-novice/dist/mcp/transports/base.js.map +1 -0
  6. package/.claude-flow-novice/dist/mcp/transports/http.js +414 -0
  7. package/.claude-flow-novice/dist/mcp/transports/http.js.map +1 -0
  8. package/.claude-flow-novice/dist/mcp/transports/stdio.js +217 -0
  9. package/.claude-flow-novice/dist/mcp/transports/stdio.js.map +1 -0
  10. package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js +129 -0
  11. package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js.map +1 -0
  12. package/.claude-flow-novice/dist/src/cli/index.js +3 -0
  13. package/.claude-flow-novice/dist/src/cli/index.js.map +1 -1
  14. package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js +266 -0
  15. package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js.map +1 -0
  16. package/.claude-flow-novice/dist/src/communication/message-bus.js +105 -2
  17. package/.claude-flow-novice/dist/src/communication/message-bus.js.map +1 -1
  18. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +1 -1
  19. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -1
  20. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js +632 -0
  21. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js.map +1 -0
  22. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js +11 -0
  23. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js.map +1 -0
  24. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js +318 -0
  25. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js.map +1 -0
  26. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js +234 -0
  27. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js.map +1 -0
  28. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js +347 -0
  29. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js.map +1 -0
  30. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js +13 -0
  31. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js.map +1 -0
  32. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js +173 -0
  33. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js.map +1 -0
  34. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js +526 -0
  35. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js.map +1 -0
  36. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js +443 -0
  37. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js.map +1 -0
  38. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js +366 -0
  39. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js.map +1 -0
  40. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js +287 -0
  41. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js.map +1 -0
  42. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js +364 -0
  43. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js.map +1 -0
  44. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js +492 -0
  45. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js.map +1 -0
  46. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js +786 -0
  47. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js.map +1 -0
  48. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js +16 -0
  49. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js.map +1 -0
  50. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js +342 -0
  51. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js.map +1 -0
  52. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js +601 -0
  53. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
  54. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js +9 -0
  55. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js.map +1 -0
  56. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js +413 -0
  57. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js.map +1 -0
  58. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js +471 -0
  59. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js.map +1 -0
  60. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js +379 -0
  61. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js.map +1 -0
  62. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js +335 -0
  63. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js.map +1 -0
  64. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js +211 -0
  65. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js.map +1 -0
  66. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js +33 -0
  67. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js.map +1 -0
  68. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js +920 -0
  69. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js.map +1 -0
  70. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js +385 -0
  71. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js.map +1 -0
  72. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js +138 -0
  73. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js.map +1 -0
  74. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js +478 -0
  75. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js.map +1 -0
  76. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js +358 -0
  77. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js.map +1 -0
  78. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js +588 -0
  79. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js.map +1 -0
  80. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js +153 -0
  81. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js.map +1 -0
  82. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js +360 -0
  83. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js.map +1 -0
  84. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js +337 -0
  85. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js.map +1 -0
  86. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js +424 -0
  87. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js.map +1 -0
  88. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js +9 -0
  89. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js.map +1 -0
  90. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js +669 -0
  91. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js.map +1 -0
  92. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js +451 -0
  93. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js.map +1 -0
  94. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js +271 -0
  95. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js.map +1 -0
  96. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js +335 -0
  97. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js.map +1 -0
  98. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js +439 -0
  99. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js.map +1 -0
  100. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js +92 -0
  101. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js.map +1 -0
  102. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js +21 -0
  103. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js.map +1 -0
  104. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js +223 -0
  105. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js.map +1 -0
  106. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js +436 -0
  107. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js.map +1 -0
  108. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js +278 -0
  109. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js.map +1 -0
  110. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js +317 -0
  111. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js.map +1 -0
  112. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js +273 -0
  113. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js.map +1 -0
  114. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js +15 -0
  115. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js.map +1 -0
  116. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js +512 -0
  117. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js.map +1 -0
  118. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js +67 -0
  119. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js.map +1 -0
  120. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js +557 -0
  121. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js.map +1 -0
  122. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js +14 -0
  123. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js.map +1 -0
  124. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js +212 -0
  125. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js.map +1 -0
  126. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js +552 -0
  127. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js.map +1 -0
  128. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js +635 -0
  129. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js.map +1 -0
  130. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js +28 -0
  131. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js.map +1 -0
  132. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js +9 -0
  133. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js.map +1 -0
  134. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js +25 -0
  135. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js.map +1 -0
  136. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js +14 -0
  137. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js.map +1 -0
  138. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js +308 -0
  139. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js.map +1 -0
  140. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js +439 -0
  141. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js.map +1 -0
  142. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js +540 -0
  143. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js.map +1 -0
  144. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js +367 -0
  145. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js.map +1 -0
  146. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js +14 -0
  147. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js.map +1 -0
  148. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js +518 -0
  149. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js.map +1 -0
  150. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js +377 -0
  151. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js.map +1 -0
  152. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js +371 -0
  153. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js.map +1 -0
  154. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js +355 -0
  155. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js.map +1 -0
  156. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js +424 -0
  157. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js.map +1 -0
  158. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js +16 -0
  159. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js.map +1 -0
  160. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js +295 -0
  161. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js.map +1 -0
  162. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js +411 -0
  163. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js.map +1 -0
  164. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js +14 -0
  165. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js.map +1 -0
  166. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js +387 -0
  167. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js.map +1 -0
  168. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js +589 -0
  169. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js.map +1 -0
  170. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js +444 -0
  171. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js.map +1 -0
  172. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js +560 -0
  173. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js.map +1 -0
  174. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js +335 -0
  175. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js.map +1 -0
  176. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js +104 -0
  177. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js.map +1 -0
  178. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js +847 -0
  179. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js.map +1 -0
  180. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js +470 -0
  181. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js.map +1 -0
  182. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js +450 -0
  183. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js.map +1 -0
  184. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js +13 -0
  185. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js.map +1 -0
  186. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js +625 -0
  187. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js.map +1 -0
  188. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js +545 -0
  189. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js.map +1 -0
  190. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js +740 -0
  191. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js.map +1 -0
  192. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js +415 -0
  193. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js.map +1 -0
  194. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js +615 -0
  195. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js.map +1 -0
  196. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js +547 -0
  197. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js.map +1 -0
  198. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js +342 -0
  199. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js.map +1 -0
  200. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js +259 -0
  201. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js.map +1 -0
  202. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js +273 -0
  203. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js.map +1 -0
  204. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js +8 -0
  205. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js.map +1 -0
  206. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js +310 -0
  207. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js.map +1 -0
  208. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js +218 -0
  209. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js.map +1 -0
  210. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js +9 -0
  211. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js.map +1 -0
  212. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js +6 -0
  213. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js.map +1 -0
  214. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js +145 -0
  215. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js.map +1 -0
  216. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js +122 -0
  217. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js.map +1 -0
  218. package/.claude-flow-novice/dist/src/coordination/config-translator.js +17 -43
  219. package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -1
  220. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +34 -76
  221. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -1
  222. package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js +172 -0
  223. package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js.map +1 -0
  224. package/.claude-flow-novice/dist/src/coordination/shared/core/index.js +7 -0
  225. package/.claude-flow-novice/dist/src/coordination/shared/core/index.js.map +1 -0
  226. package/.claude-flow-novice/dist/src/coordination/shared/index.js +19 -0
  227. package/.claude-flow-novice/dist/src/coordination/shared/index.js.map +1 -0
  228. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js +24 -0
  229. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js.map +1 -0
  230. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js +7 -0
  231. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js.map +1 -0
  232. package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js +920 -0
  233. package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js.map +1 -0
  234. package/.claude-flow-novice/dist/src/coordination/shared/message.js +138 -0
  235. package/.claude-flow-novice/dist/src/coordination/shared/message.js.map +1 -0
  236. package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js +259 -0
  237. package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js.map +1 -0
  238. package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js +17 -0
  239. package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js.map +1 -0
  240. package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js +19 -0
  241. package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js.map +1 -0
  242. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js +357 -0
  243. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js.map +1 -0
  244. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js +679 -0
  245. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js.map +1 -0
  246. package/.claude-flow-novice/dist/src/coordination/shared/types/index.js +7 -0
  247. package/.claude-flow-novice/dist/src/coordination/shared/types/index.js.map +1 -0
  248. package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js +10 -0
  249. package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js.map +1 -0
  250. package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js +52 -2
  251. package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -1
  252. package/.claude-flow-novice/dist/src/mcp/mcp-server-novice.js +37 -2
  253. package/.claude-flow-novice/dist/src/mcp/session-manager.js +3 -1
  254. package/.claude-flow-novice/dist/src/mcp/session-manager.js.map +1 -1
  255. package/.claude-flow-novice/dist/src/providers/provider-manager.js +36 -3
  256. package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -1
  257. package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js +65 -41
  258. package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js.map +1 -1
  259. package/.claude-flow-novice/dist/src/web/api/server.js +1 -1
  260. package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -1
  261. package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js +30 -0
  262. package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js.map +1 -1
  263. package/.claude-flow-novice/metrics.db-shm +0 -0
  264. package/.claude-flow-novice/metrics.db-wal +0 -0
  265. package/package.json +2 -2
  266. package/scripts/monitoring/alert-monitor.sh +220 -0
  267. package/scripts/monitoring/view-alerts.sh +307 -0
  268. package/scripts/test-zai-api.cjs +2 -2
  269. package/src/slash-commands/parse-epic.js +1 -1
@@ -0,0 +1,557 @@
1
+ /**
2
+ * Phase 9 Sprint 9.1: Help System + Deadlock Detection Integration
3
+ *
4
+ * Connects HelpCoordinator with DeadlockDetector to enable automatic help
5
+ * requests when agents are blocked in deadlock cycles. Implements:
6
+ * - Deadlock detection → Automated help routing
7
+ * - Blocked agents → Help request triggers
8
+ * - WFG cycle analysis → Helper capability matching
9
+ * - Automated recovery coordination
10
+ *
11
+ * @module coordination/v2/integration/help-deadlock-integration
12
+ */ import { EventEmitter } from 'events';
13
+ import { HelpRequestPriority } from '../help-system/help-request.js';
14
+ /**
15
+ * Help-Deadlock Integration Layer
16
+ *
17
+ * Bridges deadlock detection with help system for automated recovery.
18
+ */ export class HelpDeadlockIntegration extends EventEmitter {
19
+ deadlockDetector;
20
+ helpCoordinator;
21
+ config;
22
+ metrics;
23
+ activeResolutions;
24
+ resolutionCounter;
25
+ constructor(deadlockDetector, helpCoordinator, config){
26
+ super();
27
+ this.deadlockDetector = deadlockDetector;
28
+ this.helpCoordinator = helpCoordinator;
29
+ this.activeResolutions = new Map();
30
+ this.resolutionCounter = 0;
31
+ this.config = {
32
+ autoRequestHelp: config?.autoRequestHelp ?? true,
33
+ minSeverityThreshold: config?.minSeverityThreshold ?? 20,
34
+ enableWfgHelperSelection: config?.enableWfgHelperSelection ?? true,
35
+ maxConcurrentResolutions: config?.maxConcurrentResolutions ?? 10,
36
+ autoRetryFailedResolutions: config?.autoRetryFailedResolutions ?? true,
37
+ maxResolutionAttempts: config?.maxResolutionAttempts ?? 3,
38
+ resolutionTimeoutMs: config?.resolutionTimeoutMs ?? 60000
39
+ };
40
+ this.metrics = {
41
+ totalDeadlocksDetected: 0,
42
+ autoHelpRequestsTriggered: 0,
43
+ successfulResolutions: 0,
44
+ failedResolutions: 0,
45
+ avgResolutionTimeMs: 0,
46
+ activeResolutions: 0,
47
+ helpersUtilized: new Set(),
48
+ commonPatterns: new Map()
49
+ };
50
+ this.setupDeadlockListeners();
51
+ }
52
+ /**
53
+ * Setup listeners for deadlock events
54
+ */ setupDeadlockListeners() {
55
+ // Listen for deadlock detection events
56
+ this.deadlockDetector.on('deadlock', async (cycle)=>{
57
+ this.metrics.totalDeadlocksDetected++;
58
+ this.trackDeadlockPattern(cycle);
59
+ this.emit('deadlock-detected', {
60
+ cycleId: cycle.cycleId,
61
+ agents: cycle.agents,
62
+ severity: cycle.severity,
63
+ timestamp: new Date()
64
+ });
65
+ // Trigger automatic help if enabled and severity threshold met
66
+ if (this.config.autoRequestHelp && cycle.severity >= this.config.minSeverityThreshold) {
67
+ await this.handleDeadlock(cycle);
68
+ }
69
+ });
70
+ // Listen for detection warnings
71
+ this.deadlockDetector.on('warning', (warning)=>{
72
+ this.emit('detector-warning', warning);
73
+ });
74
+ }
75
+ /**
76
+ * Handle detected deadlock by triggering help requests
77
+ */ async handleDeadlock(cycle) {
78
+ // Check concurrent resolution limit
79
+ if (this.activeResolutions.size >= this.config.maxConcurrentResolutions) {
80
+ this.emit('resolution-rejected', {
81
+ cycleId: cycle.cycleId,
82
+ reason: 'Max concurrent resolutions reached'
83
+ });
84
+ return;
85
+ }
86
+ const resolutionId = this.generateResolutionId();
87
+ const resolution = {
88
+ resolutionId,
89
+ cycle,
90
+ helpRoutes: new Map(),
91
+ status: 'pending',
92
+ attempt: 1,
93
+ startedAt: new Date(),
94
+ helpers: []
95
+ };
96
+ this.activeResolutions.set(resolutionId, resolution);
97
+ this.metrics.activeResolutions = this.activeResolutions.size;
98
+ try {
99
+ await this.resolveDeadlock(resolution);
100
+ } catch (error) {
101
+ this.handleResolutionFailure(resolution, error);
102
+ }
103
+ }
104
+ /**
105
+ * Resolve deadlock by requesting help for blocked agents
106
+ */ async resolveDeadlock(resolution) {
107
+ resolution.status = 'in_progress';
108
+ this.emit('resolution-started', {
109
+ resolutionId: resolution.resolutionId,
110
+ cycleId: resolution.cycle.cycleId,
111
+ agents: resolution.cycle.agents
112
+ });
113
+ // Analyze WFG to identify helper candidates
114
+ const helperCandidates = await this.identifyHelperCandidates(resolution.cycle);
115
+ // Create help requests for each blocked agent in cycle
116
+ const helpRequests = await Promise.all(resolution.cycle.agents.map(async (agentId)=>{
117
+ const capabilities = this.extractRequiredCapabilities(agentId, resolution.cycle);
118
+ const priority = this.calculateHelpPriority(resolution.cycle);
119
+ try {
120
+ const result = await this.helpCoordinator.createHelpRequest(agentId, `Deadlock resolution: Agent blocked in cycle ${resolution.cycle.cycleId}`, capabilities, priority, {
121
+ cycleId: resolution.cycle.cycleId,
122
+ resolutionId: resolution.resolutionId,
123
+ cycleAgents: resolution.cycle.agents,
124
+ suggestedHelpers: helperCandidates.filter((c)=>c.capabilities.some((cap)=>capabilities.some((req)=>req.capability === cap))).map((c)=>c.agentId)
125
+ });
126
+ this.metrics.autoHelpRequestsTriggered++;
127
+ resolution.helpRoutes.set(agentId, result);
128
+ if (result.match) {
129
+ resolution.helpers.push(result.match.agentId);
130
+ this.metrics.helpersUtilized.add(result.match.agentId);
131
+ }
132
+ return result;
133
+ } catch (error) {
134
+ this.emit('help-request-failed', {
135
+ agentId,
136
+ resolutionId: resolution.resolutionId,
137
+ error: error instanceof Error ? error.message : 'Unknown error'
138
+ });
139
+ return null;
140
+ }
141
+ }));
142
+ // Check if all agents got help
143
+ const successfulRoutes = helpRequests.filter((r)=>r !== null && r.status === 'success');
144
+ if (successfulRoutes.length === resolution.cycle.agents.length) {
145
+ await this.monitorResolution(resolution);
146
+ } else {
147
+ throw new Error(`Failed to route help for ${resolution.cycle.agents.length - successfulRoutes.length} agents`);
148
+ }
149
+ }
150
+ /**
151
+ * Identify helper candidates using WFG analysis
152
+ */ async identifyHelperCandidates(cycle) {
153
+ if (!this.config.enableWfgHelperSelection) {
154
+ return [];
155
+ }
156
+ const graph = this.deadlockDetector.getGraph();
157
+ const candidates = [];
158
+ // Find agents NOT in the deadlock cycle
159
+ const cycleAgentSet = new Set(cycle.agents);
160
+ for (const [agentId, node] of Array.from(graph.entries())){
161
+ if (cycleAgentSet.has(agentId)) {
162
+ continue; // Skip agents in cycle
163
+ }
164
+ // Only consider agents that are not waiting
165
+ if (node.state === 'waiting' || node.state === 'blocked') {
166
+ continue;
167
+ }
168
+ // Check if agent holds resources needed by cycle
169
+ const relevantResources = this.findRelevantResources(node, cycle);
170
+ if (relevantResources.length > 0) {
171
+ candidates.push({
172
+ agentId,
173
+ relevance: this.calculateRelevance(node, cycle, relevantResources),
174
+ capabilities: relevantResources,
175
+ workload: this.estimateWorkload(node),
176
+ reason: `Holds ${relevantResources.length} resources needed by deadlock cycle`
177
+ });
178
+ }
179
+ }
180
+ // Sort by relevance descending
181
+ return candidates.sort((a, b)=>b.relevance - a.relevance);
182
+ }
183
+ /**
184
+ * Find resources held by candidate that are relevant to cycle
185
+ */ findRelevantResources(candidate, cycle) {
186
+ const cycleResources = new Set(cycle.resources);
187
+ const relevantResources = [];
188
+ for (const resource of Array.from(candidate.holdingResources)){
189
+ if (cycleResources.has(resource)) {
190
+ relevantResources.push(resource);
191
+ }
192
+ }
193
+ return relevantResources;
194
+ }
195
+ /**
196
+ * Calculate relevance score for helper candidate
197
+ */ calculateRelevance(candidate, cycle, relevantResources) {
198
+ // Base score from resource overlap
199
+ const resourceScore = relevantResources.length / cycle.resources.length;
200
+ // Priority bonus (higher priority agents are more valuable helpers)
201
+ const priorityScore = (candidate.priority ?? 5) / 10;
202
+ // Workload penalty (prefer less busy agents)
203
+ const workloadPenalty = this.estimateWorkload(candidate);
204
+ return resourceScore * 0.6 + priorityScore * 0.3 - workloadPenalty * 0.1;
205
+ }
206
+ /**
207
+ * Estimate agent workload from WFG state
208
+ */ estimateWorkload(node) {
209
+ // Workload estimation based on held and waiting resources
210
+ const heldCount = node.holdingResources.size;
211
+ const waitingCount = node.waitingForResources.size;
212
+ // Normalize to 0.0-1.0 range
213
+ const maxResources = 10; // Assume max 10 resources per agent
214
+ return Math.min((heldCount + waitingCount) / maxResources, 1.0);
215
+ }
216
+ /**
217
+ * Extract required capabilities from deadlock context
218
+ */ extractRequiredCapabilities(agentId, cycle) {
219
+ const graph = this.deadlockDetector.getGraph();
220
+ const node = graph.get(agentId);
221
+ if (!node) {
222
+ return [];
223
+ }
224
+ // Map waiting resources to capability requirements
225
+ const capabilities = [];
226
+ for (const resource of Array.from(node.waitingForResources)){
227
+ // Check if resource is another agent or a lock/data resource
228
+ const resourceAgent = graph.get(resource);
229
+ if (resourceAgent) {
230
+ // Waiting for another agent - need that agent's capabilities
231
+ capabilities.push({
232
+ capability: `agent-coordination:${resource}`,
233
+ required: true,
234
+ minProficiency: 0.7,
235
+ metadata: {
236
+ resourceType: 'agent',
237
+ waitingFor: resource
238
+ }
239
+ });
240
+ } else {
241
+ // Waiting for non-agent resource (lock, data, etc.)
242
+ capabilities.push({
243
+ capability: `deadlock-resolution:${cycle.resolution}`,
244
+ required: true,
245
+ minProficiency: 0.6,
246
+ metadata: {
247
+ resourceType: 'resource',
248
+ resourceId: resource,
249
+ resolution: cycle.resolution
250
+ }
251
+ });
252
+ }
253
+ }
254
+ return capabilities;
255
+ }
256
+ /**
257
+ * Calculate help request priority from cycle severity
258
+ */ calculateHelpPriority(cycle) {
259
+ if (cycle.severity >= 50) {
260
+ return HelpRequestPriority.CRITICAL;
261
+ } else if (cycle.severity >= 35) {
262
+ return HelpRequestPriority.HIGH;
263
+ } else if (cycle.severity >= 20) {
264
+ return HelpRequestPriority.NORMAL;
265
+ } else {
266
+ return HelpRequestPriority.LOW;
267
+ }
268
+ }
269
+ /**
270
+ * Monitor resolution progress and handle completion
271
+ */ async monitorResolution(resolution) {
272
+ const timeout = setTimeout(()=>{
273
+ this.handleResolutionTimeout(resolution);
274
+ }, this.config.resolutionTimeoutMs);
275
+ try {
276
+ // Track completion status for all help requests in cycle
277
+ const completionPromises = Array.from(resolution.helpRoutes.entries()).map(async ([agentId, helpRoute])=>{
278
+ return new Promise((resolve, reject)=>{
279
+ if (!helpRoute.match) {
280
+ reject(new Error(`No helper matched for agent ${agentId}`));
281
+ return;
282
+ }
283
+ const requestId = helpRoute.request.requestId;
284
+ // Subscribe to help completion event via MessageBroker
285
+ const completionTopic = `help.completed.${requestId}`;
286
+ let completed = false;
287
+ let subscription = null;
288
+ const completionHandler = async (message)=>{
289
+ if (message.payload.requestId === requestId) {
290
+ completed = true;
291
+ // Cleanup subscription
292
+ if (subscription) {
293
+ subscription.unsubscribe();
294
+ }
295
+ if (message.payload.success) {
296
+ resolve();
297
+ } else {
298
+ reject(new Error(message.payload.error || 'Help request failed'));
299
+ }
300
+ }
301
+ };
302
+ // Listen for completion event
303
+ const messageBroker = this.helpCoordinator.config?.messageBroker;
304
+ if (messageBroker) {
305
+ // Subscribe using MessageBroker API
306
+ messageBroker.subscribe({
307
+ topic: completionTopic,
308
+ handler: completionHandler
309
+ }).then((sub)=>{
310
+ subscription = sub;
311
+ }).catch((err)=>{
312
+ reject(new Error(`Subscription failed: ${err.message}`));
313
+ });
314
+ // Auto-cleanup and timeout after resolution timeout
315
+ setTimeout(()=>{
316
+ if (!completed) {
317
+ if (subscription) {
318
+ subscription.unsubscribe();
319
+ }
320
+ reject(new Error('Help request monitoring timeout'));
321
+ }
322
+ }, this.config.resolutionTimeoutMs);
323
+ } else {
324
+ // Fallback: Poll HelpCoordinator for request status
325
+ const pollInterval = setInterval(()=>{
326
+ const requestStatus = this.helpCoordinator.getRequestStatus(requestId);
327
+ if (requestStatus === 'resolved') {
328
+ clearInterval(pollInterval);
329
+ completed = true;
330
+ resolve();
331
+ } else if (requestStatus === 'failed' || requestStatus === 'cancelled') {
332
+ clearInterval(pollInterval);
333
+ completed = true;
334
+ reject(new Error(`Help request ${requestStatus}`));
335
+ }
336
+ }, 500);
337
+ // Stop polling after timeout
338
+ setTimeout(()=>{
339
+ if (!completed) {
340
+ clearInterval(pollInterval);
341
+ reject(new Error('Help request polling timeout'));
342
+ }
343
+ }, this.config.resolutionTimeoutMs);
344
+ }
345
+ });
346
+ });
347
+ // Wait for all help requests to complete
348
+ await Promise.all(completionPromises);
349
+ clearTimeout(timeout);
350
+ // Verify deadlock is actually resolved by checking WFG
351
+ const isResolved = await this.verifyDeadlockResolution(resolution.cycle);
352
+ if (!isResolved) {
353
+ throw new Error('Deadlock persists after help completion - verification failed');
354
+ }
355
+ // Mark resolution as complete
356
+ resolution.status = 'resolved';
357
+ resolution.completedAt = new Date();
358
+ const resolutionTime = resolution.completedAt.getTime() - resolution.startedAt.getTime();
359
+ this.metrics.successfulResolutions++;
360
+ this.updateAvgResolutionTime(resolutionTime);
361
+ this.activeResolutions.delete(resolution.resolutionId);
362
+ this.metrics.activeResolutions = this.activeResolutions.size;
363
+ this.emit('resolution-completed', {
364
+ resolutionId: resolution.resolutionId,
365
+ cycleId: resolution.cycle.cycleId,
366
+ durationMs: resolutionTime,
367
+ helpers: resolution.helpers
368
+ });
369
+ } catch (error) {
370
+ clearTimeout(timeout);
371
+ throw error; // Propagate to handleResolutionFailure
372
+ }
373
+ }
374
+ /**
375
+ * Verify deadlock is resolved by re-checking WFG
376
+ */ async verifyDeadlockResolution(originalCycle) {
377
+ // Re-run deadlock detection to check if cycle still exists
378
+ const currentDeadlocks = await this.deadlockDetector.detectDeadlocks();
379
+ // Check if original cycle is still present
380
+ const stillExists = currentDeadlocks.some((cycle)=>{
381
+ // Compare agent sets (cycle is the same if same agents are involved)
382
+ const originalAgentSet = new Set(originalCycle.agents);
383
+ const currentAgentSet = new Set(cycle.agents);
384
+ if (originalAgentSet.size !== currentAgentSet.size) {
385
+ return false;
386
+ }
387
+ // Convert Set to Array for iteration
388
+ for (const agent of Array.from(originalAgentSet)){
389
+ if (!currentAgentSet.has(agent)) {
390
+ return false;
391
+ }
392
+ }
393
+ return true; // Same agents = same cycle
394
+ });
395
+ return !stillExists; // Resolved if cycle no longer exists
396
+ }
397
+ /**
398
+ * Handle resolution timeout
399
+ */ handleResolutionTimeout(resolution) {
400
+ resolution.status = 'timeout';
401
+ resolution.completedAt = new Date();
402
+ resolution.error = 'Resolution timeout exceeded';
403
+ this.emit('resolution-timeout', {
404
+ resolutionId: resolution.resolutionId,
405
+ cycleId: resolution.cycle.cycleId,
406
+ attempt: resolution.attempt
407
+ });
408
+ // Retry if enabled and under attempt limit
409
+ if (this.config.autoRetryFailedResolutions && resolution.attempt < this.config.maxResolutionAttempts) {
410
+ this.retryResolution(resolution);
411
+ } else {
412
+ this.finalizeFailedResolution(resolution);
413
+ }
414
+ }
415
+ /**
416
+ * Handle resolution failure
417
+ */ handleResolutionFailure(resolution, error) {
418
+ resolution.status = 'failed';
419
+ resolution.completedAt = new Date();
420
+ resolution.error = error instanceof Error ? error.message : 'Unknown error';
421
+ this.emit('resolution-failed', {
422
+ resolutionId: resolution.resolutionId,
423
+ cycleId: resolution.cycle.cycleId,
424
+ error: resolution.error,
425
+ attempt: resolution.attempt
426
+ });
427
+ // Retry if enabled and under attempt limit
428
+ if (this.config.autoRetryFailedResolutions && resolution.attempt < this.config.maxResolutionAttempts) {
429
+ this.retryResolution(resolution);
430
+ } else {
431
+ this.finalizeFailedResolution(resolution);
432
+ }
433
+ }
434
+ /**
435
+ * Retry failed resolution
436
+ */ async retryResolution(resolution) {
437
+ resolution.attempt++;
438
+ resolution.status = 'pending';
439
+ resolution.startedAt = new Date();
440
+ resolution.completedAt = undefined;
441
+ resolution.helpRoutes.clear();
442
+ resolution.helpers = [];
443
+ this.emit('resolution-retry', {
444
+ resolutionId: resolution.resolutionId,
445
+ cycleId: resolution.cycle.cycleId,
446
+ attempt: resolution.attempt
447
+ });
448
+ try {
449
+ await this.resolveDeadlock(resolution);
450
+ } catch (error) {
451
+ this.handleResolutionFailure(resolution, error);
452
+ }
453
+ }
454
+ /**
455
+ * Finalize failed resolution after max attempts
456
+ */ finalizeFailedResolution(resolution) {
457
+ this.metrics.failedResolutions++;
458
+ this.activeResolutions.delete(resolution.resolutionId);
459
+ this.metrics.activeResolutions = this.activeResolutions.size;
460
+ this.emit('resolution-abandoned', {
461
+ resolutionId: resolution.resolutionId,
462
+ cycleId: resolution.cycle.cycleId,
463
+ attempts: resolution.attempt,
464
+ error: resolution.error
465
+ });
466
+ }
467
+ /**
468
+ * Track deadlock pattern for analytics
469
+ */ trackDeadlockPattern(cycle) {
470
+ // Create pattern signature from cycle structure
471
+ const pattern = this.generatePatternSignature(cycle);
472
+ const count = this.metrics.commonPatterns.get(pattern) ?? 0;
473
+ this.metrics.commonPatterns.set(pattern, count + 1);
474
+ }
475
+ /**
476
+ * Generate pattern signature for deadlock cycle
477
+ */ generatePatternSignature(cycle) {
478
+ // Pattern: cycleLength-resourceCount-resolution
479
+ return `${cycle.agents.length}-${cycle.resources.length}-${cycle.resolution}`;
480
+ }
481
+ /**
482
+ * Update average resolution time metric
483
+ */ updateAvgResolutionTime(resolutionTime) {
484
+ const total = this.metrics.successfulResolutions;
485
+ this.metrics.avgResolutionTimeMs = (this.metrics.avgResolutionTimeMs * (total - 1) + resolutionTime) / total;
486
+ }
487
+ /**
488
+ * Generate unique resolution ID
489
+ */ generateResolutionId() {
490
+ return `resolution_${Date.now()}_${++this.resolutionCounter}`;
491
+ }
492
+ /**
493
+ * Get integration metrics
494
+ */ getMetrics() {
495
+ return {
496
+ ...this.metrics,
497
+ deadlockMetrics: this.deadlockDetector.getMetrics(),
498
+ helpMetrics: this.helpCoordinator.getMetrics()
499
+ };
500
+ }
501
+ /**
502
+ * Get active resolutions
503
+ */ getActiveResolutions() {
504
+ return Array.from(this.activeResolutions.values());
505
+ }
506
+ /**
507
+ * Get resolution by ID
508
+ */ getResolution(resolutionId) {
509
+ return this.activeResolutions.get(resolutionId) ?? null;
510
+ }
511
+ /**
512
+ * Force retry resolution
513
+ */ async forceRetryResolution(resolutionId) {
514
+ const resolution = this.activeResolutions.get(resolutionId);
515
+ if (!resolution) {
516
+ return false;
517
+ }
518
+ if (resolution.status === 'in_progress') {
519
+ return false; // Already in progress
520
+ }
521
+ await this.retryResolution(resolution);
522
+ return true;
523
+ }
524
+ /**
525
+ * Cancel active resolution
526
+ */ cancelResolution(resolutionId) {
527
+ const resolution = this.activeResolutions.get(resolutionId);
528
+ if (!resolution) {
529
+ return false;
530
+ }
531
+ resolution.status = 'failed';
532
+ resolution.completedAt = new Date();
533
+ resolution.error = 'Cancelled by user';
534
+ this.activeResolutions.delete(resolutionId);
535
+ this.metrics.activeResolutions = this.activeResolutions.size;
536
+ this.emit('resolution-cancelled', {
537
+ resolutionId,
538
+ cycleId: resolution.cycle.cycleId
539
+ });
540
+ return true;
541
+ }
542
+ /**
543
+ * Clear all state
544
+ */ clear() {
545
+ this.activeResolutions.clear();
546
+ this.metrics.activeResolutions = 0;
547
+ this.resolutionCounter = 0;
548
+ }
549
+ /**
550
+ * Cleanup resources
551
+ */ destroy() {
552
+ this.clear();
553
+ this.removeAllListeners();
554
+ }
555
+ }
556
+
557
+ //# sourceMappingURL=help-deadlock-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.ts"],"names":["EventEmitter","HelpRequestPriority","HelpDeadlockIntegration","deadlockDetector","helpCoordinator","config","metrics","activeResolutions","resolutionCounter","Map","autoRequestHelp","minSeverityThreshold","enableWfgHelperSelection","maxConcurrentResolutions","autoRetryFailedResolutions","maxResolutionAttempts","resolutionTimeoutMs","totalDeadlocksDetected","autoHelpRequestsTriggered","successfulResolutions","failedResolutions","avgResolutionTimeMs","helpersUtilized","Set","commonPatterns","setupDeadlockListeners","on","cycle","trackDeadlockPattern","emit","cycleId","agents","severity","timestamp","Date","handleDeadlock","warning","size","reason","resolutionId","generateResolutionId","resolution","helpRoutes","status","attempt","startedAt","helpers","set","resolveDeadlock","error","handleResolutionFailure","helperCandidates","identifyHelperCandidates","helpRequests","Promise","all","map","agentId","capabilities","extractRequiredCapabilities","priority","calculateHelpPriority","result","createHelpRequest","cycleAgents","suggestedHelpers","filter","c","some","cap","req","capability","match","push","add","Error","message","successfulRoutes","r","length","monitorResolution","graph","getGraph","candidates","cycleAgentSet","node","Array","from","entries","has","state","relevantResources","findRelevantResources","relevance","calculateRelevance","workload","estimateWorkload","sort","a","b","candidate","cycleResources","resources","resource","holdingResources","resourceScore","priorityScore","workloadPenalty","heldCount","waitingCount","waitingForResources","maxResources","Math","min","get","resourceAgent","required","minProficiency","metadata","resourceType","waitingFor","resourceId","CRITICAL","HIGH","NORMAL","LOW","timeout","setTimeout","handleResolutionTimeout","completionPromises","helpRoute","resolve","reject","requestId","request","completionTopic","completed","subscription","completionHandler","payload","unsubscribe","success","messageBroker","subscribe","topic","handler","then","sub","catch","err","pollInterval","setInterval","requestStatus","getRequestStatus","clearInterval","clearTimeout","isResolved","verifyDeadlockResolution","completedAt","resolutionTime","getTime","updateAvgResolutionTime","delete","durationMs","originalCycle","currentDeadlocks","detectDeadlocks","stillExists","originalAgentSet","currentAgentSet","agent","retryResolution","finalizeFailedResolution","undefined","clear","attempts","pattern","generatePatternSignature","count","total","now","getMetrics","deadlockMetrics","helpMetrics","getActiveResolutions","values","getResolution","forceRetryResolution","cancelResolution","destroy","removeAllListeners"],"mappings":"AAAA;;;;;;;;;;;CAWC,GAED,SAASA,YAAY,QAAQ,SAAS;AAGtC,SAASC,mBAAmB,QAA+B,iCAAiC;AAiH5F;;;;CAIC,GACD,OAAO,MAAMC,gCAAgCF;IACnCG,iBAAmC;IACnCC,gBAAiC;IACjCC,OAAgD;IAChDC,QAA6B;IAC7BC,kBAA0D;IAC1DC,kBAA0B;IAElC,YACEL,gBAAkC,EAClCC,eAAgC,EAChCC,MAAsC,CACtC;QACA,KAAK;QAEL,IAAI,CAACF,gBAAgB,GAAGA;QACxB,IAAI,CAACC,eAAe,GAAGA;QACvB,IAAI,CAACG,iBAAiB,GAAG,IAAIE;QAC7B,IAAI,CAACD,iBA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CAAChC,iBAAiB,CAAC2G,GAAG,CAAC3E,iBAAiB;IACrD;IAEA;;GAEC,GACD,MAAaoJ,qBAAqBpJ,YAAoB,EAAoB;QACxE,MAAME,aAAa,IAAI,CAAClC,iBAAiB,CAAC2G,GAAG,CAAC3E;QAE9C,IAAI,CAACE,YAAY;YACf,OAAO;QACT;QAEA,IAAIA,WAAWE,MAAM,KAAK,eAAe;YACvC,OAAO,OAAO,sBAAsB;QACtC;QAEA,MAAM,IAAI,CAACgI,eAAe,CAAClI;QAC3B,OAAO;IACT;IAEA;;GAEC,GACD,AAAOmJ,iBAAiBrJ,YAAoB,EAAW;QACrD,MAAME,aAAa,IAAI,CAAClC,iBAAiB,CAAC2G,GAAG,CAAC3E;QAE9C,IAAI,CAACE,YAAY;YACf,OAAO;QACT;QAEAA,WAAWE,MAAM,GAAG;QACpBF,WAAWqH,WAAW,GAAG,IAAI5H;QAC7BO,WAAWQ,KAAK,GAAG;QAEnB,IAAI,CAAC1C,iBAAiB,CAAC2J,MAAM,CAAC3H;QAC9B,IAAI,CAACjC,OAAO,CAACC,iBAAiB,GAAG,IAAI,CAACA,iBAAiB,CAAC8B,IAAI;QAE5D,IAAI,CAACR,IAAI,CAAC,wBAAwB;YAChCU;YACAT,SAASW,WAAWd,KAAK,CAACG,OAAO;QACnC;QAEA,OAAO;IACT;IAEA;;GAEC,GACD,AAAOgJ,QAAc;QACnB,IAAI,CAACvK,iBAAiB,CAACuK,KAAK;QAC5B,IAAI,CAACxK,OAAO,CAACC,iBAAiB,GAAG;QACjC,IAAI,CAACC,iBAAiB,GAAG;IAC3B;IAEA;;GAEC,GACD,AAAOqL,UAAgB;QACrB,IAAI,CAACf,KAAK;QACV,IAAI,CAACgB,kBAAkB;IACzB;AACF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Agent Coordination V2 - Integration Layer
3
+ *
4
+ * Event-driven integrations connecting core coordination components:
5
+ * - Message Bus ↔ Completion Detector (Phase 9 Sprint 9.1)
6
+ * - State Machine ↔ SDK Integration
7
+ * - Help System ↔ Deadlock Detection
8
+ *
9
+ * @module coordination/v2/integration
10
+ */ export { MessageBusCompletionIntegration, IntegrationEvent } from './message-bus-completion-integration.js';
11
+ export { StateMachineIntegration } from './state-machine-integration.js';
12
+ export { HelpDeadlockIntegration } from './help-deadlock-integration.js';
13
+
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/integration/index.ts"],"names":["MessageBusCompletionIntegration","IntegrationEvent","StateMachineIntegration","HelpDeadlockIntegration"],"mappings":"AAAA;;;;;;;;;CASC,GAED,SACEA,+BAA+B,EAG/BC,gBAAgB,QACX,0CAA0C;AAEjD,SACEC,uBAAuB,QAGlB,iCAAiC;AAExC,SACEC,uBAAuB,QAIlB,iCAAiC"}