@claude-flow/cli 3.32.26 → 3.32.30

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 (403) hide show
  1. package/.claude/helpers/.helpers-version +1 -1
  2. package/.claude/helpers/helpers.manifest.json +2 -2
  3. package/catalog-manifest.json +4 -4
  4. package/dist/src/commands/index.d.ts +1 -0
  5. package/dist/src/commands/index.js +5 -3
  6. package/dist/src/commands/memory.js +49 -5
  7. package/dist/src/commands/metaharness.js +25 -5
  8. package/dist/src/commands/policy.d.ts +4 -0
  9. package/dist/src/commands/policy.js +107 -0
  10. package/dist/src/index.js +18 -0
  11. package/dist/src/init/claudemd-generator.js +53 -2
  12. package/dist/src/mcp-client.js +25 -1
  13. package/dist/src/mcp-tools/capability-brain.d.ts +134 -0
  14. package/dist/src/mcp-tools/capability-brain.js +697 -0
  15. package/dist/src/mcp-tools/guidance-tools.d.ts +2 -0
  16. package/dist/src/mcp-tools/guidance-tools.js +369 -37
  17. package/dist/src/mcp-tools/index.d.ts +4 -1
  18. package/dist/src/mcp-tools/index.js +3 -1
  19. package/dist/src/mcp-tools/memory-tools.js +26 -0
  20. package/dist/src/mcp-tools/metaharness-tools.js +27 -1
  21. package/dist/src/mcp-tools/policy-tools.d.ts +3 -0
  22. package/dist/src/mcp-tools/policy-tools.js +121 -0
  23. package/dist/src/memory/memory-bridge.d.ts +11 -0
  24. package/dist/src/memory/memory-bridge.js +100 -21
  25. package/dist/src/memory/memory-initializer.d.ts +22 -1
  26. package/dist/src/memory/memory-initializer.js +184 -39
  27. package/dist/src/services/bounded-worker-pool.d.ts +28 -0
  28. package/dist/src/services/bounded-worker-pool.js +90 -0
  29. package/dist/src/services/harness-flywheel-runtime.d.ts +2 -0
  30. package/dist/src/services/harness-flywheel-runtime.js +18 -0
  31. package/dist/src/services/harness-flywheel.d.ts +4 -1
  32. package/dist/src/services/harness-flywheel.js +27 -6
  33. package/dist/src/services/policy-runtime.d.ts +38 -0
  34. package/dist/src/services/policy-runtime.js +340 -0
  35. package/node_modules/@claude-flow/codex/.agents/skills/memory-management/SKILL.md +45 -0
  36. package/node_modules/@claude-flow/codex/.agents/skills/security-audit/SKILL.md +46 -0
  37. package/node_modules/@claude-flow/codex/.agents/skills/sparc-methodology/SKILL.md +46 -0
  38. package/node_modules/@claude-flow/codex/.agents/skills/swarm-orchestration/SKILL.md +53 -0
  39. package/node_modules/@claude-flow/codex/README.md +1044 -0
  40. package/node_modules/@claude-flow/codex/dist/cli.d.ts +9 -0
  41. package/node_modules/@claude-flow/codex/dist/cli.d.ts.map +1 -0
  42. package/node_modules/@claude-flow/codex/dist/cli.js +686 -0
  43. package/node_modules/@claude-flow/codex/dist/cli.js.map +1 -0
  44. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts +17 -0
  45. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts.map +1 -0
  46. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js +278 -0
  47. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js.map +1 -0
  48. package/node_modules/@claude-flow/codex/dist/dual-mode/index.d.ts +8 -0
  49. package/node_modules/@claude-flow/codex/dist/dual-mode/index.d.ts.map +1 -0
  50. package/node_modules/@claude-flow/codex/dist/dual-mode/index.js +7 -0
  51. package/node_modules/@claude-flow/codex/dist/dual-mode/index.js.map +1 -0
  52. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts +143 -0
  53. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts.map +1 -0
  54. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js +621 -0
  55. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js.map +1 -0
  56. package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts +12 -0
  57. package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts.map +1 -0
  58. package/node_modules/@claude-flow/codex/dist/generators/agents-md.js +730 -0
  59. package/node_modules/@claude-flow/codex/dist/generators/agents-md.js.map +1 -0
  60. package/node_modules/@claude-flow/codex/dist/generators/config-toml.d.ts +74 -0
  61. package/node_modules/@claude-flow/codex/dist/generators/config-toml.d.ts.map +1 -0
  62. package/node_modules/@claude-flow/codex/dist/generators/config-toml.js +922 -0
  63. package/node_modules/@claude-flow/codex/dist/generators/config-toml.js.map +1 -0
  64. package/node_modules/@claude-flow/codex/dist/generators/index.d.ts +9 -0
  65. package/node_modules/@claude-flow/codex/dist/generators/index.d.ts.map +1 -0
  66. package/node_modules/@claude-flow/codex/dist/generators/index.js +9 -0
  67. package/node_modules/@claude-flow/codex/dist/generators/index.js.map +1 -0
  68. package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts +20 -0
  69. package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts.map +1 -0
  70. package/node_modules/@claude-flow/codex/dist/generators/skill-md.js +951 -0
  71. package/node_modules/@claude-flow/codex/dist/generators/skill-md.js.map +1 -0
  72. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.d.ts +46 -0
  73. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.d.ts.map +1 -0
  74. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.js +126 -0
  75. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.js.map +1 -0
  76. package/node_modules/@claude-flow/codex/dist/harness/contract.d.ts +153 -0
  77. package/node_modules/@claude-flow/codex/dist/harness/contract.d.ts.map +1 -0
  78. package/node_modules/@claude-flow/codex/dist/harness/contract.js +44 -0
  79. package/node_modules/@claude-flow/codex/dist/harness/contract.js.map +1 -0
  80. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.d.ts +33 -0
  81. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.d.ts.map +1 -0
  82. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.js +175 -0
  83. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.js.map +1 -0
  84. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.d.ts +42 -0
  85. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.d.ts.map +1 -0
  86. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.js +140 -0
  87. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.js.map +1 -0
  88. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.d.ts +19 -0
  89. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.d.ts.map +1 -0
  90. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.js +79 -0
  91. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.js.map +1 -0
  92. package/node_modules/@claude-flow/codex/dist/harness/index.d.ts +9 -0
  93. package/node_modules/@claude-flow/codex/dist/harness/index.d.ts.map +1 -0
  94. package/node_modules/@claude-flow/codex/dist/harness/index.js +9 -0
  95. package/node_modules/@claude-flow/codex/dist/harness/index.js.map +1 -0
  96. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.d.ts +8 -0
  97. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.d.ts.map +1 -0
  98. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.js +10 -0
  99. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.js.map +1 -0
  100. package/node_modules/@claude-flow/codex/dist/harness/repository-state.d.ts +68 -0
  101. package/node_modules/@claude-flow/codex/dist/harness/repository-state.d.ts.map +1 -0
  102. package/node_modules/@claude-flow/codex/dist/harness/repository-state.js +403 -0
  103. package/node_modules/@claude-flow/codex/dist/harness/repository-state.js.map +1 -0
  104. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.d.ts +3 -0
  105. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.d.ts.map +1 -0
  106. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.js +14 -0
  107. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.js.map +1 -0
  108. package/node_modules/@claude-flow/codex/dist/index.d.ts +53 -0
  109. package/node_modules/@claude-flow/codex/dist/index.d.ts.map +1 -0
  110. package/node_modules/@claude-flow/codex/dist/index.js +54 -0
  111. package/node_modules/@claude-flow/codex/dist/index.js.map +1 -0
  112. package/node_modules/@claude-flow/codex/dist/initializer.d.ts +98 -0
  113. package/node_modules/@claude-flow/codex/dist/initializer.d.ts.map +1 -0
  114. package/node_modules/@claude-flow/codex/dist/initializer.js +795 -0
  115. package/node_modules/@claude-flow/codex/dist/initializer.js.map +1 -0
  116. package/node_modules/@claude-flow/codex/dist/loop/cli.d.ts +3 -0
  117. package/node_modules/@claude-flow/codex/dist/loop/cli.d.ts.map +1 -0
  118. package/node_modules/@claude-flow/codex/dist/loop/cli.js +123 -0
  119. package/node_modules/@claude-flow/codex/dist/loop/cli.js.map +1 -0
  120. package/node_modules/@claude-flow/codex/dist/loop/index.d.ts +58 -0
  121. package/node_modules/@claude-flow/codex/dist/loop/index.d.ts.map +1 -0
  122. package/node_modules/@claude-flow/codex/dist/loop/index.js +230 -0
  123. package/node_modules/@claude-flow/codex/dist/loop/index.js.map +1 -0
  124. package/node_modules/@claude-flow/codex/dist/mcp-config.d.ts +28 -0
  125. package/node_modules/@claude-flow/codex/dist/mcp-config.d.ts.map +1 -0
  126. package/node_modules/@claude-flow/codex/dist/mcp-config.js +121 -0
  127. package/node_modules/@claude-flow/codex/dist/mcp-config.js.map +1 -0
  128. package/node_modules/@claude-flow/codex/dist/migrations/index.d.ts +114 -0
  129. package/node_modules/@claude-flow/codex/dist/migrations/index.d.ts.map +1 -0
  130. package/node_modules/@claude-flow/codex/dist/migrations/index.js +880 -0
  131. package/node_modules/@claude-flow/codex/dist/migrations/index.js.map +1 -0
  132. package/node_modules/@claude-flow/codex/dist/templates/index.d.ts +92 -0
  133. package/node_modules/@claude-flow/codex/dist/templates/index.d.ts.map +1 -0
  134. package/node_modules/@claude-flow/codex/dist/templates/index.js +284 -0
  135. package/node_modules/@claude-flow/codex/dist/templates/index.js.map +1 -0
  136. package/node_modules/@claude-flow/codex/dist/types.d.ts +240 -0
  137. package/node_modules/@claude-flow/codex/dist/types.d.ts.map +1 -0
  138. package/node_modules/@claude-flow/codex/dist/types.js +8 -0
  139. package/node_modules/@claude-flow/codex/dist/types.js.map +1 -0
  140. package/node_modules/@claude-flow/codex/dist/validators/index.d.ts +42 -0
  141. package/node_modules/@claude-flow/codex/dist/validators/index.d.ts.map +1 -0
  142. package/node_modules/@claude-flow/codex/dist/validators/index.js +929 -0
  143. package/node_modules/@claude-flow/codex/dist/validators/index.js.map +1 -0
  144. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.d.ts +37 -0
  145. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.d.ts.map +1 -0
  146. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.js +137 -0
  147. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.js.map +1 -0
  148. package/node_modules/@claude-flow/codex/dist/worktrees/index.d.ts +2 -0
  149. package/node_modules/@claude-flow/codex/dist/worktrees/index.d.ts.map +1 -0
  150. package/node_modules/@claude-flow/codex/dist/worktrees/index.js +2 -0
  151. package/node_modules/@claude-flow/codex/dist/worktrees/index.js.map +1 -0
  152. package/node_modules/@claude-flow/codex/package.json +122 -0
  153. package/node_modules/@claude-flow/plugin-agent-federation/README.md +49 -0
  154. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.d.ts +130 -0
  155. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.d.ts.map +1 -0
  156. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.js +239 -0
  157. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.js.map +1 -0
  158. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.d.ts +34 -0
  159. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.d.ts.map +1 -0
  160. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.js +69 -0
  161. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.js.map +1 -0
  162. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.d.ts +46 -0
  163. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.d.ts.map +1 -0
  164. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.js +84 -0
  165. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.js.map +1 -0
  166. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.d.ts +27 -0
  167. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.d.ts.map +1 -0
  168. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.js +46 -0
  169. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.js.map +1 -0
  170. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.d.ts +192 -0
  171. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.d.ts.map +1 -0
  172. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.js +253 -0
  173. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.js.map +1 -0
  174. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.d.ts +211 -0
  175. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.d.ts.map +1 -0
  176. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js +501 -0
  177. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js.map +1 -0
  178. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.d.ts +114 -0
  179. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.d.ts.map +1 -0
  180. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.js +356 -0
  181. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.js.map +1 -0
  182. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts +41 -0
  183. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts.map +1 -0
  184. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js +184 -0
  185. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js.map +1 -0
  186. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.d.ts +150 -0
  187. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.d.ts.map +1 -0
  188. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.js +128 -0
  189. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.js.map +1 -0
  190. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.d.ts +74 -0
  191. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.d.ts.map +1 -0
  192. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.js +179 -0
  193. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.js.map +1 -0
  194. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.d.ts +13 -0
  195. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.d.ts.map +1 -0
  196. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +189 -0
  197. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js.map +1 -0
  198. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.d.ts +7 -0
  199. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.d.ts.map +1 -0
  200. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.js +317 -0
  201. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.js.map +1 -0
  202. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.d.ts +45 -0
  203. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.d.ts.map +1 -0
  204. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.js +71 -0
  205. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.js.map +1 -0
  206. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.d.ts +104 -0
  207. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.d.ts.map +1 -0
  208. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.js +152 -0
  209. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.js.map +1 -0
  210. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.d.ts +55 -0
  211. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.d.ts.map +1 -0
  212. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.js +105 -0
  213. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.js.map +1 -0
  214. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.d.ts +17 -0
  215. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.d.ts.map +1 -0
  216. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.js +35 -0
  217. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.js.map +1 -0
  218. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.d.ts +69 -0
  219. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.d.ts.map +1 -0
  220. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.js +149 -0
  221. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.js.map +1 -0
  222. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.d.ts +68 -0
  223. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.d.ts.map +1 -0
  224. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.js +161 -0
  225. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.js.map +1 -0
  226. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.d.ts +58 -0
  227. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.d.ts.map +1 -0
  228. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.js +122 -0
  229. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.js.map +1 -0
  230. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.d.ts +65 -0
  231. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.d.ts.map +1 -0
  232. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.js +208 -0
  233. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.js.map +1 -0
  234. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts +51 -0
  235. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts.map +1 -0
  236. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js +147 -0
  237. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js.map +1 -0
  238. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.d.ts +71 -0
  239. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.d.ts.map +1 -0
  240. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.js +194 -0
  241. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.js.map +1 -0
  242. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.d.ts +156 -0
  243. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.d.ts.map +1 -0
  244. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.js +292 -0
  245. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.js.map +1 -0
  246. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.d.ts +98 -0
  247. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.d.ts.map +1 -0
  248. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.js +122 -0
  249. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.js.map +1 -0
  250. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.d.ts +89 -0
  251. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.d.ts.map +1 -0
  252. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.js +165 -0
  253. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.js.map +1 -0
  254. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.d.ts +92 -0
  255. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.d.ts.map +1 -0
  256. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.js +100 -0
  257. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.js.map +1 -0
  258. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.d.ts +70 -0
  259. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.d.ts.map +1 -0
  260. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.js +104 -0
  261. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.js.map +1 -0
  262. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.d.ts +23 -0
  263. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.d.ts.map +1 -0
  264. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.js +24 -0
  265. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.js.map +1 -0
  266. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.d.ts +10 -0
  267. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.d.ts.map +1 -0
  268. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.js +439 -0
  269. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.js.map +1 -0
  270. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts +19 -0
  271. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts.map +1 -0
  272. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js +515 -0
  273. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js.map +1 -0
  274. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.d.ts +72 -0
  275. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.d.ts.map +1 -0
  276. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.js +269 -0
  277. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.js.map +1 -0
  278. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.d.ts +3 -0
  279. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.d.ts.map +1 -0
  280. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.js +3 -0
  281. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.js.map +1 -0
  282. package/node_modules/@claude-flow/plugin-agent-federation/package.json +64 -0
  283. package/node_modules/@claude-flow/security/README.md +292 -0
  284. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.d.ts +97 -0
  285. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.d.ts.map +1 -0
  286. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.js +537 -0
  287. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.js.map +1 -0
  288. package/node_modules/@claude-flow/security/dist/application/index.d.ts +7 -0
  289. package/node_modules/@claude-flow/security/dist/application/index.d.ts.map +1 -0
  290. package/node_modules/@claude-flow/security/dist/application/index.js +7 -0
  291. package/node_modules/@claude-flow/security/dist/application/index.js.map +1 -0
  292. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.d.ts +71 -0
  293. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.d.ts.map +1 -0
  294. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.js +153 -0
  295. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.js.map +1 -0
  296. package/node_modules/@claude-flow/security/dist/authorization/propagator.d.ts +148 -0
  297. package/node_modules/@claude-flow/security/dist/authorization/propagator.d.ts.map +1 -0
  298. package/node_modules/@claude-flow/security/dist/authorization/propagator.js +182 -0
  299. package/node_modules/@claude-flow/security/dist/authorization/propagator.js.map +1 -0
  300. package/node_modules/@claude-flow/security/dist/credential-generator.d.ts +176 -0
  301. package/node_modules/@claude-flow/security/dist/credential-generator.d.ts.map +1 -0
  302. package/node_modules/@claude-flow/security/dist/credential-generator.js +272 -0
  303. package/node_modules/@claude-flow/security/dist/credential-generator.js.map +1 -0
  304. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.d.ts +68 -0
  305. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.d.ts.map +1 -0
  306. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.js +132 -0
  307. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.js.map +1 -0
  308. package/node_modules/@claude-flow/security/dist/domain/index.d.ts +8 -0
  309. package/node_modules/@claude-flow/security/dist/domain/index.d.ts.map +1 -0
  310. package/node_modules/@claude-flow/security/dist/domain/index.js +8 -0
  311. package/node_modules/@claude-flow/security/dist/domain/index.js.map +1 -0
  312. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.d.ts +71 -0
  313. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.d.ts.map +1 -0
  314. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.js +237 -0
  315. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.js.map +1 -0
  316. package/node_modules/@claude-flow/security/dist/index.d.ts +129 -0
  317. package/node_modules/@claude-flow/security/dist/index.d.ts.map +1 -0
  318. package/node_modules/@claude-flow/security/dist/index.js +176 -0
  319. package/node_modules/@claude-flow/security/dist/index.js.map +1 -0
  320. package/node_modules/@claude-flow/security/dist/input-validator.d.ts +306 -0
  321. package/node_modules/@claude-flow/security/dist/input-validator.d.ts.map +1 -0
  322. package/node_modules/@claude-flow/security/dist/input-validator.js +393 -0
  323. package/node_modules/@claude-flow/security/dist/input-validator.js.map +1 -0
  324. package/node_modules/@claude-flow/security/dist/keychain-adapter.d.ts +48 -0
  325. package/node_modules/@claude-flow/security/dist/keychain-adapter.d.ts.map +1 -0
  326. package/node_modules/@claude-flow/security/dist/keychain-adapter.js +0 -0
  327. package/node_modules/@claude-flow/security/dist/keychain-adapter.js.map +1 -0
  328. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.d.ts +133 -0
  329. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.d.ts.map +1 -0
  330. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.js +254 -0
  331. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.js.map +1 -0
  332. package/node_modules/@claude-flow/security/dist/oauth/browser.d.ts +31 -0
  333. package/node_modules/@claude-flow/security/dist/oauth/browser.d.ts.map +1 -0
  334. package/node_modules/@claude-flow/security/dist/oauth/browser.js +55 -0
  335. package/node_modules/@claude-flow/security/dist/oauth/browser.js.map +1 -0
  336. package/node_modules/@claude-flow/security/dist/oauth/callback-server.d.ts +37 -0
  337. package/node_modules/@claude-flow/security/dist/oauth/callback-server.d.ts.map +1 -0
  338. package/node_modules/@claude-flow/security/dist/oauth/callback-server.js +86 -0
  339. package/node_modules/@claude-flow/security/dist/oauth/callback-server.js.map +1 -0
  340. package/node_modules/@claude-flow/security/dist/oauth/client.d.ts +57 -0
  341. package/node_modules/@claude-flow/security/dist/oauth/client.d.ts.map +1 -0
  342. package/node_modules/@claude-flow/security/dist/oauth/client.js +120 -0
  343. package/node_modules/@claude-flow/security/dist/oauth/client.js.map +1 -0
  344. package/node_modules/@claude-flow/security/dist/oauth/pkce.d.ts +25 -0
  345. package/node_modules/@claude-flow/security/dist/oauth/pkce.d.ts.map +1 -0
  346. package/node_modules/@claude-flow/security/dist/oauth/pkce.js +36 -0
  347. package/node_modules/@claude-flow/security/dist/oauth/pkce.js.map +1 -0
  348. package/node_modules/@claude-flow/security/dist/password-hasher.d.ts +128 -0
  349. package/node_modules/@claude-flow/security/dist/password-hasher.d.ts.map +1 -0
  350. package/node_modules/@claude-flow/security/dist/password-hasher.js +190 -0
  351. package/node_modules/@claude-flow/security/dist/password-hasher.js.map +1 -0
  352. package/node_modules/@claude-flow/security/dist/path-validator.d.ts +148 -0
  353. package/node_modules/@claude-flow/security/dist/path-validator.d.ts.map +1 -0
  354. package/node_modules/@claude-flow/security/dist/path-validator.js +421 -0
  355. package/node_modules/@claude-flow/security/dist/path-validator.js.map +1 -0
  356. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts +125 -0
  357. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts.map +1 -0
  358. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js +186 -0
  359. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js.map +1 -0
  360. package/node_modules/@claude-flow/security/dist/policy/canonical.d.ts +5 -0
  361. package/node_modules/@claude-flow/security/dist/policy/canonical.d.ts.map +1 -0
  362. package/node_modules/@claude-flow/security/dist/policy/canonical.js +30 -0
  363. package/node_modules/@claude-flow/security/dist/policy/canonical.js.map +1 -0
  364. package/node_modules/@claude-flow/security/dist/policy/engine.d.ts +34 -0
  365. package/node_modules/@claude-flow/security/dist/policy/engine.d.ts.map +1 -0
  366. package/node_modules/@claude-flow/security/dist/policy/engine.js +285 -0
  367. package/node_modules/@claude-flow/security/dist/policy/engine.js.map +1 -0
  368. package/node_modules/@claude-flow/security/dist/policy/envelope.d.ts +9 -0
  369. package/node_modules/@claude-flow/security/dist/policy/envelope.d.ts.map +1 -0
  370. package/node_modules/@claude-flow/security/dist/policy/envelope.js +90 -0
  371. package/node_modules/@claude-flow/security/dist/policy/envelope.js.map +1 -0
  372. package/node_modules/@claude-flow/security/dist/policy/evaluator.d.ts +4 -0
  373. package/node_modules/@claude-flow/security/dist/policy/evaluator.d.ts.map +1 -0
  374. package/node_modules/@claude-flow/security/dist/policy/evaluator.js +119 -0
  375. package/node_modules/@claude-flow/security/dist/policy/evaluator.js.map +1 -0
  376. package/node_modules/@claude-flow/security/dist/policy/index.d.ts +7 -0
  377. package/node_modules/@claude-flow/security/dist/policy/index.d.ts.map +1 -0
  378. package/node_modules/@claude-flow/security/dist/policy/index.js +7 -0
  379. package/node_modules/@claude-flow/security/dist/policy/index.js.map +1 -0
  380. package/node_modules/@claude-flow/security/dist/policy/product-plane.d.ts +238 -0
  381. package/node_modules/@claude-flow/security/dist/policy/product-plane.d.ts.map +1 -0
  382. package/node_modules/@claude-flow/security/dist/policy/product-plane.js +1022 -0
  383. package/node_modules/@claude-flow/security/dist/policy/product-plane.js.map +1 -0
  384. package/node_modules/@claude-flow/security/dist/policy/types.d.ts +169 -0
  385. package/node_modules/@claude-flow/security/dist/policy/types.d.ts.map +1 -0
  386. package/node_modules/@claude-flow/security/dist/policy/types.js +2 -0
  387. package/node_modules/@claude-flow/security/dist/policy/types.js.map +1 -0
  388. package/node_modules/@claude-flow/security/dist/safe-executor.d.ts +180 -0
  389. package/node_modules/@claude-flow/security/dist/safe-executor.d.ts.map +1 -0
  390. package/node_modules/@claude-flow/security/dist/safe-executor.js +390 -0
  391. package/node_modules/@claude-flow/security/dist/safe-executor.js.map +1 -0
  392. package/node_modules/@claude-flow/security/dist/token-generator.d.ts +224 -0
  393. package/node_modules/@claude-flow/security/dist/token-generator.d.ts.map +1 -0
  394. package/node_modules/@claude-flow/security/dist/token-generator.js +351 -0
  395. package/node_modules/@claude-flow/security/dist/token-generator.js.map +1 -0
  396. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.d.ts +126 -0
  397. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.d.ts.map +1 -0
  398. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.js +257 -0
  399. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.js.map +1 -0
  400. package/node_modules/@claude-flow/security/package.json +44 -0
  401. package/package.json +44 -12
  402. package/plugins/ruflo-metaharness/scripts/smoke.sh +22 -14
  403. package/plugins/ruflo-metaharness/scripts/test-mcp-tools.mjs +3 -1
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Federation peer state machine (ADR-097 Phase 2).
3
+ *
4
+ * Phase 1 shipped the budget envelope + enforcer that travels with every
5
+ * outbound message. Phase 2 adds the per-peer breaker: when a peer crosses a
6
+ * cost or failure threshold, transition it to SUSPENDED so subsequent
7
+ * `federation_send` calls short-circuit. After a cooldown the peer can
8
+ * recover; if it stays bad the breaker escalates to EVICTED.
9
+ *
10
+ * This module is the *value object* layer — pure, no I/O. The breaker
11
+ * service (Phase 2.b, separate file) reads cost-tracker telemetry, evaluates
12
+ * thresholds, and calls `transition` on the FederationNode entity. Decoupling
13
+ * the state machine from the policy lets tests pin transitions without
14
+ * standing up the cost bus.
15
+ *
16
+ * Security invariants pinned by the spec:
17
+ *
18
+ * 1. EVICTED is terminal under normal flow. The only way out is an
19
+ * explicit `reactivate` call (operator-initiated). This prevents a
20
+ * misbehaving peer from auto-recovering through the cooldown.
21
+ * 2. canTransition is the single source of truth for legality. Any path
22
+ * that mutates state MUST consult it; direct field writes are not
23
+ * permitted (entity getter/setter shape enforces this).
24
+ * 3. Reasons are constant strings, no remaining-budget echo on failure
25
+ * (matches Phase 1's anti-oracle posture).
26
+ * 4. Default cooldown is conservative (30 min) so a transient spike
27
+ * cannot ping-pong a peer ACTIVE↔SUSPENDED at high frequency.
28
+ */
29
+ /** Lifecycle state of a federation peer. */
30
+ export var FederationNodeState;
31
+ (function (FederationNodeState) {
32
+ /** Default; healthy. `federation_send` accepts deliveries. */
33
+ FederationNodeState["ACTIVE"] = "ACTIVE";
34
+ /** Breaker tripped. Sends short-circuit with PEER_SUSPENDED. */
35
+ FederationNodeState["SUSPENDED"] = "SUSPENDED";
36
+ /** Removed from active rotation. Sends short-circuit with PEER_EVICTED. */
37
+ FederationNodeState["EVICTED"] = "EVICTED";
38
+ })(FederationNodeState || (FederationNodeState = {}));
39
+ /**
40
+ * Default cooldown a SUSPENDED peer must wait before being eligible for
41
+ * SUSPENDED → ACTIVE. 30 minutes matches the ADR-097 Part 2 spec and is
42
+ * intentionally well past the prompt-cache window so a recovery probe is
43
+ * cheap to amortize.
44
+ */
45
+ export const DEFAULT_SUSPENSION_COOLDOWN_MS = 30 * 60 * 1000;
46
+ /**
47
+ * Default age at which a continuously-SUSPENDED peer is auto-escalated to
48
+ * EVICTED. 24 hours per spec — long enough to ride out a cost-tracker
49
+ * outage without false eviction, short enough that a genuinely-broken peer
50
+ * doesn't linger forever.
51
+ */
52
+ export const DEFAULT_AUTO_EVICTION_AGE_MS = 24 * 60 * 60 * 1000;
53
+ /**
54
+ * Static legality table for state transitions. Returns true iff the
55
+ * `from -> to` edge is in the allowed set. Used by the entity to reject
56
+ * illegal mutations before applying them.
57
+ *
58
+ * Allowed edges:
59
+ * ACTIVE → SUSPENDED (breaker trips)
60
+ * SUSPENDED → ACTIVE (cooldown + probe success)
61
+ * SUSPENDED → EVICTED (grace expired, or manual evict)
62
+ * ACTIVE → EVICTED (manual evict only — skips suspend)
63
+ * EVICTED → ACTIVE (manual reactivate only)
64
+ *
65
+ * Disallowed (anything else, including self-loops, is a no-op error).
66
+ */
67
+ export function canTransition(from, to) {
68
+ if (from === to)
69
+ return false;
70
+ if (from === FederationNodeState.ACTIVE) {
71
+ return to === FederationNodeState.SUSPENDED || to === FederationNodeState.EVICTED;
72
+ }
73
+ if (from === FederationNodeState.SUSPENDED) {
74
+ return to === FederationNodeState.ACTIVE || to === FederationNodeState.EVICTED;
75
+ }
76
+ // EVICTED is terminal except for explicit operator reactivate.
77
+ return to === FederationNodeState.ACTIVE;
78
+ }
79
+ /**
80
+ * Should a SUSPENDED peer be eligible for SUSPENDED → ACTIVE based purely
81
+ * on elapsed time? The breaker still has to confirm health via probe before
82
+ * it actually calls reactivate; this just answers "is the cooldown done?"
83
+ *
84
+ * Pure function of (suspendedAt, now, cooldownMs) so it's trivially
85
+ * deterministic in tests.
86
+ */
87
+ export function isCooldownElapsed(suspendedAt, now, cooldownMs = DEFAULT_SUSPENSION_COOLDOWN_MS) {
88
+ return now.getTime() - suspendedAt.getTime() >= cooldownMs;
89
+ }
90
+ /**
91
+ * Should a SUSPENDED peer be auto-escalated to EVICTED based on the age of
92
+ * its suspension? Returns true once the peer has been continuously
93
+ * SUSPENDED past the configured limit (default 24h). The breaker calls
94
+ * this on each tick and, if true, issues the SUSPENDED → EVICTED
95
+ * transition with reason GRACE_PERIOD_EXPIRED.
96
+ */
97
+ export function shouldAutoEvict(suspendedAt, now, ageLimitMs = DEFAULT_AUTO_EVICTION_AGE_MS) {
98
+ return now.getTime() - suspendedAt.getTime() >= ageLimitMs;
99
+ }
100
+ //# sourceMappingURL=federation-node-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federation-node-state.js","sourceRoot":"","sources":["../../../src/domain/value-objects/federation-node-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,4CAA4C;AAC5C,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,8DAA8D;IAC9D,wCAAiB,CAAA;IACjB,gEAAgE;IAChE,8CAAuB,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ase 1 — WireGuard configuration value objects.
3
+ *
4
+ * Pure types + deterministic helpers. No I/O, no shell calls. Used by
5
+ * WgMeshService (Phase 2) and surfaced in FederationManifest (Phase 1) so
6
+ * peers can publish their WG identity inside the same Ed25519-signed
7
+ * manifest that already carries their federation identity.
8
+ */
9
+ /**
10
+ * The WG section of a FederationManifest. Optional — present only when
11
+ * the local node has opted in via `config.wgMesh: true`.
12
+ *
13
+ * - publicKey is the X25519 public key in base64 (32-byte raw → 44 chars
14
+ * including '=' padding), exactly the format `wg-quick`/`wg setconf`
15
+ * accept. Never include the private key in the manifest.
16
+ * - endpoint is `host:port` reachable on UDP. May be a hostname (resolved
17
+ * by the consumer) or an IPv4/v6 literal. The port is WireGuard's, not
18
+ * federation's WS port — usually 51820.
19
+ * - meshIP is the assigned /32 inside the federation mesh subnet
20
+ * (10.50.0.0/16 by default). Stored as `a.b.c.d/32`.
21
+ */
22
+ export interface WgManifestSection {
23
+ readonly publicKey: string;
24
+ readonly endpoint: string;
25
+ readonly meshIP: string;
26
+ }
27
+ /**
28
+ * A locally-generated WG keypair. Kept entirely off the wire — `publicKey`
29
+ * is what gets published in the manifest; `privateKey` stays on disk
30
+ * (mode 0600) and in this in-memory object.
31
+ */
32
+ export interface WgLocalKey {
33
+ readonly publicKey: string;
34
+ readonly privateKey: string;
35
+ readonly createdAt: string;
36
+ }
37
+ /**
38
+ * Default federation mesh subnet. RFC1918 private space outside the
39
+ * common LAN/k8s ranges and Tailscale's 100.64.0.0/10. Documented in
40
+ * the ADR. Birthday-collision probability stays under 1% up to ~36
41
+ * peers and under 50% at ~302 peers — within the v1 ≤50-peer target.
42
+ */
43
+ export declare const DEFAULT_MESH_SUBNET = "10.50.0.0/16";
44
+ /**
45
+ * Generate an X25519 keypair in the format WireGuard accepts.
46
+ *
47
+ * WireGuard keys are 32 raw bytes encoded base64 (44 chars with '='
48
+ * padding). Node's `generateKeyPairSync('x25519')` returns PKCS8/SPKI
49
+ * DER envelopes — we extract the trailing 32 bytes which are the raw
50
+ * key material (the DER prefix is constant for X25519).
51
+ *
52
+ * No new dependencies: Node 18+ has X25519 support in core crypto.
53
+ */
54
+ export declare function generateWgKeyPair(): WgLocalKey;
55
+ /**
56
+ * Derive a deterministic mesh IP for `nodeId` inside `subnet`.
57
+ *
58
+ * Strategy: sha256(nodeId) → top bytes interpreted as host portion of the
59
+ * subnet, clamped to avoid the network address (.0) and broadcast (.255)
60
+ * of any /24 inside the subnet. This is collision-resistant in the
61
+ * birthday-paradox sense — see ADR for thresholds.
62
+ *
63
+ * `usedIPs` (when provided) gives previously-assigned IPs in the mesh.
64
+ * If the derived IP is already taken, the function probes `nodeId + '\x00'`,
65
+ * `nodeId + '\x01'`, … until a free slot is found. Bounded to 1024 probes;
66
+ * exceeding that means the subnet is functionally exhausted and the caller
67
+ * should jump to a larger range (see ADR `10.50.0.0/12` recommendation).
68
+ */
69
+ export declare function deriveMeshIP(nodeId: string, subnet?: string, usedIPs?: ReadonlySet<string>): string;
70
+ //# sourceMappingURL=wg-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wg-config.d.ts","sourceRoot":"","sources":["../../../src/domain/value-objects/wg-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAgB9C;AAuBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAA4B,EACpC,OAAO,GAAE,WAAW,CAAC,MAAM,CAAa,GACvC,MAAM,CAsBR"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * ADR-111 Phase 1 — WireGuard configuration value objects.
3
+ *
4
+ * Pure types + deterministic helpers. No I/O, no shell calls. Used by
5
+ * WgMeshService (Phase 2) and surfaced in FederationManifest (Phase 1) so
6
+ * peers can publish their WG identity inside the same Ed25519-signed
7
+ * manifest that already carries their federation identity.
8
+ */
9
+ import { createHash, generateKeyPairSync } from 'node:crypto';
10
+ /**
11
+ * Default federation mesh subnet. RFC1918 private space outside the
12
+ * common LAN/k8s ranges and Tailscale's 100.64.0.0/10. Documented in
13
+ * the ADR. Birthday-collision probability stays under 1% up to ~36
14
+ * peers and under 50% at ~302 peers — within the v1 ≤50-peer target.
15
+ */
16
+ export const DEFAULT_MESH_SUBNET = '10.50.0.0/16';
17
+ /**
18
+ * Generate an X25519 keypair in the format WireGuard accepts.
19
+ *
20
+ * WireGuard keys are 32 raw bytes encoded base64 (44 chars with '='
21
+ * padding). Node's `generateKeyPairSync('x25519')` returns PKCS8/SPKI
22
+ * DER envelopes — we extract the trailing 32 bytes which are the raw
23
+ * key material (the DER prefix is constant for X25519).
24
+ *
25
+ * No new dependencies: Node 18+ has X25519 support in core crypto.
26
+ */
27
+ export function generateWgKeyPair() {
28
+ const { publicKey, privateKey } = generateKeyPairSync('x25519');
29
+ const privDer = privateKey.export({ format: 'der', type: 'pkcs8' });
30
+ const pubDer = publicKey.export({ format: 'der', type: 'spki' });
31
+ // The PKCS8 prefix for X25519 is 16 bytes, leaving 32 raw bytes.
32
+ // The SPKI prefix for X25519 is 12 bytes, leaving 32 raw bytes.
33
+ const privRaw = privDer.subarray(privDer.length - 32);
34
+ const pubRaw = pubDer.subarray(pubDer.length - 32);
35
+ if (privRaw.length !== 32 || pubRaw.length !== 32) {
36
+ throw new Error(`generateWgKeyPair: unexpected DER layout (priv=${privRaw.length}B pub=${pubRaw.length}B)`);
37
+ }
38
+ return {
39
+ publicKey: pubRaw.toString('base64'),
40
+ privateKey: privRaw.toString('base64'),
41
+ createdAt: new Date().toISOString(),
42
+ };
43
+ }
44
+ /**
45
+ * Parse a `a.b.c.d/M` CIDR into a numeric base + mask-prefix-length.
46
+ * Limited to IPv4 — v1 of ADR-111 is IPv4-only inside the mesh.
47
+ */
48
+ function parseCidr(cidr) {
49
+ const m = cidr.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/);
50
+ if (!m)
51
+ throw new Error(`invalid CIDR: ${cidr}`);
52
+ const [, a, b, c, d, p] = m;
53
+ const octets = [a, b, c, d].map(Number);
54
+ const prefix = Number(p);
55
+ if (octets.some(o => o < 0 || o > 255) || prefix < 0 || prefix > 32) {
56
+ throw new Error(`out-of-range CIDR: ${cidr}`);
57
+ }
58
+ const base = ((octets[0] << 24) | (octets[1] << 16) | (octets[2] << 8) | octets[3]) >>> 0;
59
+ return { base, prefix };
60
+ }
61
+ function ipToString(n) {
62
+ return `${(n >>> 24) & 0xff}.${(n >>> 16) & 0xff}.${(n >>> 8) & 0xff}.${n & 0xff}`;
63
+ }
64
+ /**
65
+ * Derive a deterministic mesh IP for `nodeId` inside `subnet`.
66
+ *
67
+ * Strategy: sha256(nodeId) → top bytes interpreted as host portion of the
68
+ * subnet, clamped to avoid the network address (.0) and broadcast (.255)
69
+ * of any /24 inside the subnet. This is collision-resistant in the
70
+ * birthday-paradox sense — see ADR for thresholds.
71
+ *
72
+ * `usedIPs` (when provided) gives previously-assigned IPs in the mesh.
73
+ * If the derived IP is already taken, the function probes `nodeId + '\x00'`,
74
+ * `nodeId + '\x01'`, … until a free slot is found. Bounded to 1024 probes;
75
+ * exceeding that means the subnet is functionally exhausted and the caller
76
+ * should jump to a larger range (see ADR `10.50.0.0/12` recommendation).
77
+ */
78
+ export function deriveMeshIP(nodeId, subnet = DEFAULT_MESH_SUBNET, usedIPs = new Set()) {
79
+ const { base, prefix } = parseCidr(subnet);
80
+ if (prefix > 30)
81
+ throw new Error(`subnet ${subnet} too small for mesh IPs`);
82
+ const hostBits = 32 - prefix;
83
+ const hostMask = hostBits >= 32 ? 0xffffffff : ((1 << hostBits) - 1) >>> 0;
84
+ const networkBase = (base & ~hostMask) >>> 0;
85
+ for (let probe = 0; probe < 1024; probe++) {
86
+ const input = probe === 0 ? nodeId : `${nodeId}\x00${probe}`;
87
+ const hash = createHash('sha256').update(input).digest();
88
+ // Use the first 4 bytes as the host portion.
89
+ const hashHost = ((hash[0] << 24) | (hash[1] << 16) | (hash[2] << 8) | hash[3]) >>> 0;
90
+ let candidate = (networkBase | (hashHost & hostMask)) >>> 0;
91
+ const lastOctet = candidate & 0xff;
92
+ // Avoid .0 (network) and .255 (broadcast) of each /24 slice. Cheap
93
+ // clamp: bump to .1 if landing on .0, or .254 if landing on .255.
94
+ if (lastOctet === 0)
95
+ candidate = (candidate | 1) >>> 0;
96
+ else if (lastOctet === 255)
97
+ candidate = (candidate & ~1) >>> 0;
98
+ const ip = `${ipToString(candidate)}/32`;
99
+ if (!usedIPs.has(ip))
100
+ return ip;
101
+ }
102
+ throw new Error(`deriveMeshIP: subnet ${subnet} exhausted after 1024 probes for ${nodeId}; jump to a wider range`);
103
+ }
104
+ //# sourceMappingURL=wg-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wg-config.js","sourceRoot":"","sources":["../../../src/domain/value-objects/wg-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgC9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,EAAE,SAAS,EAAE,UAAU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AG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,OAAO,EAAE,CAAC;IAClC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,oCAAoC,MAAM,yBAAyB,CAAC,CAAC;AACrH,CAAC"}
@@ -0,0 +1,23 @@
1
+ export { AgentFederationPlugin } from './plugin.js';
2
+ export { FederationNode, type FederationNodeProps, type FederationNodeCapabilities, type FederationNodeMetadata, type FederationNodeStateRecord } from './domain/entities/federation-node.js';
3
+ export { FederationNodeState, type SuspensionReason, type TransitionReason, canTransition, isCooldownElapsed, shouldAutoEvict, DEFAULT_SUSPENSION_COOLDOWN_MS, DEFAULT_AUTO_EVICTION_AGE_MS, } from './domain/value-objects/federation-node-state.js';
4
+ export { FederationBreakerService, evaluatePolicy, DEFAULT_BREAKER_POLICY, DEFAULT_MAX_SAMPLES_PER_PEER, type BreakerPolicy, type BreakerDecision, type SendOutcome, } from './application/federation-breaker-service.js';
5
+ export { InMemorySpendReporter, MemorySpendReporter, DEFAULT_FEDERATION_SPEND_NAMESPACE, DEFAULT_FEDERATION_SPEND_TTL_SECONDS, type SpendReporter, type MemoryStore, type MemorySpendReporterConfig, type FederationSpendEvent, } from './application/spend-reporter.js';
6
+ export { FederationSession, type FederationSessionProps, type SessionMetrics } from './domain/entities/federation-session.js';
7
+ export { FederationEnvelope, type FederationEnvelopeProps, type FederationMessageType, type PIIScanResult, type PIIScanDetection, type PIIScanAction, CONSENSUS_REQUIRED_TYPES, } from './domain/entities/federation-envelope.js';
8
+ export { TrustLevel, TRUST_TRANSITION_THRESHOLDS, CAPABILITY_GATES, isOperationAllowed, getTrustLevelLabel, type TrustTransitionThreshold, } from './domain/entities/trust-level.js';
9
+ export { PIIPipelineService, type PIIType, type PIIAction, type PIIDetection, type PIIPolicyConfig, type PIICalibration, type PIITransformResult, type PIIConfidenceThresholds, type PIIPipelineServiceDeps, } from './domain/services/pii-pipeline-service.js';
10
+ export { DiscoveryService, type DiscoveryMechanism, type FederationManifest, type DiscoveryServiceDeps, type DiscoveryConfig, } from './domain/services/discovery-service.js';
11
+ export { HandshakeService, type HandshakeChallenge, type HandshakeChallengeResponse, type HandshakeResult, type HandshakeServiceDeps, type HandshakeConfig, } from './domain/services/handshake-service.js';
12
+ export { RoutingService, type RoutingMode, type RoutingResult, type ConsensusProposal, type RoutingServiceDeps, } from './domain/services/routing-service.js';
13
+ export { AuditService, type FederationAuditEvent, type FederationAuditEventType, type AuditSeverity, type AuditCategory, type ComplianceMode, type AuditQuery, type AuditExportFormat, type AuditServiceDeps, type AuditServiceConfig, } from './domain/services/audit-service.js';
14
+ export { TrustEvaluator, type TrustScoreComponents, type TrustTransitionResult, type ImmediateDowngradeReason, type TrustEvaluatorDeps, } from './application/trust-evaluator.js';
15
+ export { FederationCoordinator, type FederationCoordinatorConfig, type FederationStatus, } from './application/federation-coordinator.js';
16
+ export { PolicyEngine, type FederationClaimType, type SecurityPolicy, type PolicyEvaluationResult, type PolicyEngineDeps, } from './application/policy-engine.js';
17
+ export { createFederationClaimChecker, type FederationAuthorizationMode, type FederationClaimChecker, type FederationClaimCheckerConfig, } from './application/claim-checker.js';
18
+ export { DEFAULT_ENVELOPE_SIGNATURE_MODE, JCS_SIGNATURE_PROTOCOL, canonicalizeEnvelopeForVerify, isLegacyEnvelopeTypeAllowed, selectEnvelopeSignatureVersion, type EnvelopeSignatureMode, type EnvelopeSignatureVersion, } from './application/inbound-dispatcher.js';
19
+ export { FEDERATION_PLUGIN_VERSION } from './version.js';
20
+ export { A2A_PROTOCOL_VERSION, A2A_WELL_KNOWN_PATH, RUFLO_FEDERATION_BINDING, RUFLO_FEDERATION_EXTENSION_URI, toAgentCard, fromAgentCard, validateAgentCard, type A2AAgentCard, type A2AAgentInterface, type A2AAgentSkill, type A2AAgentCapabilities, type A2AAgentExtension, type A2AAgentProvider, type ToAgentCardOptions, type AgentCardValidation, } from './a2a/agent-card.js';
21
+ export { startAgentCardServer, isLoopbackHost, type AgentCardServerOptions, type AgentCardServerHandle, } from './a2a/well-known.js';
22
+ export { fetchAgentCard, consumeAgentCard, resolveAgentCardUrl, type FetchAgentCardOptions, type FetchAgentCardResult, } from './a2a/consume.js';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,KAAK,sBAAsB,EAAE,KAAK,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAC9L,OAAO,EACL,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACtB,4BAA4B,EAC5B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,kCAAkC,EAClC,oCAAoC,EACpC,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,KAAK,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAC9H,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,wBAAwB,GACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,UAAU,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EACnB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAC9B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,24 @@
1
+ export { AgentFederationPlugin } from './plugin.js';
2
+ export { FederationNode } from './domain/entities/federation-node.js';
3
+ export { FederationNodeState, canTransition, isCooldownElapsed, shouldAutoEvict, DEFAULT_SUSPENSION_COOLDOWN_MS, DEFAULT_AUTO_EVICTION_AGE_MS, } from './domain/value-objects/federation-node-state.js';
4
+ export { FederationBreakerService, evaluatePolicy, DEFAULT_BREAKER_POLICY, DEFAULT_MAX_SAMPLES_PER_PEER, } from './application/federation-breaker-service.js';
5
+ export { InMemorySpendReporter, MemorySpendReporter, DEFAULT_FEDERATION_SPEND_NAMESPACE, DEFAULT_FEDERATION_SPEND_TTL_SECONDS, } from './application/spend-reporter.js';
6
+ export { FederationSession } from './domain/entities/federation-session.js';
7
+ export { FederationEnvelope, CONSENSUS_REQUIRED_TYPES, } from './domain/entities/federation-envelope.js';
8
+ export { TrustLevel, TRUST_TRANSITION_THRESHOLDS, CAPABILITY_GATES, isOperationAllowed, getTrustLevelLabel, } from './domain/entities/trust-level.js';
9
+ export { PIIPipelineService, } from './domain/services/pii-pipeline-service.js';
10
+ export { DiscoveryService, } from './domain/services/discovery-service.js';
11
+ export { HandshakeService, } from './domain/services/handshake-service.js';
12
+ export { RoutingService, } from './domain/services/routing-service.js';
13
+ export { AuditService, } from './domain/services/audit-service.js';
14
+ export { TrustEvaluator, } from './application/trust-evaluator.js';
15
+ export { FederationCoordinator, } from './application/federation-coordinator.js';
16
+ export { PolicyEngine, } from './application/policy-engine.js';
17
+ export { createFederationClaimChecker, } from './application/claim-checker.js';
18
+ export { DEFAULT_ENVELOPE_SIGNATURE_MODE, JCS_SIGNATURE_PROTOCOL, canonicalizeEnvelopeForVerify, isLegacyEnvelopeTypeAllowed, selectEnvelopeSignatureVersion, } from './application/inbound-dispatcher.js';
19
+ export { FEDERATION_PLUGIN_VERSION } from './version.js';
20
+ // A2A (Agent2Agent, Linux Foundation) Agent Card adapter — cards only.
21
+ export { A2A_PROTOCOL_VERSION, A2A_WELL_KNOWN_PATH, RUFLO_FEDERATION_BINDING, RUFLO_FEDERATION_EXTENSION_URI, toAgentCard, fromAgentCard, validateAgentCard, } from './a2a/agent-card.js';
22
+ export { startAgentCardServer, isLoopbackHost, } from './a2a/well-known.js';
23
+ export { fetchAgentCard, consumeAgentCard, resolveAgentCardUrl, } from './a2a/consume.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings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C,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,uEAAuE;AACvE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,8BAA8B,EAC9B,WAAW,EACX,aAAa,EACb,iBAAiB,GASlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,cAAc,GAGf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,GAGpB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { MCPToolDefinition } from '@claude-flow/shared/src/plugin-interface.js';
2
+ import type { PluginContext } from '@claude-flow/shared/src/plugin-interface.js';
3
+ import type { FederationCoordinator } from './application/federation-coordinator.js';
4
+ import type { WgMeshService } from './domain/services/wg-mesh-service.js';
5
+ type CoordinatorGetter = () => FederationCoordinator | null;
6
+ type ContextGetter = () => PluginContext | null;
7
+ type WgMeshGetter = () => WgMeshService | null;
8
+ export declare function createMcpTools(getCoordinator: CoordinatorGetter, getContext: ContextGetter, getWgMesh?: WgMeshGetter): MCPToolDefinition[];
9
+ export {};
10
+ //# sourceMappingURL=mcp-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tools.d.ts","sourceRoot":"","sources":["../src/mcp-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAGrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAK1E,KAAK,iBAAiB,GAAG,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC5D,KAAK,aAAa,GAAG,MAAM,aAAa,GAAG,IAAI,CAAC;AAChD,KAAK,YAAY,GAAG,MAAM,aAAa,GAAG,IAAI,CAAC;AAM/C,wBAAgB,cAAc,CAC5B,cAAc,EAAE,iBAAiB,EACjC,UAAU,EAAE,aAAa,EACzB,SAAS,GAAE,YAAyB,GACnC,iBAAiB,EAAE,CAscrB"}