atabey 0.0.6 → 0.0.8

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 (407) hide show
  1. package/ATABEY.md +4 -4
  2. package/README.md +35 -33
  3. package/bin/cli.js +2 -2
  4. package/bin/validate-agent-army.js +6 -6
  5. package/dist/framework-mcp/src/constants.js +1 -1
  6. package/dist/framework-mcp/src/constants.js.map +1 -1
  7. package/dist/framework-mcp/src/index.js +29 -5
  8. package/dist/framework-mcp/src/index.js.map +1 -1
  9. package/dist/framework-mcp/src/resources/index.d.ts +10 -0
  10. package/dist/framework-mcp/src/resources/index.js +59 -0
  11. package/dist/framework-mcp/src/resources/index.js.map +1 -0
  12. package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
  13. package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
  14. package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
  15. package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
  16. package/dist/framework-mcp/src/tools/definitions.js +33 -1
  17. package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
  18. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
  19. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
  20. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
  21. package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
  22. package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
  23. package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
  24. package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
  25. package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
  26. package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
  27. package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
  28. package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
  29. package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
  30. package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
  31. package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
  32. package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
  33. package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
  34. package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
  35. package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
  36. package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
  37. package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
  38. package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
  39. package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
  40. package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
  41. package/dist/framework-mcp/src/tools/index.js +2 -0
  42. package/dist/framework-mcp/src/tools/index.js.map +1 -1
  43. package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
  44. package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
  45. package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
  46. package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
  47. package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
  48. package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
  49. package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
  50. package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
  51. package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
  52. package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
  53. package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
  54. package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
  55. package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
  56. package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
  57. package/dist/framework-mcp/src/tools/types.d.ts +1 -0
  58. package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
  59. package/dist/framework-mcp/src/utils/compliance.js +158 -5
  60. package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
  61. package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
  62. package/dist/framework-mcp/src/utils/permissions.js +72 -0
  63. package/dist/framework-mcp/src/utils/permissions.js.map +1 -0
  64. package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts +1 -0
  65. package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js +84 -0
  66. package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js.map +1 -0
  67. package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +31 -31
  68. package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
  69. package/dist/framework-mcp/tests/tools/file_system/permissions.test.d.ts +1 -0
  70. package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +92 -0
  71. package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -0
  72. package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
  73. package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
  74. package/dist/src/cli/adapters/core.js +13 -20
  75. package/dist/src/cli/adapters/core.js.map +1 -1
  76. package/dist/src/cli/adapters/scaffold.js +2 -2
  77. package/dist/src/cli/adapters/scaffold.js.map +1 -1
  78. package/dist/src/cli/commands/check.js +5 -3
  79. package/dist/src/cli/commands/check.js.map +1 -1
  80. package/dist/src/cli/commands/compliance.js +2 -2
  81. package/dist/src/cli/commands/compliance.js.map +1 -1
  82. package/dist/src/cli/commands/contract.js +2 -2
  83. package/dist/src/cli/commands/contract.js.map +1 -1
  84. package/dist/src/cli/commands/dashboard.d.ts +5 -0
  85. package/dist/src/cli/commands/dashboard.js +124 -0
  86. package/dist/src/cli/commands/dashboard.js.map +1 -0
  87. package/dist/src/cli/commands/explorer.js +3 -3
  88. package/dist/src/cli/commands/explorer.js.map +1 -1
  89. package/dist/src/cli/commands/git.js +3 -3
  90. package/dist/src/cli/commands/git.js.map +1 -1
  91. package/dist/src/cli/commands/init/create-agent.d.ts +4 -0
  92. package/dist/src/cli/commands/init/create-agent.js +59 -0
  93. package/dist/src/cli/commands/init/create-agent.js.map +1 -0
  94. package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -0
  95. package/dist/src/cli/commands/init/scaffold-core.js +11 -7
  96. package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
  97. package/dist/src/cli/commands/init/scaffold-docs.d.ts +1 -0
  98. package/dist/src/cli/commands/init/scaffold-docs.js +4 -6
  99. package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
  100. package/dist/src/cli/commands/init/scaffold-ops.js +4 -4
  101. package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
  102. package/dist/src/cli/commands/init/scaffold-standards.js +10 -8
  103. package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
  104. package/dist/src/cli/commands/init.js +26 -10
  105. package/dist/src/cli/commands/init.js.map +1 -1
  106. package/dist/src/cli/commands/knowledge.js +3 -3
  107. package/dist/src/cli/commands/knowledge.js.map +1 -1
  108. package/dist/src/cli/commands/lint.js +2 -2
  109. package/dist/src/cli/commands/lint.js.map +1 -1
  110. package/dist/src/cli/commands/log.js +6 -28
  111. package/dist/src/cli/commands/log.js.map +1 -1
  112. package/dist/src/cli/commands/orchestrate.d.ts +10 -17
  113. package/dist/src/cli/commands/orchestrate.js +92 -341
  114. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  115. package/dist/src/cli/commands/plan.d.ts +5 -0
  116. package/dist/src/cli/commands/plan.js +80 -59
  117. package/dist/src/cli/commands/plan.js.map +1 -1
  118. package/dist/src/cli/commands/script.js +3 -3
  119. package/dist/src/cli/commands/script.js.map +1 -1
  120. package/dist/src/cli/commands/security.js +2 -2
  121. package/dist/src/cli/commands/security.js.map +1 -1
  122. package/dist/src/cli/commands/status.js +65 -8
  123. package/dist/src/cli/commands/status.js.map +1 -1
  124. package/dist/src/cli/commands/trace.d.ts +4 -0
  125. package/dist/src/cli/commands/trace.js +83 -2
  126. package/dist/src/cli/commands/trace.js.map +1 -1
  127. package/dist/src/cli/index.js +68 -18
  128. package/dist/src/cli/index.js.map +1 -1
  129. package/dist/src/cli/shims.js +14 -14
  130. package/dist/src/cli/utils/claude.js +1 -1
  131. package/dist/src/cli/utils/claude.js.map +1 -1
  132. package/dist/src/cli/utils/compliance.js +7 -1
  133. package/dist/src/cli/utils/compliance.js.map +1 -1
  134. package/dist/src/cli/utils/fs.js +1 -1
  135. package/dist/src/cli/utils/fs.js.map +1 -1
  136. package/dist/src/cli/utils/i18n.d.ts +1 -0
  137. package/dist/src/cli/utils/i18n.js +2 -0
  138. package/dist/src/cli/utils/i18n.js.map +1 -1
  139. package/dist/src/cli/utils/memory.d.ts +12 -3
  140. package/dist/src/cli/utils/memory.js +39 -31
  141. package/dist/src/cli/utils/memory.js.map +1 -1
  142. package/dist/src/cli/utils/pkg.js +2 -2
  143. package/dist/src/cli/utils/pkg.js.map +1 -1
  144. package/dist/src/cli/utils/schemas.d.ts +8 -8
  145. package/dist/src/cli/utils/ui.js +4 -4
  146. package/dist/src/cli/utils/ui.js.map +1 -1
  147. package/dist/src/contracts/tasks.d.ts +2 -2
  148. package/dist/src/dashboard/vite.config.d.ts +2 -0
  149. package/dist/src/dashboard/vite.config.js +16 -0
  150. package/dist/src/dashboard/vite.config.js.map +1 -0
  151. package/dist/src/modules/adapters/definitions.js +10 -10
  152. package/dist/src/modules/adapters/definitions.js.map +1 -1
  153. package/dist/src/modules/adapters/shared.js +4 -4
  154. package/dist/src/modules/adapters/shared.js.map +1 -1
  155. package/dist/src/modules/agents/definitions.d.ts +19 -0
  156. package/dist/src/modules/agents/definitions.js +74 -21
  157. package/dist/src/modules/agents/definitions.js.map +1 -1
  158. package/dist/src/modules/agents/registry/backend.js +8 -0
  159. package/dist/src/modules/agents/registry/backend.js.map +1 -1
  160. package/dist/src/modules/agents/registry/database.js +7 -0
  161. package/dist/src/modules/agents/registry/database.js.map +1 -1
  162. package/dist/src/modules/agents/registry/devops.js +6 -0
  163. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  164. package/dist/src/modules/agents/registry/frontend.js +8 -0
  165. package/dist/src/modules/agents/registry/frontend.js.map +1 -1
  166. package/dist/src/modules/agents/registry/security.js +6 -0
  167. package/dist/src/modules/agents/registry/security.js.map +1 -1
  168. package/dist/src/modules/agents/types.d.ts +2 -0
  169. package/dist/src/modules/engines/evaluation-engine.d.ts +11 -0
  170. package/dist/src/modules/engines/evaluation-engine.js +103 -0
  171. package/dist/src/modules/engines/evaluation-engine.js.map +1 -0
  172. package/dist/src/modules/engines/health-engine.d.ts +16 -0
  173. package/dist/src/modules/engines/health-engine.js +50 -0
  174. package/dist/src/modules/engines/health-engine.js.map +1 -0
  175. package/dist/src/modules/engines/planning-engine.d.ts +25 -0
  176. package/dist/src/modules/engines/planning-engine.js +79 -0
  177. package/dist/src/modules/engines/planning-engine.js.map +1 -0
  178. package/dist/src/modules/engines/risk-engine.d.ts +18 -0
  179. package/dist/src/modules/engines/risk-engine.js +106 -0
  180. package/dist/src/modules/engines/risk-engine.js.map +1 -0
  181. package/dist/src/modules/engines/routing-engine.d.ts +11 -0
  182. package/dist/src/modules/engines/routing-engine.js +74 -0
  183. package/dist/src/modules/engines/routing-engine.js.map +1 -0
  184. package/dist/src/modules/engines/types.d.ts +47 -0
  185. package/dist/src/modules/engines/types.js +2 -0
  186. package/dist/src/modules/engines/types.js.map +1 -0
  187. package/dist/src/shared/constants.d.ts +6 -2
  188. package/dist/src/shared/constants.js +5 -1
  189. package/dist/src/shared/constants.js.map +1 -1
  190. package/dist/src/shared/fs.d.ts +1 -0
  191. package/dist/src/shared/fs.js +4 -0
  192. package/dist/src/shared/fs.js.map +1 -1
  193. package/dist/src/shared/storage.d.ts +60 -0
  194. package/dist/src/shared/storage.js +208 -0
  195. package/dist/src/shared/storage.js.map +1 -0
  196. package/dist/tests/adapter.test.js +3 -2
  197. package/dist/tests/adapter.test.js.map +1 -1
  198. package/dist/tests/agent-memory-v2.test.d.ts +1 -0
  199. package/dist/tests/agent-memory-v2.test.js +68 -0
  200. package/dist/tests/agent-memory-v2.test.js.map +1 -0
  201. package/dist/tests/agents-definitions.test.js +42 -0
  202. package/dist/tests/agents-definitions.test.js.map +1 -1
  203. package/dist/tests/integration/hermes_locking.test.js +7 -10
  204. package/dist/tests/integration/hermes_locking.test.js.map +1 -1
  205. package/dist/tests/orchestrate.test.js +5 -1
  206. package/dist/tests/orchestrate.test.js.map +1 -1
  207. package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
  208. package/dist/tests/orchestrator-dependencies.test.js +52 -0
  209. package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
  210. package/dist/tests/plan.test.d.ts +1 -0
  211. package/dist/tests/plan.test.js +63 -0
  212. package/dist/tests/plan.test.js.map +1 -0
  213. package/dist/tests/planning-engine.test.d.ts +1 -0
  214. package/dist/tests/planning-engine.test.js +50 -0
  215. package/dist/tests/planning-engine.test.js.map +1 -0
  216. package/dist/tests/status-cost.test.d.ts +1 -0
  217. package/dist/tests/status-cost.test.js +54 -0
  218. package/dist/tests/status-cost.test.js.map +1 -0
  219. package/dist/tests/status.test.js +8 -7
  220. package/dist/tests/status.test.js.map +1 -1
  221. package/dist/tests/trace-replay.test.d.ts +1 -0
  222. package/dist/tests/trace-replay.test.js +65 -0
  223. package/dist/tests/trace-replay.test.js.map +1 -0
  224. package/dist/tests/trace.test.js +14 -7
  225. package/dist/tests/trace.test.js.map +1 -1
  226. package/dist/ui/assets/index-Bkt7APzu.css +1 -0
  227. package/dist/ui/assets/index-CeX-06mI.js +49 -0
  228. package/dist/ui/index.html +14 -0
  229. package/framework-mcp/dist/constants.js +1 -1
  230. package/framework-mcp/{src/constants.ts → dist/framework-mcp/src/constants.js} +4 -18
  231. package/framework-mcp/{src/index.ts → dist/framework-mcp/src/index.js} +52 -53
  232. package/framework-mcp/dist/framework-mcp/src/resources/index.js +58 -0
  233. package/framework-mcp/{src/tools/control_plane/locking.ts → dist/framework-mcp/src/tools/control_plane/locking.js} +14 -21
  234. package/framework-mcp/{src/tools/control_plane/registry.ts → dist/framework-mcp/src/tools/control_plane/registry.js} +8 -11
  235. package/framework-mcp/{src/tools/definitions.ts → dist/framework-mcp/src/tools/definitions.js} +35 -5
  236. package/framework-mcp/{src/tools/file_system/batch_surgical_edit.ts → dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js} +16 -31
  237. package/framework-mcp/{src/tools/file_system/patch_file.ts → dist/framework-mcp/src/tools/file_system/patch_file.js} +9 -14
  238. package/framework-mcp/{src/tools/file_system/read_file.ts → dist/framework-mcp/src/tools/file_system/read_file.js} +9 -16
  239. package/framework-mcp/{src/tools/file_system/replace_text.ts → dist/framework-mcp/src/tools/file_system/replace_text.js} +13 -17
  240. package/framework-mcp/{src/tools/file_system/write_file.ts → dist/framework-mcp/src/tools/file_system/write_file.js} +14 -16
  241. package/framework-mcp/{src/tools/framework/audit_deps.ts → dist/framework-mcp/src/tools/framework/audit_deps.js} +9 -17
  242. package/framework-mcp/{src/tools/framework/get_status.ts → dist/framework-mcp/src/tools/framework/get_status.js} +1 -3
  243. package/framework-mcp/{src/tools/framework/orchestrate.ts → dist/framework-mcp/src/tools/framework/orchestrate.js} +1 -3
  244. package/framework-mcp/{src/tools/framework/run_tests.ts → dist/framework-mcp/src/tools/framework/run_tests.js} +9 -12
  245. package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
  246. package/framework-mcp/{src/tools/framework/update_contract_hash.ts → dist/framework-mcp/src/tools/framework/update_contract_hash.js} +1 -3
  247. package/framework-mcp/{src/tools/framework/update_memory.ts → dist/framework-mcp/src/tools/framework/update_memory.js} +2 -4
  248. package/framework-mcp/{src/tools/index.ts → dist/framework-mcp/src/tools/index.js} +5 -7
  249. package/framework-mcp/{src/tools/memory/get_insights.ts → dist/framework-mcp/src/tools/memory/get_insights.js} +4 -11
  250. package/framework-mcp/{src/tools/memory/read_memory.ts → dist/framework-mcp/src/tools/memory/read_memory.js} +3 -6
  251. package/framework-mcp/{src/tools/messaging/log_action.ts → dist/framework-mcp/src/tools/messaging/log_action.js} +2 -8
  252. package/framework-mcp/{src/tools/messaging/send_message.ts → dist/framework-mcp/src/tools/messaging/send_message.js} +19 -22
  253. package/framework-mcp/{src/tools/observability/check_ports.ts → dist/framework-mcp/src/tools/observability/check_ports.js} +6 -10
  254. package/framework-mcp/{src/tools/observability/get_health.ts → dist/framework-mcp/src/tools/observability/get_health.js} +1 -6
  255. package/framework-mcp/{src/tools/quality/check_lint.ts → dist/framework-mcp/src/tools/quality/check_lint.js} +3 -9
  256. package/framework-mcp/{src/tools/search/get_gaps.ts → dist/framework-mcp/src/tools/search/get_gaps.js} +12 -18
  257. package/framework-mcp/{src/tools/search/get_map.ts → dist/framework-mcp/src/tools/search/get_map.js} +14 -19
  258. package/framework-mcp/{src/tools/search/grep_search.ts → dist/framework-mcp/src/tools/search/grep_search.js} +26 -26
  259. package/framework-mcp/{src/tools/search/list_dir.ts → dist/framework-mcp/src/tools/search/list_dir.js} +4 -10
  260. package/framework-mcp/{src/tools/shell/run_command.ts → dist/framework-mcp/src/tools/shell/run_command.js} +1 -11
  261. package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
  262. package/framework-mcp/{src/utils/cli.ts → dist/framework-mcp/src/utils/cli.js} +25 -19
  263. package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +231 -0
  264. package/framework-mcp/{src/utils/fs.ts → dist/framework-mcp/src/utils/fs.js} +9 -10
  265. package/framework-mcp/{src/utils/metrics.ts → dist/framework-mcp/src/utils/metrics.js} +11 -28
  266. package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +71 -0
  267. package/framework-mcp/{src/utils/security.ts → dist/framework-mcp/src/utils/security.js} +9 -15
  268. package/framework-mcp/dist/index.js +29 -5
  269. package/framework-mcp/dist/resources/index.js +58 -0
  270. package/{src/cli/adapters/core.ts → framework-mcp/dist/src/cli/adapters/core.js} +21 -41
  271. package/{src/cli/adapters/index.ts → framework-mcp/dist/src/cli/adapters/index.js} +1 -1
  272. package/{src/cli/adapters/paths.ts → framework-mcp/dist/src/cli/adapters/paths.js} +19 -53
  273. package/{src/cli/adapters/scaffold.ts → framework-mcp/dist/src/cli/adapters/scaffold.js} +18 -42
  274. package/{src/cli/adapters/utils.ts → framework-mcp/dist/src/cli/adapters/utils.js} +19 -31
  275. package/{src/cli/commands/approve.ts → framework-mcp/dist/src/cli/commands/approve.js} +15 -25
  276. package/{src/cli/commands/check.ts → framework-mcp/dist/src/cli/commands/check.js} +36 -43
  277. package/{src/cli/commands/compliance.ts → framework-mcp/dist/src/cli/commands/compliance.js} +10 -15
  278. package/{src/cli/commands/contract.ts → framework-mcp/dist/src/cli/commands/contract.js} +13 -31
  279. package/framework-mcp/dist/src/cli/commands/dashboard.js +123 -0
  280. package/{src/cli/commands/explorer.ts → framework-mcp/dist/src/cli/commands/explorer.js} +14 -17
  281. package/{src/cli/commands/git.ts → framework-mcp/dist/src/cli/commands/git.js} +15 -14
  282. package/framework-mcp/dist/src/cli/commands/init/create-agent.js +58 -0
  283. package/{src/cli/commands/init/scaffold-core.ts → framework-mcp/dist/src/cli/commands/init/scaffold-core.js} +35 -59
  284. package/framework-mcp/dist/src/cli/commands/init/scaffold-docs.js +34 -0
  285. package/{src/cli/commands/init/scaffold-ops.ts → framework-mcp/dist/src/cli/commands/init/scaffold-ops.js} +19 -22
  286. package/{src/cli/commands/init/scaffold-standards.ts → framework-mcp/dist/src/cli/commands/init/scaffold-standards.js} +20 -20
  287. package/{src/cli/commands/init.ts → framework-mcp/dist/src/cli/commands/init.js} +51 -77
  288. package/{src/cli/commands/knowledge.ts → framework-mcp/dist/src/cli/commands/knowledge.js} +9 -11
  289. package/{src/cli/commands/lint.ts → framework-mcp/dist/src/cli/commands/lint.js} +5 -6
  290. package/framework-mcp/dist/src/cli/commands/log.js +10 -0
  291. package/{src/cli/commands/memory.ts → framework-mcp/dist/src/cli/commands/memory.js} +1 -3
  292. package/framework-mcp/dist/src/cli/commands/orchestrate.js +159 -0
  293. package/framework-mcp/dist/src/cli/commands/plan.js +117 -0
  294. package/{src/cli/commands/script.ts → framework-mcp/dist/src/cli/commands/script.js} +6 -7
  295. package/{src/cli/commands/security.ts → framework-mcp/dist/src/cli/commands/security.js} +6 -8
  296. package/framework-mcp/dist/src/cli/commands/status.js +97 -0
  297. package/framework-mcp/dist/src/cli/commands/trace.js +109 -0
  298. package/{src/cli/index.ts → framework-mcp/dist/src/cli/index.js} +80 -64
  299. package/{src/cli/shims.ts → framework-mcp/dist/src/cli/shims.js} +15 -15
  300. package/{src/cli/utils/claude.ts → framework-mcp/dist/src/cli/utils/claude.js} +8 -15
  301. package/{src/cli/utils/compliance.ts → framework-mcp/dist/src/cli/utils/compliance.js} +18 -36
  302. package/{src/cli/utils/config-schema.ts → framework-mcp/dist/src/cli/utils/config-schema.js} +0 -6
  303. package/{src/cli/utils/fs.ts → framework-mcp/dist/src/cli/utils/fs.js} +34 -67
  304. package/{src/cli/utils/i18n.ts → framework-mcp/dist/src/cli/utils/i18n.js} +3 -17
  305. package/{src/cli/utils/memory.ts → framework-mcp/dist/src/cli/utils/memory.js} +87 -114
  306. package/{src/cli/utils/pkg.ts → framework-mcp/dist/src/cli/utils/pkg.js} +120 -155
  307. package/{src/cli/utils/schemas.ts → framework-mcp/dist/src/cli/utils/schemas.js} +0 -3
  308. package/{src/cli/utils/string.ts → framework-mcp/dist/src/cli/utils/string.js} +18 -24
  309. package/{src/cli/utils/time.ts → framework-mcp/dist/src/cli/utils/time.js} +4 -4
  310. package/{src/cli/utils/ui.ts → framework-mcp/dist/src/cli/utils/ui.js} +9 -17
  311. package/{src/contracts/tasks.ts → framework-mcp/dist/src/contracts/tasks.js} +0 -6
  312. package/framework-mcp/dist/src/dashboard/vite.config.js +15 -0
  313. package/framework-mcp/dist/src/modules/adapters/definitions.js +140 -0
  314. package/framework-mcp/dist/src/modules/adapters/registry.js +18 -0
  315. package/{src/modules/adapters/shared.ts → framework-mcp/dist/src/modules/adapters/shared.js} +9 -25
  316. package/framework-mcp/dist/src/modules/adapters/types.js +1 -0
  317. package/{src/modules/agents/definitions.ts → framework-mcp/dist/src/modules/agents/definitions.js} +158 -161
  318. package/{src/modules/agents/registry/analyst.ts → framework-mcp/dist/src/modules/agents/registry/analyst.js} +9 -14
  319. package/{src/modules/agents/registry/architect.ts → framework-mcp/dist/src/modules/agents/registry/architect.js} +9 -14
  320. package/{src/modules/agents/registry/backend.ts → framework-mcp/dist/src/modules/agents/registry/backend.js} +16 -13
  321. package/{src/modules/agents/registry/database.ts → framework-mcp/dist/src/modules/agents/registry/database.js} +16 -14
  322. package/{src/modules/agents/registry/devops.ts → framework-mcp/dist/src/modules/agents/registry/devops.js} +15 -14
  323. package/{src/modules/agents/registry/explorer.ts → framework-mcp/dist/src/modules/agents/registry/explorer.js} +9 -14
  324. package/{src/modules/agents/registry/frontend.ts → framework-mcp/dist/src/modules/agents/registry/frontend.js} +17 -14
  325. package/{src/modules/agents/registry/git.ts → framework-mcp/dist/src/modules/agents/registry/git.js} +9 -14
  326. package/{src/modules/agents/registry/manager.ts → framework-mcp/dist/src/modules/agents/registry/manager.js} +10 -15
  327. package/{src/modules/agents/registry/mobile.ts → framework-mcp/dist/src/modules/agents/registry/mobile.js} +9 -14
  328. package/{src/modules/agents/registry/native.ts → framework-mcp/dist/src/modules/agents/registry/native.js} +9 -14
  329. package/{src/modules/agents/registry/quality.ts → framework-mcp/dist/src/modules/agents/registry/quality.js} +9 -14
  330. package/{src/modules/agents/registry/security.ts → framework-mcp/dist/src/modules/agents/registry/security.js} +15 -14
  331. package/framework-mcp/dist/src/modules/agents/types.js +1 -0
  332. package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +102 -0
  333. package/framework-mcp/dist/src/modules/engines/health-engine.js +49 -0
  334. package/framework-mcp/dist/src/modules/engines/planning-engine.js +78 -0
  335. package/framework-mcp/dist/src/modules/engines/risk-engine.js +105 -0
  336. package/framework-mcp/dist/src/modules/engines/routing-engine.js +73 -0
  337. package/framework-mcp/dist/src/modules/engines/types.js +1 -0
  338. package/{src/modules/skills/definitions.ts → framework-mcp/dist/src/modules/skills/definitions.js} +0 -1
  339. package/{src/shared/constants.ts → framework-mcp/dist/src/shared/constants.js} +40 -71
  340. package/{src/shared/errors.ts → framework-mcp/dist/src/shared/errors.js} +10 -17
  341. package/{src/shared/fs.ts → framework-mcp/dist/src/shared/fs.js} +14 -13
  342. package/{src/shared/logger.ts → framework-mcp/dist/src/shared/logger.js} +28 -51
  343. package/framework-mcp/dist/src/shared/storage.js +207 -0
  344. package/framework-mcp/dist/src/shared/types.js +12 -0
  345. package/framework-mcp/dist/tools/control_plane/locking.js +3 -3
  346. package/framework-mcp/dist/tools/control_plane/registry.js +3 -2
  347. package/framework-mcp/dist/tools/definitions.js +33 -1
  348. package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +8 -3
  349. package/framework-mcp/dist/tools/file_system/patch_file.js +8 -3
  350. package/framework-mcp/dist/tools/file_system/read_file.js +3 -3
  351. package/framework-mcp/dist/tools/file_system/replace_text.js +8 -3
  352. package/framework-mcp/dist/tools/file_system/write_file.js +10 -5
  353. package/framework-mcp/dist/tools/framework/audit_deps.js +2 -2
  354. package/framework-mcp/dist/tools/framework/run_tests.js +2 -2
  355. package/framework-mcp/dist/tools/framework/submit_plan.js +13 -0
  356. package/framework-mcp/dist/tools/framework/update_memory.js +1 -1
  357. package/framework-mcp/dist/tools/index.js +2 -0
  358. package/framework-mcp/dist/tools/memory/get_insights.js +1 -1
  359. package/framework-mcp/dist/tools/messaging/log_action.js +1 -1
  360. package/framework-mcp/dist/tools/messaging/send_message.js +5 -5
  361. package/framework-mcp/dist/tools/observability/check_ports.js +1 -1
  362. package/framework-mcp/dist/tools/quality/check_lint.js +2 -2
  363. package/framework-mcp/dist/tools/search/get_gaps.js +1 -1
  364. package/framework-mcp/dist/tools/search/grep_search.js +3 -3
  365. package/framework-mcp/dist/utils/compliance.js +158 -5
  366. package/framework-mcp/dist/utils/permissions.js +71 -0
  367. package/framework-mcp/package.json +7 -1
  368. package/mcp.json +1 -1
  369. package/package.json +10 -6
  370. package/templates/prompts/contract-design-recipe.md +1 -1
  371. package/templates/prompts/db-management-recipe.md +3 -3
  372. package/templates/prompts/deployment-recipe.md +3 -3
  373. package/templates/prompts/performance-optimization-recipe.md +3 -3
  374. package/templates/prompts/pull-request-template.md +2 -2
  375. package/templates/prompts/security-audit-recipe.md +3 -3
  376. package/templates/standards/crud-governance.md +1 -1
  377. package/templates/standards/deployment-standards.md +1 -1
  378. package/templates/standards/governance-standards.md +1 -1
  379. package/templates/standards/llm-governance.md +1 -1
  380. package/templates/standards/nextjs-standards.md +13 -0
  381. package/templates/standards/observability-standards.md +1 -1
  382. package/templates/standards/security-audit-standards.md +1 -1
  383. package/templates/standards/security-standards.md +1 -1
  384. package/templates/standards/testing-standards.md +1 -1
  385. package/templates/standards/vite-standards.md +13 -0
  386. package/framework-mcp/package-lock.json +0 -1191
  387. package/framework-mcp/src/declarations.d.ts +0 -17
  388. package/framework-mcp/src/tools/types.ts +0 -89
  389. package/framework-mcp/src/utils/compliance.ts +0 -95
  390. package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
  391. package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
  392. package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
  393. package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
  394. package/framework-mcp/tsconfig.json +0 -14
  395. package/src/cli/commands/init/scaffold-docs.ts +0 -44
  396. package/src/cli/commands/log.ts +0 -37
  397. package/src/cli/commands/orchestrate.ts +0 -450
  398. package/src/cli/commands/plan.ts +0 -113
  399. package/src/cli/commands/status.ts +0 -44
  400. package/src/cli/commands/trace.ts +0 -31
  401. package/src/modules/adapters/definitions.ts +0 -171
  402. package/src/modules/adapters/registry.ts +0 -27
  403. package/src/modules/adapters/types.ts +0 -16
  404. package/src/modules/agents/types.ts +0 -37
  405. package/src/schema/agent-lifecycle-schema.json +0 -59
  406. package/src/shared/types.ts +0 -20
  407. /package/{src/contracts/index.ts → framework-mcp/dist/src/contracts/index.js} +0 -0
