claude-flow-novice 2.15.4 → 2.15.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 (456) hide show
  1. package/.claude/cfn-extras/.gs-api-quota.json +16 -0
  2. package/.claude/cfn-extras/.gs-progress-state.json +22 -0
  3. package/.claude/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  4. package/.claude/cfn-extras/agents/google-sheets/README.md +114 -0
  5. package/.claude/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  6. package/.claude/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  7. package/.claude/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  8. package/.claude/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  9. package/.claude/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  10. package/.claude/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  11. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  12. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  13. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  14. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  15. package/.claude/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  16. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  17. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  18. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  19. package/.claude/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  20. package/.claude/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  21. package/.claude/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  22. package/.claude/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  23. package/.claude/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  24. package/.claude/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  25. package/.claude/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  26. package/.claude/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  27. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  28. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  29. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  30. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  31. package/.claude/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  32. package/.claude/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  33. package/.claude/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  34. package/.claude/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  35. package/.claude/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  36. package/.claude/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  37. package/.claude/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  38. package/.claude/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  39. package/.claude/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  40. package/.claude/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  41. package/.claude/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  42. package/.claude/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  43. package/.claude/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  44. package/.claude/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  45. package/.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  46. package/.claude/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  47. package/.claude/commands/cfn-context.md +10 -0
  48. package/.claude/commands/cfn-loop-cli.md +44 -14
  49. package/.claude/commands/google-sheets/google-sheets-loop.md +289 -0
  50. package/.claude/skills/cfn-agent-selector/SKILL.md +143 -0
  51. package/.claude/skills/cfn-agent-selector/select-agents.sh +94 -0
  52. package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  53. package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  54. package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  55. package/.claude/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  56. package/.claude/skills/cfn-docker-redis-coordination/README.md +294 -0
  57. package/.claude/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  58. package/.claude/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  59. package/.claude/skills/cfn-docker-redis-coordination/package.json +40 -0
  60. package/.claude/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  61. package/.claude/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  62. package/.claude/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  63. package/.claude/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  64. package/.claude/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  65. package/.claude/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  66. package/.claude/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  67. package/.claude/skills/cfn-loop-orchestration/README.md +149 -41
  68. package/.claude/skills/cfn-loop-orchestration/jest.config.js +67 -0
  69. package/.claude/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  70. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +147 -16
  71. package/.claude/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  72. package/.claude/skills/cfn-loop-orchestration/package.json +49 -0
  73. package/.claude/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  74. package/.claude/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  75. package/.claude/skills/cfn-loop-orchestration/src/index.ts +14 -0
  76. package/.claude/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  77. package/.claude/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  78. package/.claude/skills/cfn-loop-orchestration/src/types.ts +188 -0
  79. package/.claude/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  80. package/.claude/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  81. package/.claude/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  82. package/.claude/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  83. package/.claude/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  84. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  85. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  86. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  87. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  88. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  89. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  90. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  91. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  92. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  93. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  94. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  95. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  96. package/.claude/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  97. package/.claude/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  98. package/.claude/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  99. package/.claude/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  100. package/.claude/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  101. package/.claude/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  102. package/.claude/skills/cfn-redis-coordination/dist/index.js +114 -0
  103. package/.claude/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  104. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  105. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  106. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  107. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  108. package/.claude/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  109. package/.claude/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  110. package/.claude/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  111. package/.claude/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  112. package/.claude/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  113. package/.claude/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  114. package/.claude/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  115. package/.claude/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  116. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  117. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  118. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  119. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  120. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  121. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  122. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  123. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  124. package/.claude/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  125. package/.claude/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  126. package/.claude/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  127. package/.claude/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  128. package/.claude/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  129. package/.claude/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  130. package/.claude/skills/cfn-redis-coordination/dist/types.js +81 -0
  131. package/.claude/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  132. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  133. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  134. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  135. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  136. package/.claude/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  137. package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -2
  138. package/.claude/skills/cfn-redis-coordination/jest.config.js +23 -0
  139. package/.claude/skills/cfn-redis-coordination/package-lock.json +5272 -0
  140. package/.claude/skills/cfn-redis-coordination/package.json +45 -0
  141. package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  142. package/.claude/skills/cfn-redis-coordination/redis-functions.sh +3 -2
  143. package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  144. package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  145. package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  146. package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  147. package/.claude/skills/cfn-redis-coordination/src/index.ts +82 -0
  148. package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  149. package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  150. package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  151. package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  152. package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  153. package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  154. package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  155. package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  156. package/.claude/skills/cfn-redis-coordination/src/types.ts +235 -0
  157. package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  158. package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  159. package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  160. package/.claude/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  161. package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  162. package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  163. package/.claude/skills/cfn-redis-coordination/tsconfig.json +31 -0
  164. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +172 -2
  165. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +1 -1
  166. package/claude-assets/agents/custom/cfn-redis-operations.md +530 -0
  167. package/claude-assets/agents/custom/cfn-system-expert.md +77 -0
  168. package/claude-assets/cfn-extras/.gs-api-quota.json +16 -0
  169. package/claude-assets/cfn-extras/.gs-progress-state.json +22 -0
  170. package/claude-assets/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  171. package/claude-assets/cfn-extras/agents/google-sheets/README.md +114 -0
  172. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  173. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  174. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  175. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  176. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  177. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  178. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  179. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  180. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  181. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  182. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  183. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  184. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  185. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  186. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  187. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  188. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  189. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  190. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  191. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  192. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  193. package/claude-assets/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  194. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  195. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  196. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  197. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  198. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  199. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  200. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  201. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  202. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  203. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  204. package/claude-assets/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  205. package/claude-assets/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  206. package/claude-assets/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  207. package/claude-assets/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  208. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  209. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  210. package/claude-assets/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  211. package/claude-assets/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  212. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  213. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  214. package/claude-assets/commands/cfn-context.md +10 -0
  215. package/claude-assets/commands/cfn-loop-cli.md +44 -14
  216. package/claude-assets/commands/google-sheets/google-sheets-loop.md +289 -0
  217. package/claude-assets/hooks/cfn-pre-execution/SESSION_START_README.md +87 -0
  218. package/claude-assets/hooks/cfn-pre-execution/TEST_SESSION_START.md +128 -0
  219. package/claude-assets/hooks/cfn-pre-execution/session-start-context.sh +111 -0
  220. package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_EXAMPLE.md +209 -0
  221. package/claude-assets/skills/cfn-agent-selection-with-fallback/README.md +130 -0
  222. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +243 -0
  223. package/claude-assets/skills/cfn-agent-selection-with-fallback/agent-mappings.json +142 -0
  224. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +173 -0
  225. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +71 -0
  226. package/claude-assets/skills/cfn-agent-selection-with-fallback/test-agent-selection.sh +282 -0
  227. package/claude-assets/skills/cfn-agent-selector/SKILL.md +143 -0
  228. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +94 -0
  229. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  230. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  231. package/claude-assets/skills/cfn-docker-coordination/.eslintrc.json +33 -0
  232. package/claude-assets/skills/cfn-docker-coordination/README.md +349 -0
  233. package/claude-assets/skills/cfn-docker-coordination/docker-helpers.sh +433 -0
  234. package/claude-assets/skills/cfn-docker-coordination/jest.config.js +25 -0
  235. package/claude-assets/skills/cfn-docker-coordination/package-lock.json +6827 -0
  236. package/claude-assets/skills/cfn-docker-coordination/package.json +38 -0
  237. package/claude-assets/skills/cfn-docker-coordination/src/agent-container.ts +471 -0
  238. package/claude-assets/skills/cfn-docker-coordination/src/docker-client.ts +483 -0
  239. package/claude-assets/skills/cfn-docker-coordination/src/health-checker.ts +418 -0
  240. package/claude-assets/skills/cfn-docker-coordination/src/index.ts +45 -0
  241. package/claude-assets/skills/cfn-docker-coordination/src/network-manager.ts +377 -0
  242. package/claude-assets/skills/cfn-docker-coordination/src/types.ts +412 -0
  243. package/claude-assets/skills/cfn-docker-coordination/src/volume-manager.ts +389 -0
  244. package/claude-assets/skills/cfn-docker-coordination/tests/agent-container.test.ts +379 -0
  245. package/claude-assets/skills/cfn-docker-coordination/tests/docker-client.test.ts +345 -0
  246. package/claude-assets/skills/cfn-docker-coordination/tests/health-checker.test.ts +535 -0
  247. package/claude-assets/skills/cfn-docker-coordination/tests/integration.test.ts +193 -0
  248. package/claude-assets/skills/cfn-docker-coordination/tests/network-manager.test.ts +352 -0
  249. package/claude-assets/skills/cfn-docker-coordination/tests/setup.ts +36 -0
  250. package/claude-assets/skills/cfn-docker-coordination/tsconfig.json +29 -0
  251. package/claude-assets/skills/cfn-docker-logging/INTEGRATION.md +268 -0
  252. package/claude-assets/skills/cfn-docker-logging/SAMPLE_OUTPUTS.md +237 -0
  253. package/claude-assets/skills/cfn-docker-logging/SKILL.md +442 -0
  254. package/claude-assets/skills/cfn-docker-logging/capture-container-logs.sh +120 -0
  255. package/claude-assets/skills/cfn-docker-logging/enable-logging.sh +430 -0
  256. package/claude-assets/skills/cfn-docker-logging/init-hybrid-logging.sh +210 -0
  257. package/claude-assets/skills/cfn-docker-logging/queries/analytics-summary.sh +87 -0
  258. package/claude-assets/skills/cfn-docker-logging/queries/query-agent-timeline.sh +51 -0
  259. package/claude-assets/skills/cfn-docker-logging/queries/query-consensus-history.sh +56 -0
  260. package/claude-assets/skills/cfn-docker-logging/queries/query-coordination-timeline.sh +39 -0
  261. package/claude-assets/skills/cfn-docker-logging/queries/query-failed-containers.sh +40 -0
  262. package/claude-assets/skills/cfn-docker-logging/queries/query-gate-checks.sh +39 -0
  263. package/claude-assets/skills/cfn-docker-logging/schema.sql +111 -0
  264. package/claude-assets/skills/cfn-docker-logging/sqlite-helpers.sh +240 -0
  265. package/claude-assets/skills/cfn-docker-logging/test-hybrid-logging.sh +331 -0
  266. package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  267. package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  268. package/claude-assets/skills/cfn-docker-redis-coordination/README.md +294 -0
  269. package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  270. package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  271. package/claude-assets/skills/cfn-docker-redis-coordination/package.json +40 -0
  272. package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  273. package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  274. package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  275. package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  276. package/claude-assets/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  277. package/claude-assets/skills/cfn-error-logging/.eslintrc.json +57 -0
  278. package/claude-assets/skills/cfn-error-logging/.prettierrc.json +10 -0
  279. package/claude-assets/skills/cfn-error-logging/MIGRATION_SUMMARY.md +485 -0
  280. package/claude-assets/skills/cfn-error-logging/package.json +47 -0
  281. package/claude-assets/skills/cfn-error-logging/src/error-logger.ts +1042 -0
  282. package/claude-assets/skills/cfn-error-logging/src/index.ts +12 -0
  283. package/claude-assets/skills/cfn-error-logging/src/types.ts +456 -0
  284. package/claude-assets/skills/cfn-error-logging/tests/error-logger.test.ts +1302 -0
  285. package/claude-assets/skills/cfn-error-logging/tsconfig.json +38 -0
  286. package/claude-assets/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  287. package/claude-assets/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  288. package/claude-assets/skills/cfn-loop-orchestration/README.md +149 -41
  289. package/claude-assets/skills/cfn-loop-orchestration/jest.config.js +67 -0
  290. package/claude-assets/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  291. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +147 -16
  292. package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  293. package/claude-assets/skills/cfn-loop-orchestration/package.json +49 -0
  294. package/claude-assets/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  295. package/claude-assets/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  296. package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +14 -0
  297. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  298. package/claude-assets/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  299. package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +188 -0
  300. package/claude-assets/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  301. package/claude-assets/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  302. package/claude-assets/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  303. package/claude-assets/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  304. package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  305. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  306. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  307. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  308. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  309. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  310. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  311. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  312. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  313. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  314. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  315. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  316. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  317. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  318. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  319. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  320. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  321. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  322. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  323. package/claude-assets/skills/cfn-redis-coordination/dist/index.js +114 -0
  324. package/claude-assets/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  325. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  326. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  327. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  328. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  329. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  330. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  331. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  332. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  333. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  334. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  335. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  336. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  337. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  338. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  339. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  340. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  341. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  342. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  343. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  344. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  345. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  346. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  347. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  348. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  349. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  350. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  351. package/claude-assets/skills/cfn-redis-coordination/dist/types.js +81 -0
  352. package/claude-assets/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  353. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  354. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  355. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  356. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  357. package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  358. package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -2
  359. package/claude-assets/skills/cfn-redis-coordination/jest.config.js +23 -0
  360. package/claude-assets/skills/cfn-redis-coordination/package-lock.json +5272 -0
  361. package/claude-assets/skills/cfn-redis-coordination/package.json +45 -0
  362. package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  363. package/claude-assets/skills/cfn-redis-coordination/redis-functions.sh +3 -2
  364. package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  365. package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  366. package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  367. package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  368. package/claude-assets/skills/cfn-redis-coordination/src/index.ts +82 -0
  369. package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  370. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  371. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  372. package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  373. package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  374. package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  375. package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  376. package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  377. package/claude-assets/skills/cfn-redis-coordination/src/types.ts +235 -0
  378. package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  379. package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  380. package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  381. package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  382. package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  383. package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  384. package/claude-assets/skills/cfn-redis-coordination/tsconfig.json +31 -0
  385. package/claude-assets/skills/cfn-skill-propagation/README.md +233 -0
  386. package/claude-assets/skills/cfn-skill-propagation/package-lock.json +5174 -0
  387. package/claude-assets/skills/cfn-skill-propagation/package.json +52 -0
  388. package/claude-assets/skills/cfn-skill-propagation/propagate-skill-update.sh +32 -0
  389. package/claude-assets/skills/cfn-skill-propagation/src/cli.ts +75 -0
  390. package/claude-assets/skills/cfn-skill-propagation/src/database-adapter.ts +239 -0
  391. package/claude-assets/skills/cfn-skill-propagation/src/file-system-adapter.ts +113 -0
  392. package/claude-assets/skills/cfn-skill-propagation/src/index.ts +72 -0
  393. package/claude-assets/skills/cfn-skill-propagation/src/logger.ts +43 -0
  394. package/claude-assets/skills/cfn-skill-propagation/src/metadata-parser.ts +154 -0
  395. package/claude-assets/skills/cfn-skill-propagation/src/skill-propagator.ts +274 -0
  396. package/claude-assets/skills/cfn-skill-propagation/src/skill-validator.ts +179 -0
  397. package/claude-assets/skills/cfn-skill-propagation/src/types.ts +143 -0
  398. package/claude-assets/skills/cfn-skill-propagation/src/version-manager.ts +118 -0
  399. package/claude-assets/skills/cfn-skill-propagation/tests/file-system-adapter.test.ts +91 -0
  400. package/claude-assets/skills/cfn-skill-propagation/tests/metadata-parser.test.ts +176 -0
  401. package/claude-assets/skills/cfn-skill-propagation/tests/skill-propagator.test.ts +209 -0
  402. package/claude-assets/skills/cfn-skill-propagation/tests/skill-validator.test.ts +203 -0
  403. package/claude-assets/skills/cfn-skill-propagation/tests/version-manager.test.ts +115 -0
  404. package/claude-assets/skills/cfn-skill-propagation/tsconfig.json +34 -0
  405. package/claude-assets/skills/task-classifier/SKILL.md +81 -0
  406. package/claude-assets/skills/task-classifier/classify-task.sh +62 -0
  407. package/claude-assets/skills/workflow-codification/package-lock.json +5170 -0
  408. package/claude-assets/skills/workflow-codification/package.json +30 -0
  409. package/claude-assets/skills/workflow-codification/src/index.ts +24 -0
  410. package/claude-assets/skills/workflow-codification/src/pattern-analyzer.ts +537 -0
  411. package/claude-assets/skills/workflow-codification/src/types.ts +180 -0
  412. package/claude-assets/skills/workflow-codification/tests/pattern-analyzer.test.ts +960 -0
  413. package/claude-assets/skills/workflow-codification/tsconfig.json +34 -0
  414. package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
  415. package/dist/agent-spawner/agent-spawner.js +448 -0
  416. package/dist/agent-spawner/agent-spawner.js.map +1 -0
  417. package/dist/agent-spawner/index.js +10 -0
  418. package/dist/agent-spawner/index.js.map +1 -0
  419. package/dist/agent-spawner/types.js +14 -0
  420. package/dist/agent-spawner/types.js.map +1 -0
  421. package/dist/cli/agent-executor.js +47 -1
  422. package/dist/cli/agent-executor.js.map +1 -1
  423. package/dist/cli/agent-spawn.js +4 -1
  424. package/dist/cli/agent-spawn.js.map +1 -1
  425. package/dist/cli/config-manager.js +109 -91
  426. package/dist/cli/config-manager.js.map +1 -1
  427. package/dist/cli/conversation-fork-cleanup.js +201 -0
  428. package/dist/cli/conversation-fork-cleanup.js.map +1 -0
  429. package/dist/cli/conversation-fork.js +16 -3
  430. package/dist/cli/conversation-fork.js.map +1 -1
  431. package/dist/cli/tool-executor.js +3 -1
  432. package/dist/cli/tool-executor.js.map +1 -1
  433. package/dist/gate-checker/gate-checker.js +292 -0
  434. package/dist/gate-checker/gate-checker.js.map +1 -0
  435. package/dist/gate-checker/types.js +94 -0
  436. package/dist/gate-checker/types.js.map +1 -0
  437. package/dist/lib/database-service/connection-pool-manager.js +2 -1
  438. package/dist/lib/database-service/connection-pool-manager.js.map +1 -1
  439. package/dist/orchestrator/index.js +10 -0
  440. package/dist/orchestrator/index.js.map +1 -0
  441. package/dist/orchestrator/orchestrate.js +496 -0
  442. package/dist/orchestrator/orchestrate.js.map +1 -0
  443. package/dist/orchestrator/types.js +58 -0
  444. package/dist/orchestrator/types.js.map +1 -0
  445. package/docs/BUG_19_MEMORY_LEAK_TASK_MODE.md +405 -0
  446. package/docs/MEMORY_CLEANUP_GUIDE.md +358 -0
  447. package/docs/MEMORY_LEAK_FIX_SUMMARY.md +322 -0
  448. package/docs/REDIS_CLEANUP_EXECUTIVE_SUMMARY.md +319 -0
  449. package/docs/REDIS_CLEANUP_VERIFICATION_REPORT.md +574 -0
  450. package/package.json +208 -201
  451. package/readme/README.md +34 -1
  452. package/scripts/switch-api.sh +142 -4
  453. package/scripts/verify-no-secrets.sh +6 -13
  454. package/scripts/verify-redis-cleanup.sh +173 -0
  455. package/tests/README.md +201 -0
  456. package/tests/test-memory-leak-task-mode.sh +435 -0
