@claude-flow/cli 3.32.29 → 3.32.32

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 (378) hide show
  1. package/.claude/helpers/helpers.manifest.json +2 -2
  2. package/catalog-manifest.json +2 -2
  3. package/dist/src/autopilot-state.d.ts +10 -0
  4. package/dist/src/autopilot-state.js +16 -0
  5. package/dist/src/commands/autopilot.js +10 -4
  6. package/dist/src/init/claudemd-generator.js +53 -2
  7. package/dist/src/mcp-tools/autopilot-tools.js +18 -3
  8. package/dist/src/mcp-tools/capability-brain.js +22 -22
  9. package/dist/src/mcp-tools/guidance-tools.js +1 -1
  10. package/dist/src/services/harness-flywheel-runtime.d.ts +21 -1
  11. package/dist/src/services/harness-flywheel-runtime.js +46 -24
  12. package/node_modules/@claude-flow/codex/.agents/skills/memory-management/SKILL.md +45 -0
  13. package/node_modules/@claude-flow/codex/.agents/skills/security-audit/SKILL.md +46 -0
  14. package/node_modules/@claude-flow/codex/.agents/skills/sparc-methodology/SKILL.md +46 -0
  15. package/node_modules/@claude-flow/codex/.agents/skills/swarm-orchestration/SKILL.md +53 -0
  16. package/node_modules/@claude-flow/codex/README.md +1044 -0
  17. package/node_modules/@claude-flow/codex/dist/cli.d.ts +9 -0
  18. package/node_modules/@claude-flow/codex/dist/cli.d.ts.map +1 -0
  19. package/node_modules/@claude-flow/codex/dist/cli.js +686 -0
  20. package/node_modules/@claude-flow/codex/dist/cli.js.map +1 -0
  21. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts +17 -0
  22. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts.map +1 -0
  23. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js +278 -0
  24. package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js.map +1 -0
  25. package/node_modules/@claude-flow/codex/dist/dual-mode/index.d.ts +8 -0
  26. package/node_modules/@claude-flow/codex/dist/dual-mode/index.d.ts.map +1 -0
  27. package/node_modules/@claude-flow/codex/dist/dual-mode/index.js +7 -0
  28. package/node_modules/@claude-flow/codex/dist/dual-mode/index.js.map +1 -0
  29. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts +143 -0
  30. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts.map +1 -0
  31. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js +621 -0
  32. package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js.map +1 -0
  33. package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts +12 -0
  34. package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts.map +1 -0
  35. package/node_modules/@claude-flow/codex/dist/generators/agents-md.js +730 -0
  36. package/node_modules/@claude-flow/codex/dist/generators/agents-md.js.map +1 -0
  37. package/node_modules/@claude-flow/codex/dist/generators/config-toml.d.ts +74 -0
  38. package/node_modules/@claude-flow/codex/dist/generators/config-toml.d.ts.map +1 -0
  39. package/node_modules/@claude-flow/codex/dist/generators/config-toml.js +922 -0
  40. package/node_modules/@claude-flow/codex/dist/generators/config-toml.js.map +1 -0
  41. package/node_modules/@claude-flow/codex/dist/generators/index.d.ts +9 -0
  42. package/node_modules/@claude-flow/codex/dist/generators/index.d.ts.map +1 -0
  43. package/node_modules/@claude-flow/codex/dist/generators/index.js +9 -0
  44. package/node_modules/@claude-flow/codex/dist/generators/index.js.map +1 -0
  45. package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts +20 -0
  46. package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts.map +1 -0
  47. package/node_modules/@claude-flow/codex/dist/generators/skill-md.js +951 -0
  48. package/node_modules/@claude-flow/codex/dist/generators/skill-md.js.map +1 -0
  49. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.d.ts +46 -0
  50. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.d.ts.map +1 -0
  51. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.js +126 -0
  52. package/node_modules/@claude-flow/codex/dist/harness/build-evidence.js.map +1 -0
  53. package/node_modules/@claude-flow/codex/dist/harness/contract.d.ts +153 -0
  54. package/node_modules/@claude-flow/codex/dist/harness/contract.d.ts.map +1 -0
  55. package/node_modules/@claude-flow/codex/dist/harness/contract.js +44 -0
  56. package/node_modules/@claude-flow/codex/dist/harness/contract.js.map +1 -0
  57. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.d.ts +33 -0
  58. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.d.ts.map +1 -0
  59. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.js +175 -0
  60. package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.js.map +1 -0
  61. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.d.ts +42 -0
  62. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.d.ts.map +1 -0
  63. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.js +140 -0
  64. package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.js.map +1 -0
  65. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.d.ts +19 -0
  66. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.d.ts.map +1 -0
  67. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.js +79 -0
  68. package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.js.map +1 -0
  69. package/node_modules/@claude-flow/codex/dist/harness/index.d.ts +9 -0
  70. package/node_modules/@claude-flow/codex/dist/harness/index.d.ts.map +1 -0
  71. package/node_modules/@claude-flow/codex/dist/harness/index.js +9 -0
  72. package/node_modules/@claude-flow/codex/dist/harness/index.js.map +1 -0
  73. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.d.ts +8 -0
  74. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.d.ts.map +1 -0
  75. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.js +10 -0
  76. package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.js.map +1 -0
  77. package/node_modules/@claude-flow/codex/dist/harness/repository-state.d.ts +68 -0
  78. package/node_modules/@claude-flow/codex/dist/harness/repository-state.d.ts.map +1 -0
  79. package/node_modules/@claude-flow/codex/dist/harness/repository-state.js +403 -0
  80. package/node_modules/@claude-flow/codex/dist/harness/repository-state.js.map +1 -0
  81. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.d.ts +3 -0
  82. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.d.ts.map +1 -0
  83. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.js +14 -0
  84. package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.js.map +1 -0
  85. package/node_modules/@claude-flow/codex/dist/index.d.ts +53 -0
  86. package/node_modules/@claude-flow/codex/dist/index.d.ts.map +1 -0
  87. package/node_modules/@claude-flow/codex/dist/index.js +54 -0
  88. package/node_modules/@claude-flow/codex/dist/index.js.map +1 -0
  89. package/node_modules/@claude-flow/codex/dist/initializer.d.ts +98 -0
  90. package/node_modules/@claude-flow/codex/dist/initializer.d.ts.map +1 -0
  91. package/node_modules/@claude-flow/codex/dist/initializer.js +795 -0
  92. package/node_modules/@claude-flow/codex/dist/initializer.js.map +1 -0
  93. package/node_modules/@claude-flow/codex/dist/loop/cli.d.ts +3 -0
  94. package/node_modules/@claude-flow/codex/dist/loop/cli.d.ts.map +1 -0
  95. package/node_modules/@claude-flow/codex/dist/loop/cli.js +123 -0
  96. package/node_modules/@claude-flow/codex/dist/loop/cli.js.map +1 -0
  97. package/node_modules/@claude-flow/codex/dist/loop/index.d.ts +58 -0
  98. package/node_modules/@claude-flow/codex/dist/loop/index.d.ts.map +1 -0
  99. package/node_modules/@claude-flow/codex/dist/loop/index.js +230 -0
  100. package/node_modules/@claude-flow/codex/dist/loop/index.js.map +1 -0
  101. package/node_modules/@claude-flow/codex/dist/mcp-config.d.ts +28 -0
  102. package/node_modules/@claude-flow/codex/dist/mcp-config.d.ts.map +1 -0
  103. package/node_modules/@claude-flow/codex/dist/mcp-config.js +121 -0
  104. package/node_modules/@claude-flow/codex/dist/mcp-config.js.map +1 -0
  105. package/node_modules/@claude-flow/codex/dist/migrations/index.d.ts +114 -0
  106. package/node_modules/@claude-flow/codex/dist/migrations/index.d.ts.map +1 -0
  107. package/node_modules/@claude-flow/codex/dist/migrations/index.js +880 -0
  108. package/node_modules/@claude-flow/codex/dist/migrations/index.js.map +1 -0
  109. package/node_modules/@claude-flow/codex/dist/templates/index.d.ts +92 -0
  110. package/node_modules/@claude-flow/codex/dist/templates/index.d.ts.map +1 -0
  111. package/node_modules/@claude-flow/codex/dist/templates/index.js +284 -0
  112. package/node_modules/@claude-flow/codex/dist/templates/index.js.map +1 -0
  113. package/node_modules/@claude-flow/codex/dist/types.d.ts +240 -0
  114. package/node_modules/@claude-flow/codex/dist/types.d.ts.map +1 -0
  115. package/node_modules/@claude-flow/codex/dist/types.js +8 -0
  116. package/node_modules/@claude-flow/codex/dist/types.js.map +1 -0
  117. package/node_modules/@claude-flow/codex/dist/validators/index.d.ts +42 -0
  118. package/node_modules/@claude-flow/codex/dist/validators/index.d.ts.map +1 -0
  119. package/node_modules/@claude-flow/codex/dist/validators/index.js +929 -0
  120. package/node_modules/@claude-flow/codex/dist/validators/index.js.map +1 -0
  121. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.d.ts +37 -0
  122. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.d.ts.map +1 -0
  123. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.js +137 -0
  124. package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.js.map +1 -0
  125. package/node_modules/@claude-flow/codex/dist/worktrees/index.d.ts +2 -0
  126. package/node_modules/@claude-flow/codex/dist/worktrees/index.d.ts.map +1 -0
  127. package/node_modules/@claude-flow/codex/dist/worktrees/index.js +2 -0
  128. package/node_modules/@claude-flow/codex/dist/worktrees/index.js.map +1 -0
  129. package/node_modules/@claude-flow/codex/package.json +122 -0
  130. package/node_modules/@claude-flow/plugin-agent-federation/README.md +49 -0
  131. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.d.ts +130 -0
  132. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.d.ts.map +1 -0
  133. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.js +239 -0
  134. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.js.map +1 -0
  135. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.d.ts +34 -0
  136. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.d.ts.map +1 -0
  137. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.js +69 -0
  138. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.js.map +1 -0
  139. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.d.ts +46 -0
  140. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.d.ts.map +1 -0
  141. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.js +84 -0
  142. package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.js.map +1 -0
  143. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.d.ts +27 -0
  144. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.d.ts.map +1 -0
  145. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.js +46 -0
  146. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.js.map +1 -0
  147. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.d.ts +192 -0
  148. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.d.ts.map +1 -0
  149. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.js +253 -0
  150. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.js.map +1 -0
  151. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.d.ts +211 -0
  152. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.d.ts.map +1 -0
  153. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js +501 -0
  154. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js.map +1 -0
  155. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.d.ts +114 -0
  156. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.d.ts.map +1 -0
  157. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.js +356 -0
  158. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.js.map +1 -0
  159. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts +41 -0
  160. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts.map +1 -0
  161. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js +184 -0
  162. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js.map +1 -0
  163. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.d.ts +150 -0
  164. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.d.ts.map +1 -0
  165. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.js +128 -0
  166. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.js.map +1 -0
  167. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.d.ts +74 -0
  168. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.d.ts.map +1 -0
  169. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.js +179 -0
  170. package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.js.map +1 -0
  171. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.d.ts +13 -0
  172. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.d.ts.map +1 -0
  173. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +189 -0
  174. package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js.map +1 -0
  175. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.d.ts +7 -0
  176. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.d.ts.map +1 -0
  177. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.js +317 -0
  178. package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.js.map +1 -0
  179. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.d.ts +45 -0
  180. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.d.ts.map +1 -0
  181. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.js +71 -0
  182. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.js.map +1 -0
  183. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.d.ts +104 -0
  184. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.d.ts.map +1 -0
  185. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.js +152 -0
  186. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.js.map +1 -0
  187. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.d.ts +55 -0
  188. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.d.ts.map +1 -0
  189. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.js +105 -0
  190. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.js.map +1 -0
  191. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.d.ts +17 -0
  192. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.d.ts.map +1 -0
  193. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.js +35 -0
  194. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.js.map +1 -0
  195. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.d.ts +69 -0
  196. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.d.ts.map +1 -0
  197. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.js +149 -0
  198. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.js.map +1 -0
  199. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.d.ts +68 -0
  200. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.d.ts.map +1 -0
  201. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.js +161 -0
  202. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.js.map +1 -0
  203. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.d.ts +58 -0
  204. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.d.ts.map +1 -0
  205. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.js +122 -0
  206. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.js.map +1 -0
  207. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.d.ts +65 -0
  208. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.d.ts.map +1 -0
  209. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.js +208 -0
  210. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.js.map +1 -0
  211. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts +51 -0
  212. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts.map +1 -0
  213. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js +147 -0
  214. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js.map +1 -0
  215. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.d.ts +71 -0
  216. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.d.ts.map +1 -0
  217. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.js +194 -0
  218. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.js.map +1 -0
  219. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.d.ts +156 -0
  220. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.d.ts.map +1 -0
  221. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.js +292 -0
  222. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.js.map +1 -0
  223. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.d.ts +98 -0
  224. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.d.ts.map +1 -0
  225. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.js +122 -0
  226. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.js.map +1 -0
  227. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.d.ts +89 -0
  228. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.d.ts.map +1 -0
  229. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.js +165 -0
  230. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.js.map +1 -0
  231. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.d.ts +92 -0
  232. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.d.ts.map +1 -0
  233. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.js +100 -0
  234. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.js.map +1 -0
  235. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.d.ts +70 -0
  236. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.d.ts.map +1 -0
  237. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.js +104 -0
  238. package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.js.map +1 -0
  239. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.d.ts +23 -0
  240. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.d.ts.map +1 -0
  241. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.js +24 -0
  242. package/node_modules/@claude-flow/plugin-agent-federation/dist/index.js.map +1 -0
  243. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.d.ts +10 -0
  244. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.d.ts.map +1 -0
  245. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.js +439 -0
  246. package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.js.map +1 -0
  247. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts +19 -0
  248. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts.map +1 -0
  249. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js +515 -0
  250. package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js.map +1 -0
  251. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.d.ts +72 -0
  252. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.d.ts.map +1 -0
  253. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.js +269 -0
  254. package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.js.map +1 -0
  255. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.d.ts +3 -0
  256. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.d.ts.map +1 -0
  257. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.js +3 -0
  258. package/node_modules/@claude-flow/plugin-agent-federation/dist/version.js.map +1 -0
  259. package/node_modules/@claude-flow/plugin-agent-federation/package.json +64 -0
  260. package/node_modules/@claude-flow/security/README.md +292 -0
  261. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.d.ts +97 -0
  262. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.d.ts.map +1 -0
  263. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.js +537 -0
  264. package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.js.map +1 -0
  265. package/node_modules/@claude-flow/security/dist/application/index.d.ts +7 -0
  266. package/node_modules/@claude-flow/security/dist/application/index.d.ts.map +1 -0
  267. package/node_modules/@claude-flow/security/dist/application/index.js +7 -0
  268. package/node_modules/@claude-flow/security/dist/application/index.js.map +1 -0
  269. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.d.ts +71 -0
  270. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.d.ts.map +1 -0
  271. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.js +153 -0
  272. package/node_modules/@claude-flow/security/dist/application/services/security-application-service.js.map +1 -0
  273. package/node_modules/@claude-flow/security/dist/authorization/propagator.d.ts +148 -0
  274. package/node_modules/@claude-flow/security/dist/authorization/propagator.d.ts.map +1 -0
  275. package/node_modules/@claude-flow/security/dist/authorization/propagator.js +182 -0
  276. package/node_modules/@claude-flow/security/dist/authorization/propagator.js.map +1 -0
  277. package/node_modules/@claude-flow/security/dist/credential-generator.d.ts +176 -0
  278. package/node_modules/@claude-flow/security/dist/credential-generator.d.ts.map +1 -0
  279. package/node_modules/@claude-flow/security/dist/credential-generator.js +272 -0
  280. package/node_modules/@claude-flow/security/dist/credential-generator.js.map +1 -0
  281. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.d.ts +68 -0
  282. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.d.ts.map +1 -0
  283. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.js +132 -0
  284. package/node_modules/@claude-flow/security/dist/domain/entities/security-context.js.map +1 -0
  285. package/node_modules/@claude-flow/security/dist/domain/index.d.ts +8 -0
  286. package/node_modules/@claude-flow/security/dist/domain/index.d.ts.map +1 -0
  287. package/node_modules/@claude-flow/security/dist/domain/index.js +8 -0
  288. package/node_modules/@claude-flow/security/dist/domain/index.js.map +1 -0
  289. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.d.ts +71 -0
  290. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.d.ts.map +1 -0
  291. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.js +237 -0
  292. package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.js.map +1 -0
  293. package/node_modules/@claude-flow/security/dist/index.d.ts +129 -0
  294. package/node_modules/@claude-flow/security/dist/index.d.ts.map +1 -0
  295. package/node_modules/@claude-flow/security/dist/index.js +176 -0
  296. package/node_modules/@claude-flow/security/dist/index.js.map +1 -0
  297. package/node_modules/@claude-flow/security/dist/input-validator.d.ts +306 -0
  298. package/node_modules/@claude-flow/security/dist/input-validator.d.ts.map +1 -0
  299. package/node_modules/@claude-flow/security/dist/input-validator.js +393 -0
  300. package/node_modules/@claude-flow/security/dist/input-validator.js.map +1 -0
  301. package/node_modules/@claude-flow/security/dist/keychain-adapter.d.ts +48 -0
  302. package/node_modules/@claude-flow/security/dist/keychain-adapter.d.ts.map +1 -0
  303. package/node_modules/@claude-flow/security/dist/keychain-adapter.js +0 -0
  304. package/node_modules/@claude-flow/security/dist/keychain-adapter.js.map +1 -0
  305. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.d.ts +133 -0
  306. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.d.ts.map +1 -0
  307. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.js +254 -0
  308. package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.js.map +1 -0
  309. package/node_modules/@claude-flow/security/dist/oauth/browser.d.ts +31 -0
  310. package/node_modules/@claude-flow/security/dist/oauth/browser.d.ts.map +1 -0
  311. package/node_modules/@claude-flow/security/dist/oauth/browser.js +55 -0
  312. package/node_modules/@claude-flow/security/dist/oauth/browser.js.map +1 -0
  313. package/node_modules/@claude-flow/security/dist/oauth/callback-server.d.ts +37 -0
  314. package/node_modules/@claude-flow/security/dist/oauth/callback-server.d.ts.map +1 -0
  315. package/node_modules/@claude-flow/security/dist/oauth/callback-server.js +86 -0
  316. package/node_modules/@claude-flow/security/dist/oauth/callback-server.js.map +1 -0
  317. package/node_modules/@claude-flow/security/dist/oauth/client.d.ts +57 -0
  318. package/node_modules/@claude-flow/security/dist/oauth/client.d.ts.map +1 -0
  319. package/node_modules/@claude-flow/security/dist/oauth/client.js +120 -0
  320. package/node_modules/@claude-flow/security/dist/oauth/client.js.map +1 -0
  321. package/node_modules/@claude-flow/security/dist/oauth/pkce.d.ts +25 -0
  322. package/node_modules/@claude-flow/security/dist/oauth/pkce.d.ts.map +1 -0
  323. package/node_modules/@claude-flow/security/dist/oauth/pkce.js +36 -0
  324. package/node_modules/@claude-flow/security/dist/oauth/pkce.js.map +1 -0
  325. package/node_modules/@claude-flow/security/dist/password-hasher.d.ts +128 -0
  326. package/node_modules/@claude-flow/security/dist/password-hasher.d.ts.map +1 -0
  327. package/node_modules/@claude-flow/security/dist/password-hasher.js +190 -0
  328. package/node_modules/@claude-flow/security/dist/password-hasher.js.map +1 -0
  329. package/node_modules/@claude-flow/security/dist/path-validator.d.ts +148 -0
  330. package/node_modules/@claude-flow/security/dist/path-validator.d.ts.map +1 -0
  331. package/node_modules/@claude-flow/security/dist/path-validator.js +421 -0
  332. package/node_modules/@claude-flow/security/dist/path-validator.js.map +1 -0
  333. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts +125 -0
  334. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts.map +1 -0
  335. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js +186 -0
  336. package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js.map +1 -0
  337. package/node_modules/@claude-flow/security/dist/policy/canonical.d.ts +5 -0
  338. package/node_modules/@claude-flow/security/dist/policy/canonical.d.ts.map +1 -0
  339. package/node_modules/@claude-flow/security/dist/policy/canonical.js +30 -0
  340. package/node_modules/@claude-flow/security/dist/policy/canonical.js.map +1 -0
  341. package/node_modules/@claude-flow/security/dist/policy/engine.d.ts +34 -0
  342. package/node_modules/@claude-flow/security/dist/policy/engine.d.ts.map +1 -0
  343. package/node_modules/@claude-flow/security/dist/policy/engine.js +285 -0
  344. package/node_modules/@claude-flow/security/dist/policy/engine.js.map +1 -0
  345. package/node_modules/@claude-flow/security/dist/policy/envelope.d.ts +9 -0
  346. package/node_modules/@claude-flow/security/dist/policy/envelope.d.ts.map +1 -0
  347. package/node_modules/@claude-flow/security/dist/policy/envelope.js +90 -0
  348. package/node_modules/@claude-flow/security/dist/policy/envelope.js.map +1 -0
  349. package/node_modules/@claude-flow/security/dist/policy/evaluator.d.ts +4 -0
  350. package/node_modules/@claude-flow/security/dist/policy/evaluator.d.ts.map +1 -0
  351. package/node_modules/@claude-flow/security/dist/policy/evaluator.js +119 -0
  352. package/node_modules/@claude-flow/security/dist/policy/evaluator.js.map +1 -0
  353. package/node_modules/@claude-flow/security/dist/policy/index.d.ts +7 -0
  354. package/node_modules/@claude-flow/security/dist/policy/index.d.ts.map +1 -0
  355. package/node_modules/@claude-flow/security/dist/policy/index.js +7 -0
  356. package/node_modules/@claude-flow/security/dist/policy/index.js.map +1 -0
  357. package/node_modules/@claude-flow/security/dist/policy/product-plane.d.ts +238 -0
  358. package/node_modules/@claude-flow/security/dist/policy/product-plane.d.ts.map +1 -0
  359. package/node_modules/@claude-flow/security/dist/policy/product-plane.js +1022 -0
  360. package/node_modules/@claude-flow/security/dist/policy/product-plane.js.map +1 -0
  361. package/node_modules/@claude-flow/security/dist/policy/types.d.ts +169 -0
  362. package/node_modules/@claude-flow/security/dist/policy/types.d.ts.map +1 -0
  363. package/node_modules/@claude-flow/security/dist/policy/types.js +2 -0
  364. package/node_modules/@claude-flow/security/dist/policy/types.js.map +1 -0
  365. package/node_modules/@claude-flow/security/dist/safe-executor.d.ts +180 -0
  366. package/node_modules/@claude-flow/security/dist/safe-executor.d.ts.map +1 -0
  367. package/node_modules/@claude-flow/security/dist/safe-executor.js +390 -0
  368. package/node_modules/@claude-flow/security/dist/safe-executor.js.map +1 -0
  369. package/node_modules/@claude-flow/security/dist/token-generator.d.ts +224 -0
  370. package/node_modules/@claude-flow/security/dist/token-generator.d.ts.map +1 -0
  371. package/node_modules/@claude-flow/security/dist/token-generator.js +351 -0
  372. package/node_modules/@claude-flow/security/dist/token-generator.js.map +1 -0
  373. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.d.ts +126 -0
  374. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.d.ts.map +1 -0
  375. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.js +257 -0
  376. package/node_modules/@claude-flow/security/dist/tool-output-guardrail.js.map +1 -0
  377. package/node_modules/@claude-flow/security/package.json +44 -0
  378. package/package.json +24 -8