@@ -1,29 +1,23 @@
1
1
  import fs from "fs";
2
2
  import { safePath } from "../../utils/security.js";
3
- import { ReadFileArgs, ToolResult } from "../types.js";
4
3
  import { Metrics } from "../../utils/metrics.js";
5
-
6
- export function handleReadFile(projectRoot: string, args: ReadFileArgs): ToolResult {
4
+ export function handleReadFile(projectRoot, args) {
7
5
  if (!args.path) {
8
6
  const err = "Missing 'path' argument.";
9
7
  Metrics.logError(projectRoot, "@mcp", "read_file", err);
10
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
8
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
11
9
  }
12
-
13
10
  try {
14
11
  const filePath = safePath(projectRoot, args.path);
15
12
  if (!fs.existsSync(filePath)) {
16
13
  const err = `File not found: ${args.path}`;
17
14
  Metrics.logError(projectRoot, "@mcp", "read_file", err);
18
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
15
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
19
16
  }
20
-
21
17
  const startLine = args.startLine;
22
18
  const endLine = args.endLine;
23
-
24
19
  const content = fs.readFileSync(filePath, "utf8");
25
20
  const lines = content.split(/\r?\n/);
26
-
27
21
  if (startLine !== undefined || endLine !== undefined) {
28
22
  const start = startLine !== undefined ? Math.max(1, startLine) - 1 : 0;
29
23
  const end = endLine !== undefined ? Math.min(lines.length, endLine) : lines.length;
@@ -32,7 +26,6 @@ export function handleReadFile(projectRoot: string, args: ReadFileArgs): ToolRes
32
26
  Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
33
27
  return { content: [{ type: "text", text: sliced }] };
34
28
  }
35
-
36
29
  // Default protection limit: 1000 lines
37
30
  const DEFAULT_MAX_LINES = 1000;
38
31
  if (lines.length > DEFAULT_MAX_LINES) {
@@ -41,18 +34,18 @@ export function handleReadFile(projectRoot: string, args: ReadFileArgs): ToolRes
41
34
  Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path} (truncated)`, tokens);
42
35
  return {
43
36
  content: [{
44
- type: "text",
45
- text: `${sliced}\n\n... [TRUNCATED - File is too long (${lines.length} lines). Only the first ${DEFAULT_MAX_LINES} lines are shown. Use startLine and endLine parameters to read other parts of the file.]`
46
- }]
37
+ type: "text",
38
+ text: `${sliced}\n\n... [TRUNCATED - File is too long (${lines.length} lines). Only the first ${DEFAULT_MAX_LINES} lines are shown. Use startLine and endLine parameters to read other parts of the file.]`
39
+ }]
47
40
  };
48
41
  }
49
-
50
42
  const tokens = Metrics.estimateTokens(content);
51
43
  Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
52
44
  return { content: [{ type: "text", text: content }] };
53
- } catch (e) {
45
+ }
46
+ catch (e) {
54
47
  const err = `Failed to read file: ${String(e)}`;
55
48
  Metrics.logError(projectRoot, "@mcp", `read_file:${args.path}`, err);
56
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
49
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
57
50
  }
58
51
  }
@@ -1,24 +1,22 @@
1
1
  import fs from "fs";
2
2
  import { safePath } from "../../utils/security.js";
3
3
  import { writeTextFileAtomic } from "../../utils/fs.js";
4
- import { ReplaceTextArgs, ToolResult } from "../types.js";
5
4
  import { Metrics } from "../../utils/metrics.js";
6
-
7
- import { verifyCorporateCompliance } from "../../utils/compliance.js";
8
-
9
- export function handleReplaceText(projectRoot: string, args: ReplaceTextArgs): ToolResult {
5
+ import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
6
+ import { verifyWritePermission } from "../../utils/permissions.js";
7
+ export async function handleReplaceText(projectRoot, args) {
10
8
  const filePath = safePath(projectRoot, args.path);
9
+ // ENFORCE PERMISSION MATRIX
10
+ verifyWritePermission(projectRoot, args.path);
11
11
  const content = fs.readFileSync(filePath, "utf8");
12
12
  const oldText = args.oldText;
13
13
  const newText = args.newText;
14
14
  const allowMultiple = args.allowMultiple || false; // Default to false
15
-
16
15
  if (!content.includes(oldText)) {
17
16
  const err = `Text not found in file: ${oldText.slice(0, 100)}...`;
18
17
  Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
19
18
  throw new Error(err);
20
19
  }
21
-
22
20
  // Surgical precision guard: reject ambiguous replacements unless allowMultiple is true.
23
21
  if (!allowMultiple) {
24
22
  const firstIndex = content.indexOf(oldText);
@@ -26,29 +24,27 @@ export function handleReplaceText(projectRoot: string, args: ReplaceTextArgs): T
26
24
  if (firstIndex !== lastIndex) {
27
25
  const count = (content.match(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length;
28
26
  const err = `Ambiguous replacement: "${oldText.slice(0, 80)}..." found ${count} times in ${args.path}. ` +
29
- "Provide a longer, unique context string or set 'allow_multiple' to true.";
27
+ "Provide a longer, unique context string or set 'allow_multiple' to true.";
30
28
  Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
31
29
  throw new Error(err);
32
30
  }
33
31
  }
34
-
35
32
  // Perform replacement(s).
36
33
  // Use a function replacer so special patterns ($&, $1, $$) inside newText
37
34
  // are treated literally and never reinterpreted as regex backreferences.
38
- let newContent: string;
35
+ let newContent;
39
36
  if (allowMultiple) {
40
37
  newContent = content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), () => newText);
41
- } else {
38
+ }
39
+ else {
42
40
  newContent = content.replace(oldText, () => newText);
43
41
  }
44
-
45
42
  // ENFORCE CORPORATE COMPLIANCE
46
- verifyCorporateCompliance(newContent, args.path as string);
47
-
43
+ verifyCorporateCompliance(newContent, args.path);
44
+ // ENFORCE RISK & HUMAN APPROVAL GATEWAY
45
+ await verifyRiskAndAwaitApproval(projectRoot, newContent, args.path);
48
46
  writeTextFileAtomic(filePath, newContent);
49
-
50
47
  const tokens = Metrics.estimateTokens(newText);
51
48
  Metrics.logUsage(projectRoot, "@mcp", `replace_text: ${args.path}`, tokens);
52
-
53
- return { content: [{ type: "text", text: `✅ Surgical edit successful in ${args.path}` }] };
49
+ return { content: [{ type: "text", text: `[OK] Surgical edit successful in ${args.path}` }] };
54
50
  }
@@ -3,30 +3,27 @@ import path from "path";
3
3
  import { safePath, resolveFrameworkDir } from "../../utils/security.js";
4
4
  import { writeTextFileAtomic, appendFileSafe } from "../../utils/fs.js";
5
5
  import { Metrics } from "../../utils/metrics.js";
6
- import { WriteFileArgs, ToolResult } from "../types.js";
7
-
8
- import { verifyCorporateCompliance } from "../../utils/compliance.js";
9
-
10
- export function handleWriteFile(projectRoot: string, args: WriteFileArgs): ToolResult {
6
+ import { verifyCorporateCompliance, verifyRiskAndAwaitApproval } from "../../utils/compliance.js";
7
+ import { verifyWritePermission } from "../../utils/permissions.js";
8
+ export async function handleWriteFile(projectRoot, args) {
11
9
  if (!args.path || args.content === undefined) {
12
10
  const err = "Missing 'path' or 'content' argument.";
13
11
  Metrics.logError(projectRoot, "@mcp", "write_file", err);
14
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
12
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
15
13
  }
16
-
17
14
  try {
18
15
  const filePath = safePath(projectRoot, args.path);
19
16
  const content = args.content;
20
-
17
+ // ENFORCE PERMISSION MATRIX
18
+ verifyWritePermission(projectRoot, args.path);
21
19
  // ENFORCE CORPORATE COMPLIANCE
22
20
  verifyCorporateCompliance(content, args.path);
23
-
21
+ // ENFORCE RISK & HUMAN APPROVAL GATEWAY
22
+ await verifyRiskAndAwaitApproval(projectRoot, content, args.path);
24
23
  writeTextFileAtomic(filePath, content);
25
-
26
24
  // AUTO-LOGGING & METRICS
27
25
  const tokens = Metrics.estimateTokens(content);
28
26
  Metrics.logUsage(projectRoot, "@mcp", `write_file: ${args.path}`, tokens);
29
-
30
27
  try {
31
28
  const frameworkDir = resolveFrameworkDir(projectRoot);
32
29
  const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
@@ -34,12 +31,13 @@ export function handleWriteFile(projectRoot: string, args: WriteFileArgs): ToolR
34
31
  const entry = `\n### ${new Date().toISOString().split("T")[0]} — Auto-Update\n- **Action:** wrote file \`${args.path}\` (${tokens} tokens estimated).\n`;
35
32
  appendFileSafe(memoryPath, entry);
36
33
  }
37
- } catch { /* ignore memory logging errors */ }
38
-
39
- return { content: [{ type: "text", text: `✅ File written: ${args.path}` }] };
40
- } catch (e) {
34
+ }
35
+ catch { /* ignore memory logging errors */ }
36
+ return { content: [{ type: "text", text: `[OK] File written: ${args.path}` }] };
37
+ }
38
+ catch (e) {
41
39
  const err = `Failed to write file: ${String(e)}`;
42
40
  Metrics.logError(projectRoot, "@mcp", `write_file:${args.path}`, err);
43
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
41
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
44
42
  }