@@ -0,0 +1,419 @@
1
+ "use strict";
2
+ /**
3
+ * Waiting Coordinator
4
+ *
5
+ * Handles blocking coordination using Redis BLPOP for agents to wait
6
+ * for specific conditions (gate passed, consensus reached, etc).
7
+ *
8
+ * Migrated from:
9
+ * - invoke-waiting-mode.sh (223 lines)
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WaitingCoordinator = void 0;
13
+ const types_1 = require("./types");
14
+ class WaitingCoordinator {
15
+ redis;
16
+ logger;
17
+ constructor(redis, logger) {
18
+ this.redis = redis;
19
+ this.logger = logger;
20
+ }
21
+ /**
22
+ * Wait for a specific condition with BLPOP (blocking)
23
+ *
24
+ * Blocks until condition is signaled or timeout occurs.
25
+ * In Task Mode: Returns immediately with false
26
+ * In CLI Mode: Blocks on Redis list
27
+ */
28
+ async waitForCompletion(taskId, agentId, timeoutSeconds = 300, namespace = 'swarm') {
29
+ // Validate inputs
30
+ if (!(0, types_1.isValidTaskId)(taskId)) {
31
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
32
+ }
33
+ if (!(0, types_1.isValidAgentId)(agentId)) {
34
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid agent ID: ${agentId}`);
35
+ }
36
+ const startTime = Date.now();
37
+ // Graceful no-op in Task Mode
38
+ if (!this.redis.canUseRedis) {
39
+ this.logger.info(`Task Mode: Wait for completion skipped (no Redis) - Agent: ${agentId}`);
40
+ return {
41
+ condition: 'agent-completion',
42
+ met: true,
43
+ timedOut: false,
44
+ waitedMs: 0
45
+ };
46
+ }
47
+ // CLI Mode: Block on Redis list
48
+ const doneKey = `${namespace}:${taskId}:${agentId}:done`;
49
+ try {
50
+ this.logger.info(`⏳ Waiting for completion: ${agentId} (timeout: ${timeoutSeconds}s)`);
51
+ // BLPOP with timeout (Redis timeout in seconds)
52
+ const result = await this.redis.blpop(doneKey, timeoutSeconds);
53
+ const waitedMs = Date.now() - startTime;
54
+ if (result) {
55
+ this.logger.info(`✅ Agent completed: ${agentId} (waited ${waitedMs}ms)`);
56
+ return {
57
+ condition: 'agent-completion',
58
+ met: true,
59
+ timedOut: false,
60
+ waitedMs,
61
+ metadata: { signal: result[1] }
62
+ };
63
+ }
64
+ else {
65
+ this.logger.warn(`⏱️ Timeout waiting for agent: ${agentId} (${timeoutSeconds}s)`);
66
+ return {
67
+ condition: 'agent-completion',
68
+ met: false,
69
+ timedOut: true,
70
+ waitedMs
71
+ };
72
+ }
73
+ }
74
+ catch (error) {
75
+ this.logger.error('Failed to wait for completion', error);
76
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to wait for completion: ${error.message}`);
77
+ }
78
+ }
79
+ /**
80
+ * Wait for gate to pass (test pass rate threshold)
81
+ *
82
+ * Blocks until gate-passed signal is received.
83
+ * In Task Mode: Returns immediately with true
84
+ * In CLI Mode: Blocks on Redis list
85
+ */
86
+ async waitForGate(taskId, timeoutSeconds = 600, namespace = 'swarm') {
87
+ // Validate input
88
+ if (!(0, types_1.isValidTaskId)(taskId)) {
89
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
90
+ }
91
+ const startTime = Date.now();
92
+ // Graceful no-op in Task Mode
93
+ if (!this.redis.canUseRedis) {
94
+ this.logger.info('Task Mode: Wait for gate skipped (no Redis)');
95
+ return {
96
+ condition: 'gate-passed',
97
+ met: true,
98
+ timedOut: false,
99
+ waitedMs: 0
100
+ };
101
+ }
102
+ // CLI Mode: Block on Redis list
103
+ const gateKey = `${namespace}:${taskId}:gate-passed`;
104
+ try {
105
+ this.logger.info(`⏳ Waiting for gate to pass (timeout: ${timeoutSeconds}s)`);
106
+ // BLPOP with timeout
107
+ const result = await this.redis.blpop(gateKey, timeoutSeconds);
108
+ const waitedMs = Date.now() - startTime;
109
+ if (result) {
110
+ this.logger.info(`✅ Gate passed (waited ${waitedMs}ms)`);
111
+ return {
112
+ condition: 'gate-passed',
113
+ met: true,
114
+ timedOut: false,
115
+ waitedMs,
116
+ metadata: { signal: result[1] }
117
+ };
118
+ }
119
+ else {
120
+ this.logger.warn(`⏱️ Timeout waiting for gate (${timeoutSeconds}s)`);
121
+ return {
122
+ condition: 'gate-passed',
123
+ met: false,
124
+ timedOut: true,
125
+ waitedMs
126
+ };
127
+ }
128
+ }
129
+ catch (error) {
130
+ this.logger.error('Failed to wait for gate', error);
131
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to wait for gate: ${error.message}`);
132
+ }
133
+ }
134
+ /**
135
+ * Wait for consensus to be reached from validators
136
+ *
137
+ * Blocks until consensus signal is received.
138
+ * In Task Mode: Returns immediately with true
139
+ * In CLI Mode: Blocks on Redis list
140
+ */
141
+ async waitForConsensus(taskId, timeoutSeconds = 600, namespace = 'swarm') {
142
+ // Validate input
143
+ if (!(0, types_1.isValidTaskId)(taskId)) {
144
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
145
+ }
146
+ const startTime = Date.now();
147
+ // Graceful no-op in Task Mode
148
+ if (!this.redis.canUseRedis) {
149
+ this.logger.info('Task Mode: Wait for consensus skipped (no Redis)');
150
+ return {
151
+ condition: 'consensus-reached',
152
+ met: true,
153
+ timedOut: false,
154
+ waitedMs: 0
155
+ };
156
+ }
157
+ // CLI Mode: Block on Redis list
158
+ const consensusKey = `${namespace}:${taskId}:consensus-reached`;
159
+ try {
160
+ this.logger.info(`⏳ Waiting for consensus (timeout: ${timeoutSeconds}s)`);
161
+ // BLPOP with timeout
162
+ const result = await this.redis.blpop(consensusKey, timeoutSeconds);
163
+ const waitedMs = Date.now() - startTime;
164
+ if (result) {
165
+ this.logger.info(`✅ Consensus reached (waited ${waitedMs}ms)`);
166
+ return {
167
+ condition: 'consensus-reached',
168
+ met: true,
169
+ timedOut: false,
170
+ waitedMs,
171
+ metadata: { signal: result[1] }
172
+ };
173
+ }
174
+ else {
175
+ this.logger.warn(`⏱️ Timeout waiting for consensus (${timeoutSeconds}s)`);
176
+ return {
177
+ condition: 'consensus-reached',
178
+ met: false,
179
+ timedOut: true,
180
+ waitedMs
181
+ };
182
+ }
183
+ }
184
+ catch (error) {
185
+ this.logger.error('Failed to wait for consensus', error);
186
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to wait for consensus: ${error.message}`);
187
+ }
188
+ }
189
+ /**
190
+ * Wait for custom condition by key name
191
+ *
192
+ * Generic wait mechanism for any condition.
193
+ * In Task Mode: Returns immediately with true
194
+ * In CLI Mode: Blocks on Redis list
195
+ */
196
+ async waitForCondition(taskId, conditionName, timeoutSeconds = 300, namespace = 'swarm') {
197
+ // Validate input
198
+ if (!(0, types_1.isValidTaskId)(taskId)) {
199
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
200
+ }
201
+ if (!conditionName || conditionName.length === 0) {
202
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, 'Condition name cannot be empty');
203
+ }
204
+ const startTime = Date.now();
205
+ // Graceful no-op in Task Mode
206
+ if (!this.redis.canUseRedis) {
207
+ this.logger.info(`Task Mode: Wait for condition skipped (no Redis) - ${conditionName}`);
208
+ return {
209
+ condition: conditionName,
210
+ met: true,
211
+ timedOut: false,
212
+ waitedMs: 0
213
+ };
214
+ }
215
+ // CLI Mode: Block on Redis list
216
+ const conditionKey = `${namespace}:${taskId}:${conditionName}`;
217
+ try {
218
+ this.logger.info(`⏳ Waiting for condition: ${conditionName} (timeout: ${timeoutSeconds}s)`);
219
+ // BLPOP with timeout
220
+ const result = await this.redis.blpop(conditionKey, timeoutSeconds);
221
+ const waitedMs = Date.now() - startTime;
222
+ if (result) {
223
+ this.logger.info(`✅ Condition met: ${conditionName} (waited ${waitedMs}ms)`);
224
+ return {
225
+ condition: conditionName,
226
+ met: true,
227
+ timedOut: false,
228
+ waitedMs,
229
+ metadata: { signal: result[1] }
230
+ };
231
+ }
232
+ else {
233
+ this.logger.warn(`⏱️ Timeout waiting for condition: ${conditionName} (${timeoutSeconds}s)`);
234
+ return {
235
+ condition: conditionName,
236
+ met: false,
237
+ timedOut: true,
238
+ waitedMs
239
+ };
240
+ }
241
+ }
242
+ catch (error) {
243
+ this.logger.error('Failed to wait for condition', error);
244
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to wait for condition ${conditionName}: ${error.message}`);
245
+ }
246
+ }
247
+ /**
248
+ * Signal a condition to wake waiting agents
249
+ *
250
+ * In Task Mode: Logs and returns gracefully
251
+ * In CLI Mode: Pushes signal to Redis list
252
+ */
253
+ async signalCondition(taskId, conditionName, metadata, namespace = 'swarm') {
254
+ // Validate input
255
+ if (!(0, types_1.isValidTaskId)(taskId)) {
256
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
257
+ }
258
+ if (!conditionName || conditionName.length === 0) {
259
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, 'Condition name cannot be empty');
260
+ }
261
+ const timestamp = new Date().toISOString();
262
+ // Graceful no-op in Task Mode
263
+ if (!this.redis.canUseRedis) {
264
+ this.logger.info(`Task Mode: Condition signal skipped (no Redis) - ${conditionName}`);
265
+ return {
266
+ agentId: 'orchestrator',
267
+ signalType: conditionName,
268
+ status: 'signaled',
269
+ timestamp
270
+ };
271
+ }
272
+ // CLI Mode: Push signal to Redis
273
+ const conditionKey = `${namespace}:${taskId}:${conditionName}`;
274
+ try {
275
+ const payload = JSON.stringify({
276
+ conditionName,
277
+ timestamp,
278
+ metadata: metadata || {}
279
+ });
280
+ await this.redis.lpush(conditionKey, payload);
281
+ // Set TTL (1 hour - long enough for agents to see it)
282
+ await this.redis.expire(conditionKey, 3600);
283
+ this.logger.info(`✅ Signal sent: ${conditionName}`);
284
+ return {
285
+ agentId: 'orchestrator',
286
+ signalType: conditionName,
287
+ status: 'signaled',
288
+ timestamp
289
+ };
290
+ }
291
+ catch (error) {
292
+ this.logger.error('Failed to signal condition', error);
293
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to signal condition ${conditionName}: ${error.message}`);
294
+ }
295
+ }
296
+ /**
297
+ * Wait for multiple agents to complete with parallel blocking
298
+ *
299
+ * In Task Mode: Returns immediately
300
+ * In CLI Mode: Blocks on multiple agent done keys
301
+ */
302
+ async waitForMultipleAgents(taskId, agentIds, timeoutSeconds = 600, namespace = 'swarm') {
303
+ // Validate input
304
+ if (!(0, types_1.isValidTaskId)(taskId)) {
305
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
306
+ }
307
+ if (!agentIds || agentIds.length === 0) {
308
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, 'Agent IDs list cannot be empty');
309
+ }
310
+ // Graceful no-op in Task Mode
311
+ if (!this.redis.canUseRedis) {
312
+ this.logger.info('Task Mode: Wait for multiple agents skipped (no Redis)');
313
+ return {
314
+ completed: agentIds,
315
+ timedOut: false,
316
+ waitedMs: 0
317
+ };
318
+ }
319
+ const startTime = Date.now();
320
+ const completed = [];
321
+ const keys = agentIds.map(id => `${namespace}:${taskId}:${id}:done`);
322
+ try {
323
+ this.logger.info(`⏳ Waiting for ${agentIds.length} agents to complete (timeout: ${timeoutSeconds}s)`);
324
+ while (completed.length < agentIds.length) {
325
+ const waitedMs = Date.now() - startTime;
326
+ // Check timeout
327
+ if (waitedMs / 1000 >= timeoutSeconds) {
328
+ this.logger.warn(`⏱️ Timeout waiting for agents to complete`);
329
+ return {
330
+ completed,
331
+ timedOut: true,
332
+ waitedMs
333
+ };
334
+ }
335
+ // Calculate remaining timeout for BLPOP
336
+ const remainingSeconds = timeoutSeconds - (waitedMs / 1000);
337
+ // BLPOP on all remaining keys
338
+ const pendingKeys = agentIds
339
+ .filter(id => !completed.includes(id))
340
+ .map(id => `${namespace}:${taskId}:${id}:done`);
341
+ if (pendingKeys.length === 0)
342
+ break;
343
+ // BLPOP returns [key, value] or null
344
+ const blpopArgs = [...pendingKeys, Math.ceil(remainingSeconds)];
345
+ const result = await this.redis.blpop(...blpopArgs);
346
+ if (result) {
347
+ const key = result[0];
348
+ // Extract agent ID from key: "namespace:taskId:agentId:done"
349
+ const agentId = key.split(':')[2];
350
+ if (!completed.includes(agentId)) {
351
+ completed.push(agentId);
352
+ this.logger.info(`✅ Agent completed: ${agentId}`);
353
+ }
354
+ }
355
+ }
356
+ const waitedMs = Date.now() - startTime;
357
+ this.logger.info(`✅ All agents completed (waited ${waitedMs}ms)`);
358
+ return {
359
+ completed,
360
+ timedOut: false,
361
+ waitedMs
362
+ };
363
+ }
364
+ catch (error) {
365
+ this.logger.error('Failed to wait for multiple agents', error);
366
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to wait for multiple agents: ${error.message}`);
367
+ }
368
+ }
369
+ /**
370
+ * Poll for condition (non-blocking alternative to BLPOP)
371
+ *
372
+ * Useful when you can't use BLPOP (Task Mode stubbing issues).
373
+ */
374
+ async pollForCondition(taskId, conditionName, timeoutSeconds = 300, pollIntervalMs = 1000, namespace = 'swarm') {
375
+ // Validate input
376
+ if (!(0, types_1.isValidTaskId)(taskId)) {
377
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.VALIDATION_ERROR, `Invalid task ID: ${taskId}`);
378
+ }
379
+ const startTime = Date.now();
380
+ const conditionKey = `${namespace}:${taskId}:${conditionName}`;
381
+ try {
382
+ this.logger.info(`⏳ Polling for condition: ${conditionName} (timeout: ${timeoutSeconds}s, poll interval: ${pollIntervalMs}ms)`);
383
+ while (true) {
384
+ const waitedMs = Date.now() - startTime;
385
+ // Check timeout
386
+ if (waitedMs / 1000 >= timeoutSeconds) {
387
+ this.logger.warn(`⏱️ Timeout polling for condition: ${conditionName}`);
388
+ return {
389
+ condition: conditionName,
390
+ met: false,
391
+ timedOut: true,
392
+ waitedMs
393
+ };
394
+ }
395
+ // Check condition
396
+ if (this.redis.canUseRedis) {
397
+ const result = await this.redis.get(conditionKey);
398
+ if (result && result === 'true') {
399
+ this.logger.info(`✅ Condition met via polling: ${conditionName}`);
400
+ return {
401
+ condition: conditionName,
402
+ met: true,
403
+ timedOut: false,
404
+ waitedMs
405
+ };
406
+ }
407
+ }
408
+ // Wait before next poll
409
+ await new Promise(resolve => setTimeout(resolve, pollIntervalMs));
410
+ }
411
+ }
412
+ catch (error) {
413
+ this.logger.error('Failed to poll for condition', error);
414
+ throw new types_1.CoordinationError(types_1.CoordinationErrorType.REDIS_UNAVAILABLE, `Failed to poll for condition ${conditionName}: ${error.message}`);
415
+ }
416
+ }
417
+ }
418
+ exports.WaitingCoordinator = WaitingCoordinator;
419
+ //# sourceMappingURL=waiting-coordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waiting-coordinator.js","sourceRoot":"","sources":["../src/waiting-coordinator.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAOH,mCAKiB;AAkBjB,MAAa,kBAAkB;IAEnB;IACA;IAFV,YACU,KAAuB,EACvB,MAAc;QADd,UAAK,GAAL,KAAK,CAAkB;QACvB,WAAM,GAAN,MAAM,CAAQ;IACrB,CAAC;IAEJ;;;;;;OAMG;IACH,KAAK,CAAC,iBAAiB,CACrB,MAAc,EACd,OAAgB,EAChB,iBAAyB,GAAG,EAC5B,YAAoB,OAAO;QAE3B,kBAAkB;QAClB,IAAI,CAAC,IAAA,qBAAa,EAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,yBAAiB,CACzB,6BAAqB,CAAC,gBAAgB,EACtC,oBAAoB,MAAM,EAAE,CAC7B,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAA,sBAAc,EAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,yBAAiB,CACzB,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