@@ -0,0 +1,922 @@
1
+ /**
2
+ * @claude-flow/codex - config.toml Generator
3
+ *
4
+ * Generates Codex CLI configuration files in TOML format
5
+ */
6
+ import { getRufloMcpServerConfig, renderMcpServerToml } from '../mcp-config.js';
7
+ /**
8
+ * Generate a config.toml file based on the provided options
9
+ */
10
+ export async function generateConfigToml(options = {}) {
11
+ const { model = 'gpt-5.3-codex', approvalPolicy = 'on-request', sandboxMode = 'workspace-write', webSearch = 'cached', projectDocMaxBytes = 65536, features = {}, mcpServers = [], skills = [], profiles = {}, historyPersistence = 'save-all', security = {}, performance = {}, logging = {}, policy = {}, swarmAutomation = {}, } = options;
12
+ const lines = [];
13
+ // Header
14
+ lines.push('# =============================================================================');
15
+ lines.push('# Claude Flow V3 - Codex Configuration');
16
+ lines.push('# =============================================================================');
17
+ lines.push('# Generated by: @claude-flow/codex');
18
+ lines.push('# Documentation: https://github.com/ruvnet/ruflo');
19
+ lines.push('# ');
20
+ lines.push('# This file configures the Codex CLI for Claude Flow integration.');
21
+ lines.push('# Place in .agents/config.toml (project) or .codex/config.toml (user).');
22
+ lines.push('# =============================================================================');
23
+ lines.push('');
24
+ lines.push('# =============================================================================');
25
+ lines.push('# Core Settings');
26
+ lines.push('# =============================================================================');
27
+ lines.push('');
28
+ lines.push('# Model selection - the AI model to use for code generation');
29
+ lines.push('# Options: gpt-5.3-codex, gpt-4o, claude-sonnet, claude-opus');
30
+ lines.push(`model = "${model}"`);
31
+ lines.push('');
32
+ lines.push('# Approval policy determines when human approval is required');
33
+ lines.push('# - untrusted: Always require approval');
34
+ lines.push('# - on-failure: Require approval only after failures');
35
+ lines.push('# - on-request: Require approval for significant changes');
36
+ lines.push('# - never: Auto-approve all actions (use with caution)');
37
+ lines.push(`approval_policy = "${approvalPolicy}"`);
38
+ lines.push('');
39
+ lines.push('# Sandbox mode controls file system access');
40
+ lines.push('# - read-only: Can only read files, no modifications');
41
+ lines.push('# - workspace-write: Can write within workspace directory');
42
+ lines.push('# - danger-full-access: Full file system access (dangerous)');
43
+ lines.push(`sandbox_mode = "${sandboxMode}"`);
44
+ lines.push('');
45
+ lines.push('# Web search enables internet access for research');
46
+ lines.push('# - disabled: No web access');
47
+ lines.push('# - cached: Use cached results when available');
48
+ lines.push('# - live: Always fetch fresh results');
49
+ lines.push(`web_search = "${webSearch}"`);
50
+ lines.push('');
51
+ // Project Documentation
52
+ lines.push('# =============================================================================');
53
+ lines.push('# Project Documentation');
54
+ lines.push('# =============================================================================');
55
+ lines.push('');
56
+ lines.push('# Maximum bytes to read from AGENTS.md files');
57
+ lines.push(`project_doc_max_bytes = ${projectDocMaxBytes}`);
58
+ lines.push('');
59
+ lines.push('# Fallback filenames if AGENTS.md not found');
60
+ lines.push('project_doc_fallback_filenames = [');
61
+ lines.push(' "AGENTS.md",');
62
+ lines.push(' "TEAM_GUIDE.md",');
63
+ lines.push(' ".agents.md"');
64
+ lines.push(']');
65
+ lines.push('');
66
+ // All Codex root keys above must appear before the first TOML table.
67
+ lines.push('# =============================================================================');
68
+ lines.push('# Ruflo Agentic Policy Engine (ADR-324)');
69
+ lines.push('# =============================================================================');
70
+ lines.push('');
71
+ lines.push('[policy]');
72
+ lines.push('# legacy preserves existing installs; observe records would-deny decisions; enforce blocks');
73
+ lines.push(`mode = "${policy.mode ?? 'legacy'}"`);
74
+ lines.push('');
75
+ lines.push('[swarm.automation]');
76
+ lines.push('# Unattended fanout is opt-in. Interactive Codex may still delegate explicitly.');
77
+ lines.push(`enabled = ${swarmAutomation.enabled ?? false}`);
78
+ lines.push(`max_concurrent = ${swarmAutomation.maxConcurrent ?? 4}`);
79
+ lines.push(`max_writers = ${swarmAutomation.maxWriters ?? 2}`);
80
+ lines.push(`worktree_isolation = ${swarmAutomation.worktreeIsolation ?? true}`);
81
+ lines.push(`dependency_failure = "${swarmAutomation.dependencyFailure ?? 'cancel'}"`);
82
+ lines.push(`agent_timeout_seconds = ${swarmAutomation.agentTimeoutSeconds ?? 1800}`);
83
+ lines.push(`max_output_bytes = ${swarmAutomation.maxOutputBytes ?? 1048576}`);
84
+ lines.push('');
85
+ // Features
86
+ lines.push('# =============================================================================');
87
+ lines.push('# Features');
88
+ lines.push('# =============================================================================');
89
+ lines.push('');
90
+ lines.push('[features]');
91
+ lines.push('# Enable child AGENTS.md guidance');
92
+ lines.push(`child_agents_md = ${features.childAgentsMd ?? true}`);
93
+ lines.push('');
94
+ lines.push('# Cache shell environment for faster repeated commands');
95
+ lines.push(`shell_snapshot = ${features.shellSnapshot ?? true}`);
96
+ lines.push('');
97
+ lines.push('# Smart approvals based on request context');
98
+ lines.push(`request_rule = ${features.requestRule ?? true}`);
99
+ lines.push('');
100
+ lines.push('# Enable remote compaction for large histories');
101
+ lines.push(`remote_compaction = ${features.remoteCompaction ?? true}`);
102
+ lines.push('');
103
+ // MCP Servers
104
+ if (mcpServers.length > 0 || true) { // Always include claude-flow by default
105
+ lines.push('# =============================================================================');
106
+ lines.push('# MCP Servers');
107
+ lines.push('# =============================================================================');
108
+ lines.push('');
109
+ // Default claude-flow server
110
+ const hasRuflo = mcpServers.some(s => s.name === 'ruflo' || s.name === 'claude-flow');
111
+ if (!hasRuflo) {
112
+ lines.push(...generateMcpServer(getRufloMcpServerConfig()));
113
+ lines.push('');
114
+ }
115
+ for (const server of mcpServers) {
116
+ lines.push(...generateMcpServer(server));
117
+ lines.push('');
118
+ }
119
+ }
120
+ // Skills Configuration
121
+ if (skills.length > 0) {
122
+ lines.push('# =============================================================================');
123
+ lines.push('# Skills Configuration');
124
+ lines.push('# =============================================================================');
125
+ lines.push('');
126
+ for (const skill of skills) {
127
+ lines.push(...generateSkillConfig(skill));
128
+ lines.push('');
129
+ }
130
+ }
131
+ // Profiles
132
+ lines.push('# =============================================================================');
133
+ lines.push('# Profiles');
134
+ lines.push('# =============================================================================');
135
+ lines.push('');
136
+ // Default profiles
137
+ const defaultProfiles = {
138
+ dev: {
139
+ approvalPolicy: 'on-request',
140
+ sandboxMode: 'workspace-write',
141
+ webSearch: 'live',
142
+ },
143
+ safe: {
144
+ approvalPolicy: 'untrusted',
145
+ sandboxMode: 'read-only',
146
+ webSearch: 'disabled',
147
+ },
148
+ ci: {
149
+ approvalPolicy: 'never',
150
+ sandboxMode: 'workspace-write',
151
+ webSearch: 'cached',
152
+ },
153
+ ...profiles,
154
+ };
155
+ for (const [name, profile] of Object.entries(defaultProfiles)) {
156
+ lines.push(...generateProfile(name, profile));
157
+ lines.push('');
158
+ }
159
+ // History
160
+ lines.push('# =============================================================================');
161
+ lines.push('# History');
162
+ lines.push('# =============================================================================');
163
+ lines.push('');
164
+ lines.push('[history]');
165
+ lines.push('# Save all session transcripts');
166
+ lines.push(`persistence = "${historyPersistence}"`);
167
+ lines.push('');
168
+ // Shell Environment Policy
169
+ lines.push('# =============================================================================');
170
+ lines.push('# Shell Environment');
171
+ lines.push('# =============================================================================');
172
+ lines.push('');
173
+ lines.push('[shell_environment_policy]');
174
+ lines.push('# Inherit environment variables');
175
+ lines.push('inherit = "core"');
176
+ lines.push('');
177
+ lines.push('# Exclude sensitive variables');
178
+ lines.push('exclude = ["*_KEY", "*_SECRET", "*_TOKEN", "*_PASSWORD"]');
179
+ lines.push('');
180
+ // Sandbox Workspace Write Settings
181
+ lines.push('# =============================================================================');
182
+ lines.push('# Sandbox Workspace Write Settings');
183
+ lines.push('# =============================================================================');
184
+ lines.push('');
185
+ lines.push('[sandbox_workspace_write]');
186
+ lines.push('# Additional writable paths beyond workspace');
187
+ lines.push('writable_roots = []');
188
+ lines.push('');
189
+ lines.push('# Allow network access');
190
+ lines.push('network_access = true');
191
+ lines.push('');
192
+ lines.push('# Exclude temp directories');
193
+ lines.push('exclude_slash_tmp = false');
194
+ lines.push('');
195
+ // Security Settings
196
+ lines.push('# =============================================================================');
197
+ lines.push('# Security Settings');
198
+ lines.push('# =============================================================================');
199
+ lines.push('');
200
+ lines.push('[security]');
201
+ lines.push('# Enable input validation for all user inputs');
202
+ lines.push(`input_validation = ${security.inputValidation ?? true}`);
203
+ lines.push('');
204
+ lines.push('# Prevent directory traversal attacks');
205
+ lines.push(`path_traversal_prevention = ${security.pathTraversal ?? true}`);
206
+ lines.push('');
207
+ lines.push('# Scan for hardcoded secrets');
208
+ lines.push(`secret_scanning = ${security.secretScanning ?? true}`);
209
+ lines.push('');
210
+ lines.push('# Scan dependencies for known CVEs');
211
+ lines.push(`cve_scanning = ${security.cveScanning ?? true}`);
212
+ lines.push('');
213
+ lines.push('# Maximum file size for operations (bytes)');
214
+ lines.push(`max_file_size = ${security.maxFileSize ?? 10485760}`);
215
+ lines.push('');
216
+ lines.push('# Allowed file extensions (empty = allow all)');
217
+ const allowedExts = security.allowedExtensions ?? [];
218
+ if (allowedExts.length > 0) {
219
+ lines.push(`allowed_extensions = [${allowedExts.map((e) => `"${e}"`).join(', ')}]`);
220
+ }
221
+ else {
222
+ lines.push('allowed_extensions = []');
223
+ }
224
+ lines.push('');
225
+ lines.push('# Blocked file patterns (regex)');
226
+ const blockedPatterns = security.blockedPatterns ?? ['\\.env$', 'credentials\\.json$', '\\.pem$', '\\.key$'];
227
+ lines.push(`blocked_patterns = [${blockedPatterns.map((p) => `"${escapeTomlString(p)}"`).join(', ')}]`);
228
+ lines.push('');
229
+ // Performance Settings
230
+ lines.push('# =============================================================================');
231
+ lines.push('# Performance Settings');
232
+ lines.push('# =============================================================================');
233
+ lines.push('');
234
+ lines.push('[performance]');
235
+ lines.push('# Maximum concurrent agents');
236
+ lines.push(`max_agents = ${performance.maxAgents ?? 8}`);
237
+ lines.push('');
238
+ lines.push('# Task timeout in seconds');
239
+ lines.push(`task_timeout = ${performance.taskTimeout ?? 300}`);
240
+ lines.push('');
241
+ lines.push('# Memory limit per agent');
242
+ lines.push(`memory_limit = "${performance.memoryLimit ?? '512MB'}"`);
243
+ lines.push('');
244
+ lines.push('# Enable response caching');
245
+ lines.push(`cache_enabled = ${performance.cacheEnabled ?? true}`);
246
+ lines.push('');
247
+ lines.push('# Cache TTL in seconds');
248
+ lines.push(`cache_ttl = ${performance.cacheTtl ?? 3600}`);
249
+ lines.push('');
250
+ lines.push('# Enable parallel task execution');
251
+ lines.push(`parallel_execution = ${performance.parallelExecution ?? true}`);
252
+ lines.push('');
253
+ // Logging Settings
254
+ lines.push('# =============================================================================');
255
+ lines.push('# Logging Settings');
256
+ lines.push('# =============================================================================');
257
+ lines.push('');
258
+ lines.push('[logging]');
259
+ lines.push('# Log level: debug, info, warn, error');
260
+ lines.push(`level = "${logging.level ?? 'info'}"`);
261
+ lines.push('');
262
+ lines.push('# Log format: json, text, pretty');
263
+ lines.push(`format = "${logging.format ?? 'pretty'}"`);
264
+ lines.push('');
265
+ lines.push('# Log destination: stdout, file, both');
266
+ lines.push(`destination = "${logging.destination ?? 'stdout'}"`);
267
+ lines.push('');
268
+ if (logging.filePath || logging.destination === 'file' || logging.destination === 'both') {
269
+ lines.push('# Log file path');
270
+ lines.push(`file_path = "${logging.filePath ?? './logs/claude-flow.log'}"`);
271
+ lines.push('');
272
+ lines.push('# Maximum number of log files to retain');
273
+ lines.push(`max_files = ${logging.maxFiles ?? 10}`);
274
+ lines.push('');
275
+ lines.push('# Maximum size per log file');
276
+ lines.push(`max_size = "${logging.maxSize ?? '10MB'}"`);
277
+ lines.push('');
278
+ }
279
+ // Neural/Intelligence Settings
280
+ lines.push('# =============================================================================');
281
+ lines.push('# Neural Intelligence Settings');
282
+ lines.push('# =============================================================================');
283
+ lines.push('');
284
+ lines.push('[neural]');
285
+ lines.push('# Enable SONA (Self-Optimizing Neural Architecture)');
286
+ lines.push('sona_enabled = true');
287
+ lines.push('');
288
+ lines.push('# Enable HNSW vector search');
289
+ lines.push('hnsw_enabled = true');
290
+ lines.push('');
291
+ lines.push('# HNSW index parameters');
292
+ lines.push('hnsw_m = 16');
293
+ lines.push('hnsw_ef_construction = 200');
294
+ lines.push('hnsw_ef_search = 100');
295
+ lines.push('');
296
+ lines.push('# Enable pattern learning');
297
+ lines.push('pattern_learning = true');
298
+ lines.push('');
299
+ lines.push('# Learning rate for neural adaptation');
300
+ lines.push('learning_rate = 0.01');
301
+ lines.push('');
302
+ // Swarm Settings
303
+ lines.push('# =============================================================================');
304
+ lines.push('# Swarm Orchestration Settings');
305
+ lines.push('# =============================================================================');
306
+ lines.push('');
307
+ lines.push('[swarm]');
308
+ lines.push('# Default topology: hierarchical, mesh, ring, star');
309
+ lines.push('default_topology = "hierarchical"');
310
+ lines.push('');
311
+ lines.push('# Default strategy: balanced, specialized, adaptive');
312
+ lines.push('default_strategy = "specialized"');
313
+ lines.push('');
314
+ lines.push('# Consensus algorithm: raft, byzantine, gossip');
315
+ lines.push('consensus = "raft"');
316
+ lines.push('');
317
+ lines.push('# Enable anti-drift measures');
318
+ lines.push('anti_drift = true');
319
+ lines.push('');
320
+ lines.push('# Checkpoint interval (tasks)');
321
+ lines.push('checkpoint_interval = 10');
322
+ lines.push('');
323
+ // Hooks Settings
324
+ lines.push('# =============================================================================');
325
+ lines.push('# Hooks Configuration');
326
+ lines.push('# =============================================================================');
327
+ lines.push('');
328
+ lines.push('[hooks]');
329
+ lines.push('# Enable lifecycle hooks');
330
+ lines.push('enabled = true');
331
+ lines.push('');
332
+ lines.push('# Pre-task hook');
333
+ lines.push('pre_task = true');
334
+ lines.push('');
335
+ lines.push('# Post-task hook (for learning)');
336
+ lines.push('post_task = true');
337
+ lines.push('');
338
+ lines.push('# Enable neural training on post-edit');
339
+ lines.push('train_on_edit = true');
340
+ lines.push('');
341
+ // Background Workers
342
+ lines.push('# =============================================================================');
343
+ lines.push('# Background Workers');
344
+ lines.push('# =============================================================================');
345
+ lines.push('');
346
+ lines.push('[workers]');
347
+ lines.push('# Enable background workers');
348
+ lines.push('enabled = true');
349
+ lines.push('');
350
+ lines.push('# Worker configuration');
351
+ lines.push('[workers.audit]');
352
+ lines.push('enabled = true');
353
+ lines.push('priority = "critical"');
354
+ lines.push('interval = 300');
355
+ lines.push('');
356
+ lines.push('[workers.optimize]');
357
+ lines.push('enabled = true');
358
+ lines.push('priority = "high"');
359
+ lines.push('interval = 600');
360
+ lines.push('');
361
+ lines.push('[workers.consolidate]');
362
+ lines.push('enabled = true');
363
+ lines.push('priority = "low"');
364
+ lines.push('interval = 1800');
365
+ lines.push('');
366
+ return lines.join('\n');
367
+ }
368
+ /**
369
+ * Escape special characters in TOML strings
370
+ */
371
+ function escapeTomlString(str) {
372
+ return str
373
+ .replace(/\\/g, '\\\\')
374
+ .replace(/"/g, '\\"')
375
+ .replace(/\n/g, '\\n')
376
+ .replace(/\r/g, '\\r')
377
+ .replace(/\t/g, '\\t');
378
+ }
379
+ /**
380
+ * Generate MCP server configuration lines
381
+ */
382
+ function generateMcpServer(server) {
383
+ const lines = [];
384
+ lines.push(`[mcp_servers.${server.name}]`);
385
+ lines.push(`command = "${server.command}"`);
386
+ if (server.args && server.args.length > 0) {
387
+ const argsStr = server.args.map(a => `"${a}"`).join(', ');
388
+ lines.push(`args = [${argsStr}]`);
389
+ }
390
+ lines.push(`enabled = ${server.enabled ?? true}`);
391
+ if (server.toolTimeout) {
392
+ lines.push(`tool_timeout_sec = ${server.toolTimeout}`);
393
+ }
394
+ if (server.env && Object.keys(server.env).length > 0) {
395
+ lines.push('');
396
+ lines.push(`[mcp_servers.${server.name}.env]`);
397
+ for (const [key, value] of Object.entries(server.env)) {
398
+ lines.push(`${key} = "${value}"`);
399
+ }
400
+ }
401
+ return lines;
402
+ }
403
+ /**
404
+ * Generate skill configuration lines
405
+ */
406
+ function generateSkillConfig(skill) {
407
+ const lines = [];
408
+ lines.push('[[skills.config]]');
409
+ lines.push(`path = "${skill.path}"`);
410
+ lines.push(`enabled = ${skill.enabled ?? true}`);
411
+ return lines;
412
+ }
413
+ /**
414
+ * Generate profile configuration lines
415
+ */
416
+ function generateProfile(name, profile) {
417
+ const lines = [];
418
+ const comment = name === 'dev' ? 'Development profile - more permissive for local work'
419
+ : name === 'safe' ? 'Safe profile - maximum restrictions'
420
+ : name === 'ci' ? 'CI profile - for automated pipelines'
421
+ : `${name} profile`;
422
+ lines.push(`# ${comment}`);
423
+ lines.push(`[profiles.${name}]`);
424
+ if (profile.approvalPolicy) {
425
+ lines.push(`approval_policy = "${profile.approvalPolicy}"`);
426
+ }
427
+ if (profile.sandboxMode) {
428
+ lines.push(`sandbox_mode = "${profile.sandboxMode}"`);
429
+ }
430
+ if (profile.webSearch) {
431
+ lines.push(`web_search = "${profile.webSearch}"`);
432
+ }
433
+ return lines;
434
+ }
435
+ /**
436
+ * Generate minimal config.toml
437
+ */
438
+ export async function generateMinimalConfigToml(options = {}) {
439
+ const { model = 'gpt-5.3-codex', approvalPolicy = 'on-request', sandboxMode = 'workspace-write', } = options;
440
+ return `# Claude Flow V3 - Minimal Codex Configuration
441
+
442
+ model = "${model}"
443
+ approval_policy = "${approvalPolicy}"
444
+ sandbox_mode = "${sandboxMode}"
445
+
446
+ [mcp_servers.ruflo]
447
+ command = "npx"
448
+ args = ["-y", "ruflo@latest", "mcp", "start"]
449
+ enabled = true
450
+ startup_timeout_sec = 120
451
+ `;
452
+ }
453
+ /**
454
+ * Generate CI/CD config.toml
455
+ */
456
+ export async function generateCIConfigToml(platform = process.platform) {
457
+ const mcpCommand = renderMcpServerToml(getRufloMcpServerConfig(platform, 300)).join('\n');
458
+ return `# =============================================================================
459
+ # Claude Flow V3 - CI/CD Pipeline Configuration
460
+ # =============================================================================
461
+ # Optimized for automated CI/CD environments
462
+ # No interactive approvals, ephemeral history, minimal overhead
463
+ # =============================================================================
464
+
465
+ model = "gpt-5.3-codex"
466
+ approval_policy = "never"
467
+ sandbox_mode = "workspace-write"
468
+ web_search = "disabled"
469
+
470
+ # Project documentation
471
+ project_doc_max_bytes = 65536
472
+
473
+ [features]
474
+ # Disable interactive features for CI
475
+ shell_snapshot = false
476
+ remote_compaction = false
477
+ child_agents_md = true
478
+ request_rule = false
479
+
480
+ ${mcpCommand}
481
+
482
+ [history]
483
+ persistence = "none"
484
+
485
+ [shell_environment_policy]
486
+ inherit = "core"
487
+ exclude = ["*_KEY", "*_SECRET", "*_TOKEN", "*_PASSWORD", "CI_*"]
488
+
489
+ [security]
490
+ input_validation = true
491
+ path_traversal_prevention = true
492
+ secret_scanning = true
493
+ cve_scanning = true
494
+
495
+ [performance]
496
+ max_agents = 4
497
+ task_timeout = 600
498
+ cache_enabled = false
499
+ parallel_execution = true
500
+
501
+ [logging]
502
+ level = "info"
503
+ format = "json"
504
+ destination = "stdout"
505
+
506
+ [swarm]
507
+ default_topology = "hierarchical"
508
+ default_strategy = "specialized"
509
+ anti_drift = true
510
+
511
+ [hooks]
512
+ enabled = true
513
+ pre_task = true
514
+ post_task = false
515
+ train_on_edit = false
516
+ `;
517
+ }
518
+ /**
519
+ * Generate enterprise config.toml with full governance
520
+ */
521
+ export async function generateEnterpriseConfigToml() {
522
+ return `# =============================================================================
523
+ # Claude Flow V3 - Enterprise Configuration
524
+ # =============================================================================
525
+ # Full governance, audit logging, and compliance features enabled
526
+ # Suitable for enterprise environments with strict security requirements
527
+ # =============================================================================
528
+
529
+ model = "gpt-5.3-codex"
530
+ approval_policy = "on-request"
531
+ sandbox_mode = "workspace-write"
532
+ web_search = "cached"
533
+
534
+ # Project documentation
535
+ project_doc_max_bytes = 131072
536
+ project_doc_fallback_filenames = [
537
+ "AGENTS.md",
538
+ "TEAM_GUIDE.md",
539
+ ".agents.md",
540
+ "CONTRIBUTING.md"
541
+ ]
542
+
543
+ [features]
544
+ child_agents_md = true
545
+ shell_snapshot = true
546
+ request_rule = true
547
+ remote_compaction = true
548
+
549
+ # =============================================================================
550
+ # MCP Servers
551
+ # =============================================================================
552
+
553
+ [mcp_servers.ruflo]
554
+ command = "npx"
555
+ args = ["-y", "ruflo@latest", "mcp", "start"]
556
+ enabled = true
557
+ tool_timeout_sec = 120
558
+
559
+ [mcp_servers.ruflo.env]
560
+ CLAUDE_FLOW_LOG_LEVEL = "info"
561
+
562
+ # =============================================================================
563
+ # Profiles
564
+ # =============================================================================
565
+
566
+ # Development profile - more permissive for local work
567
+ [profiles.dev]
568
+ approval_policy = "never"
569
+ sandbox_mode = "danger-full-access"
570
+ web_search = "live"
571
+
572
+ # Safe profile - maximum restrictions
573
+ [profiles.safe]
574
+ approval_policy = "untrusted"
575
+ sandbox_mode = "read-only"
576
+ web_search = "disabled"
577
+
578
+ # CI profile - for automated pipelines
579
+ [profiles.ci]
580
+ approval_policy = "never"
581
+ sandbox_mode = "workspace-write"
582
+ web_search = "disabled"
583
+
584
+ # Production profile - careful changes only
585
+ [profiles.production]
586
+ approval_policy = "untrusted"
587
+ sandbox_mode = "workspace-write"
588
+ web_search = "cached"
589
+
590
+ # =============================================================================
591
+ # History
592
+ # =============================================================================
593
+
594
+ [history]
595
+ persistence = "save-all"
596
+ retention_days = 90
597
+ audit_log = true
598
+
599
+ # =============================================================================
600
+ # Shell Environment
601
+ # =============================================================================
602
+
603
+ [shell_environment_policy]
604
+ inherit = "core"
605
+ exclude = ["*_KEY", "*_SECRET", "*_TOKEN", "*_PASSWORD", "AWS_*", "AZURE_*"]
606
+
607
+ [sandbox_workspace_write]
608
+ writable_roots = []
609
+ network_access = true
610
+ exclude_slash_tmp = false
611
+
612
+ # =============================================================================
613
+ # Security (Enterprise)
614
+ # =============================================================================
615
+
616
+ [security]
617
+ input_validation = true
618
+ path_traversal_prevention = true
619
+ secret_scanning = true
620
+ cve_scanning = true
621
+ max_file_size = 10485760
622
+ blocked_patterns = ["\\\\.env$", "credentials\\\\.json$", "\\\\.pem$", "\\\\.key$", "secrets\\\\.yaml$"]
623
+
624
+ # RBAC configuration
625
+ [security.rbac]
626
+ enabled = true
627
+ default_role = "developer"
628
+
629
+ # Audit configuration
630
+ [security.audit]
631
+ enabled = true
632
+ destination = "file"
633
+ file_path = "./logs/audit.json"
634
+ retention_days = 90
635
+
636
+ # =============================================================================
637
+ # Performance
638
+ # =============================================================================
639
+
640
+ [performance]
641
+ max_agents = 8
642
+ task_timeout = 300
643
+ memory_limit = "1GB"
644
+ cache_enabled = true
645
+ cache_ttl = 3600
646
+ parallel_execution = true
647
+
648
+ # =============================================================================
649
+ # Logging (Enterprise)
650
+ # =============================================================================
651
+
652
+ [logging]
653
+ level = "info"
654
+ format = "json"
655
+ destination = "both"
656
+ file_path = "./logs/claude-flow.log"
657
+ max_files = 30
658
+ max_size = "50MB"
659
+
660
+ # =============================================================================
661
+ # Neural Intelligence
662
+ # =============================================================================
663
+
664
+ [neural]
665
+ sona_enabled = true
666
+ hnsw_enabled = true
667
+ hnsw_m = 16
668
+ hnsw_ef_construction = 200
669
+ hnsw_ef_search = 100
670
+ pattern_learning = true
671
+ learning_rate = 0.01
672
+
673
+ # =============================================================================
674
+ # Swarm Orchestration
675
+ # =============================================================================
676
+
677
+ [swarm]
678
+ default_topology = "hierarchical"
679
+ default_strategy = "specialized"
680
+ consensus = "raft"
681
+ anti_drift = true
682
+ checkpoint_interval = 10
683
+
684
+ # =============================================================================
685
+ # Hooks
686
+ # =============================================================================
687
+
688
+ [hooks]
689
+ enabled = true
690
+ pre_task = true
691
+ post_task = true
692
+ train_on_edit = true
693
+
694
+ # =============================================================================
695
+ # Background Workers
696
+ # =============================================================================
697
+
698
+ [workers]
699
+ enabled = true
700
+
701
+ [workers.audit]
702
+ enabled = true
703
+ priority = "critical"
704
+ interval = 300
705
+
706
+ [workers.optimize]
707
+ enabled = true
708
+ priority = "high"
709
+ interval = 600
710
+
711
+ [workers.consolidate]
712
+ enabled = true
713
+ priority = "low"
714
+ interval = 1800
715
+
716
+ [workers.testgaps]
717
+ enabled = true
718
+ priority = "normal"
719
+ interval = 3600
720
+
721
+ # =============================================================================
722
+ # Compliance
723
+ # =============================================================================
724
+
725
+ [compliance]
726
+ soc2 = true
727
+ gdpr = true
728
+ pci_dss = false
729
+ hipaa = false
730
+ `;
731
+ }
732
+ /**
733
+ * Generate development config.toml with permissive settings
734
+ */
735
+ export async function generateDevConfigToml() {
736
+ return `# =============================================================================
737
+ # Claude Flow V3 - Development Configuration
738
+ # =============================================================================
739
+ # Permissive settings for local development
740
+ # Auto-approve most actions, full access, live web search
741
+ # =============================================================================
742
+
743
+ model = "gpt-5.3-codex"
744
+ approval_policy = "never"
745
+ sandbox_mode = "danger-full-access"
746
+ web_search = "live"
747
+
748
+ # Project documentation
749
+ project_doc_max_bytes = 65536
750
+
751
+ [features]
752
+ child_agents_md = true
753
+ shell_snapshot = true
754
+ request_rule = false
755
+ remote_compaction = true
756
+
757
+ [mcp_servers.ruflo]
758
+ command = "npx"
759
+ args = ["-y", "ruflo@latest", "mcp", "start"]
760
+ enabled = true
761
+ tool_timeout_sec = 120
762
+
763
+ [history]
764
+ persistence = "save-all"
765
+
766
+ [shell_environment_policy]
767
+ inherit = "all"
768
+ exclude = []
769
+
770
+ [sandbox_workspace_write]
771
+ writable_roots = ["/tmp", "~/.cache"]
772
+ network_access = true
773
+ exclude_slash_tmp = false
774
+
775
+ [security]
776
+ input_validation = true
777
+ path_traversal_prevention = true
778
+ secret_scanning = true
779
+ cve_scanning = false
780
+
781
+ [performance]
782
+ max_agents = 8
783
+ task_timeout = 600
784
+ cache_enabled = true
785
+ parallel_execution = true
786
+
787
+ [logging]
788
+ level = "debug"
789
+ format = "pretty"
790
+ destination = "stdout"
791
+
792
+ [neural]
793
+ sona_enabled = true
794
+ hnsw_enabled = true
795
+ pattern_learning = true
796
+
797
+ [swarm]
798
+ default_topology = "hierarchical"
799
+ default_strategy = "specialized"
800
+ anti_drift = true
801
+
802
+ [hooks]
803
+ enabled = true
804
+ pre_task = true
805
+ post_task = true
806
+ train_on_edit = true
807
+
808
+ [workers]
809
+ enabled = true
810
+ `;
811
+ }
812
+ /**
813
+ * Generate security-focused config.toml
814
+ */
815
+ export async function generateSecureConfigToml() {
816
+ return `# =============================================================================
817
+ # Claude Flow V3 - Security-Focused Configuration
818
+ # =============================================================================
819
+ # Maximum security restrictions for sensitive environments
820
+ # All actions require approval, read-only access, no web search
821
+ # =============================================================================
822
+
823
+ model = "gpt-5.3-codex"
824
+ approval_policy = "untrusted"
825
+ sandbox_mode = "read-only"
826
+ web_search = "disabled"
827
+
828
+ # Project documentation
829
+ project_doc_max_bytes = 32768
830
+
831
+ [features]
832
+ child_agents_md = true
833
+ shell_snapshot = false
834
+ request_rule = true
835
+ remote_compaction = false
836
+
837
+ [mcp_servers.ruflo]
838
+ command = "npx"
839
+ args = ["-y", "ruflo@latest", "mcp", "start"]
840
+ enabled = true
841
+ tool_timeout_sec = 60
842
+
843
+ [history]
844
+ persistence = "save-all"
845
+ retention_days = 365
846
+
847
+ [shell_environment_policy]
848
+ inherit = "none"
849
+ exclude = ["*"]
850
+
851
+ [sandbox_workspace_write]
852
+ writable_roots = []
853
+ network_access = false
854
+ exclude_slash_tmp = true
855
+
856
+ [security]
857
+ input_validation = true
858
+ path_traversal_prevention = true
859
+ secret_scanning = true
860
+ cve_scanning = true
861
+ max_file_size = 1048576
862
+ allowed_extensions = [".ts", ".js", ".json", ".md", ".yaml", ".yml"]
863
+ blocked_patterns = ["\\\\.env", "secret", "credential", "password", "key", "token", "\\\\.pem", "\\\\.p12"]
864
+
865
+ [security.rbac]
866
+ enabled = true
867
+ default_role = "observer"
868
+
869
+ [security.audit]
870
+ enabled = true
871
+ destination = "both"
872
+ file_path = "./logs/security-audit.json"
873
+ retention_days = 365
874
+
875
+ [performance]
876
+ max_agents = 4
877
+ task_timeout = 120
878
+ cache_enabled = false
879
+ parallel_execution = false
880
+
881
+ [logging]
882
+ level = "info"
883
+ format = "json"
884
+ destination = "both"
885
+ file_path = "./logs/claude-flow.log"
886
+ max_files = 100
887
+ max_size = "10MB"
888
+
889
+ [neural]
890
+ sona_enabled = false
891
+ hnsw_enabled = true
892
+ pattern_learning = false
893
+
894
+ [swarm]
895
+ default_topology = "hierarchical"
896
+ default_strategy = "specialized"
897
+ consensus = "byzantine"
898
+ anti_drift = true
899
+ checkpoint_interval = 5
900
+
901
+ [hooks]
902
+ enabled = true
903
+ pre_task = true
904
+ post_task = true
905
+ train_on_edit = false
906
+
907
+ [workers]
908
+ enabled = true
909
+
910
+ [workers.audit]
911
+ enabled = true
912
+ priority = "critical"
913
+ interval = 60
914
+
915
+ [workers.optimize]
916
+ enabled = false
917
+
918
+ [workers.consolidate]
919
+ enabled = false
920
+ `;
921
+ }
922
+ //# sourceMappingURL=config-toml.js.map