45
43
  }
@@ -1,49 +1,41 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { ToolArgs, ToolResult } from "../types.js";
4
-
5
3
  /**
6
4
  * Audits package.json for unused or duplicate-like packages.
7
5
  * Focuses on project health and cleanup.
8
6
  */
9
- export function handleAuditDependencies(projectRoot: string, _args: ToolArgs): ToolResult {
7
+ export function handleAuditDependencies(projectRoot, _args) {
10
8
  const pkgPath = path.join(projectRoot, "package.json");
11
9
  if (!fs.existsSync(pkgPath)) {
12
10
  throw new Error("package.json not found.");
13
11
  }
14
-
15
12
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
16
13
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
17
14
  const depNames = Object.keys(deps);
18
-
19
- const results: string[] = [];
20
-
15
+ const results = [];
21
16
  // 1. Look for similar packages (potential duplicates)
22
- const similarityGroups: Record<string, string[]> = {
17
+ const similarityGroups = {
23
18
  "CSS/Styling": ["tailwind", "panda", "styled-components", "emotion", "sass"],
24
19
  "Testing": ["vitest", "jest", "mocha", "jasmine"],
25
20
  "Fetching": ["axios", "ky", "fetch"]
26
21
  };
27
-
28
22
  for (const [group, patterns] of Object.entries(similarityGroups)) {
29
23
  const found = depNames.filter(d => patterns.some(p => d.includes(p)));
30
24
  if (found.length > 1) {
31
- results.push(`⚠️ Potential redundancy in [${group}]: Found ${found.join(", ")}`);
25
+ results.push(`[WARN] Potential redundancy in [${group}]: Found ${found.join(", ")}`);
32
26
  }
33
27
  }
34
-
35
28
  // 2. Scan for "any" usage in package names (bad practice markers)
36
29
  const legacyDeps = depNames.filter(d => d.includes("legacy") || d.includes("compat"));
37
30
  if (legacyDeps.length > 0) {
38
31
  results.push(`ℹ️ Legacy compatibility packages detected: ${legacyDeps.join(", ")}`);
39
32
  }
40
-
41
33
  return {
42
34
  content: [{
43
- type: "text",
44
- text: results.length > 0
45
- ? `Dependency Audit Results:\n\n${results.join("\n")}`
46
- : " Dependencies look clean and consolidated."
47
- }]
35
+ type: "text",
36
+ text: results.length > 0
37
+ ? `Dependency Audit Results:\n\n${results.join("\n")}`
38
+ : "[OK] Dependencies look clean and consolidated."
39
+ }]
48
40
  };
49
41
  }
