atabey 0.0.5 → 0.0.7

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 (388) 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.d.ts +1 -0
  8. package/dist/framework-mcp/src/index.js +30 -5
  9. package/dist/framework-mcp/src/index.js.map +1 -1
  10. package/dist/framework-mcp/src/resources/index.d.ts +10 -0
  11. package/dist/framework-mcp/src/resources/index.js +59 -0
  12. package/dist/framework-mcp/src/resources/index.js.map +1 -0
  13. package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
  14. package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
  15. package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
  16. package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
  17. package/dist/framework-mcp/src/tools/definitions.js +33 -1
  18. package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
  19. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
  20. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
  21. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
  22. package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
  23. package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
  24. package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
  25. package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
  26. package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
  27. package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
  28. package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
  29. package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
  30. package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
  31. package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
  32. package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
  33. package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
  34. package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
  35. package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
  36. package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
  37. package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
  38. package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
  39. package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
  40. package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
  41. package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
  42. package/dist/framework-mcp/src/tools/index.js +2 -0
  43. package/dist/framework-mcp/src/tools/index.js.map +1 -1
  44. package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
  45. package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
  46. package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
  47. package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
  48. package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
  49. package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
  50. package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
  51. package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
  52. package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
  53. package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
  54. package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
  55. package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
  56. package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
  57. package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
  58. package/dist/framework-mcp/src/tools/types.d.ts +1 -0
  59. package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
  60. package/dist/framework-mcp/src/utils/compliance.js +158 -5
  61. package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
  62. package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
  63. package/dist/framework-mcp/src/utils/permissions.js +72 -0
  64. package/dist/framework-mcp/src/utils/permissions.js.map +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 +1 -1
  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 +5 -2
  188. package/dist/src/shared/constants.js +4 -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/agent-memory-v2.test.d.ts +1 -0
  197. package/dist/tests/agent-memory-v2.test.js +68 -0
  198. package/dist/tests/agent-memory-v2.test.js.map +1 -0
  199. package/dist/tests/agents-definitions.test.js +42 -0
  200. package/dist/tests/agents-definitions.test.js.map +1 -1
  201. package/dist/tests/integration/hermes_locking.test.js +7 -10
  202. package/dist/tests/integration/hermes_locking.test.js.map +1 -1
  203. package/dist/tests/orchestrate.test.js +5 -1
  204. package/dist/tests/orchestrate.test.js.map +1 -1
  205. package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
  206. package/dist/tests/orchestrator-dependencies.test.js +52 -0
  207. package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
  208. package/dist/tests/plan.test.d.ts +1 -0
  209. package/dist/tests/plan.test.js +63 -0
  210. package/dist/tests/plan.test.js.map +1 -0
  211. package/dist/tests/planning-engine.test.d.ts +1 -0
  212. package/dist/tests/planning-engine.test.js +50 -0
  213. package/dist/tests/planning-engine.test.js.map +1 -0
  214. package/dist/tests/status-cost.test.d.ts +1 -0
  215. package/dist/tests/status-cost.test.js +54 -0
  216. package/dist/tests/status-cost.test.js.map +1 -0
  217. package/dist/tests/status.test.js +8 -7
  218. package/dist/tests/status.test.js.map +1 -1
  219. package/dist/tests/trace-replay.test.d.ts +1 -0
  220. package/dist/tests/trace-replay.test.js +65 -0
  221. package/dist/tests/trace-replay.test.js.map +1 -0
  222. package/dist/tests/trace.test.js +14 -7
  223. package/dist/tests/trace.test.js.map +1 -1
  224. package/dist/ui/assets/index-Bkt7APzu.css +1 -0
  225. package/dist/ui/assets/index-CeX-06mI.js +49 -0
  226. package/dist/ui/index.html +14 -0
  227. package/package.json +5 -4
  228. package/templates/prompts/contract-design-recipe.md +1 -1
  229. package/templates/prompts/db-management-recipe.md +3 -3
  230. package/templates/prompts/deployment-recipe.md +3 -3
  231. package/templates/prompts/performance-optimization-recipe.md +3 -3
  232. package/templates/prompts/pull-request-template.md +2 -2
  233. package/templates/prompts/security-audit-recipe.md +3 -3
  234. package/templates/standards/crud-governance.md +1 -1
  235. package/templates/standards/deployment-standards.md +1 -1
  236. package/templates/standards/governance-standards.md +1 -1
  237. package/templates/standards/llm-governance.md +1 -1
  238. package/templates/standards/nextjs-standards.md +13 -0
  239. package/templates/standards/observability-standards.md +1 -1
  240. package/templates/standards/security-audit-standards.md +1 -1
  241. package/templates/standards/security-standards.md +1 -1
  242. package/templates/standards/testing-standards.md +1 -1
  243. package/templates/standards/vite-standards.md +13 -0
  244. package/framework-mcp/dist/constants.js +0 -64
  245. package/framework-mcp/dist/index.js +0 -119
  246. package/framework-mcp/dist/tools/control_plane/locking.js +0 -82
  247. package/framework-mcp/dist/tools/control_plane/registry.js +0 -34
  248. package/framework-mcp/dist/tools/definitions.js +0 -290
  249. package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +0 -59
  250. package/framework-mcp/dist/tools/file_system/patch_file.js +0 -29
  251. package/framework-mcp/dist/tools/file_system/read_file.js +0 -51
  252. package/framework-mcp/dist/tools/file_system/replace_text.js +0 -45
  253. package/framework-mcp/dist/tools/file_system/write_file.js +0 -38
  254. package/framework-mcp/dist/tools/framework/audit_deps.js +0 -41
  255. package/framework-mcp/dist/tools/framework/get_status.js +0 -5
  256. package/framework-mcp/dist/tools/framework/orchestrate.js +0 -5
  257. package/framework-mcp/dist/tools/framework/run_tests.js +0 -27
  258. package/framework-mcp/dist/tools/framework/update_contract_hash.js +0 -5
  259. package/framework-mcp/dist/tools/framework/update_memory.js +0 -8
  260. package/framework-mcp/dist/tools/index.js +0 -60
  261. package/framework-mcp/dist/tools/memory/get_insights.js +0 -34
  262. package/framework-mcp/dist/tools/memory/read_memory.js +0 -28
  263. package/framework-mcp/dist/tools/messaging/log_action.js +0 -22
  264. package/framework-mcp/dist/tools/messaging/send_message.js +0 -94
  265. package/framework-mcp/dist/tools/observability/check_ports.js +0 -26
  266. package/framework-mcp/dist/tools/observability/get_health.js +0 -19
  267. package/framework-mcp/dist/tools/quality/check_lint.js +0 -30
  268. package/framework-mcp/dist/tools/search/get_gaps.js +0 -48
  269. package/framework-mcp/dist/tools/search/get_map.js +0 -43
  270. package/framework-mcp/dist/tools/search/grep_search.js +0 -75
  271. package/framework-mcp/dist/tools/search/list_dir.js +0 -28
  272. package/framework-mcp/dist/tools/shell/run_command.js +0 -56
  273. package/framework-mcp/dist/utils/cli.js +0 -59
  274. package/framework-mcp/dist/utils/compliance.js +0 -78
  275. package/framework-mcp/dist/utils/fs.js +0 -44
  276. package/framework-mcp/dist/utils/metrics.js +0 -56
  277. package/framework-mcp/dist/utils/security.js +0 -60
  278. package/framework-mcp/package-lock.json +0 -1191
  279. package/framework-mcp/package.json +0 -26
  280. package/framework-mcp/src/constants.ts +0 -78
  281. package/framework-mcp/src/declarations.d.ts +0 -17
  282. package/framework-mcp/src/index.ts +0 -144
  283. package/framework-mcp/src/tools/control_plane/locking.ts +0 -89
  284. package/framework-mcp/src/tools/control_plane/registry.ts +0 -38
  285. package/framework-mcp/src/tools/definitions.ts +0 -292
  286. package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +0 -79
  287. package/framework-mcp/src/tools/file_system/patch_file.ts +0 -39
  288. package/framework-mcp/src/tools/file_system/read_file.ts +0 -58
  289. package/framework-mcp/src/tools/file_system/replace_text.ts +0 -54
  290. package/framework-mcp/src/tools/file_system/write_file.ts +0 -45
  291. package/framework-mcp/src/tools/framework/audit_deps.ts +0 -49
  292. package/framework-mcp/src/tools/framework/get_status.ts +0 -7
  293. package/framework-mcp/src/tools/framework/orchestrate.ts +0 -7
  294. package/framework-mcp/src/tools/framework/run_tests.ts +0 -30
  295. package/framework-mcp/src/tools/framework/update_contract_hash.ts +0 -7
  296. package/framework-mcp/src/tools/framework/update_memory.ts +0 -10
  297. package/framework-mcp/src/tools/index.ts +0 -64
  298. package/framework-mcp/src/tools/memory/get_insights.ts +0 -41
  299. package/framework-mcp/src/tools/memory/read_memory.ts +0 -31
  300. package/framework-mcp/src/tools/messaging/log_action.ts +0 -28
  301. package/framework-mcp/src/tools/messaging/send_message.ts +0 -97
  302. package/framework-mcp/src/tools/observability/check_ports.ts +0 -30
  303. package/framework-mcp/src/tools/observability/get_health.ts +0 -24
  304. package/framework-mcp/src/tools/quality/check_lint.ts +0 -36
  305. package/framework-mcp/src/tools/search/get_gaps.ts +0 -54
  306. package/framework-mcp/src/tools/search/get_map.ts +0 -48
  307. package/framework-mcp/src/tools/search/grep_search.ts +0 -75
  308. package/framework-mcp/src/tools/search/list_dir.ts +0 -34
  309. package/framework-mcp/src/tools/shell/run_command.ts +0 -66
  310. package/framework-mcp/src/tools/types.ts +0 -89
  311. package/framework-mcp/src/utils/cli.ts +0 -53
  312. package/framework-mcp/src/utils/compliance.ts +0 -95
  313. package/framework-mcp/src/utils/fs.ts +0 -45
  314. package/framework-mcp/src/utils/metrics.ts +0 -73
  315. package/framework-mcp/src/utils/security.ts +0 -66
  316. package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
  317. package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
  318. package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
  319. package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
  320. package/framework-mcp/tsconfig.json +0 -14
  321. package/src/cli/adapters/core.ts +0 -91
  322. package/src/cli/adapters/index.ts +0 -5
  323. package/src/cli/adapters/paths.ts +0 -135
  324. package/src/cli/adapters/scaffold.ts +0 -95
  325. package/src/cli/adapters/utils.ts +0 -87
  326. package/src/cli/commands/approve.ts +0 -73
  327. package/src/cli/commands/check.ts +0 -188
  328. package/src/cli/commands/compliance.ts +0 -55
  329. package/src/cli/commands/contract.ts +0 -68
  330. package/src/cli/commands/explorer.ts +0 -45
  331. package/src/cli/commands/git.ts +0 -39
  332. package/src/cli/commands/init/scaffold-core.ts +0 -136
  333. package/src/cli/commands/init/scaffold-docs.ts +0 -44
  334. package/src/cli/commands/init/scaffold-ops.ts +0 -83
  335. package/src/cli/commands/init/scaffold-standards.ts +0 -67
  336. package/src/cli/commands/init.ts +0 -193
  337. package/src/cli/commands/knowledge.ts +0 -44
  338. package/src/cli/commands/lint.ts +0 -23
  339. package/src/cli/commands/log.ts +0 -37
  340. package/src/cli/commands/memory.ts +0 -6
  341. package/src/cli/commands/orchestrate.ts +0 -450
  342. package/src/cli/commands/plan.ts +0 -113
  343. package/src/cli/commands/script.ts +0 -20
  344. package/src/cli/commands/security.ts +0 -38
  345. package/src/cli/commands/status.ts +0 -44
  346. package/src/cli/commands/trace.ts +0 -31
  347. package/src/cli/index.ts +0 -322
  348. package/src/cli/shims.ts +0 -66
  349. package/src/cli/utils/claude.ts +0 -63
  350. package/src/cli/utils/compliance.ts +0 -191
  351. package/src/cli/utils/config-schema.ts +0 -48
  352. package/src/cli/utils/fs.ts +0 -170
  353. package/src/cli/utils/i18n.ts +0 -44
  354. package/src/cli/utils/memory.ts +0 -303
  355. package/src/cli/utils/pkg.ts +0 -317
  356. package/src/cli/utils/schemas.ts +0 -22
  357. package/src/cli/utils/string.ts +0 -55
  358. package/src/cli/utils/time.ts +0 -27
  359. package/src/cli/utils/ui.ts +0 -66
  360. package/src/contracts/index.ts +0 -1
  361. package/src/contracts/tasks.ts +0 -26
  362. package/src/modules/adapters/definitions.ts +0 -171
  363. package/src/modules/adapters/registry.ts +0 -27
  364. package/src/modules/adapters/shared.ts +0 -120
  365. package/src/modules/adapters/types.ts +0 -16
  366. package/src/modules/agents/definitions.ts +0 -460
  367. package/src/modules/agents/registry/analyst.ts +0 -44
  368. package/src/modules/agents/registry/architect.ts +0 -47
  369. package/src/modules/agents/registry/backend.ts +0 -46
  370. package/src/modules/agents/registry/database.ts +0 -43
  371. package/src/modules/agents/registry/devops.ts +0 -44
  372. package/src/modules/agents/registry/explorer.ts +0 -41
  373. package/src/modules/agents/registry/frontend.ts +0 -48
  374. package/src/modules/agents/registry/git.ts +0 -41
  375. package/src/modules/agents/registry/manager.ts +0 -58
  376. package/src/modules/agents/registry/mobile.ts +0 -44
  377. package/src/modules/agents/registry/native.ts +0 -44
  378. package/src/modules/agents/registry/quality.ts +0 -46
  379. package/src/modules/agents/registry/security.ts +0 -42
  380. package/src/modules/agents/types.ts +0 -37
  381. package/src/modules/skills/definitions.ts +0 -71
  382. package/src/schema/agent-lifecycle-schema.json +0 -59
  383. package/src/shared/constants.ts +0 -218
  384. package/src/shared/errors.ts +0 -75
  385. package/src/shared/fs.ts +0 -50
  386. package/src/shared/logger.ts +0 -139
  387. package/src/shared/types.ts +0 -20
  388. /package/{framework-mcp/dist/tools/types.js → dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts} +0 -0
