@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,880 @@
1
+ /**
2
+ * @claude-flow/codex - Migrations
3
+ *
4
+ * Migration utilities for converting Claude Code configurations to Codex format
5
+ * Supports full CLAUDE.md parsing with section extraction, skill conversion,
6
+ * and proper AGENTS.md/config.toml generation.
7
+ */
8
+ import { getRufloMcpServerConfig, renderMcpServerToml } from '../mcp-config.js';
9
+ /**
10
+ * Feature mappings between Claude Code and Codex
11
+ */
12
+ export const FEATURE_MAPPINGS = [
13
+ {
14
+ claudeCode: 'CLAUDE.md',
15
+ codex: 'AGENTS.md',
16
+ status: 'mapped',
17
+ notes: 'Main instruction file - content is portable',
18
+ },
19
+ {
20
+ claudeCode: 'CLAUDE.local.md',
21
+ codex: '.codex/AGENTS.override.md',
22
+ status: 'mapped',
23
+ notes: 'Local overrides - gitignored in both',
24
+ },
25
+ {
26
+ claudeCode: 'settings.json',
27
+ codex: 'config.toml',
28
+ status: 'mapped',
29
+ notes: 'Format conversion required (JSON to TOML)',
30
+ },
31
+ {
32
+ claudeCode: '/skill-name',
33
+ codex: '$skill-name',
34
+ status: 'mapped',
35
+ notes: 'Skill invocation syntax - search and replace',
36
+ },
37
+ {
38
+ claudeCode: 'TodoWrite',
39
+ codex: 'Task tracking',
40
+ status: 'mapped',
41
+ notes: 'Similar functionality with different API',
42
+ },
43
+ {
44
+ claudeCode: 'Task tool agents',
45
+ codex: 'Sub-agent collaboration',
46
+ status: 'partial',
47
+ notes: 'Codex sub-agents via CODEX_HANDOFF_TARGET env var',
48
+ },
49
+ {
50
+ claudeCode: 'MCP servers',
51
+ codex: '[mcp_servers]',
52
+ status: 'mapped',
53
+ notes: 'Configuration format differs but same functionality',
54
+ },
55
+ {
56
+ claudeCode: 'hooks system',
57
+ codex: 'Automations',
58
+ status: 'partial',
59
+ notes: 'Codex automations are scheduled, not event-driven',
60
+ },
61
+ {
62
+ claudeCode: 'EnterPlanMode',
63
+ codex: 'No direct equivalent',
64
+ status: 'unsupported',
65
+ notes: 'Codex uses different planning paradigm',
66
+ },
67
+ {
68
+ claudeCode: 'Permission modes',
69
+ codex: 'approval_policy + sandbox_mode',
70
+ status: 'mapped',
71
+ notes: 'Codex provides more granular control',
72
+ },
73
+ ];
74
+ /**
75
+ * Hook keywords recognized in CLAUDE.md
76
+ */
77
+ const HOOK_KEYWORDS = [
78
+ 'pre-task',
79
+ 'post-task',
80
+ 'pre-edit',
81
+ 'post-edit',
82
+ 'pre-command',
83
+ 'post-command',
84
+ 'session-start',
85
+ 'session-end',
86
+ 'session-restore',
87
+ 'route',
88
+ 'explain',
89
+ 'pretrain',
90
+ 'notify',
91
+ ];
92
+ /**
93
+ * Patterns that need migration warnings
94
+ */
95
+ const WARNING_PATTERNS = [
96
+ { pattern: 'EnterPlanMode', message: 'EnterPlanMode has no direct Codex equivalent - review planning workflow' },
97
+ { pattern: 'claude -p', message: 'claude -p headless mode - use Codex sub-agent patterns instead' },
98
+ { pattern: 'TodoWrite', message: 'TodoWrite - Codex uses different task tracking approach' },
99
+ { pattern: /--dangerously-skip-permissions/g, message: 'Dangerous permission skip detected - use Codex approval_policy instead' },
100
+ { pattern: /mcp__claude-flow__/g, message: 'MCP tool calls need migration to Codex MCP configuration' },
101
+ { pattern: /mcp__ruv-swarm__/g, message: 'Swarm MCP calls - ensure ruv-swarm MCP server is configured in config.toml' },
102
+ ];
103
+ /**
104
+ * Parse a CLAUDE.md file completely
105
+ */
106
+ export async function parseClaudeMd(content) {
107
+ const lines = content.split('\n');
108
+ const result = {
109
+ title: '',
110
+ sections: [],
111
+ skills: [],
112
+ hooks: [],
113
+ customInstructions: [],
114
+ codeBlocks: [],
115
+ mcpServers: [],
116
+ settings: {},
117
+ warnings: [],
118
+ };
119
+ // Extract title (first H1)
120
+ const titleMatch = content.match(/^#\s+(.+)$/m);
121
+ if (titleMatch && titleMatch[1]) {
122
+ result.title = titleMatch[1].trim();
123
+ result.settings.projectName = result.title;
124
+ }
125
+ // Parse sections
126
+ result.sections = parseSections(content, lines);
127
+ // Extract skills (both /skill-name and $skill-name syntax)
128
+ result.skills = extractSkills(content, lines);
129
+ // Extract hooks
130
+ result.hooks = extractHooks(content);
131
+ // Extract code blocks
132
+ result.codeBlocks = extractCodeBlocks(content, lines);
133
+ // Extract MCP server configurations from code blocks
134
+ result.mcpServers = extractMcpServers(result.codeBlocks);
135
+ // Extract settings from content
136
+ result.settings = {
137
+ ...result.settings,
138
+ ...extractSettings(content, result.sections),
139
+ };
140
+ // Extract custom instructions (behavioral rules)
141
+ result.customInstructions = extractBehavioralRules(content);
142
+ // Check for patterns that need warnings
143
+ for (const { pattern, message } of WARNING_PATTERNS) {
144
+ if (typeof pattern === 'string') {
145
+ if (content.includes(pattern)) {
146
+ result.warnings.push(message);
147
+ }
148
+ }
149
+ else {
150
+ if (pattern.test(content)) {
151
+ result.warnings.push(message);
152
+ }
153
+ }
154
+ }
155
+ return result;
156
+ }
157
+ /**
158
+ * Parse sections from markdown content
159
+ */
160
+ function parseSections(content, lines) {
161
+ const sections = [];
162
+ const sectionRegex = /^(#{1,6})\s+(.+)$/;
163
+ let currentSection = null;
164
+ let contentLines = [];
165
+ for (let i = 0; i < lines.length; i++) {
166
+ const line = lines[i];
167
+ const match = sectionRegex.exec(line);
168
+ if (match && match[1] && match[2]) {
169
+ // Save previous section
170
+ if (currentSection) {
171
+ currentSection.content = contentLines.join('\n').trim();
172
+ currentSection.endLine = i;
173
+ sections.push(currentSection);
174
+ }
175
+ // Start new section
176
+ currentSection = {
177
+ level: match[1].length,
178
+ title: match[2].trim(),
179
+ content: '',
180
+ startLine: i + 1,
181
+ endLine: i + 1,
182
+ };
183
+ contentLines = [];
184
+ }
185
+ else if (currentSection) {
186
+ contentLines.push(line);
187
+ }
188
+ }
189
+ // Save last section
190
+ if (currentSection) {
191
+ currentSection.content = contentLines.join('\n').trim();
192
+ currentSection.endLine = lines.length;
193
+ sections.push(currentSection);
194
+ }
195
+ return sections;
196
+ }
197
+ /**
198
+ * Extract skill references from content
199
+ */
200
+ function extractSkills(content, lines) {
201
+ const skills = [];
202
+ const seenSkills = new Set();
203
+ // Slash syntax: /skill-name
204
+ const slashRegex = /\/([a-z][a-z0-9-]*)/g;
205
+ let match;
206
+ while ((match = slashRegex.exec(content)) !== null) {
207
+ const name = match[1];
208
+ // Skip common false positives
209
+ if (['src', 'dist', 'docs', 'tests', 'config', 'scripts', 'examples', 'node_modules', 'workspaces'].includes(name)) {
210
+ continue;
211
+ }
212
+ if (!seenSkills.has(`slash:${name}`)) {
213
+ seenSkills.add(`slash:${name}`);
214
+ const lineNum = findLineNumber(content, match.index);
215
+ skills.push({
216
+ name,
217
+ syntax: 'slash',
218
+ context: getContextAroundMatch(lines, lineNum),
219
+ line: lineNum,
220
+ });
221
+ }
222
+ }
223
+ // Dollar syntax: $skill-name
224
+ const dollarRegex = /\$([a-z][a-z0-9-]+)/g;
225
+ while ((match = dollarRegex.exec(content)) !== null) {
226
+ const name = match[1];
227
+ if (!seenSkills.has(`dollar:${name}`)) {
228
+ seenSkills.add(`dollar:${name}`);
229
+ const lineNum = findLineNumber(content, match.index);
230
+ skills.push({
231
+ name,
232
+ syntax: 'dollar',
233
+ context: getContextAroundMatch(lines, lineNum),
234
+ line: lineNum,
235
+ });
236
+ }
237
+ }
238
+ return skills;
239
+ }
240
+ /**
241
+ * Extract hooks referenced in content
242
+ */
243
+ function extractHooks(content) {
244
+ const hooks = [];
245
+ const lowerContent = content.toLowerCase();
246
+ for (const hook of HOOK_KEYWORDS) {
247
+ if (lowerContent.includes(hook)) {
248
+ hooks.push(hook);
249
+ }
250
+ }
251
+ return hooks;
252
+ }
253
+ /**
254
+ * Extract code blocks from markdown
255
+ */
256
+ function extractCodeBlocks(content, lines) {
257
+ const blocks = [];
258
+ const codeBlockRegex = /```(\w*)\n([\s\S]*?)```/g;
259
+ let match;
260
+ while ((match = codeBlockRegex.exec(content)) !== null) {
261
+ blocks.push({
262
+ language: match[1] || 'text',
263
+ content: match[2].trim(),
264
+ line: findLineNumber(content, match.index),
265
+ });
266
+ }
267
+ return blocks;
268
+ }
269
+ /**
270
+ * Extract MCP server configurations from code blocks
271
+ */
272
+ function extractMcpServers(codeBlocks) {
273
+ const servers = [];
274
+ for (const block of codeBlocks) {
275
+ // Look for MCP server configurations in bash/shell blocks
276
+ if (['bash', 'shell', 'sh', 'zsh'].includes(block.language)) {
277
+ // Pattern: claude mcp add <name> <command> [args...]
278
+ const mcpAddRegex = /claude\s+mcp\s+add\s+(\S+)\s+(.+)/g;
279
+ let match;
280
+ while ((match = mcpAddRegex.exec(block.content)) !== null) {
281
+ const name = match[1];
282
+ const parts = match[2].trim().split(/\s+/);
283
+ servers.push({
284
+ name,
285
+ command: parts[0] || 'npx',
286
+ args: parts.slice(1),
287
+ enabled: true,
288
+ });
289
+ }
290
+ }
291
+ // Look for JSON MCP configurations
292
+ if (['json', 'jsonc'].includes(block.language)) {
293
+ try {
294
+ const parsed = JSON.parse(block.content);
295
+ if (parsed.mcpServers) {
296
+ for (const [name, config] of Object.entries(parsed.mcpServers)) {
297
+ const mcpConfig = config;
298
+ servers.push({
299
+ name,
300
+ command: mcpConfig.command || 'npx',
301
+ args: mcpConfig.args || [],
302
+ enabled: true,
303
+ });
304
+ }
305
+ }
306
+ }
307
+ catch {
308
+ // Not valid JSON, skip
309
+ }
310
+ }
311
+ // Look for JavaScript/TypeScript MCP tool calls
312
+ if (['javascript', 'typescript', 'js', 'ts'].includes(block.language)) {
313
+ // Pattern: mcp__<server>__<tool>
314
+ const mcpCallRegex = /mcp__([a-z-]+)__/g;
315
+ const seenServers = new Set();
316
+ let match;
317
+ while ((match = mcpCallRegex.exec(block.content)) !== null) {
318
+ const serverName = match[1].replace(/-/g, '_');
319
+ if (!seenServers.has(serverName)) {
320
+ seenServers.add(serverName);
321
+ // Don't add as full config, just note it exists
322
+ }
323
+ }
324
+ }
325
+ }
326
+ // Deduplicate
327
+ const seen = new Set();
328
+ return servers.filter((s) => {
329
+ if (seen.has(s.name))
330
+ return false;
331
+ seen.add(s.name);
332
+ return true;
333
+ });
334
+ }
335
+ /**
336
+ * Extract settings from content and sections
337
+ */
338
+ function extractSettings(content, sections) {
339
+ const settings = {};
340
+ // Look for tech stack
341
+ const techMatch = content.match(/(?:Tech\s*Stack|Technology|Stack)[:\s]+([^\n]+)/i);
342
+ if (techMatch && techMatch[1]) {
343
+ settings.techStack = techMatch[1].replace(/\*\*/g, '').trim();
344
+ }
345
+ // Look for build command
346
+ const buildMatch = content.match(/(?:Build|Compile)[:\s]*\n?```(?:bash|sh)?\n([^\n]+)/i);
347
+ if (buildMatch && buildMatch[1]) {
348
+ settings.buildCommand = buildMatch[1].trim();
349
+ }
350
+ else {
351
+ // Check for npm run build pattern
352
+ if (content.includes('npm run build')) {
353
+ settings.buildCommand = 'npm run build';
354
+ }
355
+ }
356
+ // Look for test command
357
+ const testMatch = content.match(/(?:Test)[:\s]*\n?```(?:bash|sh)?\n([^\n]+)/i);
358
+ if (testMatch && testMatch[1]) {
359
+ settings.testCommand = testMatch[1].trim();
360
+ }
361
+ else {
362
+ if (content.includes('npm test')) {
363
+ settings.testCommand = 'npm test';
364
+ }
365
+ }
366
+ // Look for dev command
367
+ if (content.includes('npm run dev')) {
368
+ settings.devCommand = 'npm run dev';
369
+ }
370
+ // Look for approval/permission settings
371
+ if (content.includes('auto-approve') || content.includes('autoApprove')) {
372
+ settings.approvalPolicy = 'never';
373
+ }
374
+ else if (content.includes('read-only')) {
375
+ settings.sandboxMode = 'read-only';
376
+ }
377
+ // Look for model specification
378
+ const modelMatch = content.match(/model[:\s]+["']?([^"'\n]+)["']?/i);
379
+ if (modelMatch && modelMatch[1]) {
380
+ settings.model = modelMatch[1].trim();
381
+ }
382
+ return settings;
383
+ }
384
+ /**
385
+ * Extract behavioral rules from content
386
+ */
387
+ function extractBehavioralRules(content) {
388
+ const rules = [];
389
+ // Look for Behavioral Rules section
390
+ const behavioralMatch = content.match(/##\s*Behavioral\s*Rules[^\n]*\n([\s\S]*?)(?=\n##|\n#\s|$)/i);
391
+ if (behavioralMatch && behavioralMatch[1]) {
392
+ const ruleLines = behavioralMatch[1].split('\n');
393
+ for (const line of ruleLines) {
394
+ const trimmed = line.trim();
395
+ if (trimmed.startsWith('- ')) {
396
+ rules.push(trimmed.substring(2));
397
+ }
398
+ else if (trimmed.startsWith('* ')) {
399
+ rules.push(trimmed.substring(2));
400
+ }
401
+ }
402
+ }
403
+ // Also look for Security Rules
404
+ const securityMatch = content.match(/##\s*Security\s*Rules?[^\n]*\n([\s\S]*?)(?=\n##|\n#\s|$)/i);
405
+ if (securityMatch && securityMatch[1]) {
406
+ const securityLines = securityMatch[1].split('\n');
407
+ for (const line of securityLines) {
408
+ const trimmed = line.trim();
409
+ if (trimmed.startsWith('- ')) {
410
+ rules.push(trimmed.substring(2));
411
+ }
412
+ else if (trimmed.startsWith('* ')) {
413
+ rules.push(trimmed.substring(2));
414
+ }
415
+ }
416
+ }
417
+ return rules;
418
+ }
419
+ /**
420
+ * Find line number for a character index
421
+ */
422
+ function findLineNumber(content, index) {
423
+ return content.substring(0, index).split('\n').length;
424
+ }
425
+ /**
426
+ * Get context around a match
427
+ */
428
+ function getContextAroundMatch(lines, lineNum) {
429
+ const start = Math.max(0, lineNum - 2);
430
+ const end = Math.min(lines.length, lineNum + 1);
431
+ return lines.slice(start, end).join('\n');
432
+ }
433
+ /**
434
+ * Analyze a CLAUDE.md file for migration (simplified interface)
435
+ */
436
+ export async function analyzeClaudeMd(content) {
437
+ const parsed = await parseClaudeMd(content);
438
+ return {
439
+ sections: parsed.sections.map((s) => s.title),
440
+ skills: [...new Set(parsed.skills.map((s) => s.name))],
441
+ hooks: parsed.hooks,
442
+ customInstructions: parsed.customInstructions,
443
+ warnings: parsed.warnings,
444
+ };
445
+ }
446
+ /**
447
+ * Convert skill invocation syntax from slash to dollar
448
+ */
449
+ export function convertSkillSyntax(content) {
450
+ // Convert /skill-name to $skill-name, but avoid path-like patterns
451
+ return content.replace(/(?<![a-zA-Z0-9_./])\/([a-z][a-z0-9-]*)(?![a-zA-Z0-9_./])/g, (match, skillName) => {
452
+ // Skip common directory names
453
+ const skipPatterns = ['src', 'dist', 'docs', 'tests', 'config', 'scripts', 'examples', 'node_modules', 'workspaces', 'data', 'logs', 'tmp', 'var', 'etc', 'usr', 'bin', 'lib'];
454
+ if (skipPatterns.includes(skillName)) {
455
+ return match;
456
+ }
457
+ return `$${skillName}`;
458
+ });
459
+ }
460
+ /**
461
+ * Generate AGENTS.md content from parsed CLAUDE.md
462
+ */
463
+ export function generateAgentsMdFromParsed(parsed) {
464
+ const lines = [];
465
+ // Title
466
+ lines.push(`# ${parsed.title || 'Project Agent Guide'}`);
467
+ lines.push('');
468
+ lines.push('> Migrated from CLAUDE.md by @claude-flow/codex');
469
+ lines.push('');
470
+ // Project Overview
471
+ lines.push('## Project Overview');
472
+ lines.push('');
473
+ if (parsed.settings.techStack) {
474
+ lines.push(`**Tech Stack**: ${parsed.settings.techStack}`);
475
+ }
476
+ lines.push('');
477
+ // Quick Start
478
+ lines.push('## Setup');
479
+ lines.push('');
480
+ if (parsed.settings.buildCommand) {
481
+ lines.push('### Build');
482
+ lines.push('```bash');
483
+ lines.push(parsed.settings.buildCommand);
484
+ lines.push('```');
485
+ lines.push('');
486
+ }
487
+ if (parsed.settings.testCommand) {
488
+ lines.push('### Test');
489
+ lines.push('```bash');
490
+ lines.push(parsed.settings.testCommand);
491
+ lines.push('```');
492
+ lines.push('');
493
+ }
494
+ if (parsed.settings.devCommand) {
495
+ lines.push('### Development');
496
+ lines.push('```bash');
497
+ lines.push(parsed.settings.devCommand);
498
+ lines.push('```');
499
+ lines.push('');
500
+ }
501
+ // Code Standards
502
+ lines.push('## Code Standards');
503
+ lines.push('');
504
+ lines.push('- Files under 500 lines');
505
+ lines.push('- No hardcoded secrets');
506
+ lines.push('- Input validation at boundaries');
507
+ lines.push('- Typed interfaces for public APIs');
508
+ lines.push('');
509
+ // Skills
510
+ if (parsed.skills.length > 0) {
511
+ lines.push('## Skills');
512
+ lines.push('');
513
+ lines.push('| Skill | Original Syntax |');
514
+ lines.push('|-------|-----------------|');
515
+ for (const skill of parsed.skills) {
516
+ const codexSyntax = `$${skill.name}`;
517
+ const originalSyntax = skill.syntax === 'slash' ? `/${skill.name}` : `$${skill.name}`;
518
+ lines.push(`| \`${codexSyntax}\` | \`${originalSyntax}\` |`);
519
+ }
520
+ lines.push('');
521
+ }
522
+ // Security
523
+ lines.push('## Security');
524
+ lines.push('');
525
+ if (parsed.customInstructions.length > 0) {
526
+ for (const rule of parsed.customInstructions.slice(0, 10)) {
527
+ lines.push(`- ${rule}`);
528
+ }
529
+ }
530
+ else {
531
+ lines.push('- NEVER commit secrets or credentials');
532
+ lines.push('- Validate all user inputs');
533
+ lines.push('- Prevent directory traversal attacks');
534
+ }
535
+ lines.push('');
536
+ // Hooks (as reference)
537
+ if (parsed.hooks.length > 0) {
538
+ lines.push('## Automation Hooks');
539
+ lines.push('');
540
+ lines.push('The following hooks were detected in the original configuration:');
541
+ lines.push('');
542
+ for (const hook of parsed.hooks) {
543
+ lines.push(`- \`${hook}\``);
544
+ }
545
+ lines.push('');
546
+ lines.push('> Note: Codex uses scheduled Automations instead of event-driven hooks.');
547
+ lines.push('');
548
+ }
549
+ // MCP Servers
550
+ if (parsed.mcpServers.length > 0) {
551
+ lines.push('## MCP Servers');
552
+ lines.push('');
553
+ lines.push('Configure in config.toml:');
554
+ lines.push('');
555
+ for (const server of parsed.mcpServers) {
556
+ lines.push(`- **${server.name}**: \`${server.command} ${(server.args || []).join(' ')}\``);
557
+ }
558
+ lines.push('');
559
+ }
560
+ // Migration notes
561
+ if (parsed.warnings.length > 0) {
562
+ lines.push('## Migration Notes');
563
+ lines.push('');
564
+ for (const warning of parsed.warnings) {
565
+ lines.push(`- ${warning}`);
566
+ }
567
+ lines.push('');
568
+ }
569
+ return lines.join('\n');
570
+ }
571
+ /**
572
+ * Convert settings.json to config.toml format
573
+ */
574
+ export function convertSettingsToToml(settings, platform = process.platform) {
575
+ const lines = [];
576
+ lines.push('# Migrated from settings.json');
577
+ lines.push('# Generated by @claude-flow/codex');
578
+ lines.push('');
579
+ // Model
580
+ if (settings.model) {
581
+ lines.push(`model = "${settings.model}"`);
582
+ }
583
+ else {
584
+ lines.push('model = "gpt-5.3-codex"');
585
+ }
586
+ lines.push('');
587
+ // Permissions mapping
588
+ if (settings.permissions) {
589
+ const perms = settings.permissions;
590
+ if (perms.autoApprove === true) {
591
+ lines.push('approval_policy = "never"');
592
+ lines.push('sandbox_mode = "danger-full-access"');
593
+ }
594
+ else if (perms.autoApprove === 'read-only') {
595
+ lines.push('approval_policy = "on-request"');
596
+ lines.push('sandbox_mode = "read-only"');
597
+ }
598
+ else {
599
+ lines.push('approval_policy = "on-request"');
600
+ lines.push('sandbox_mode = "workspace-write"');
601
+ }
602
+ }
603
+ else {
604
+ lines.push('approval_policy = "on-request"');
605
+ lines.push('sandbox_mode = "workspace-write"');
606
+ }
607
+ lines.push('');
608
+ // Web search
609
+ if (settings.webSearch !== undefined) {
610
+ const mode = settings.webSearch === true ? 'live' : settings.webSearch === false ? 'disabled' : 'cached';
611
+ lines.push(`web_search = "${mode}"`);
612
+ }
613
+ else {
614
+ lines.push('web_search = "cached"');
615
+ }
616
+ lines.push('');
617
+ // Features
618
+ lines.push('[features]');
619
+ lines.push('child_agents_md = true');
620
+ lines.push('shell_snapshot = true');
621
+ lines.push('request_rule = true');
622
+ lines.push('');
623
+ // MCP servers
624
+ if (settings.mcpServers && typeof settings.mcpServers === 'object') {
625
+ for (const [name, config] of Object.entries(settings.mcpServers)) {
626
+ // Claude Flow/Ruflo aliases are replaced with the dedicated MCP binary
627
+ // below. This avoids preserving the recursive `mcp start` CLI path.
628
+ if (name === 'claude-flow' || name === 'ruflo') {
629
+ continue;
630
+ }
631
+ const mcpConfig = config;
632
+ lines.push(`[mcp_servers.${name}]`);
633
+ if (mcpConfig.command) {
634
+ lines.push(`command = "${mcpConfig.command}"`);
635
+ }
636
+ if (mcpConfig.args && mcpConfig.args.length > 0) {
637
+ const argsStr = mcpConfig.args.map((a) => `"${a}"`).join(', ');
638
+ lines.push(`args = [${argsStr}]`);
639
+ }
640
+ lines.push('enabled = true');
641
+ if (mcpConfig.env && Object.keys(mcpConfig.env).length > 0) {
642
+ lines.push('');
643
+ lines.push(`[mcp_servers.${name}.env]`);
644
+ for (const [key, value] of Object.entries(mcpConfig.env)) {
645
+ lines.push(`${key} = "${value}"`);
646
+ }
647
+ }
648
+ lines.push('');
649
+ }
650
+ }
651
+ // Ruflo is additive for every migrated installation. Unknown/custom MCP
652
+ // entries above are preserved.
653
+ lines.push(...renderMcpServerToml(getRufloMcpServerConfig(platform)));
654
+ lines.push('');
655
+ // Additive compatibility defaults. Enforcement and unattended fanout are
656
+ // deliberate transitions, never migration side effects.
657
+ lines.push('[policy]');
658
+ lines.push('mode = "legacy"');
659
+ lines.push('');
660
+ lines.push('[swarm.automation]');
661
+ lines.push('enabled = false');
662
+ lines.push('max_concurrent = 4');
663
+ lines.push('max_writers = 2');
664
+ lines.push('worktree_isolation = true');
665
+ lines.push('dependency_failure = "cancel"');
666
+ lines.push('agent_timeout_seconds = 1800');
667
+ lines.push('max_output_bytes = 1048576');
668
+ lines.push('');
669
+ // History
670
+ lines.push('[history]');
671
+ lines.push('persistence = "save-all"');
672
+ lines.push('');
673
+ // Profiles
674
+ lines.push('# Development profile');
675
+ lines.push('[profiles.dev]');
676
+ lines.push('approval_policy = "on-request"');
677
+ lines.push('sandbox_mode = "workspace-write"');
678
+ lines.push('');
679
+ lines.push('# Safe profile');
680
+ lines.push('[profiles.safe]');
681
+ lines.push('approval_policy = "untrusted"');
682
+ lines.push('sandbox_mode = "read-only"');
683
+ lines.push('');
684
+ return lines.join('\n');
685
+ }
686
+ /**
687
+ * Generate config.toml from parsed CLAUDE.md
688
+ */
689
+ export function generateConfigTomlFromParsed(parsed) {
690
+ const lines = [];
691
+ lines.push('# Migrated from CLAUDE.md');
692
+ lines.push('# Generated by @claude-flow/codex');
693
+ lines.push('');
694
+ // Model
695
+ lines.push(`model = "${parsed.settings.model || 'gpt-5.3-codex'}"`);
696
+ lines.push('');
697
+ // Approval policy
698
+ const approvalPolicy = parsed.settings.approvalPolicy || 'on-request';
699
+ lines.push(`approval_policy = "${approvalPolicy}"`);
700
+ lines.push('');
701
+ // Sandbox mode
702
+ const sandboxMode = parsed.settings.sandboxMode || 'workspace-write';
703
+ lines.push(`sandbox_mode = "${sandboxMode}"`);
704
+ lines.push('');
705
+ // Web search
706
+ lines.push('web_search = "cached"');
707
+ lines.push('');
708
+ // Features
709
+ lines.push('[features]');
710
+ lines.push('child_agents_md = true');
711
+ lines.push('shell_snapshot = true');
712
+ lines.push('request_rule = true');
713
+ lines.push('');
714
+ // MCP servers
715
+ if (parsed.mcpServers.length > 0) {
716
+ for (const server of parsed.mcpServers) {
717
+ if (server.name === 'claude-flow' || server.name === 'ruflo')
718
+ continue;
719
+ lines.push(`[mcp_servers.${server.name.replace(/-/g, '_')}]`);
720
+ lines.push(`command = "${server.command}"`);
721
+ if (server.args && server.args.length > 0) {
722
+ const argsStr = server.args.map((a) => `"${a}"`).join(', ');
723
+ lines.push(`args = [${argsStr}]`);
724
+ }
725
+ lines.push(`enabled = ${server.enabled ?? true}`);
726
+ lines.push('');
727
+ }
728
+ }
729
+ lines.push(...renderMcpServerToml(getRufloMcpServerConfig()));
730
+ lines.push('');
731
+ lines.push('[policy]');
732
+ lines.push('mode = "legacy"');
733
+ lines.push('');
734
+ lines.push('[swarm.automation]');
735
+ lines.push('enabled = false');
736
+ lines.push('max_concurrent = 4');
737
+ lines.push('max_writers = 2');
738
+ lines.push('worktree_isolation = true');
739
+ lines.push('dependency_failure = "cancel"');
740
+ lines.push('agent_timeout_seconds = 1800');
741
+ lines.push('max_output_bytes = 1048576');
742
+ lines.push('');
743
+ // Skills
744
+ if (parsed.skills.length > 0) {
745
+ lines.push('# Skills detected in original configuration');
746
+ for (const skill of parsed.skills) {
747
+ lines.push(`# - ${skill.name} (${skill.syntax} syntax)`);
748
+ }
749
+ lines.push('');
750
+ }
751
+ // History
752
+ lines.push('[history]');
753
+ lines.push('persistence = "save-all"');
754
+ lines.push('');
755
+ // Profiles
756
+ lines.push('[profiles.dev]');
757
+ lines.push('approval_policy = "on-request"');
758
+ lines.push('sandbox_mode = "workspace-write"');
759
+ lines.push('');
760
+ lines.push('[profiles.safe]');
761
+ lines.push('approval_policy = "untrusted"');
762
+ lines.push('sandbox_mode = "read-only"');
763
+ lines.push('');
764
+ return lines.join('\n');
765
+ }
766
+ /**
767
+ * Migrate from Claude Code (CLAUDE.md) to Codex (AGENTS.md)
768
+ */
769
+ export async function migrateFromClaudeCode(options) {
770
+ const { sourcePath, targetPath, preserveComments = true, generateSkills = true } = options;
771
+ try {
772
+ // In actual implementation, this would read the file
773
+ // For now, we provide the structure for the migration
774
+ const result = {
775
+ success: true,
776
+ agentsMdPath: `${targetPath}/AGENTS.md`,
777
+ skillsCreated: generateSkills
778
+ ? ['swarm-orchestration', 'memory-management', 'security-audit']
779
+ : [],
780
+ configTomlPath: `${targetPath}/.agents/config.toml`,
781
+ mappings: FEATURE_MAPPINGS,
782
+ warnings: [
783
+ 'Review skill invocation syntax (changed from / to $)',
784
+ 'Check hook configurations for Automation compatibility',
785
+ 'Verify MCP server configurations in config.toml',
786
+ ],
787
+ };
788
+ return result;
789
+ }
790
+ catch (error) {
791
+ return {
792
+ success: false,
793
+ warnings: [`Migration failed: ${error instanceof Error ? error.message : 'Unknown error'}`],
794
+ };
795
+ }
796
+ }
797
+ /**
798
+ * Perform full migration with content
799
+ */
800
+ export async function performFullMigration(claudeMdContent, settingsJson) {
801
+ // Parse CLAUDE.md
802
+ const parsed = await parseClaudeMd(claudeMdContent);
803
+ // Generate AGENTS.md
804
+ let agentsMd = generateAgentsMdFromParsed(parsed);
805
+ // Convert skill syntax in the generated content
806
+ agentsMd = convertSkillSyntax(agentsMd);
807
+ // Generate config.toml
808
+ let configToml;
809
+ if (settingsJson) {
810
+ configToml = convertSettingsToToml(settingsJson);
811
+ }
812
+ else {
813
+ configToml = generateConfigTomlFromParsed(parsed);
814
+ }
815
+ // Collect skills to create
816
+ const skillsToCreate = [...new Set(parsed.skills.map((s) => s.name))];
817
+ return {
818
+ agentsMd,
819
+ configToml,
820
+ warnings: parsed.warnings,
821
+ skillsToCreate,
822
+ };
823
+ }
824
+ /**
825
+ * Generate migration report
826
+ */
827
+ export function generateMigrationReport(result) {
828
+ const lines = [];
829
+ lines.push('# Migration Report');
830
+ lines.push('');
831
+ lines.push(`**Status**: ${result.success ? 'Success' : 'Failed'}`);
832
+ lines.push(`**Generated**: ${new Date().toISOString()}`);
833
+ lines.push('');
834
+ if (result.agentsMdPath) {
835
+ lines.push('## Generated Files');
836
+ lines.push('');
837
+ lines.push(`- AGENTS.md: \`${result.agentsMdPath}\``);
838
+ if (result.configTomlPath) {
839
+ lines.push(`- config.toml: \`${result.configTomlPath}\``);
840
+ }
841
+ lines.push('');
842
+ }
843
+ if (result.skillsCreated && result.skillsCreated.length > 0) {
844
+ lines.push('## Skills Created');
845
+ lines.push('');
846
+ for (const skill of result.skillsCreated) {
847
+ lines.push(`- \`$${skill}\``);
848
+ }
849
+ lines.push('');
850
+ }
851
+ if (result.mappings) {
852
+ lines.push('## Feature Mappings');
853
+ lines.push('');
854
+ lines.push('| Claude Code | Codex | Status | Notes |');
855
+ lines.push('|-------------|-------|--------|-------|');
856
+ for (const mapping of result.mappings) {
857
+ const notes = mapping.notes || '';
858
+ lines.push(`| \`${mapping.claudeCode}\` | \`${mapping.codex}\` | ${mapping.status} | ${notes} |`);
859
+ }
860
+ lines.push('');
861
+ }
862
+ if (result.warnings && result.warnings.length > 0) {
863
+ lines.push('## Warnings');
864
+ lines.push('');
865
+ for (const warning of result.warnings) {
866
+ lines.push(`- ${warning}`);
867
+ }
868
+ lines.push('');
869
+ }
870
+ lines.push('## Next Steps');
871
+ lines.push('');
872
+ lines.push('1. Review generated AGENTS.md for accuracy');
873
+ lines.push('2. Update skill references from `/skill-name` to `$skill-name`');
874
+ lines.push('3. Configure MCP servers in config.toml');
875
+ lines.push('4. Create skill definitions in `.agents/skills/`');
876
+ lines.push('5. Test with `codex` CLI');
877
+ lines.push('');
878
+ return lines.join('\n');
879
+ }
880
+ //# sourceMappingURL=index.js.map