@@ -1,7 +1,5 @@
1
1
  import { safeExec } from "../../utils/cli.js";
2
- import { GetStatusArgs, ToolResult } from "../types.js";
3
-
4
- export function handleGetFrameworkStatus(projectRoot: string, args: GetStatusArgs): ToolResult {
2
+ export function handleGetFrameworkStatus(projectRoot, args) {
5
3
  const output = safeExec("npx", ["atabey", "status"], projectRoot, args.timeout);
6
4
  return { content: [{ type: "text", text: output }] };
7
5
  }
@@ -1,7 +1,5 @@
1
1
  import { safeExec } from "../../utils/cli.js";
2
- import { OrchestrateArgs, ToolResult } from "../types.js";
3
-
4
- export function handleOrchestrateLoop(projectRoot: string, args: OrchestrateArgs): ToolResult {
2
+ export function handleOrchestrateLoop(projectRoot, args) {
5
3
  const output = safeExec("npx", ["atabey", "orchestrate"], projectRoot, args.timeout);
6
4
  return { content: [{ type: "text", text: output }] };
7
5
  }
@@ -1,30 +1,27 @@
1
1
  import { execSync } from "child_process";
2
- import { RunTestsArgs, ToolResult } from "../types.js";
3
2
  import { getBackendLanguage, getDefaultTestCommand } from "../../utils/cli.js";
4
-
5
3
  /**
6
4
  * Executes project tests and returns results for agent analysis.
7
5
  */
8
- export function handleRunTests(projectRoot: string, args: RunTestsArgs): ToolResult {
6
+ export function handleRunTests(projectRoot, args) {
9
7
  const language = getBackendLanguage(projectRoot);
10
8
  const testCommand = args.command || getDefaultTestCommand(language);
11
-
12
9
  try {
13
10
  const output = execSync(testCommand, { cwd: projectRoot, encoding: "utf8", stdio: "pipe" });
14
11
  return {
15
- content: [{ type: "text", text: `✅ Tests passed successfully for ${language}!\n\n${output}` }]
12
+ content: [{ type: "text", text: `[OK] Tests passed successfully for ${language}!\n\n${output}` }]
16
13
  };
17
- } catch (error: unknown) {
18
- const err = error as { stderr?: Buffer; stdout?: Buffer };
14
+ }
15
+ catch (error) {
16
+ const err = error;
19
17
  const stderr = err.stderr?.toString() || "";
20
18
  const stdout = err.stdout?.toString() || "";
21
-
22
19
  return {
23
20
  isError: true,
24
- content: [{
25
- type: "text",
26
- text: `❌ Tests FAILED for ${language}!\n\n--- STDOUT ---\n${stdout}\n\n--- STDERR ---\n${stderr}`
27
- }]
21
+ content: [{
22
+ type: "text",
23
+ text: `[ERROR] Tests FAILED for ${language}!\n\n--- STDOUT ---\n${stdout}\n\n--- STDERR ---\n${stderr}`
24
+ }]
28
25
  };
29
26
  }
30
27
  }
@@ -0,0 +1,13 @@
1
+ import { safeExec } from "../../utils/cli.js";
2
+ export function handleSubmitPlan(projectRoot, args) {
3
+ if (!args.tasks || !Array.isArray(args.tasks)) {
4
+ return {
5
+ isError: true,
6
+ content: [{ type: "text", text: "[ERROR] Error: 'tasks' array is required for submit_plan." }]
7
+ };
8
+ }
9
+ const planJson = JSON.stringify(args.tasks);
10
+ // Escape for shell if necessary, but safeExec handles arguments as an array
11
+ const output = safeExec("npx", ["atabey", "plan:submit", planJson], projectRoot);
12
+ return { content: [{ type: "text", text: output }] };
13
+ }
@@ -1,7 +1,5 @@
1
1
  import { safeExec } from "../../utils/cli.js";
2
- import { UpdateContractHashArgs, ToolResult } from "../types.js";
3
-
4
- export function handleUpdateContractHash(projectRoot: string, args: UpdateContractHashArgs): ToolResult {
2
+ export function handleUpdateContractHash(projectRoot, args) {
5
3
  const output = safeExec("npx", ["atabey", "update-contract"], projectRoot, args.timeout);
6
4
  return { content: [{ type: "text", text: output }] };
7
5
  }
@@ -1,10 +1,8 @@
1
1
  import { safeExec } from "../../utils/cli.js";
2
- import { UpdateProjectMemoryArgs, ToolResult } from "../types.js";
3
-
4
- export function handleUpdateProjectMemory(projectRoot: string, args: UpdateProjectMemoryArgs): ToolResult {
2
+ export function handleUpdateProjectMemory(projectRoot, args) {
5
3
  const section = args.section;
6
4
  const content = args.content;
7
5
  // Using execFileSync with array args prevents command injection
8
6
  safeExec("npx", ["atabey", "update_project_memory", section, content], projectRoot);
9
- return { content: [{ type: "text", text: `✅ Section ${section} updated.` }] };
7
+ return { content: [{ type: "text", text: `[OK] Section ${section} updated.` }] };
10
8
  }
@@ -15,6 +15,7 @@ import { handleRunTests } from "./framework/run_tests.js";
15
15
  import { handleGetSystemHealth } from "./observability/get_health.js";
16
16
  import { handleCheckPorts } from "./observability/check_ports.js";
17
17
  import { handleOrchestrateLoop } from "./framework/orchestrate.js";
18
+ import { handleSubmitPlan } from "./framework/submit_plan.js";
18
19
  import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
19
20
  import { handleReadProjectMemory } from "./memory/read_memory.js";
20
21
  import { handleGetMemoryInsights } from "./memory/get_insights.js";
@@ -24,14 +25,11 @@ import { handleAcquireLock, handleReleaseLock } from "./control_plane/locking.js
24
25
  import { handleRegisterAgent } from "./control_plane/registry.js";
25
26
  import { handleRunCommand } from "./shell/run_command.js";
26
27
  import { handleCheckLint } from "./quality/check_lint.js";
27
- import { ToolHandler, ToolResult } from "./types.js";
28
-
29
28
  // Map of tool names to their handler functions
30
- const bind = <T>(fn: (root: string, args: T) => ToolResult | Promise<ToolResult>): ToolHandler => {
31
- return (root: string, args: unknown) => fn(root, args as T);
29
+ const bind = (fn) => {
30
+ return (root, args) => fn(root, args);
32
31
  };
33
-
34
- export const toolHandlers: Record<string, ToolHandler> = {
32
+ export const toolHandlers = {
35
33
  read_file: bind(handleReadFile),
36
34
  view_file: bind(handleReadFile), // Alias
37
35
  list_dir: bind(handleListDir),
@@ -51,6 +49,7 @@ export const toolHandlers: Record<string, ToolHandler> = {
51
49
  get_system_health: bind(handleGetSystemHealth),
52
50
  check_active_ports: bind(handleCheckPorts),
53
51
  orchestrate_loop: bind(handleOrchestrateLoop),
52
+ submit_plan: bind(handleSubmitPlan),
54
53
  send_agent_message: bind(handleSendAgentMessage),
55
54
  log_agent_action: bind(handleLogAgentAction),
56
55
  update_contract_hash: bind(handleUpdateContractHash),
@@ -60,5 +59,4 @@ export const toolHandlers: Record<string, ToolHandler> = {
60
59
  run_shell_command: bind(handleRunCommand),
61
60
  check_lint: bind(handleCheckLint),
62
61
  };
63
-
64
62
  export { TOOLS };
@@ -1,27 +1,21 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
- import { ToolArgs, ToolResult } from "../types.js";
5
-
6
4
  /**
7
5
  * Extracts key insights from the project memory to minimize token usage.
8
6
  * Returns only the active phase, trace, and the last 5 decisions/tasks.
9
7
  */
10
- export function handleGetMemoryInsights(projectRoot: string, _args: ToolArgs): ToolResult {
8
+ export function handleGetMemoryInsights(projectRoot, _args) {
11
9
  try {
12
10
  const frameworkDir = resolveFrameworkDir(projectRoot);
13
11
  const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
14
-
15
12
  if (!fs.existsSync(memoryPath)) {
16
13
  return { content: [{ type: "text", text: "New project: No history available." }] };
17
14
  }
18
-
19
15
  const content = fs.readFileSync(memoryPath, "utf8");
20
16
  const lines = content.split("\n");
21
-
22
17
  const activePhase = lines.find(l => l.includes("**Phase:**"))?.split("**Phase:**")[1]?.trim() || "Unknown";
23
18
  const activeTrace = lines.find(l => l.includes("**Trace ID:**"))?.split("**Trace ID:**")[1]?.trim() || "None";
24
-
25
19
  // Find the last 5 history items (heuristic)
26
20
  const historyStartIndex = lines.findIndex(l => l.toUpperCase().includes("HISTORY"));
27
21
  let recentHistory = "No history found.";
@@ -31,11 +25,10 @@ export function handleGetMemoryInsights(projectRoot: string, _args: ToolArgs): T
31
25
  .slice(-5)
32
26
  .join("\n");
33
27
  }
34
-
35
- const insights = `🧠 **Memory Insights**\n- **Phase:** ${activePhase}\n- **Trace:** ${activeTrace}\n\n**Recent Actions:**\n${recentHistory}`;
36
-
28
+ const insights = `[MEMORY] **Memory Insights**\n- **Phase:** ${activePhase}\n- **Trace:** ${activeTrace}\n\n**Recent Actions:**\n${recentHistory}`;
37
29
  return { content: [{ type: "text", text: insights }] };
38
- } catch (e) {
30
+ }
31
+ catch (e) {
39
32
  return { isError: true, content: [{ type: "text", text: `Failed to extract insights: ${String(e)}` }] };
40
33
  }
41
34
  }
@@ -1,28 +1,25 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
- import { ToolArgs, ToolResult } from "../types.js";
5
-
6
4
  /**
7
5
  * Reads the project's central memory (PROJECT_MEMORY.md).
8
6
  * This is the "brain" of the project.
9
7
  */
10
- export function handleReadProjectMemory(projectRoot: string, _args: ToolArgs): ToolResult {
8
+ export function handleReadProjectMemory(projectRoot, _args) {
11
9
  try {
12
10
  const frameworkDir = resolveFrameworkDir(projectRoot);
13
11
  const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
14
-
15
12
  if (!fs.existsSync(memoryPath)) {
16
13
  return {
17
14
  content: [{ type: "text", text: "ℹ️ Project memory file not found. It might be a new project." }]
18
15
  };
19
16
  }
20
-
21
17
  const content = fs.readFileSync(memoryPath, "utf8");
22
18
  return {
23
19
  content: [{ type: "text", text: content }]
24
20
  };
25
- } catch (e) {
21
+ }
22
+ catch (e) {
26
23
  return {
27
24
  isError: true,
28
25
  content: [{ type: "text", text: `Failed to read project memory: ${String(e)}` }]
@@ -1,16 +1,12 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
- import { LogAgentActionArgs, ToolResult } from "../types.js";
5
-
6
- export function handleLogAgentAction(projectRoot: string, args: LogAgentActionArgs): ToolResult {
4
+ export function handleLogAgentAction(projectRoot, args) {
7
5
  const { agent, action, traceId, status, summary } = args;
8
6
  const findings = args.findings ? args.findings.split(",").map(f => f.trim()) : [];
9
-
10
7
  const frameworkDir = resolveFrameworkDir(projectRoot);
11
8
  const agentName = agent.replace("@", "");
12
9
  const logPath = path.join(projectRoot, frameworkDir, "logs", `${agentName}.json`);
13
-
14
10
  const logEntry = {
15
11
  timestamp: new Date().toISOString(),
16
12
  agent,
@@ -20,9 +16,7 @@ export function handleLogAgentAction(projectRoot: string, args: LogAgentActionAr
20
16
  summary,
21
17
  findings
22
18
  };
23
-
24
19
  fs.mkdirSync(path.dirname(logPath), { recursive: true });
25
20
  fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
26
-
27
- return { content: [{ type: "text", text: `✅ Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
21
+ return { content: [{ type: "text", text: `[OK] Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
28
22
  }
@@ -1,25 +1,20 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
- import { SendAgentMessageArgs, ToolResult } from "../types.js";
5
4
  import { Metrics } from "../../utils/metrics.js";
6
-
7
- export async function handleSendAgentMessage(projectRoot: string, args: SendAgentMessageArgs): Promise<ToolResult> {
5
+ export async function handleSendAgentMessage(projectRoot, args) {
8
6
  const { to, category, content, traceId, parentId, requiresApproval } = args;
9
7
  const from = args.from || "@mcp";
10
-
11
8
  if (!to || !category || !content || !traceId) {
12
9
  const err = "Missing required messaging arguments (to, category, content, or traceId).";
13
10
  Metrics.logError(projectRoot, from, "send_agent_message", err);
14
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
11
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
15
12
  }
16
-
17
13
  const frameworkDir = resolveFrameworkDir(projectRoot);
18
14
  const messagesDir = path.join(projectRoot, frameworkDir, "messages");
19
15
  const agentName = to.replace("@", "");
20
16
  const messagePath = path.join(messagesDir, `${agentName}.json`);
21
17
  const lockPath = path.join(messagesDir, `${agentName}.lock`);
22
-
23
18
  // Hermes Lock Protocol: Retry 20 times with 500ms delay
24
19
  let retries = 20;
25
20
  let acquired = false;
@@ -33,7 +28,8 @@ export async function handleSendAgentMessage(projectRoot: string, args: SendAgen
33
28
  fs.renameSync(lockPath, tempLockPath);
34
29
  fs.unlinkSync(tempLockPath);
35
30
  }
36
- } catch {
31
+ }
32
+ catch {
37
33
  // ignore if concurrently unlinked or renamed
38
34
  }
39
35
  }
@@ -41,31 +37,30 @@ export async function handleSendAgentMessage(projectRoot: string, args: SendAgen
41
37
  fs.writeFileSync(lockPath, `Locked by ${from} at ${new Date().toISOString()}`, { flag: "wx" });
42
38
  acquired = true;
43
39
  break;
44
- } catch (err: unknown) {
45
- const error = err as { code?: string; message?: string };
40
+ }
41
+ catch (err) {
42
+ const error = err;
46
43
  if (error.code === "EEXIST") {
47
44
  retries--;
48
45
  if (retries > 0) {
49
46
  await new Promise((resolve) => setTimeout(resolve, 500));
50
47
  }
51
- } else {
52
- return { content: [{ type: "text", text: `❌ Unexpected lock acquisition error: ${error.message || String(err)}` }], isError: true };
48
+ }
49
+ else {
50
+ return { content: [{ type: "text", text: `[ERROR] Unexpected lock acquisition error: ${error.message || String(err)}` }], isError: true };
53
51
  }
54
52
  }
55
53
  }
56
-
57
54
  if (!acquired) {
58
55
  const err = `Could not send message to ${to}: Hermes lock is busy.`;
59
56
  Metrics.logError(projectRoot, from, "send_agent_message", err);
60
- return { content: [{ type: "text", text: `❌ ${err}` }], isError: true };
57
+ return { content: [{ type: "text", text: `[ERROR] ${err}` }], isError: true };
61
58
  }
62
-
63
59
  try {
64
60
  const defaultPriority = (category === "ALERT" || category === "ACTION") ? "HIGH" : "NORMAL";
65
61
  const finalRequiresApproval = requiresApproval !== undefined
66
62
  ? requiresApproval
67
63
  : category === "ALERT";
68
-
69
64
  const message = {
70
65
  timestamp: new Date().toISOString(),
71
66
  from,
@@ -78,18 +73,20 @@ export async function handleSendAgentMessage(projectRoot: string, args: SendAgen
78
73
  status: "PENDING",
79
74
  requiresApproval: finalRequiresApproval
80
75
  };
81
-
82
76
  fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
83
- return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
84
- } catch (e) {
77
+ return { content: [{ type: "text", text: `[OK] Message sent to ${to} (from: ${from})` }] };
78
+ }
79
+ catch (e) {
85
80
  const err = `Failed to write message: ${String(e)}`;
86
81
  Metrics.logError(projectRoot, from, "send_agent_message", err);
87
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
88
- } finally {
82
+ return { isError: true, content: [{ type: "text", text: `[ERROR] ${err}` }] };
83
+ }
84
+ finally {
89
85
  if (acquired && fs.existsSync(lockPath)) {
90
86
  try {
91
87
  fs.unlinkSync(lockPath);
92
- } catch {
88
+ }
89
+ catch {
93
90
  // ignore
94
91
  }
95
92
  }
@@ -1,28 +1,24 @@
1
1
  import { execSync } from "child_process";
2
- import { CheckActivePortsArgs, ToolResult } from "../types.js";
3
-
4
2
  /**
5
3
  * Checks for active network ports and their status.
6
4
  */
7
- export function handleCheckPorts(projectRoot: string, args: CheckActivePortsArgs): ToolResult {
5
+ export function handleCheckPorts(projectRoot, args) {
8
6
  const filter = args.filter || ""; // Optional filter (e.g., ":3000")
9
-
10
7
  try {
11
8
  // Using 'lsof -i -P -n' to list open files and network connections
12
9
  // Note: may require permissions or behave differently on non-Unix systems
13
10
  const command = process.platform === "win32"
14
11
  ? `netstat -ano | findstr LISTENING ${filter ? `| findstr ${filter}` : ""}`
15
12
  : `lsof -i -P -n | grep LISTEN ${filter ? `| grep ${filter}` : ""}`;
16
-
17
13
  const output = execSync(command, { encoding: "utf8" });
18
-
19
14
  return {
20
15
  content: [{
21
- type: "text",
22
- text: `📡 **Active Listening Ports:**\n\n${output || "No active listening ports found matching filter."}`
23
- }]
16
+ type: "text",
17
+ text: `[SIGNAL] **Active Listening Ports:**\n\n${output || "No active listening ports found matching filter."}`
18
+ }]
24
19
  };
25
- } catch (_e) {
20
+ }
21
+ catch (_e) {
26
22
  return {
27
23
  content: [{ type: "text", text: "ℹ️ No active ports found or command failed (this is normal if nothing is listening)." }]
28
24
  };