claude-flow-novice 2.15.5 → 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 (440) 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 +36 -15
  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 +91 -8
  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/jest.config.js +23 -0
  138. package/.claude/skills/cfn-redis-coordination/package-lock.json +5272 -0
  139. package/.claude/skills/cfn-redis-coordination/package.json +45 -0
  140. package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  141. package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  142. package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  143. package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  144. package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  145. package/.claude/skills/cfn-redis-coordination/src/index.ts +82 -0
  146. package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  147. package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  148. package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  149. package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  150. package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  151. package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  152. package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  153. package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  154. package/.claude/skills/cfn-redis-coordination/src/types.ts +235 -0
  155. package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  156. package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  157. package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  158. package/.claude/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  159. package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  160. package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  161. package/.claude/skills/cfn-redis-coordination/tsconfig.json +31 -0
  162. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +172 -2
  163. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +1 -1
  164. package/claude-assets/agents/custom/cfn-redis-operations.md +530 -0
  165. package/claude-assets/agents/custom/cfn-system-expert.md +77 -0
  166. package/claude-assets/cfn-extras/.gs-api-quota.json +16 -0
  167. package/claude-assets/cfn-extras/.gs-progress-state.json +22 -0
  168. package/claude-assets/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  169. package/claude-assets/cfn-extras/agents/google-sheets/README.md +114 -0
  170. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  171. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  172. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  173. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  174. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  175. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  176. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  177. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  178. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  179. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  180. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  181. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  182. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  183. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  184. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  185. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  186. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  187. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  188. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  189. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  190. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  191. package/claude-assets/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  192. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  193. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  194. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  195. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  196. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  197. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  198. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  199. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  200. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  201. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  202. package/claude-assets/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  203. package/claude-assets/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  204. package/claude-assets/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  205. package/claude-assets/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  206. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  207. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  208. package/claude-assets/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  209. package/claude-assets/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  210. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  211. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  212. package/claude-assets/commands/cfn-context.md +10 -0
  213. package/claude-assets/commands/cfn-loop-cli.md +36 -15
  214. package/claude-assets/commands/google-sheets/google-sheets-loop.md +289 -0
  215. package/claude-assets/hooks/cfn-pre-execution/SESSION_START_README.md +87 -0
  216. package/claude-assets/hooks/cfn-pre-execution/TEST_SESSION_START.md +128 -0
  217. package/claude-assets/hooks/cfn-pre-execution/session-start-context.sh +111 -0
  218. package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_EXAMPLE.md +209 -0
  219. package/claude-assets/skills/cfn-agent-selection-with-fallback/README.md +130 -0
  220. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +243 -0
  221. package/claude-assets/skills/cfn-agent-selection-with-fallback/agent-mappings.json +142 -0
  222. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +173 -0
  223. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +71 -0
  224. package/claude-assets/skills/cfn-agent-selection-with-fallback/test-agent-selection.sh +282 -0
  225. package/claude-assets/skills/cfn-agent-selector/SKILL.md +143 -0
  226. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +94 -0
  227. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  228. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  229. package/claude-assets/skills/cfn-docker-coordination/.eslintrc.json +33 -0
  230. package/claude-assets/skills/cfn-docker-coordination/README.md +349 -0
  231. package/claude-assets/skills/cfn-docker-coordination/docker-helpers.sh +433 -0
  232. package/claude-assets/skills/cfn-docker-coordination/jest.config.js +25 -0
  233. package/claude-assets/skills/cfn-docker-coordination/package-lock.json +6827 -0
  234. package/claude-assets/skills/cfn-docker-coordination/package.json +38 -0
  235. package/claude-assets/skills/cfn-docker-coordination/src/agent-container.ts +471 -0
  236. package/claude-assets/skills/cfn-docker-coordination/src/docker-client.ts +483 -0
  237. package/claude-assets/skills/cfn-docker-coordination/src/health-checker.ts +418 -0
  238. package/claude-assets/skills/cfn-docker-coordination/src/index.ts +45 -0
  239. package/claude-assets/skills/cfn-docker-coordination/src/network-manager.ts +377 -0
  240. package/claude-assets/skills/cfn-docker-coordination/src/types.ts +412 -0
  241. package/claude-assets/skills/cfn-docker-coordination/src/volume-manager.ts +389 -0
  242. package/claude-assets/skills/cfn-docker-coordination/tests/agent-container.test.ts +379 -0
  243. package/claude-assets/skills/cfn-docker-coordination/tests/docker-client.test.ts +345 -0
  244. package/claude-assets/skills/cfn-docker-coordination/tests/health-checker.test.ts +535 -0
  245. package/claude-assets/skills/cfn-docker-coordination/tests/integration.test.ts +193 -0
  246. package/claude-assets/skills/cfn-docker-coordination/tests/network-manager.test.ts +352 -0
  247. package/claude-assets/skills/cfn-docker-coordination/tests/setup.ts +36 -0
  248. package/claude-assets/skills/cfn-docker-coordination/tsconfig.json +29 -0
  249. package/claude-assets/skills/cfn-docker-logging/INTEGRATION.md +268 -0
  250. package/claude-assets/skills/cfn-docker-logging/SAMPLE_OUTPUTS.md +237 -0
  251. package/claude-assets/skills/cfn-docker-logging/SKILL.md +442 -0
  252. package/claude-assets/skills/cfn-docker-logging/capture-container-logs.sh +120 -0
  253. package/claude-assets/skills/cfn-docker-logging/enable-logging.sh +430 -0
  254. package/claude-assets/skills/cfn-docker-logging/init-hybrid-logging.sh +210 -0
  255. package/claude-assets/skills/cfn-docker-logging/queries/analytics-summary.sh +87 -0
  256. package/claude-assets/skills/cfn-docker-logging/queries/query-agent-timeline.sh +51 -0
  257. package/claude-assets/skills/cfn-docker-logging/queries/query-consensus-history.sh +56 -0
  258. package/claude-assets/skills/cfn-docker-logging/queries/query-coordination-timeline.sh +39 -0
  259. package/claude-assets/skills/cfn-docker-logging/queries/query-failed-containers.sh +40 -0
  260. package/claude-assets/skills/cfn-docker-logging/queries/query-gate-checks.sh +39 -0
  261. package/claude-assets/skills/cfn-docker-logging/schema.sql +111 -0
  262. package/claude-assets/skills/cfn-docker-logging/sqlite-helpers.sh +240 -0
  263. package/claude-assets/skills/cfn-docker-logging/test-hybrid-logging.sh +331 -0
  264. package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  265. package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  266. package/claude-assets/skills/cfn-docker-redis-coordination/README.md +294 -0
  267. package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  268. package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  269. package/claude-assets/skills/cfn-docker-redis-coordination/package.json +40 -0
  270. package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  271. package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  272. package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  273. package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  274. package/claude-assets/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  275. package/claude-assets/skills/cfn-error-logging/.eslintrc.json +57 -0
  276. package/claude-assets/skills/cfn-error-logging/.prettierrc.json +10 -0
  277. package/claude-assets/skills/cfn-error-logging/MIGRATION_SUMMARY.md +485 -0
  278. package/claude-assets/skills/cfn-error-logging/package.json +47 -0
  279. package/claude-assets/skills/cfn-error-logging/src/error-logger.ts +1042 -0
  280. package/claude-assets/skills/cfn-error-logging/src/index.ts +12 -0
  281. package/claude-assets/skills/cfn-error-logging/src/types.ts +456 -0
  282. package/claude-assets/skills/cfn-error-logging/tests/error-logger.test.ts +1302 -0
  283. package/claude-assets/skills/cfn-error-logging/tsconfig.json +38 -0
  284. package/claude-assets/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  285. package/claude-assets/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  286. package/claude-assets/skills/cfn-loop-orchestration/README.md +149 -41
  287. package/claude-assets/skills/cfn-loop-orchestration/jest.config.js +67 -0
  288. package/claude-assets/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  289. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +91 -8
  290. package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  291. package/claude-assets/skills/cfn-loop-orchestration/package.json +49 -0
  292. package/claude-assets/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  293. package/claude-assets/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  294. package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +14 -0
  295. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  296. package/claude-assets/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  297. package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +188 -0
  298. package/claude-assets/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  299. package/claude-assets/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  300. package/claude-assets/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  301. package/claude-assets/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  302. package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  303. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  304. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  305. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  306. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  307. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  308. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  309. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  310. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  311. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  312. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  313. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  314. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  315. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  316. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  317. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  318. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  319. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  320. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  321. package/claude-assets/skills/cfn-redis-coordination/dist/index.js +114 -0
  322. package/claude-assets/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  323. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  324. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  325. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  326. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  327. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  328. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  329. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  330. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  331. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  332. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  333. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  334. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  335. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  336. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  337. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  338. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  339. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  340. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  341. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  342. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  343. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  344. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  345. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  346. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  347. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  348. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  349. package/claude-assets/skills/cfn-redis-coordination/dist/types.js +81 -0
  350. package/claude-assets/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  351. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  352. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  353. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  354. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  355. package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  356. package/claude-assets/skills/cfn-redis-coordination/jest.config.js +23 -0
  357. package/claude-assets/skills/cfn-redis-coordination/package-lock.json +5272 -0
  358. package/claude-assets/skills/cfn-redis-coordination/package.json +45 -0
  359. package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  360. package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  361. package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  362. package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  363. package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  364. package/claude-assets/skills/cfn-redis-coordination/src/index.ts +82 -0
  365. package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  366. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  367. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  368. package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  369. package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  370. package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  371. package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  372. package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  373. package/claude-assets/skills/cfn-redis-coordination/src/types.ts +235 -0
  374. package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  375. package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  376. package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  377. package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  378. package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  379. package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  380. package/claude-assets/skills/cfn-redis-coordination/tsconfig.json +31 -0
  381. package/claude-assets/skills/cfn-skill-propagation/README.md +233 -0
  382. package/claude-assets/skills/cfn-skill-propagation/package-lock.json +5174 -0
  383. package/claude-assets/skills/cfn-skill-propagation/package.json +52 -0
  384. package/claude-assets/skills/cfn-skill-propagation/propagate-skill-update.sh +32 -0
  385. package/claude-assets/skills/cfn-skill-propagation/src/cli.ts +75 -0
  386. package/claude-assets/skills/cfn-skill-propagation/src/database-adapter.ts +239 -0
  387. package/claude-assets/skills/cfn-skill-propagation/src/file-system-adapter.ts +113 -0
  388. package/claude-assets/skills/cfn-skill-propagation/src/index.ts +72 -0
  389. package/claude-assets/skills/cfn-skill-propagation/src/logger.ts +43 -0
  390. package/claude-assets/skills/cfn-skill-propagation/src/metadata-parser.ts +154 -0
  391. package/claude-assets/skills/cfn-skill-propagation/src/skill-propagator.ts +274 -0
  392. package/claude-assets/skills/cfn-skill-propagation/src/skill-validator.ts +179 -0
  393. package/claude-assets/skills/cfn-skill-propagation/src/types.ts +143 -0
  394. package/claude-assets/skills/cfn-skill-propagation/src/version-manager.ts +118 -0
  395. package/claude-assets/skills/cfn-skill-propagation/tests/file-system-adapter.test.ts +91 -0
  396. package/claude-assets/skills/cfn-skill-propagation/tests/metadata-parser.test.ts +176 -0
  397. package/claude-assets/skills/cfn-skill-propagation/tests/skill-propagator.test.ts +209 -0
  398. package/claude-assets/skills/cfn-skill-propagation/tests/skill-validator.test.ts +203 -0
  399. package/claude-assets/skills/cfn-skill-propagation/tests/version-manager.test.ts +115 -0
  400. package/claude-assets/skills/cfn-skill-propagation/tsconfig.json +34 -0
  401. package/claude-assets/skills/task-classifier/SKILL.md +81 -0
  402. package/claude-assets/skills/task-classifier/classify-task.sh +62 -0
  403. package/claude-assets/skills/workflow-codification/package-lock.json +5170 -0
  404. package/claude-assets/skills/workflow-codification/package.json +30 -0
  405. package/claude-assets/skills/workflow-codification/src/index.ts +24 -0
  406. package/claude-assets/skills/workflow-codification/src/pattern-analyzer.ts +537 -0
  407. package/claude-assets/skills/workflow-codification/src/types.ts +180 -0
  408. package/claude-assets/skills/workflow-codification/tests/pattern-analyzer.test.ts +960 -0
  409. package/claude-assets/skills/workflow-codification/tsconfig.json +34 -0
  410. package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
  411. package/dist/agent-spawner/agent-spawner.js +448 -0
  412. package/dist/agent-spawner/agent-spawner.js.map +1 -0
  413. package/dist/agent-spawner/index.js +10 -0
  414. package/dist/agent-spawner/index.js.map +1 -0
  415. package/dist/agent-spawner/types.js +14 -0
  416. package/dist/agent-spawner/types.js.map +1 -0
  417. package/dist/agents/agent-loader.js +146 -165
  418. package/dist/agents/agent-loader.js.map +1 -1
  419. package/dist/cli/agent-executor.js +47 -1
  420. package/dist/cli/agent-executor.js.map +1 -1
  421. package/dist/cli/agent-spawn.js +4 -1
  422. package/dist/cli/agent-spawn.js.map +1 -1
  423. package/dist/cli/tool-executor.js +3 -1
  424. package/dist/cli/tool-executor.js.map +1 -1
  425. package/dist/gate-checker/gate-checker.js +292 -0
  426. package/dist/gate-checker/gate-checker.js.map +1 -0
  427. package/dist/gate-checker/types.js +94 -0
  428. package/dist/gate-checker/types.js.map +1 -0
  429. package/dist/lib/database-service/connection-pool-manager.js +2 -1
  430. package/dist/lib/database-service/connection-pool-manager.js.map +1 -1
  431. package/dist/orchestrator/index.js +10 -0
  432. package/dist/orchestrator/index.js.map +1 -0
  433. package/dist/orchestrator/orchestrate.js +496 -0
  434. package/dist/orchestrator/orchestrate.js.map +1 -0
  435. package/dist/orchestrator/types.js +58 -0
  436. package/dist/orchestrator/types.js.map +1 -0
  437. package/package.json +1 -1
  438. package/scripts/switch-api.sh +142 -4
  439. package/scripts/verify-no-secrets.sh +6 -13
  440. package/tests/README.md +175 -58
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Integration Tests
3
+ * Tests requiring Docker daemon to be running
4
+ */
5
+
6
+ import { createDockerManager } from '../src/index';
7
+
8
+ describe('Docker Coordination Integration', () => {
9
+ let manager: ReturnType<typeof createDockerManager>;
10
+
11
+ beforeAll(async () => {
12
+ manager = createDockerManager();
13
+ });
14
+
15
+ describe('Docker connectivity', () => {
16
+ it('should verify Docker daemon is accessible', async () => {
17
+ const accessible = await manager.docker.isAccessible();
18
+
19
+ // Skip test if Docker is not available
20
+ if (!accessible) {
21
+ console.warn('Docker daemon not available - skipping integration tests');
22
+ return;
23
+ }
24
+
25
+ expect(accessible).toBe(true);
26
+ });
27
+
28
+ it('should get Docker version', async () => {
29
+ const accessible = await manager.docker.isAccessible();
30
+ if (!accessible) return;
31
+
32
+ const version = await manager.docker.getVersion();
33
+ expect(version).toBeDefined();
34
+ });
35
+ });
36
+
37
+ describe('Container listing', () => {
38
+ it('should list containers', async () => {
39
+ const accessible = await manager.docker.isAccessible();
40
+ if (!accessible) return;
41
+
42
+ const containers = await manager.docker.listContainers(true);
43
+ expect(Array.isArray(containers)).toBe(true);
44
+ });
45
+ });
46
+
47
+ describe('Network management', () => {
48
+ it('should verify CFN network can be created', async () => {
49
+ const accessible = await manager.docker.isAccessible();
50
+ if (!accessible) return;
51
+
52
+ const networkName = `cfn-test-${Date.now()}`;
53
+
54
+ try {
55
+ const network = await manager.networks.createNetworkIfMissing(networkName);
56
+ expect(network).toBeDefined();
57
+
58
+ // Cleanup
59
+ try {
60
+ await manager.networks.removeNetwork(network);
61
+ } catch {
62
+ // Network might not be removable in test environment
63
+ }
64
+ } catch (error) {
65
+ // Skip if network creation fails (might not have permissions)
66
+ console.warn('Network creation skipped:', error);
67
+ }
68
+ });
69
+
70
+ it('should verify network can be accessed', async () => {
71
+ const accessible = await manager.docker.isAccessible();
72
+ if (!accessible) return;
73
+
74
+ const networkName = 'cfn-network';
75
+
76
+ try {
77
+ const exists = await manager.networks.verifyNetworkExists(networkName);
78
+ // Network might not exist, but the call should work
79
+ expect(typeof exists).toBe('boolean');
80
+ } catch {
81
+ // Network check failures are expected in some environments
82
+ }
83
+ });
84
+ });
85
+
86
+ describe('Volume management', () => {
87
+ it('should list volumes', async () => {
88
+ const accessible = await manager.docker.isAccessible();
89
+ if (!accessible) return;
90
+
91
+ const volumes = await manager.volumes.listVolumes();
92
+ expect(Array.isArray(volumes)).toBe(true);
93
+ });
94
+
95
+ it('should list dangling volumes', async () => {
96
+ const accessible = await manager.docker.isAccessible();
97
+ if (!accessible) return;
98
+
99
+ const volumes = await manager.volumes.listVolumes(true);
100
+ expect(Array.isArray(volumes)).toBe(true);
101
+ });
102
+
103
+ it('should create test volume', async () => {
104
+ const accessible = await manager.docker.isAccessible();
105
+ if (!accessible) return;
106
+
107
+ const volumeName = `cfn-test-${Date.now()}`;
108
+
109
+ try {
110
+ const volume = await manager.volumes.createVolume(volumeName);
111
+ expect(volume).toBeDefined();
112
+
113
+ // Cleanup
114
+ try {
115
+ await manager.volumes.removeVolume(volume);
116
+ } catch {
117
+ // Volume might be in use
118
+ }
119
+ } catch (error) {
120
+ // Skip if volume creation fails
121
+ console.warn('Volume creation skipped:', error);
122
+ }
123
+ });
124
+ });
125
+
126
+ describe('Manager factory', () => {
127
+ it('should create manager with all components', () => {
128
+ expect(manager.docker).toBeDefined();
129
+ expect(manager.agents).toBeDefined();
130
+ expect(manager.networks).toBeDefined();
131
+ expect(manager.volumes).toBeDefined();
132
+ expect(manager.health).toBeDefined();
133
+ });
134
+
135
+ it('should have proper component types', () => {
136
+ expect(typeof manager.docker).toBe('object');
137
+ expect(typeof manager.agents).toBe('object');
138
+ expect(typeof manager.networks).toBe('object');
139
+ expect(typeof manager.volumes).toBe('object');
140
+ expect(typeof manager.health).toBe('object');
141
+ });
142
+ });
143
+
144
+ describe('Module exports', () => {
145
+ it('should export types', () => {
146
+ // Import would happen at the top level
147
+ // This just verifies the exports are available
148
+ expect(true).toBe(true);
149
+ });
150
+
151
+ it('should have proper error classes', () => {
152
+ // Error classes should be exported
153
+ expect(true).toBe(true);
154
+ });
155
+ });
156
+
157
+ describe('Environment validation', () => {
158
+ it('should handle missing Docker socket gracefully', async () => {
159
+ // Test that using custom socket path doesn't crash
160
+ const client = createDockerManager('/custom/socket.sock');
161
+ expect(client.docker).toBeDefined();
162
+ });
163
+ });
164
+
165
+ describe('Error handling', () => {
166
+ it('should throw errors with proper context', async () => {
167
+ const accessible = await manager.docker.isAccessible();
168
+ if (!accessible) return;
169
+
170
+ try {
171
+ await manager.docker.getContainer('nonexistent-container-12345');
172
+ } catch (error) {
173
+ expect(error).toBeDefined();
174
+ expect((error as any).message).toBeDefined();
175
+ }
176
+ });
177
+ });
178
+
179
+ describe('Cleanup', () => {
180
+ it('should handle cleanup operations', async () => {
181
+ const accessible = await manager.docker.isAccessible();
182
+ if (!accessible) return;
183
+
184
+ try {
185
+ // Attempt to prune dangling volumes
186
+ const result = await manager.volumes.pruneVolumes();
187
+ expect(result).toBeDefined();
188
+ } catch {
189
+ // Pruning might fail in restricted environments
190
+ }
191
+ });
192
+ });
193
+ });
@@ -0,0 +1,352 @@
1
+ /**
2
+ * Network Manager Tests
3
+ */
4
+
5
+ import { NetworkManager } from '../src/network-manager';
6
+ import { NetworkError } from '../src/types';
7
+
8
+ describe('NetworkManager', () => {
9
+ let manager: NetworkManager;
10
+
11
+ beforeEach(() => {
12
+ manager = new NetworkManager('/var/run/docker.sock');
13
+ });
14
+
15
+ describe('network names', () => {
16
+ it('should use default network name', () => {
17
+ const defaultName = 'cfn-network';
18
+ expect(defaultName).toBe('cfn-network');
19
+ });
20
+
21
+ it('should accept custom network names', () => {
22
+ const customName = 'my-custom-network';
23
+ expect(customName.length).toBeGreaterThan(0);
24
+ });
25
+
26
+ it('should validate network names are lowercase', () => {
27
+ const validNames = [
28
+ 'cfn-network',
29
+ 'cfn-backend',
30
+ 'test-network-123'
31
+ ];
32
+
33
+ validNames.forEach(name => {
34
+ expect(name).toBe(name.toLowerCase());
35
+ });
36
+ });
37
+
38
+ it('should reject network names with uppercase', () => {
39
+ const invalidName = 'CFN-NETWORK';
40
+ expect(invalidName).not.toBe(invalidName.toLowerCase());
41
+ });
42
+ });
43
+
44
+ describe('network drivers', () => {
45
+ it('should use bridge driver by default', () => {
46
+ const driver = 'bridge';
47
+ expect(driver).toBe('bridge');
48
+ });
49
+
50
+ it('should accept overlay driver', () => {
51
+ const driver = 'overlay';
52
+ expect(driver).toBe('overlay');
53
+ });
54
+
55
+ it('should accept custom drivers', () => {
56
+ const driver = 'custom-driver';
57
+ expect(driver.length).toBeGreaterThan(0);
58
+ });
59
+ });
60
+
61
+ describe('network IPAM configuration', () => {
62
+ it('should use proper subnet format', () => {
63
+ const subnet = '172.20.0.0/16';
64
+ expect(subnet).toMatch(/^\d+\.\d+\.\d+\.\d+\/\d+$/);
65
+ });
66
+
67
+ it('should use proper gateway format', () => {
68
+ const gateway = '172.20.0.1';
69
+ expect(gateway).toMatch(/^\d+\.\d+\.\d+\.\d+$/);
70
+ });
71
+
72
+ it('should support multiple subnets', () => {
73
+ const subnets = [
74
+ '172.20.0.0/16',
75
+ '172.21.0.0/16',
76
+ '172.22.0.0/16'
77
+ ];
78
+
79
+ expect(subnets.length).toBeGreaterThan(1);
80
+ subnets.forEach(subnet => {
81
+ expect(subnet).toMatch(/^\d+\.\d+\.\d+\.\d+\/\d+$/);
82
+ });
83
+ });
84
+ });
85
+
86
+ describe('network labels', () => {
87
+ it('should add CFN managed label', () => {
88
+ const labels = {
89
+ 'cfn-managed': 'true'
90
+ };
91
+
92
+ expect(labels['cfn-managed']).toBe('true');
93
+ });
94
+
95
+ it('should add network identification label', () => {
96
+ const labels = {
97
+ 'cfn-network': 'true'
98
+ };
99
+
100
+ expect(labels['cfn-network']).toBe('true');
101
+ });
102
+
103
+ it('should support custom labels', () => {
104
+ const labels = {
105
+ 'cfn-managed': 'true',
106
+ 'environment': 'dev',
107
+ 'team': 'platform'
108
+ };
109
+
110
+ expect(Object.keys(labels).length).toBe(3);
111
+ });
112
+ });
113
+
114
+ describe('network options', () => {
115
+ it('should enable IP masquerade', () => {
116
+ const option = 'com.docker.network.bridge.enable_ip_masquerade';
117
+ expect(option).toContain('docker.network');
118
+ });
119
+
120
+ it('should enable inter-container communication', () => {
121
+ const option = 'com.docker.network.bridge.enable_icc';
122
+ expect(option).toContain('docker.network');
123
+ });
124
+
125
+ it('should disable default bridge', () => {
126
+ const option = 'com.docker.network.bridge.default_bridge';
127
+ const value = 'false';
128
+ expect(value).toBe('false');
129
+ });
130
+ });
131
+
132
+ describe('network filtering', () => {
133
+ it('should filter by CFN managed label', () => {
134
+ const networks = [
135
+ { Name: 'cfn-network', Labels: { 'cfn-managed': 'true' } },
136
+ { Name: 'other-network', Labels: {} },
137
+ { Name: 'cfn-backend', Labels: { 'cfn-managed': 'true' } }
138
+ ];
139
+
140
+ const filtered = networks.filter(n =>
141
+ n.Labels?.['cfn-managed'] === 'true'
142
+ );
143
+
144
+ expect(filtered.length).toBe(2);
145
+ expect(filtered[0].Name).toBe('cfn-network');
146
+ });
147
+
148
+ it('should filter by network name pattern', () => {
149
+ const networks = [
150
+ { Name: 'cfn-network' },
151
+ { Name: 'cfn-backend' },
152
+ { Name: 'my-network' }
153
+ ];
154
+
155
+ const filtered = networks.filter(n =>
156
+ n.Name.startsWith('cfn-')
157
+ );
158
+
159
+ expect(filtered.length).toBe(2);
160
+ });
161
+ });
162
+
163
+ describe('container connection', () => {
164
+ it('should track connected containers', () => {
165
+ const containers: Record<string, object> = {
166
+ 'container-1': { Name: 'agent-1' },
167
+ 'container-2': { Name: 'agent-2' }
168
+ };
169
+
170
+ expect(Object.keys(containers).length).toBe(2);
171
+ });
172
+
173
+ it('should support custom IPv4 assignment', () => {
174
+ const ipv4 = '172.20.1.100';
175
+ expect(ipv4).toMatch(/^\d+\.\d+\.\d+\.\d+$/);
176
+ });
177
+
178
+ it('should support IPv6 if available', () => {
179
+ const ipv6 = 'fe80::42:1ff:fe00:0';
180
+ expect(ipv6).toContain(':');
181
+ });
182
+ });
183
+
184
+ describe('network info conversion', () => {
185
+ it('should convert network inspect to NetworkInfo', () => {
186
+ const mockNetwork = {
187
+ Name: 'cfn-network',
188
+ Id: 'abc123',
189
+ Driver: 'bridge',
190
+ Containers: {
191
+ 'id-1': {},
192
+ 'id-2': {}
193
+ },
194
+ IPAM: {
195
+ Config: [
196
+ { Subnet: '172.20.0.0/16', Gateway: '172.20.0.1' }
197
+ ]
198
+ }
199
+ };
200
+
201
+ const containers = Object.keys(mockNetwork.Containers);
202
+ expect(containers.length).toBe(2);
203
+ expect(mockNetwork.Name).toBe('cfn-network');
204
+ });
205
+ });
206
+
207
+ describe('network validation', () => {
208
+ it('should validate network name is not empty', () => {
209
+ const networkName = 'cfn-network';
210
+ expect(networkName.length).toBeGreaterThan(0);
211
+ });
212
+
213
+ it('should validate driver is specified', () => {
214
+ const driver = 'bridge';
215
+ expect(driver).toBeDefined();
216
+ });
217
+
218
+ it('should validate IPAM config exists', () => {
219
+ const ipam = {
220
+ Driver: 'default',
221
+ Config: [
222
+ { Subnet: '172.20.0.0/16', Gateway: '172.20.0.1' }
223
+ ]
224
+ };
225
+
226
+ expect(ipam.Config.length).toBeGreaterThan(0);
227
+ });
228
+ });
229
+
230
+ describe('network isolation', () => {
231
+ it('should use distinct subnet ranges per network', () => {
232
+ const subnets = [
233
+ '172.20.0.0/16', // Network 1
234
+ '172.21.0.0/16', // Network 2
235
+ '172.22.0.0/16' // Network 3
236
+ ];
237
+
238
+ const addresses = subnets.map(s => {
239
+ const [network] = s.split('/');
240
+ return network;
241
+ });
242
+
243
+ expect(addresses[0]).not.toBe(addresses[1]);
244
+ expect(addresses[1]).not.toBe(addresses[2]);
245
+ });
246
+
247
+ it('should isolate containers to networks', () => {
248
+ const network1Containers = ['container-1', 'container-2'];
249
+ const network2Containers = ['container-3', 'container-4'];
250
+
251
+ const allContainers = [
252
+ ...network1Containers,
253
+ ...network2Containers
254
+ ];
255
+
256
+ expect(allContainers.length).toBe(4);
257
+ expect(network1Containers).not.toEqual(network2Containers);
258
+ });
259
+ });
260
+
261
+ describe('pruning', () => {
262
+ it('should track deleted networks', () => {
263
+ const result = {
264
+ NetworksDeleted: ['network-1', 'network-2'],
265
+ SpaceReclaimed: 0
266
+ };
267
+
268
+ expect(result.NetworksDeleted.length).toBe(2);
269
+ });
270
+
271
+ it('should track space reclaimed', () => {
272
+ const result = {
273
+ NetworksDeleted: [],
274
+ SpaceReclaimed: 1024000
275
+ };
276
+
277
+ expect(result.SpaceReclaimed).toBeGreaterThanOrEqual(0);
278
+ });
279
+ });
280
+
281
+ describe('error handling', () => {
282
+ it('should throw NetworkError on creation failure', () => {
283
+ const error = new NetworkError('Failed to create network');
284
+ expect(error).toBeInstanceOf(NetworkError);
285
+ });
286
+
287
+ it('should preserve original error', () => {
288
+ const originalError = new Error('Docker error');
289
+ const networkError = new NetworkError('Wrapped', originalError);
290
+ expect(networkError.originalError).toBe(originalError);
291
+ });
292
+
293
+ it('should have NetworkError name', () => {
294
+ const error = new NetworkError('Test');
295
+ expect(error.name).toBe('NetworkError');
296
+ });
297
+ });
298
+
299
+ describe('network existence checks', () => {
300
+ it('should return true for existing network', () => {
301
+ const exists = true;
302
+ expect(exists).toBe(true);
303
+ });
304
+
305
+ it('should return false for non-existing network', () => {
306
+ const exists = false;
307
+ expect(exists).toBe(false);
308
+ });
309
+ });
310
+
311
+ describe('force disconnection', () => {
312
+ it('should support force flag for disconnect', () => {
313
+ const force = true;
314
+ expect(force).toBe(true);
315
+ });
316
+
317
+ it('should default to non-force disconnect', () => {
318
+ const force = false;
319
+ expect(force).toBe(false);
320
+ });
321
+ });
322
+
323
+ describe('network agenttype filtering', () => {
324
+ it('should search for network by agent type', () => {
325
+ const agentType = 'backend';
326
+ const networkName = `cfn-${agentType}-network`;
327
+ expect(networkName).toBe('cfn-backend-network');
328
+ });
329
+
330
+ it('should fallback to default network', () => {
331
+ const defaultNetwork = 'cfn-network';
332
+ expect(defaultNetwork).toBe('cfn-network');
333
+ });
334
+ });
335
+
336
+ describe('IP address information', () => {
337
+ it('should return subnet and gateway', () => {
338
+ const ipInfo = {
339
+ subnet: '172.20.0.0/16',
340
+ gateway: '172.20.0.1'
341
+ };
342
+
343
+ expect(ipInfo.subnet).toMatch(/\/\d+$/);
344
+ expect(ipInfo.gateway).toMatch(/^\d+\.\d+\.\d+\.\d+$/);
345
+ });
346
+
347
+ it('should return null if IPAM missing', () => {
348
+ const ipInfo = null;
349
+ expect(ipInfo).toBeNull();
350
+ });
351
+ });
352
+ });
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Jest Setup File
3
+ * Configures test environment and utilities
4
+ */
5
+
6
+ // Increase Jest timeout for Docker operations
7
+ jest.setTimeout(60_000);
8
+
9
+ // Mock Docker socket by default
10
+ process.env.DOCKER_HOST = '/var/run/docker.sock';
11
+
12
+ // Suppress console output during tests unless debugging
13
+ if (process.env.DEBUG_TESTS !== 'true') {
14
+ global.console = {
15
+ ...console,
16
+ log: jest.fn(),
17
+ debug: jest.fn(),
18
+ info: jest.fn(),
19
+ warn: jest.fn(),
20
+ error: jest.fn()
21
+ };
22
+ }
23
+
24
+ /**
25
+ * Test helper to create mock Docker response
26
+ */
27
+ export function createMockDockerResponse<T>(data: T): T {
28
+ return data;
29
+ }
30
+
31
+ /**
32
+ * Test helper to simulate async delay
33
+ */
34
+ export async function delay(ms: number): Promise<void> {
35
+ return new Promise(resolve => setTimeout(resolve, ms));
36
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "lib": ["ES2020"],
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true,
18
+ "noImplicitReturns": true,
19
+ "noFallthroughCasesInSwitch": true,
20
+ "strictNullChecks": true,
21
+ "strictFunctionTypes": true,
22
+ "strictBindCallApply": true,
23
+ "strictPropertyInitialization": true,
24
+ "alwaysStrict": true,
25
+ "allowSyntheticDefaultImports": true
26
+ },
27
+ "include": ["src/**/*"],
28
+ "exclude": ["node_modules", "dist", "tests"]
29
+ }