@@ -1,290 +0,0 @@
1
- export const TOOLS = [
2
- {
3
- name: "read_file",
4
- description: "Read the content of a file within the project. Supports optional line range reading to prevent stream overload.",
5
- inputSchema: {
6
- type: "object",
7
- properties: {
8
- path: { type: "string", description: "Path to the file relative to project root" },
9
- startLine: { type: "number", description: "Optional starting line number (1-indexed)" },
10
- endLine: { type: "number", description: "Optional ending line number (inclusive)" },
11
- },
12
- required: ["path"],
13
- },
14
- },
15
- {
16
- name: "list_dir",
17
- description: "List the contents of a directory. Essential for codebase exploration.",
18
- inputSchema: {
19
- type: "object",
20
- properties: {
21
- path: { type: "string", description: "Path to the directory relative to project root (default: '.')" },
22
- },
23
- },
24
- },
25
- {
26
- name: "grep_search",
27
- description: "Perform a recursive regex search across the codebase to find functions, variables, or patterns.",
28
- inputSchema: {
29
- type: "object",
30
- properties: {
31
- pattern: { type: "string", description: "The regex pattern to search for" },
32
- includePattern: { type: "string", description: "Optional: Filter files by extension (e.g., '.ts')" },
33
- excludePattern: { type: "string", description: "Optional: Directory pattern to exclude (default: 'node_modules')" },
34
- },
35
- required: ["pattern"],
36
- },
37
- },
38
- {
39
- name: "write_file",
40
- description: "Write content to a file. Creates directories if missing.",
41
- inputSchema: {
42
- type: "object",
43
- properties: {
44
- path: { type: "string", description: "Path to the file relative to project root" },
45
- content: { type: "string", description: "Complete content of the file" },
46
- },
47
- required: ["path", "content"],
48
- },
49
- },
50
- {
51
- name: "replace_text",
52
- description: "Surgically replace a string in a file with another string.",
53
- inputSchema: {
54
- type: "object",
55
- properties: {
56
- path: { type: "string", description: "Path to the file" },
57
- oldText: { type: "string", description: "The exact text to find" },
58
- newText: { type: "string", description: "The text to replace it with" },
59
- allowMultiple: { type: "boolean", description: "Allow multiple replacements if oldText is not unique." }
60
- },
61
- required: ["path", "oldText", "newText"],
62
- },
63
- },
64
- {
65
- name: "batch_surgical_edit",
66
- description: "Perform multiple surgical text replacements across multiple files in a single batch request. More efficient for cross-cutting changes.",
67
- inputSchema: {
68
- type: "object",
69
- properties: {
70
- edits: {
71
- type: "array",
72
- items: {
73
- type: "object",
74
- properties: {
75
- path: { type: "string", description: "Path to the file" },
76
- oldText: { type: "string", description: "The exact text to find" },
77
- newText: { type: "string", description: "The text to replace it with" },
78
- allowMultiple: { type: "boolean", description: "Allow multiple replacements in this file." }
79
- },
80
- required: ["path", "oldText", "newText"]
81
- }
82
- }
83
- },
84
- required: ["edits"],
85
- },
86
- },
87
- {
88
- name: "patch_file",
89
- description: "Safely update a file by replacing a specific line range with new content.",
90
- inputSchema: {
91
- type: "object",
92
- properties: {
93
- path: { type: "string", description: "Path to the file" },
94
- startLine: { type: "number", description: "Starting line number (1-indexed)" },
95
- endLine: { type: "number", description: "Ending line number (inclusive)" },
96
- newContent: { type: "string", description: "The new lines to insert" },
97
- },
98
- required: ["path", "startLine", "endLine", "newContent"],
99
- },
100
- },
101
- {
102
- name: "get_project_map",
103
- description: "Generate a tree-view map of the project structure to visualize the layout. Useful for onboarding and architectural analysis.",
104
- inputSchema: {
105
- type: "object",
106
- properties: {
107
- maxDepth: { type: "number", description: "Maximum directory depth to scan (default: 3)" },
108
- includeFiles: { type: "boolean", description: "Whether to include files in the map (default: true)" }
109
- }
110
- }
111
- },
112
- {
113
- name: "get_project_gaps",
114
- description: "Scans the codebase for TODOs, FIXMEs, and empty function bodies. Helps identify what is left and where the agent might have skipped logic.",
115
- inputSchema: {
116
- type: "object",
117
- properties: {
118
- path: { type: "string", description: "Path to the source directory (default: 'src')" },
119
- },
120
- },
121
- },
122
- {
123
- name: "audit_dependencies",
124
- description: "Audits package.json for unused, redundant, or duplicate-like packages to ensure a clean dependency tree.",
125
- inputSchema: { type: "object", properties: {} },
126
- },
127
- {
128
- name: "run_tests",
129
- description: "Execute project test suites (Vitest, Playwright, etc.) and capture detailed pass/fail reports for analysis.",
130
- inputSchema: {
131
- type: "object",
132
- properties: {
133
- command: { type: "string", description: "The test command to run (default: project's standard test command)" }
134
- }
135
- }
136
- },
137
- {
138
- name: "get_system_health",
139
- description: "Retrieve real-time system metrics like CPU load, RAM usage, and uptime.",
140
- inputSchema: { type: "object", properties: {} }
141
- },
142
- {
143
- name: "check_active_ports",
144
- description: "Identify which network ports are currently active and listening. Helps verify if the dev server or API is running.",
145
- inputSchema: {
146
- type: "object",
147
- properties: {
148
- filter: { type: "string", description: "Optional: Filter results by port number or service name (e.g., ':3000')" }
149
- }
150
- }
151
- },
152
- {
153
- name: "get_framework_status",
154
- description: "Get the current project phase, active traces, and agent states.",
155
- inputSchema: { type: "object", properties: {} },
156
- },
157
- {
158
- name: "read_project_memory",
159
- description: "Read the full project central memory (PROJECT_MEMORY.md). Use this at the start of a session to gain context.",
160
- inputSchema: { type: "object", properties: {} },
161
- },
162
- {
163
- name: "get_memory_insights",
164
- description: "Retrieve a summarized version of the project memory (active phase, trace, and last 5 actions) to save tokens.",
165
- inputSchema: { type: "object", properties: {} },
166
- },
167
- {
168
- name: "update_project_memory",
169
- description: "Update a specific section in PROJECT_MEMORY.md.",
170
- inputSchema: {
171
- type: "object",
172
- properties: {
173
- section: { type: "string", description: "Section name (e.g., HISTORY, ACTIVE TASKS)" },
174
- content: { type: "string", description: "Markdown content to append or set" },
175
- },
176
- required: ["section", "content"],
177
- },
178
- },
179
- {
180
- name: "orchestrate_loop",
181
- description: "Process the pending Hermes messages and trigger dynamic state transitions.",
182
- inputSchema: { type: "object", properties: {} },
183
- },
184
- {
185
- name: "send_agent_message",
186
- description: "Send a Hermes protocol message to another agent for collaboration or sub-tasking.",
187
- inputSchema: {
188
- type: "object",
189
- properties: {
190
- from: { type: "string", description: "Sender agent (e.g., @manager, @backend)." },
191
- to: { type: "string", description: "Target agent (e.g., @backend, @quality)." },
192
- category: { type: "string", enum: ["ACTION", "DELEGATION", "SUBTASK", "REPLY", "ALERT"], description: "Message type." },
193
- content: { type: "string", description: "Task description or message content." },
194
- traceId: { type: "string", description: "Active Trace ID." },
195
- parentId: { type: "string", description: "Optional parent task trace ID for hierarchical tracking." },
196
- priority: { type: "string", enum: ["HIGH", "NORMAL", "LOW"], description: "Optional priority level (HIGH, NORMAL, LOW). Defaults to HIGH for ALERT/ACTION." },
197
- requiresApproval: { type: "boolean", description: "If true, this message will require manager approval before being processed." },
198
- },
199
- required: ["from", "to", "category", "content", "traceId"],
200
- },
201
- },
202
- {
203
- name: "acquire_lock",
204
- description: "Acquire a stateful lock on a shared resource (like PROJECT_MEMORY.md) to prevent concurrent write conflicts.",
205
- inputSchema: {
206
- type: "object",
207
- properties: {
208
- resource: { type: "string", description: "The resource name or path to lock (e.g., 'memory')." },
209
- agent: { type: "string", description: "The agent requesting the lock (e.g., '@backend')." },
210
- ttl: { type: "number", description: "Time-to-live in seconds before the lock auto-expires (default: 60)." }
211
- },
212
- required: ["resource", "agent"]
213
- }
214
- },
215
- {
216
- name: "release_lock",
217
- description: "Release a previously acquired lock on a resource.",
218
- inputSchema: {
219
- type: "object",
220
- properties: {
221
- resource: { type: "string", description: "The resource name or path." },
222
- agent: { type: "string", description: "The agent releasing the lock." }
223
- },
224
- required: ["resource", "agent"]
225
- }
226
- },
227
- {
228
- name: "register_agent",
229
- description: "Register an agent instance with the Control Plane and validate its permissions.",
230
- inputSchema: {
231
- type: "object",
232
- properties: {
233
- agent: { type: "string", description: "The agent name (e.g., '@backend')." },
234
- role: { type: "string", description: "The role of the agent." },
235
- capability: { type: "number", description: "The capability score (1-10)." }
236
- },
237
- required: ["agent", "role"]
238
- }
239
- },
240
- {
241
- name: "log_agent_action",
242
- description: "Log an agent action to the framework logs.",
243
- inputSchema: {
244
- type: "object",
245
- properties: {
246
- agent: { type: "string", description: "The agent name (e.g., @manager, @backend)" },
247
- action: { type: "string", description: "Action type or name" },
248
- traceId: { type: "string", description: "The active Trace ID" },
249
- status: { type: "string", enum: ["SUCCESS", "FAILURE"], description: "The status of the action" },
250
- summary: { type: "string", description: "Brief description of the action taken" },
251
- findings: { type: "string", description: "Optional comma-separated findings or details" }
252
- },
253
- required: ["agent", "action", "traceId", "status", "summary"]
254
- }
255
- },
256
- {
257
- name: "update_contract_hash",
258
- description: "Re-generate and synchronize the backend contract SHA-256 hash.",
259
- inputSchema: { type: "object", properties: {} }
260
- },
261
- {
262
- name: "run_shell_command",
263
- description: "Execute a shell command. For security, only a limited set of commands are allowed.",
264
- inputSchema: {
265
- type: "object",
266
- properties: {
267
- command: { type: "string", description: "The shell command to execute." },
268
- },
269
- required: ["command"],
270
- },
271
- },
272
- {
273
- name: "check_lint",
274
- description: "Run the project's linter (e.g., ESLint) to check for code quality and style issues.",
275
- inputSchema: { type: "object", properties: {} },
276
- },
277
- {
278
- name: "view_file",
279
- description: "Alias for read_file. Reads the content of a file within the project.",
280
- inputSchema: {
281
- type: "object",
282
- properties: {
283
- path: { type: "string", description: "Path to the file relative to project root" },
284
- startLine: { type: "number", description: "Optional starting line number (1-indexed)" },
285
- endLine: { type: "number", description: "Optional ending line number (inclusive)" },
286
- },
287
- required: ["path"],
288
- },
289
- }
290
- ];
@@ -1,59 +0,0 @@
1
- import fs from "fs";
2
- import { safePath } from "../../utils/security.js";
3
- import { writeTextFileAtomic } from "../../utils/fs.js";
4
- import { Metrics } from "../../utils/metrics.js";
5
- import { verifyCorporateCompliance } from "../../utils/compliance.js";
6
- /**
7
- * Performs multiple surgical text replacements across multiple files in a single batch.
8
- */
9
- export function handleBatchSurgicalEdit(projectRoot, args) {
10
- const edits = args.edits;
11
- if (!Array.isArray(edits) || edits.length === 0) {
12
- const err = "No edits provided in the batch request.";
13
- Metrics.logError(projectRoot, "@mcp", "batch_surgical_edit", err);
14
- throw new Error(err);
15
- }
16
- const results = [];
17
- let totalTokens = 0;
18
- for (const edit of edits) {
19
- const filePath = safePath(projectRoot, edit.path);
20
- if (!fs.existsSync(filePath)) {
21
- const err = `File not found: ${edit.path}`;
22
- Metrics.logError(projectRoot, "@mcp", `batch_surgical_edit:${edit.path}`, err);
23
- throw new Error(err);
24
- }
25
- const content = fs.readFileSync(filePath, "utf8");
26
- const { oldText, newText, allowMultiple = false } = edit;
27
- if (!content.includes(oldText)) {
28
- const err = `Text not found in file ${edit.path}`;
29
- Metrics.logError(projectRoot, "@mcp", `batch_surgical_edit:${edit.path}`, err);
30
- throw new Error(err);
31
- }
32
- // Surgical precision guard
33
- if (!allowMultiple) {
34
- const firstIndex = content.indexOf(oldText);
35
- const lastIndex = content.lastIndexOf(oldText);
36
- if (firstIndex !== lastIndex) {
37
- const err = `Ambiguous replacement in ${edit.path}`;
38
- Metrics.logError(projectRoot, "@mcp", `batch_surgical_edit:${edit.path}`, err);
39
- throw new Error(err);
40
- }
41
- }
42
- const newContent = allowMultiple
43
- ? content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), newText)
44
- : content.replace(oldText, newText);
45
- // ENFORCE CORPORATE COMPLIANCE
46
- verifyCorporateCompliance(newContent, edit.path);
47
- writeTextFileAtomic(filePath, newContent);
48
- const tokens = Metrics.estimateTokens(newText);
49
- totalTokens += tokens;
50
- results.push(`✅ Edited ${edit.path}`);
51
- }
52
- Metrics.logUsage(projectRoot, "@mcp", `batch_surgical_edit: ${edits.length} files`, totalTokens);
53
- return {
54
- content: [{
55
- type: "text",
56
- text: `Successfully performed ${edits.length} edits:\n${results.join("\n")}`
57
- }]
58
- };
59
- }
@@ -1,29 +0,0 @@
1
- import fs from "fs";
2
- import { safePath } from "../../utils/security.js";
3
- import { Metrics } from "../../utils/metrics.js";
4
- import { verifyCorporateCompliance } from "../../utils/compliance.js";
5
- export function handlePatchFile(projectRoot, args) {
6
- const filePath = safePath(projectRoot, args.path);
7
- const lines = fs.readFileSync(filePath, "utf8").split("\n");
8
- const start = args.startLine - 1;
9
- const end = args.endLine;
10
- const newContent = args.newContent.split("\n");
11
- if (start < 0 || start > lines.length) {
12
- const err = `Invalid start line: ${start + 1}. File has ${lines.length} lines.`;
13
- Metrics.logError(projectRoot, "@mcp", `patch_file:${args.path}`, err);
14
- throw new Error(err);
15
- }
16
- if (end < start + 1 || end > lines.length) {
17
- const err = `Invalid end line: ${end}. Must be between ${start + 1} and ${lines.length}.`;
18
- Metrics.logError(projectRoot, "@mcp", `patch_file:${args.path}`, err);
19
- throw new Error(err);
20
- }
21
- lines.splice(start, end - start, ...newContent);
22
- const patchedContent = lines.join("\n");
23
- // ENFORCE CORPORATE COMPLIANCE
24
- verifyCorporateCompliance(patchedContent, args.path);
25
- fs.writeFileSync(filePath, patchedContent);
26
- const tokens = Metrics.estimateTokens(args.newContent);
27
- Metrics.logUsage(projectRoot, "@mcp", `patch_file: ${args.path}`, tokens);
28
- return { content: [{ type: "text", text: `✅ File patched successfully: ${args.path}` }] };
29
- }
@@ -1,51 +0,0 @@
1
- import fs from "fs";
2
- import { safePath } from "../../utils/security.js";
3
- import { Metrics } from "../../utils/metrics.js";
4
- export function handleReadFile(projectRoot, args) {
5
- if (!args.path) {
6
- const err = "Missing 'path' argument.";
7
- Metrics.logError(projectRoot, "@mcp", "read_file", err);
8
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
9
- }
10
- try {
11
- const filePath = safePath(projectRoot, args.path);
12
- if (!fs.existsSync(filePath)) {
13
- const err = `File not found: ${args.path}`;
14
- Metrics.logError(projectRoot, "@mcp", "read_file", err);
15
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
16
- }
17
- const startLine = args.startLine;
18
- const endLine = args.endLine;
19
- const content = fs.readFileSync(filePath, "utf8");
20
- const lines = content.split(/\r?\n/);
21
- if (startLine !== undefined || endLine !== undefined) {
22
- const start = startLine !== undefined ? Math.max(1, startLine) - 1 : 0;
23
- const end = endLine !== undefined ? Math.min(lines.length, endLine) : lines.length;
24
- const sliced = lines.slice(start, end).join("\n");
25
- const tokens = Metrics.estimateTokens(sliced);
26
- Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
27
- return { content: [{ type: "text", text: sliced }] };
28
- }
29
- // Default protection limit: 1000 lines
30
- const DEFAULT_MAX_LINES = 1000;
31
- if (lines.length > DEFAULT_MAX_LINES) {
32
- const sliced = lines.slice(0, DEFAULT_MAX_LINES).join("\n");
33
- const tokens = Metrics.estimateTokens(sliced);
34
- Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path} (truncated)`, tokens);
35
- return {
36
- content: [{
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
- }]
40
- };
41
- }
42
- const tokens = Metrics.estimateTokens(content);
43
- Metrics.logUsage(projectRoot, "@mcp", `read_file: ${args.path}`, tokens);
44
- return { content: [{ type: "text", text: content }] };
45
- }
46
- catch (e) {
47
- const err = `Failed to read file: ${String(e)}`;
48
- Metrics.logError(projectRoot, "@mcp", `read_file:${args.path}`, err);
49
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
50
- }
51
- }
@@ -1,45 +0,0 @@
1
- import fs from "fs";
2
- import { safePath } from "../../utils/security.js";
3
- import { writeTextFileAtomic } from "../../utils/fs.js";
4
- import { Metrics } from "../../utils/metrics.js";
5
- import { verifyCorporateCompliance } from "../../utils/compliance.js";
6
- export function handleReplaceText(projectRoot, args) {
7
- const filePath = safePath(projectRoot, args.path);
8
- const content = fs.readFileSync(filePath, "utf8");
9
- const oldText = args.oldText;
10
- const newText = args.newText;
11
- const allowMultiple = args.allowMultiple || false; // Default to false
12
- if (!content.includes(oldText)) {
13
- const err = `Text not found in file: ${oldText.slice(0, 100)}...`;
14
- Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
15
- throw new Error(err);
16
- }
17
- // Surgical precision guard: reject ambiguous replacements unless allowMultiple is true.
18
- if (!allowMultiple) {
19
- const firstIndex = content.indexOf(oldText);
20
- const lastIndex = content.lastIndexOf(oldText);
21
- if (firstIndex !== lastIndex) {
22
- const count = (content.match(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length;
23
- const err = `Ambiguous replacement: "${oldText.slice(0, 80)}..." found ${count} times in ${args.path}. ` +
24
- "Provide a longer, unique context string or set 'allow_multiple' to true.";
25
- Metrics.logError(projectRoot, "@mcp", `replace_text:${args.path}`, err);
26
- throw new Error(err);
27
- }
28
- }
29
- // Perform replacement(s).
30
- // Use a function replacer so special patterns ($&, $1, $$) inside newText
31
- // are treated literally and never reinterpreted as regex backreferences.
32
- let newContent;
33
- if (allowMultiple) {
34
- newContent = content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), () => newText);
35
- }
36
- else {
37
- newContent = content.replace(oldText, () => newText);
38
- }
39
- // ENFORCE CORPORATE COMPLIANCE
40
- verifyCorporateCompliance(newContent, args.path);
41
- writeTextFileAtomic(filePath, newContent);
42
- const tokens = Metrics.estimateTokens(newText);
43
- Metrics.logUsage(projectRoot, "@mcp", `replace_text: ${args.path}`, tokens);
44
- return { content: [{ type: "text", text: `✅ Surgical edit successful in ${args.path}` }] };
45
- }
@@ -1,38 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { safePath, resolveFrameworkDir } from "../../utils/security.js";
4
- import { writeTextFileAtomic, appendFileSafe } from "../../utils/fs.js";
5
- import { Metrics } from "../../utils/metrics.js";
6
- import { verifyCorporateCompliance } from "../../utils/compliance.js";
7
- export function handleWriteFile(projectRoot, args) {
8
- if (!args.path || args.content === undefined) {
9
- const err = "Missing 'path' or 'content' argument.";
10
- Metrics.logError(projectRoot, "@mcp", "write_file", err);
11
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
12
- }
13
- try {
14
- const filePath = safePath(projectRoot, args.path);
15
- const content = args.content;
16
- // ENFORCE CORPORATE COMPLIANCE
17
- verifyCorporateCompliance(content, args.path);
18
- writeTextFileAtomic(filePath, content);
19
- // AUTO-LOGGING & METRICS
20
- const tokens = Metrics.estimateTokens(content);
21
- Metrics.logUsage(projectRoot, "@mcp", `write_file: ${args.path}`, tokens);
22
- try {
23
- const frameworkDir = resolveFrameworkDir(projectRoot);
24
- const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
25
- if (fs.existsSync(memoryPath)) {
26
- const entry = `\n### ${new Date().toISOString().split("T")[0]} — Auto-Update\n- **Action:** wrote file \`${args.path}\` (${tokens} tokens estimated).\n`;
27
- appendFileSafe(memoryPath, entry);
28
- }
29
- }
30
- catch { /* ignore memory logging errors */ }
31
- return { content: [{ type: "text", text: `✅ File written: ${args.path}` }] };
32
- }
33
- catch (e) {
34
- const err = `Failed to write file: ${String(e)}`;
35
- Metrics.logError(projectRoot, "@mcp", `write_file:${args.path}`, err);
36
- return { isError: true, content: [{ type: "text", text: `❌ ${err}` }] };
37
- }
38
- }
@@ -1,41 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- /**
4
- * Audits package.json for unused or duplicate-like packages.
5
- * Focuses on project health and cleanup.
6
- */
7
- export function handleAuditDependencies(projectRoot, _args) {
8
- const pkgPath = path.join(projectRoot, "package.json");
9
- if (!fs.existsSync(pkgPath)) {
10
- throw new Error("package.json not found.");
11
- }
12
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
13
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
14
- const depNames = Object.keys(deps);
15
- const results = [];
16
- // 1. Look for similar packages (potential duplicates)
17
- const similarityGroups = {
18
- "CSS/Styling": ["tailwind", "panda", "styled-components", "emotion", "sass"],
19
- "Testing": ["vitest", "jest", "mocha", "jasmine"],
20
- "Fetching": ["axios", "ky", "fetch"]
21
- };
22
- for (const [group, patterns] of Object.entries(similarityGroups)) {
23
- const found = depNames.filter(d => patterns.some(p => d.includes(p)));
24
- if (found.length > 1) {
25
- results.push(`⚠️ Potential redundancy in [${group}]: Found ${found.join(", ")}`);
26
- }
27
- }
28
- // 2. Scan for "any" usage in package names (bad practice markers)
29
- const legacyDeps = depNames.filter(d => d.includes("legacy") || d.includes("compat"));
30
- if (legacyDeps.length > 0) {
31
- results.push(`ℹ️ Legacy compatibility packages detected: ${legacyDeps.join(", ")}`);
32
- }
33
- return {
34
- content: [{
35
- type: "text",
36
- text: results.length > 0
37
- ? `Dependency Audit Results:\n\n${results.join("\n")}`
38
- : "✅ Dependencies look clean and consolidated."
39
- }]
40
- };
41
- }
@@ -1,5 +0,0 @@
1
- import { safeExec } from "../../utils/cli.js";
2
- export function handleGetFrameworkStatus(projectRoot, args) {
3
- const output = safeExec("npx", ["atabey", "status"], projectRoot, args.timeout);
4
- return { content: [{ type: "text", text: output }] };
5
- }
@@ -1,5 +0,0 @@
1
- import { safeExec } from "../../utils/cli.js";
2
- export function handleOrchestrateLoop(projectRoot, args) {
3
- const output = safeExec("npx", ["atabey", "orchestrate"], projectRoot, args.timeout);
4
- return { content: [{ type: "text", text: output }] };
5
- }
@@ -1,27 +0,0 @@
1
- import { execSync } from "child_process";
2
- import { getBackendLanguage, getDefaultTestCommand } from "../../utils/cli.js";
3
- /**
4
- * Executes project tests and returns results for agent analysis.
5
- */
6
- export function handleRunTests(projectRoot, args) {
7
- const language = getBackendLanguage(projectRoot);
8
- const testCommand = args.command || getDefaultTestCommand(language);
9
- try {
10
- const output = execSync(testCommand, { cwd: projectRoot, encoding: "utf8", stdio: "pipe" });
11
- return {
12
- content: [{ type: "text", text: `✅ Tests passed successfully for ${language}!\n\n${output}` }]
13
- };
14
- }
15
- catch (error) {
16
- const err = error;
17
- const stderr = err.stderr?.toString() || "";
18
- const stdout = err.stdout?.toString() || "";
19
- return {
20
- isError: true,
21
- content: [{
22
- type: "text",
23
- text: `❌ Tests FAILED for ${language}!\n\n--- STDOUT ---\n${stdout}\n\n--- STDERR ---\n${stderr}`
24
- }]
25
- };
26
- }
27
- }
@@ -1,5 +0,0 @@
1
- import { safeExec } from "../../utils/cli.js";
2
- export function handleUpdateContractHash(projectRoot, args) {
3
- const output = safeExec("npx", ["atabey", "update-contract"], projectRoot, args.timeout);
4
- return { content: [{ type: "text", text: output }] };
5
- }
@@ -1,8 +0,0 @@
1
- import { safeExec } from "../../utils/cli.js";
2
- export function handleUpdateProjectMemory(projectRoot, args) {
3
- const section = args.section;
4
- const content = args.content;
5
- // Using execFileSync with array args prevents command injection
6
- safeExec("npx", ["atabey", "update_project_memory", section, content], projectRoot);
7
- return { content: [{ type: "text", text: `✅ Section ${section} updated.` }] };
8
- }