atabey 0.0.11 → 0.0.13

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 (522) hide show
  1. package/ATABEY.md +52 -249
  2. package/PRIVACY.md +161 -0
  3. package/README.md +355 -140
  4. package/bin/completion.sh +30 -0
  5. package/bin/{validate-agent-army.js → validate-al-registry.js} +6 -6
  6. package/dist/framework-mcp/src/index.js +14 -2
  7. package/dist/framework-mcp/src/index.js.map +1 -1
  8. package/dist/framework-mcp/src/resources/index.js +5 -5
  9. package/dist/framework-mcp/src/resources/index.js.map +1 -1
  10. package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +1 -1
  11. package/dist/framework-mcp/src/tools/control_plane/locking.js +11 -9
  12. package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
  13. package/dist/framework-mcp/src/tools/definitions.d.ts +5 -0
  14. package/dist/framework-mcp/src/tools/definitions.js +116 -241
  15. package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
  16. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +4 -4
  17. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
  18. package/dist/framework-mcp/src/tools/file_system/read_file.js +1 -1
  19. package/dist/framework-mcp/src/tools/file_system/replace_text.js +3 -3
  20. package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
  21. package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
  22. package/dist/framework-mcp/src/tools/file_system/write_file.js +4 -4
  23. package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
  24. package/dist/framework-mcp/src/tools/framework/audit_deps.js +1 -1
  25. package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
  26. package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +4 -3
  27. package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -1
  28. package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.d.ts +19 -0
  29. package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +138 -0
  30. package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js.map +1 -0
  31. package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.d.ts +8 -0
  32. package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +91 -0
  33. package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js.map +1 -0
  34. package/dist/framework-mcp/src/tools/index.d.ts +2 -0
  35. package/dist/framework-mcp/src/tools/index.js +81 -17
  36. package/dist/framework-mcp/src/tools/index.js.map +1 -1
  37. package/dist/framework-mcp/src/tools/memory/delete_knowledge.d.ts +8 -0
  38. package/dist/framework-mcp/src/tools/memory/delete_knowledge.js +29 -0
  39. package/dist/framework-mcp/src/tools/memory/delete_knowledge.js.map +1 -0
  40. package/dist/framework-mcp/src/tools/memory/read_memory.js +1 -1
  41. package/dist/framework-mcp/src/tools/memory/read_memory.js.map +1 -1
  42. package/dist/framework-mcp/src/tools/memory/search_knowledge.d.ts +8 -0
  43. package/dist/framework-mcp/src/tools/memory/search_knowledge.js +49 -0
  44. package/dist/framework-mcp/src/tools/memory/search_knowledge.js.map +1 -0
  45. package/dist/framework-mcp/src/tools/memory/store_knowledge.d.ts +10 -0
  46. package/dist/framework-mcp/src/tools/memory/store_knowledge.js +31 -0
  47. package/dist/framework-mcp/src/tools/memory/store_knowledge.js.map +1 -0
  48. package/dist/framework-mcp/src/tools/messaging/ask_human.d.ts +6 -0
  49. package/dist/framework-mcp/src/tools/messaging/ask_human.js +31 -0
  50. package/dist/framework-mcp/src/tools/messaging/ask_human.js.map +1 -0
  51. package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
  52. package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
  53. package/dist/framework-mcp/src/tools/observability/get_health.js +1 -1
  54. package/dist/framework-mcp/src/tools/quality/analyze_code_quality.d.ts +11 -0
  55. package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +166 -0
  56. package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js.map +1 -0
  57. package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.d.ts +11 -0
  58. package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +135 -0
  59. package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js.map +1 -0
  60. package/dist/framework-mcp/src/tools/schemas.d.ts +439 -0
  61. package/dist/framework-mcp/src/tools/schemas.js +183 -0
  62. package/dist/framework-mcp/src/tools/schemas.js.map +1 -0
  63. package/dist/framework-mcp/src/tools/search/get_map.js +2 -2
  64. package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -1
  65. package/dist/framework-mcp/src/tools/search/grep_search.js +10 -7
  66. package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
  67. package/dist/framework-mcp/src/tools/shell/run_command.js +72 -7
  68. package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -1
  69. package/dist/framework-mcp/src/tools/types.d.ts +10 -9
  70. package/dist/framework-mcp/src/utils/compliance.d.ts +10 -0
  71. package/dist/framework-mcp/src/utils/compliance.js +102 -41
  72. package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
  73. package/dist/framework-mcp/src/utils/fs.d.ts +10 -7
  74. package/dist/framework-mcp/src/utils/fs.js +10 -7
  75. package/dist/framework-mcp/src/utils/fs.js.map +1 -1
  76. package/dist/framework-mcp/src/utils/types.d.ts +8 -0
  77. package/dist/framework-mcp/src/utils/types.js +4 -0
  78. package/dist/framework-mcp/src/utils/types.js.map +1 -1
  79. package/dist/framework-mcp/src/utils/zod-to-mcp.d.ts +10 -0
  80. package/dist/framework-mcp/src/utils/zod-to-mcp.js +80 -0
  81. package/dist/framework-mcp/src/utils/zod-to-mcp.js.map +1 -0
  82. package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +4 -4
  83. package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
  84. package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +17 -16
  85. package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
  86. package/dist/src/cli/adapters/core.js +2 -1
  87. package/dist/src/cli/adapters/core.js.map +1 -1
  88. package/dist/src/cli/adapters/scaffold.js +2 -1
  89. package/dist/src/cli/adapters/scaffold.js.map +1 -1
  90. package/dist/src/cli/commands/check.js +17 -17
  91. package/dist/src/cli/commands/check.js.map +1 -1
  92. package/dist/src/cli/commands/compliance.d.ts +5 -1
  93. package/dist/src/cli/commands/compliance.js +34 -42
  94. package/dist/src/cli/commands/compliance.js.map +1 -1
  95. package/dist/src/cli/commands/contract.js +6 -5
  96. package/dist/src/cli/commands/contract.js.map +1 -1
  97. package/dist/src/cli/commands/coverage.d.ts +1 -0
  98. package/dist/src/cli/commands/coverage.js +121 -0
  99. package/dist/src/cli/commands/coverage.js.map +1 -0
  100. package/dist/src/cli/commands/dashboard.d.ts +1 -1
  101. package/dist/src/cli/commands/dashboard.js +479 -39
  102. package/dist/src/cli/commands/dashboard.js.map +1 -1
  103. package/dist/src/cli/commands/explorer.js +8 -7
  104. package/dist/src/cli/commands/explorer.js.map +1 -1
  105. package/dist/src/cli/commands/gateway.d.ts +1 -0
  106. package/dist/src/cli/commands/gateway.js +172 -0
  107. package/dist/src/cli/commands/gateway.js.map +1 -0
  108. package/dist/src/cli/commands/git.js +8 -9
  109. package/dist/src/cli/commands/git.js.map +1 -1
  110. package/dist/src/cli/commands/index-codebase.d.ts +4 -0
  111. package/dist/src/cli/commands/index-codebase.js +52 -0
  112. package/dist/src/cli/commands/index-codebase.js.map +1 -0
  113. package/dist/src/cli/commands/init/create-agent.js +3 -3
  114. package/dist/src/cli/commands/init/create-agent.js.map +1 -1
  115. package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -1
  116. package/dist/src/cli/commands/init/scaffold-core.js +7 -6
  117. package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
  118. package/dist/src/cli/commands/init/scaffold-docs.js +4 -3
  119. package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
  120. package/dist/src/cli/commands/init/scaffold-ops.js +3 -3
  121. package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
  122. package/dist/src/cli/commands/init/scaffold-standards.js +11 -7
  123. package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
  124. package/dist/src/cli/commands/init.d.ts +2 -0
  125. package/dist/src/cli/commands/init.js +127 -45
  126. package/dist/src/cli/commands/init.js.map +1 -1
  127. package/dist/src/cli/commands/knowledge.js +5 -32
  128. package/dist/src/cli/commands/knowledge.js.map +1 -1
  129. package/dist/src/cli/commands/lint.js +5 -4
  130. package/dist/src/cli/commands/lint.js.map +1 -1
  131. package/dist/src/cli/commands/mcp.d.ts +11 -0
  132. package/dist/src/cli/commands/mcp.js +130 -0
  133. package/dist/src/cli/commands/mcp.js.map +1 -0
  134. package/dist/src/cli/commands/orchestrate.d.ts +10 -9
  135. package/dist/src/cli/commands/orchestrate.js +132 -66
  136. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  137. package/dist/src/cli/commands/plan.js +16 -14
  138. package/dist/src/cli/commands/plan.js.map +1 -1
  139. package/dist/src/cli/commands/quickstart.d.ts +9 -0
  140. package/dist/src/cli/commands/quickstart.js +72 -0
  141. package/dist/src/cli/commands/quickstart.js.map +1 -0
  142. package/dist/src/cli/commands/script.js +6 -5
  143. package/dist/src/cli/commands/script.js.map +1 -1
  144. package/dist/src/cli/commands/security.js +5 -8
  145. package/dist/src/cli/commands/security.js.map +1 -1
  146. package/dist/src/cli/commands/status.js +23 -19
  147. package/dist/src/cli/commands/status.js.map +1 -1
  148. package/dist/src/cli/commands/trace.d.ts +2 -0
  149. package/dist/src/cli/commands/trace.js +59 -61
  150. package/dist/src/cli/commands/trace.js.map +1 -1
  151. package/dist/src/cli/index.js +236 -294
  152. package/dist/src/cli/index.js.map +1 -1
  153. package/dist/src/cli/platforms/core.d.ts +12 -0
  154. package/dist/src/cli/platforms/core.js +73 -0
  155. package/dist/src/cli/platforms/core.js.map +1 -0
  156. package/dist/src/cli/platforms/index.d.ts +5 -0
  157. package/dist/src/cli/platforms/index.js +6 -0
  158. package/dist/src/cli/platforms/index.js.map +1 -0
  159. package/dist/src/cli/platforms/paths.d.ts +15 -0
  160. package/dist/src/cli/platforms/paths.js +102 -0
  161. package/dist/src/cli/platforms/paths.js.map +1 -0
  162. package/dist/src/cli/platforms/scaffold.d.ts +2 -0
  163. package/dist/src/cli/platforms/scaffold.js +73 -0
  164. package/dist/src/cli/platforms/scaffold.js.map +1 -0
  165. package/dist/src/cli/platforms/utils.d.ts +4 -0
  166. package/dist/src/cli/platforms/utils.js +76 -0
  167. package/dist/src/cli/platforms/utils.js.map +1 -0
  168. package/dist/src/cli/shims.js +5 -5
  169. package/dist/src/cli/utils/claude.js +2 -1
  170. package/dist/src/cli/utils/claude.js.map +1 -1
  171. package/dist/src/cli/utils/compliance.d.ts +10 -9
  172. package/dist/src/cli/utils/compliance.js +10 -171
  173. package/dist/src/cli/utils/compliance.js.map +1 -1
  174. package/dist/src/cli/utils/fs.d.ts +3 -3
  175. package/dist/src/cli/utils/fs.js +8 -7
  176. package/dist/src/cli/utils/fs.js.map +1 -1
  177. package/dist/src/cli/utils/i18n.d.ts +5 -0
  178. package/dist/src/cli/utils/i18n.js +5 -0
  179. package/dist/src/cli/utils/i18n.js.map +1 -1
  180. package/dist/src/cli/utils/memory.js +9 -6
  181. package/dist/src/cli/utils/memory.js.map +1 -1
  182. package/dist/src/cli/utils/pkg.js +8 -7
  183. package/dist/src/cli/utils/pkg.js.map +1 -1
  184. package/dist/src/cli/utils/schemas.d.ts +4 -4
  185. package/dist/src/cli/utils/ui.d.ts +23 -0
  186. package/dist/src/cli/utils/ui.js +42 -0
  187. package/dist/src/cli/utils/ui.js.map +1 -1
  188. package/dist/src/contracts/tasks.d.ts +4 -4
  189. package/dist/src/dashboard/src/hooks/useApi.d.ts +18 -0
  190. package/dist/src/dashboard/src/hooks/useApi.js +47 -0
  191. package/dist/src/dashboard/src/hooks/useApi.js.map +1 -0
  192. package/dist/src/dashboard/src/hooks/useSSE.d.ts +12 -0
  193. package/dist/src/dashboard/src/hooks/useSSE.js +60 -0
  194. package/dist/src/dashboard/src/hooks/useSSE.js.map +1 -0
  195. package/dist/src/modules/adapters/shared.js +3 -3
  196. package/dist/src/modules/adapters/shared.js.map +1 -1
  197. package/dist/src/modules/agents/definitions.d.ts +5 -13
  198. package/dist/src/modules/agents/definitions.js +179 -78
  199. package/dist/src/modules/agents/definitions.js.map +1 -1
  200. package/dist/src/modules/agents/registry/analyst.js +2 -1
  201. package/dist/src/modules/agents/registry/analyst.js.map +1 -1
  202. package/dist/src/modules/agents/registry/architect.js +1 -0
  203. package/dist/src/modules/agents/registry/architect.js.map +1 -1
  204. package/dist/src/modules/agents/registry/backend.js +8 -6
  205. package/dist/src/modules/agents/registry/backend.js.map +1 -1
  206. package/dist/src/modules/agents/registry/database.js.map +1 -1
  207. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  208. package/dist/src/modules/agents/registry/explorer.js +2 -0
  209. package/dist/src/modules/agents/registry/explorer.js.map +1 -1
  210. package/dist/src/modules/agents/registry/frontend.js +8 -6
  211. package/dist/src/modules/agents/registry/frontend.js.map +1 -1
  212. package/dist/src/modules/agents/registry/git.js.map +1 -1
  213. package/dist/src/modules/agents/registry/manager.js +11 -4
  214. package/dist/src/modules/agents/registry/manager.js.map +1 -1
  215. package/dist/src/modules/agents/registry/mobile.js +7 -5
  216. package/dist/src/modules/agents/registry/mobile.js.map +1 -1
  217. package/dist/src/modules/agents/registry/native.js +7 -5
  218. package/dist/src/modules/agents/registry/native.js.map +1 -1
  219. package/dist/src/modules/agents/registry/quality.js +11 -8
  220. package/dist/src/modules/agents/registry/quality.js.map +1 -1
  221. package/dist/src/modules/agents/registry/security.js.map +1 -1
  222. package/dist/src/modules/contracts/api.d.ts +178 -0
  223. package/dist/src/modules/contracts/api.js +56 -0
  224. package/dist/src/modules/contracts/api.js.map +1 -0
  225. package/dist/src/modules/contracts/index.d.ts +5 -0
  226. package/dist/src/modules/contracts/index.js +6 -0
  227. package/dist/src/modules/contracts/index.js.map +1 -0
  228. package/dist/src/modules/engines/agent-executor.d.ts +50 -0
  229. package/dist/src/modules/engines/agent-executor.js +188 -0
  230. package/dist/src/modules/engines/agent-executor.js.map +1 -0
  231. package/dist/src/modules/engines/health-engine.d.ts +7 -1
  232. package/dist/src/modules/engines/health-engine.js +85 -8
  233. package/dist/src/modules/engines/health-engine.js.map +1 -1
  234. package/dist/src/modules/engines/planning-engine.d.ts +1 -1
  235. package/dist/src/modules/engines/planning-engine.js +5 -4
  236. package/dist/src/modules/engines/planning-engine.js.map +1 -1
  237. package/dist/src/modules/engines/quality-gate.d.ts +23 -0
  238. package/dist/src/modules/engines/quality-gate.js +85 -0
  239. package/dist/src/modules/engines/quality-gate.js.map +1 -0
  240. package/dist/src/modules/engines/risk-engine.js +6 -6
  241. package/dist/src/modules/engines/risk-engine.js.map +1 -1
  242. package/dist/src/modules/engines/routing-engine.d.ts +59 -1
  243. package/dist/src/modules/engines/routing-engine.js +353 -25
  244. package/dist/src/modules/engines/routing-engine.js.map +1 -1
  245. package/dist/src/modules/engines/types.d.ts +7 -3
  246. package/dist/src/modules/gateway/circuit-breaker.d.ts +40 -0
  247. package/dist/src/modules/gateway/circuit-breaker.js +163 -0
  248. package/dist/src/modules/gateway/circuit-breaker.js.map +1 -0
  249. package/dist/src/modules/gateway/cost-tracker.d.ts +55 -0
  250. package/dist/src/modules/gateway/cost-tracker.js +127 -0
  251. package/dist/src/modules/gateway/cost-tracker.js.map +1 -0
  252. package/dist/src/modules/gateway/gateway.d.ts +68 -0
  253. package/dist/src/modules/gateway/gateway.js +235 -0
  254. package/dist/src/modules/gateway/gateway.js.map +1 -0
  255. package/dist/src/modules/gateway/index.d.ts +19 -0
  256. package/dist/src/modules/gateway/index.js +19 -0
  257. package/dist/src/modules/gateway/index.js.map +1 -0
  258. package/dist/src/modules/gateway/load-balancer.d.ts +86 -0
  259. package/dist/src/modules/gateway/load-balancer.js +230 -0
  260. package/dist/src/modules/gateway/load-balancer.js.map +1 -0
  261. package/dist/src/modules/gateway/providers/anthropic.d.ts +14 -0
  262. package/dist/src/modules/gateway/providers/anthropic.js +169 -0
  263. package/dist/src/modules/gateway/providers/anthropic.js.map +1 -0
  264. package/dist/src/modules/gateway/providers/base.d.ts +38 -0
  265. package/dist/src/modules/gateway/providers/base.js +42 -0
  266. package/dist/src/modules/gateway/providers/base.js.map +1 -0
  267. package/dist/src/modules/gateway/providers/google.d.ts +18 -0
  268. package/dist/src/modules/gateway/providers/google.js +176 -0
  269. package/dist/src/modules/gateway/providers/google.js.map +1 -0
  270. package/dist/src/modules/gateway/providers/grok.d.ts +14 -0
  271. package/dist/src/modules/gateway/providers/grok.js +166 -0
  272. package/dist/src/modules/gateway/providers/grok.js.map +1 -0
  273. package/dist/src/modules/gateway/providers/index.d.ts +21 -0
  274. package/dist/src/modules/gateway/providers/index.js +38 -0
  275. package/dist/src/modules/gateway/providers/index.js.map +1 -0
  276. package/dist/src/modules/gateway/providers/ollama.d.ts +23 -0
  277. package/dist/src/modules/gateway/providers/ollama.js +187 -0
  278. package/dist/src/modules/gateway/providers/ollama.js.map +1 -0
  279. package/dist/src/modules/gateway/providers/openai.d.ts +14 -0
  280. package/dist/src/modules/gateway/providers/openai.js +170 -0
  281. package/dist/src/modules/gateway/providers/openai.js.map +1 -0
  282. package/dist/src/modules/gateway/rate-limiter.d.ts +41 -0
  283. package/dist/src/modules/gateway/rate-limiter.js +119 -0
  284. package/dist/src/modules/gateway/rate-limiter.js.map +1 -0
  285. package/dist/src/modules/gateway/types.d.ts +114 -0
  286. package/dist/src/modules/gateway/types.js +8 -0
  287. package/dist/src/modules/gateway/types.js.map +1 -0
  288. package/dist/src/modules/memory/core.d.ts +42 -0
  289. package/dist/src/modules/memory/core.js +100 -0
  290. package/dist/src/modules/memory/core.js.map +1 -0
  291. package/dist/src/modules/memory/embedding.d.ts +28 -0
  292. package/dist/src/modules/memory/embedding.js +131 -0
  293. package/dist/src/modules/memory/embedding.js.map +1 -0
  294. package/dist/src/modules/memory/types.d.ts +18 -0
  295. package/dist/src/modules/memory/types.js +2 -0
  296. package/dist/src/modules/memory/types.js.map +1 -0
  297. package/dist/src/modules/memory/vector-store.d.ts +13 -0
  298. package/dist/src/modules/memory/vector-store.js +75 -0
  299. package/dist/src/modules/memory/vector-store.js.map +1 -0
  300. package/dist/src/modules/providers/definitions.d.ts +9 -0
  301. package/dist/src/modules/providers/definitions.js +141 -0
  302. package/dist/src/modules/providers/definitions.js.map +1 -0
  303. package/dist/src/modules/providers/registry.d.ts +12 -0
  304. package/dist/src/modules/providers/registry.js +19 -0
  305. package/dist/src/modules/providers/registry.js.map +1 -0
  306. package/dist/src/modules/providers/shared.d.ts +1 -0
  307. package/dist/src/modules/providers/shared.js +105 -0
  308. package/dist/src/modules/providers/shared.js.map +1 -0
  309. package/dist/src/modules/providers/types.d.ts +14 -0
  310. package/dist/src/modules/providers/types.js +2 -0
  311. package/dist/src/modules/providers/types.js.map +1 -0
  312. package/dist/src/modules/skills/adapter-skills.d.ts +68 -0
  313. package/dist/src/modules/skills/adapter-skills.js +450 -0
  314. package/dist/src/modules/skills/adapter-skills.js.map +1 -0
  315. package/dist/src/shared/audit.d.ts +105 -0
  316. package/dist/src/shared/audit.js +220 -0
  317. package/dist/src/shared/audit.js.map +1 -0
  318. package/dist/src/shared/constants.d.ts +11 -11
  319. package/dist/src/shared/constants.js +3 -3
  320. package/dist/src/shared/constants.js.map +1 -1
  321. package/dist/src/shared/fs.js +4 -2
  322. package/dist/src/shared/fs.js.map +1 -1
  323. package/dist/src/shared/lock.d.ts +82 -0
  324. package/dist/src/shared/lock.js +160 -0
  325. package/dist/src/shared/lock.js.map +1 -0
  326. package/dist/src/shared/logger.d.ts +2 -0
  327. package/dist/src/shared/logger.js +15 -5
  328. package/dist/src/shared/logger.js.map +1 -1
  329. package/dist/src/shared/pii.d.ts +37 -0
  330. package/dist/src/shared/pii.js +122 -0
  331. package/dist/src/shared/pii.js.map +1 -0
  332. package/dist/src/shared/retention.d.ts +63 -0
  333. package/dist/src/shared/retention.js +171 -0
  334. package/dist/src/shared/retention.js.map +1 -0
  335. package/dist/src/shared/storage.d.ts +13 -11
  336. package/dist/src/shared/storage.js +18 -14
  337. package/dist/src/shared/storage.js.map +1 -1
  338. package/dist/src/shared/string.d.ts +1 -0
  339. package/dist/src/shared/string.js +30 -0
  340. package/dist/src/shared/string.js.map +1 -0
  341. package/dist/src/shared/types.d.ts +8 -0
  342. package/dist/src/shared/types.js +4 -0
  343. package/dist/src/shared/types.js.map +1 -1
  344. package/dist/tests/adapter.test.js +3 -2
  345. package/dist/tests/adapter.test.js.map +1 -1
  346. package/dist/tests/adapters/paths.test.js +4 -4
  347. package/dist/tests/adapters/paths.test.js.map +1 -1
  348. package/dist/tests/cli/commands/check.test.d.ts +1 -0
  349. package/dist/tests/cli/commands/check.test.js +9 -0
  350. package/dist/tests/cli/commands/check.test.js.map +1 -0
  351. package/dist/tests/cli/commands/coverage.test.d.ts +1 -0
  352. package/dist/tests/cli/commands/coverage.test.js +9 -0
  353. package/dist/tests/cli/commands/coverage.test.js.map +1 -0
  354. package/dist/tests/cli/commands/dashboard-coverage.test.d.ts +1 -0
  355. package/dist/tests/cli/commands/dashboard-coverage.test.js +88 -0
  356. package/dist/tests/cli/commands/dashboard-coverage.test.js.map +1 -0
  357. package/dist/tests/cli/commands/exports.test.d.ts +1 -0
  358. package/dist/tests/cli/commands/exports.test.js +61 -0
  359. package/dist/tests/cli/commands/exports.test.js.map +1 -0
  360. package/dist/tests/cli/commands/lint.test.d.ts +1 -0
  361. package/dist/tests/cli/commands/lint.test.js +9 -0
  362. package/dist/tests/cli/commands/lint.test.js.map +1 -0
  363. package/dist/tests/cli/init/adapter_init.test.js +4 -5
  364. package/dist/tests/cli/init/adapter_init.test.js.map +1 -1
  365. package/dist/tests/cli/init/unified_init.test.js +5 -7
  366. package/dist/tests/cli/init/unified_init.test.js.map +1 -1
  367. package/dist/tests/core-memory.test.d.ts +1 -0
  368. package/dist/tests/core-memory.test.js +78 -0
  369. package/dist/tests/core-memory.test.js.map +1 -0
  370. package/dist/tests/dashboard.test.d.ts +1 -0
  371. package/dist/tests/dashboard.test.js +116 -0
  372. package/dist/tests/dashboard.test.js.map +1 -0
  373. package/dist/tests/fs-utils.test.js +5 -5
  374. package/dist/tests/fs-utils.test.js.map +1 -1
  375. package/dist/tests/integration/agent_flow.test.js +24 -10
  376. package/dist/tests/integration/agent_flow.test.js.map +1 -1
  377. package/dist/tests/modules/adapters/adapters.test.js +2 -2
  378. package/dist/tests/modules/adapters/adapters.test.js.map +1 -1
  379. package/dist/tests/modules/contracts/contracts.test.d.ts +1 -0
  380. package/dist/tests/modules/contracts/contracts.test.js +73 -0
  381. package/dist/tests/modules/contracts/contracts.test.js.map +1 -0
  382. package/dist/tests/modules/engines/agent-executor.test.d.ts +1 -0
  383. package/dist/tests/modules/engines/agent-executor.test.js +61 -0
  384. package/dist/tests/modules/engines/agent-executor.test.js.map +1 -0
  385. package/dist/tests/modules/engines/evaluation-engine.test.d.ts +1 -0
  386. package/dist/tests/modules/engines/evaluation-engine.test.js +45 -0
  387. package/dist/tests/modules/engines/evaluation-engine.test.js.map +1 -0
  388. package/dist/tests/modules/engines/health-engine.test.d.ts +1 -0
  389. package/dist/tests/modules/engines/health-engine.test.js +56 -0
  390. package/dist/tests/modules/engines/health-engine.test.js.map +1 -0
  391. package/dist/tests/modules/engines/planning-engine.test.d.ts +1 -0
  392. package/dist/tests/modules/engines/planning-engine.test.js +75 -0
  393. package/dist/tests/modules/engines/planning-engine.test.js.map +1 -0
  394. package/dist/tests/modules/engines/risk-engine.test.d.ts +1 -0
  395. package/dist/tests/modules/engines/risk-engine.test.js +61 -0
  396. package/dist/tests/modules/engines/risk-engine.test.js.map +1 -0
  397. package/dist/tests/modules/engines/routing-engine.test.d.ts +1 -0
  398. package/dist/tests/modules/engines/routing-engine.test.js +56 -0
  399. package/dist/tests/modules/engines/routing-engine.test.js.map +1 -0
  400. package/dist/tests/modules/gateway/circuit-breaker.test.d.ts +1 -0
  401. package/dist/tests/modules/gateway/circuit-breaker.test.js +124 -0
  402. package/dist/tests/modules/gateway/circuit-breaker.test.js.map +1 -0
  403. package/dist/tests/modules/gateway/cost-tracker.test.d.ts +1 -0
  404. package/dist/tests/modules/gateway/cost-tracker.test.js +74 -0
  405. package/dist/tests/modules/gateway/cost-tracker.test.js.map +1 -0
  406. package/dist/tests/modules/gateway/load-balancer.test.d.ts +1 -0
  407. package/dist/tests/modules/gateway/load-balancer.test.js +70 -0
  408. package/dist/tests/modules/gateway/load-balancer.test.js.map +1 -0
  409. package/dist/tests/modules/gateway/rate-limiter.test.d.ts +1 -0
  410. package/dist/tests/modules/gateway/rate-limiter.test.js +62 -0
  411. package/dist/tests/modules/gateway/rate-limiter.test.js.map +1 -0
  412. package/dist/tests/modules/memory/vector-store.test.d.ts +1 -0
  413. package/dist/tests/modules/memory/vector-store.test.js +109 -0
  414. package/dist/tests/modules/memory/vector-store.test.js.map +1 -0
  415. package/dist/tests/orchestrator-dependencies.test.js +40 -22
  416. package/dist/tests/orchestrator-dependencies.test.js.map +1 -1
  417. package/dist/tests/planning-engine.test.js +9 -8
  418. package/dist/tests/planning-engine.test.js.map +1 -1
  419. package/dist/tests/risk-engine.test.d.ts +1 -0
  420. package/dist/tests/risk-engine.test.js +44 -0
  421. package/dist/tests/risk-engine.test.js.map +1 -0
  422. package/dist/tests/shared/audit.test.d.ts +1 -0
  423. package/dist/tests/shared/audit.test.js +53 -0
  424. package/dist/tests/shared/audit.test.js.map +1 -0
  425. package/dist/tests/status-cost.test.js +15 -24
  426. package/dist/tests/status-cost.test.js.map +1 -1
  427. package/dist/tests/status.test.js +16 -17
  428. package/dist/tests/status.test.js.map +1 -1
  429. package/dist/tests/storage-operations.test.d.ts +1 -0
  430. package/dist/tests/storage-operations.test.js +116 -0
  431. package/dist/tests/storage-operations.test.js.map +1 -0
  432. package/dist/tests/trace-replay.test.js +34 -40
  433. package/dist/tests/trace-replay.test.js.map +1 -1
  434. package/dist/ui/assets/index-B-d2ejS8.js +519 -0
  435. package/dist/ui/assets/index-CyXywq5G.css +1 -0
  436. package/dist/ui/index.html +2 -2
  437. package/dist/vitest.config.js +5 -5
  438. package/dist/vitest.config.js.map +1 -1
  439. package/framework-mcp/README.md +339 -25
  440. package/framework-mcp/dist/dashboard/assets/index-BAPGLiWE.js +267 -0
  441. package/framework-mcp/dist/dashboard/index.html +15 -0
  442. package/framework-mcp/dist/framework-mcp/src/constants.js +64 -0
  443. package/framework-mcp/dist/framework-mcp/src/index.js +156 -0
  444. package/framework-mcp/dist/framework-mcp/src/resources/index.js +58 -0
  445. package/framework-mcp/dist/framework-mcp/src/tools/control_plane/locking.js +84 -0
  446. package/framework-mcp/dist/framework-mcp/src/tools/control_plane/registry.js +35 -0
  447. package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +197 -0
  448. package/framework-mcp/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +64 -0
  449. package/framework-mcp/dist/framework-mcp/src/tools/file_system/patch_file.js +34 -0
  450. package/framework-mcp/dist/framework-mcp/src/tools/file_system/read_file.js +51 -0
  451. package/framework-mcp/dist/framework-mcp/src/tools/file_system/replace_text.js +50 -0
  452. package/framework-mcp/dist/framework-mcp/src/tools/file_system/write_file.js +55 -0
  453. package/framework-mcp/dist/framework-mcp/src/tools/framework/audit_deps.js +41 -0
  454. package/framework-mcp/dist/framework-mcp/src/tools/framework/get_status.js +5 -0
  455. package/framework-mcp/dist/framework-mcp/src/tools/framework/orchestrate.js +5 -0
  456. package/framework-mcp/dist/framework-mcp/src/tools/framework/run_tests.js +27 -0
  457. package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
  458. package/framework-mcp/dist/framework-mcp/src/tools/framework/update_contract_hash.js +5 -0
  459. package/framework-mcp/dist/framework-mcp/src/tools/framework/update_memory.js +8 -0
  460. package/framework-mcp/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +137 -0
  461. package/framework-mcp/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +90 -0
  462. package/framework-mcp/dist/framework-mcp/src/tools/index.js +126 -0
  463. package/framework-mcp/dist/framework-mcp/src/tools/memory/delete_knowledge.js +28 -0
  464. package/framework-mcp/dist/framework-mcp/src/tools/memory/get_insights.js +22 -0
  465. package/framework-mcp/dist/framework-mcp/src/tools/memory/read_memory.js +28 -0
  466. package/framework-mcp/dist/framework-mcp/src/tools/memory/search_knowledge.js +48 -0
  467. package/framework-mcp/dist/framework-mcp/src/tools/memory/store_knowledge.js +30 -0
  468. package/framework-mcp/dist/framework-mcp/src/tools/messaging/ask_human.js +30 -0
  469. package/framework-mcp/dist/framework-mcp/src/tools/messaging/log_action.js +22 -0
  470. package/framework-mcp/dist/framework-mcp/src/tools/messaging/send_message.js +94 -0
  471. package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +26 -0
  472. package/framework-mcp/dist/framework-mcp/src/tools/observability/get_health.js +19 -0
  473. package/framework-mcp/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +165 -0
  474. package/framework-mcp/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +134 -0
  475. package/framework-mcp/dist/framework-mcp/src/tools/quality/check_lint.js +30 -0
  476. package/framework-mcp/dist/framework-mcp/src/tools/schemas.js +182 -0
  477. package/framework-mcp/dist/framework-mcp/src/tools/search/get_gaps.js +48 -0
  478. package/framework-mcp/dist/framework-mcp/src/tools/search/get_map.js +43 -0
  479. package/framework-mcp/dist/framework-mcp/src/tools/search/grep_search.js +78 -0
  480. package/framework-mcp/dist/framework-mcp/src/tools/search/list_dir.js +28 -0
  481. package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +121 -0
  482. package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
  483. package/framework-mcp/dist/framework-mcp/src/utils/cli.js +59 -0
  484. package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +292 -0
  485. package/framework-mcp/dist/framework-mcp/src/utils/errors.js +68 -0
  486. package/framework-mcp/dist/framework-mcp/src/utils/fs.js +47 -0
  487. package/framework-mcp/dist/framework-mcp/src/utils/memory.js +74 -0
  488. package/framework-mcp/dist/framework-mcp/src/utils/metrics.js +56 -0
  489. package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +71 -0
  490. package/framework-mcp/dist/framework-mcp/src/utils/security.js +60 -0
  491. package/framework-mcp/dist/framework-mcp/src/utils/storage.js +207 -0
  492. package/framework-mcp/dist/framework-mcp/src/utils/types.js +16 -0
  493. package/framework-mcp/dist/framework-mcp/src/utils/zod-to-mcp.js +79 -0
  494. package/framework-mcp/dist/index.js +14 -2
  495. package/framework-mcp/dist/src/cli/utils/memory.js +279 -0
  496. package/framework-mcp/dist/src/cli/utils/time.js +27 -0
  497. package/framework-mcp/dist/src/cli/utils/ui.js +100 -0
  498. package/framework-mcp/dist/src/modules/memory/core.js +99 -0
  499. package/framework-mcp/dist/src/modules/memory/embedding.js +130 -0
  500. package/framework-mcp/dist/src/modules/memory/types.js +1 -0
  501. package/framework-mcp/dist/src/modules/memory/vector-store.js +74 -0
  502. package/framework-mcp/dist/src/shared/constants.js +187 -0
  503. package/framework-mcp/dist/src/shared/fs.js +53 -0
  504. package/framework-mcp/dist/src/shared/logger.js +126 -0
  505. package/framework-mcp/dist/src/shared/pii.js +121 -0
  506. package/framework-mcp/dist/src/shared/storage.js +211 -0
  507. package/framework-mcp/dist/src/shared/types.js +16 -0
  508. package/framework-mcp/dist/tools/definitions.js +79 -247
  509. package/framework-mcp/dist/tools/index.js +37 -0
  510. package/framework-mcp/dist/tools/schemas.js +133 -0
  511. package/framework-mcp/dist/utils/types.js +4 -0
  512. package/framework-mcp/dist/utils/zod-to-mcp.js +77 -0
  513. package/framework-mcp/package.json +2 -2
  514. package/mcp.json +5 -4
  515. package/package.json +19 -17
  516. package/templates/full/ATABEY_FULL.md +515 -0
  517. package/templates/standards/crud-governance.md +1 -1
  518. package/templates/standards/logging-and-secrets.md +1 -1
  519. package/templates/standards/performance-standards.md +2 -2
  520. package/templates/standards/quality-standards.md +1 -1
  521. package/dist/ui/assets/index-Bkt7APzu.css +0 -1
  522. package/dist/ui/assets/index-CeX-06mI.js +0 -49
@@ -1,322 +1,154 @@
1
+ import * as schemas from "./schemas.js";
2
+ import { zodToMcpSchema } from "../utils/zod-to-mcp.js";
3
+ /**
4
+ * ─── SUPREME TOOL REGISTRY ─────────────────────────────────────────
5
+ * Every tool is dynamically generated from its Zod schema.
6
+ * ZERO manual JSON schema maintenance permitted.
7
+ */
1
8
  export const TOOLS = [
9
+ // File System
2
10
  {
3
11
  name: "read_file",
4
12
  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
- },
13
+ inputSchema: zodToMcpSchema(schemas.ReadFileSchema),
14
14
  },
15
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
- },
16
+ name: "view_file",
17
+ description: "Alias for read_file. Reads the content of a file within the project.",
18
+ inputSchema: zodToMcpSchema(schemas.ReadFileSchema),
37
19
  },
38
20
  {
39
21
  name: "write_file",
40
22
  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
- },
23
+ inputSchema: zodToMcpSchema(schemas.WriteFileSchema),
49
24
  },
50
25
  {
51
26
  name: "replace_text",
52
27
  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
- },
28
+ inputSchema: zodToMcpSchema(schemas.ReplaceTextSchema),
63
29
  },
64
30
  {
65
31
  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
- },
32
+ description: "Perform multiple surgical text replacements across multiple files in a single batch request.",
33
+ inputSchema: zodToMcpSchema(schemas.BatchSurgicalEditSchema),
86
34
  },
87
35
  {
88
36
  name: "patch_file",
89
37
  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
- },
38
+ inputSchema: zodToMcpSchema(schemas.PatchFileSchema),
39
+ },
40
+ // Search & Exploration
41
+ {
42
+ name: "list_dir",
43
+ description: "List the contents of a directory. Essential for codebase exploration.",
44
+ inputSchema: zodToMcpSchema(schemas.ListDirSchema),
45
+ },
46
+ {
47
+ name: "grep_search",
48
+ description: "Perform a recursive regex search across the codebase.",
49
+ inputSchema: zodToMcpSchema(schemas.GrepSearchSchema),
100
50
  },
101
51
  {
102
52
  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
- }
53
+ description: "Generate a tree-view map of the project structure.",
54
+ inputSchema: zodToMcpSchema(schemas.GetProjectMapSchema),
111
55
  },
112
56
  {
113
57
  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
- },
58
+ description: "Scans the codebase for TODOs, FIXMEs, and empty function bodies.",
59
+ inputSchema: zodToMcpSchema(schemas.GetProjectGapsSchema),
121
60
  },
61
+ // Framework & System
122
62
  {
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: {} },
63
+ name: "run_shell_command",
64
+ description: "Execute a shell command. Restricted for security.",
65
+ inputSchema: zodToMcpSchema(schemas.RunShellCommandSchema),
126
66
  },
127
67
  {
128
68
  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
- }
69
+ description: "Execute project test suites and capture pass/fail reports.",
70
+ inputSchema: zodToMcpSchema(schemas.RunTestsSchema),
136
71
  },
137
72
  {
138
73
  name: "get_system_health",
139
- description: "Retrieve real-time system metrics like CPU load, RAM usage, and uptime.",
140
- inputSchema: { type: "object", properties: {} }
74
+ description: "Retrieve real-time system metrics (CPU, RAM).",
75
+ inputSchema: zodToMcpSchema(schemas.GetSystemHealthSchema),
141
76
  },
142
77
  {
143
78
  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
- }
79
+ description: "Identify which network ports are currently active.",
80
+ inputSchema: zodToMcpSchema(schemas.CheckPortsSchema),
151
81
  },
152
82
  {
153
83
  name: "get_framework_status",
154
84
  description: "Get the current project phase, active traces, and agent states.",
155
- inputSchema: { type: "object", properties: {} },
85
+ inputSchema: zodToMcpSchema(schemas.GetFrameworkStatusSchema),
156
86
  },
157
87
  {
158
88
  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: {} },
89
+ description: "Read the full project central memory (PROJECT_MEMORY.md).",
90
+ inputSchema: zodToMcpSchema(schemas.ReadProjectMemorySchema),
161
91
  },
162
92
  {
163
93
  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: {} },
94
+ description: "Retrieve a summarized version of the project memory.",
95
+ inputSchema: zodToMcpSchema(schemas.GetMemoryInsightsSchema),
166
96
  },
167
97
  {
168
98
  name: "update_project_memory",
169
99
  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
- },
100
+ inputSchema: zodToMcpSchema(schemas.UpdateProjectMemorySchema),
178
101
  },
179
102
  {
180
103
  name: "orchestrate_loop",
181
- description: "Process the pending Hermes messages and trigger dynamic state transitions.",
182
- inputSchema: { type: "object", properties: {} },
104
+ description: "Process pending Hermes messages and trigger transitions.",
105
+ inputSchema: zodToMcpSchema(schemas.OrchestrateLoopSchema),
183
106
  },
184
107
  {
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
- },
108
+ name: "submit_plan",
109
+ description: "Submit a structured DAG plan of tasks for the project.",
110
+ inputSchema: zodToMcpSchema(schemas.SubmitPlanSchema),
201
111
  },
202
112
  {
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
- }
113
+ name: "update_contract_hash",
114
+ description: "Re-generate and synchronize the backend contract SHA-256 hash.",
115
+ inputSchema: zodToMcpSchema(schemas.UpdateContractHashSchema),
214
116
  },
215
117
  {
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
- }
118
+ name: "audit_dependencies",
119
+ description: "Audits package.json for unused or redundant packages.",
120
+ inputSchema: zodToMcpSchema(schemas.AuditDependenciesSchema),
226
121
  },
227
122
  {
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
- specialties: {
237
- type: "object",
238
- additionalProperties: { type: "number" },
239
- description: "Sub-specialty weights mapping (e.g. {\"postgres\": 10, \"redis\": 8})"
240
- }
241
- },
242
- required: ["agent", "role"]
243
- }
123
+ name: "check_lint",
124
+ description: "Run the project's linter (e.g., ESLint).",
125
+ inputSchema: zodToMcpSchema(schemas.CheckLintSchema),
244
126
  },
127
+ // Control Plane
245
128
  {
246
- name: "log_agent_action",
247
- description: "Log an agent action to the framework logs.",
248
- inputSchema: {
249
- type: "object",
250
- properties: {
251
- agent: { type: "string", description: "The agent name (e.g., @manager, @backend)" },
252
- action: { type: "string", description: "Action type or name" },
253
- traceId: { type: "string", description: "The active Trace ID" },
254
- status: { type: "string", enum: ["SUCCESS", "FAILURE"], description: "The status of the action" },
255
- summary: { type: "string", description: "Brief description of the action taken" },
256
- findings: { type: "string", description: "Optional comma-separated findings or details" }
257
- },
258
- required: ["agent", "action", "traceId", "status", "summary"]
259
- }
129
+ name: "acquire_lock",
130
+ description: "Acquire a stateful lock on a shared resource.",
131
+ inputSchema: zodToMcpSchema(schemas.AcquireLockSchema),
260
132
  },
261
133
  {
262
- name: "update_contract_hash",
263
- description: "Re-generate and synchronize the backend contract SHA-256 hash.",
264
- inputSchema: { type: "object", properties: {} }
134
+ name: "release_lock",
135
+ description: "Release a previously acquired lock.",
136
+ inputSchema: zodToMcpSchema(schemas.ReleaseLockSchema),
265
137
  },
266
138
  {
267
- name: "run_shell_command",
268
- description: "Execute a shell command. For security, only a limited set of commands are allowed.",
269
- inputSchema: {
270
- type: "object",
271
- properties: {
272
- command: { type: "string", description: "The shell command to execute." },
273
- },
274
- required: ["command"],
275
- },
139
+ name: "register_agent",
140
+ description: "Register an agent instance with the Control Plane.",
141
+ inputSchema: zodToMcpSchema(schemas.RegisterAgentSchema),
276
142
  },
143
+ // Messaging (Hermes)
277
144
  {
278
- name: "check_lint",
279
- description: "Run the project's linter (e.g., ESLint) to check for code quality and style issues.",
280
- inputSchema: { type: "object", properties: {} },
145
+ name: "send_agent_message",
146
+ description: "Send a Hermes protocol message to another agent.",
147
+ inputSchema: zodToMcpSchema(schemas.SendAgentMessageSchema),
281
148
  },
282
149
  {
283
- name: "submit_plan",
284
- description: "Submit a structured DAG plan of tasks for the project. This will be decomposed and queued for execution.",
285
- inputSchema: {
286
- type: "object",
287
- properties: {
288
- tasks: {
289
- type: "array",
290
- items: {
291
- type: "object",
292
- properties: {
293
- id: { type: "string", description: "Unique task ID (e.g. TASK_01)" },
294
- agent: { type: "string", description: "The agent responsible for the task (e.g. @backend)" },
295
- task: { type: "string", description: "The task description" },
296
- dependencies: {
297
- type: "array",
298
- items: { type: "string" },
299
- description: "List of task IDs that must be completed before this task."
300
- }
301
- },
302
- required: ["id", "agent", "task"]
303
- }
304
- }
305
- },
306
- required: ["tasks"],
307
- },
150
+ name: "log_agent_action",
151
+ description: "Log an agent action to the framework logs.",
152
+ inputSchema: zodToMcpSchema(schemas.LogAgentActionSchema),
308
153
  },
309
- {
310
- name: "view_file",
311
- description: "Alias for read_file. Reads the content of a file within the project.",
312
- inputSchema: {
313
- type: "object",
314
- properties: {
315
- path: { type: "string", description: "Path to the file relative to project root" },
316
- startLine: { type: "number", description: "Optional starting line number (1-indexed)" },
317
- endLine: { type: "number", description: "Optional ending line number (inclusive)" },
318
- },
319
- required: ["path"],
320
- },
321
- }
322
154
  ];
@@ -25,6 +25,7 @@ import { handleAcquireLock, handleReleaseLock } from "./control_plane/locking.js
25
25
  import { handleRegisterAgent } from "./control_plane/registry.js";
26
26
  import { handleRunCommand } from "./shell/run_command.js";
27
27
  import { handleCheckLint } from "./quality/check_lint.js";
28
+ import * as schemas from "./schemas.js";
28
29
  // Map of tool names to their handler functions
29
30
  const bind = (fn) => {
30
31
  return (root, args) => fn(root, args);
@@ -59,4 +60,40 @@ export const toolHandlers = {
59
60
  run_shell_command: bind(handleRunCommand),
60
61
  check_lint: bind(handleCheckLint),
61
62
  };
63
+ // Map of tool names to their Zod validation schemas
64
+ export const toolSchemas = {
65
+ // File System
66
+ read_file: schemas.ReadFileSchema,
67
+ view_file: schemas.ReadFileSchema,
68
+ write_file: schemas.WriteFileSchema,
69
+ replace_text: schemas.ReplaceTextSchema,
70
+ batch_surgical_edit: schemas.BatchSurgicalEditSchema,
71
+ patch_file: schemas.PatchFileSchema,
72
+ // Search & Exploration
73
+ list_dir: schemas.ListDirSchema,
74
+ grep_search: schemas.GrepSearchSchema,
75
+ get_project_map: schemas.GetProjectMapSchema,
76
+ get_project_gaps: schemas.GetProjectGapsSchema,
77
+ // Framework & System
78
+ run_shell_command: schemas.RunShellCommandSchema,
79
+ run_tests: schemas.RunTestsSchema,
80
+ get_system_health: schemas.GetSystemHealthSchema,
81
+ check_active_ports: schemas.CheckPortsSchema,
82
+ get_framework_status: schemas.GetFrameworkStatusSchema,
83
+ read_project_memory: schemas.ReadProjectMemorySchema,
84
+ get_memory_insights: schemas.GetMemoryInsightsSchema,
85
+ update_project_memory: schemas.UpdateProjectMemorySchema,
86
+ orchestrate_loop: schemas.OrchestrateLoopSchema,
87
+ submit_plan: schemas.SubmitPlanSchema,
88
+ update_contract_hash: schemas.UpdateContractHashSchema,
89
+ audit_dependencies: schemas.AuditDependenciesSchema,
90
+ check_lint: schemas.CheckLintSchema,
91
+ // Control Plane
92
+ acquire_lock: schemas.AcquireLockSchema,
93
+ release_lock: schemas.ReleaseLockSchema,
94
+ register_agent: schemas.RegisterAgentSchema,
95
+ // Messaging (Hermes)
96
+ send_agent_message: schemas.SendAgentMessageSchema,
97
+ log_agent_action: schemas.LogAgentActionSchema,
98
+ };
62
99
  export { TOOLS };
@@ -0,0 +1,133 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * ─── ATABEY BRANDED TYPES ─────────────────────────────────────────
4
+ * Using Zod's .brand() to ensure compile-time and runtime safety.
5
+ * These types represent the "System DNA".
6
+ */
7
+ export const AgentIDSchema = z.string()
8
+ .regex(/^@[a-zA-Z0-9_-]+$/, "AgentID must start with '@' followed by alphanumeric characters/underscores.")
9
+ .brand();
10
+ export const TraceIDSchema = z.string()
11
+ .min(1, "TraceID cannot be empty")
12
+ .brand();
13
+ export const TaskIDSchema = z.string()
14
+ .regex(/^TASK-[0-9]+$/, "TaskID must follow the format 'TASK-001'.")
15
+ .brand();
16
+ export const PhaseIDSchema = z.enum(["PHASE_0", "PHASE_1", "PHASE_2", "PHASE_3", "PHASE_4"])
17
+ .brand();
18
+ /**
19
+ * ─── TOOL CONTRACTS ────────────────────────────────────────────────
20
+ * Every tool must have a strict schema defining its boundary.
21
+ * No unknown properties are allowed (.strict()).
22
+ */
23
+ // ─── File System
24
+ export const ReadFileSchema = z.object({
25
+ path: z.string().min(1, "Path is required"),
26
+ startLine: z.number().int().positive().optional(),
27
+ endLine: z.number().int().positive().optional(),
28
+ }).strict();
29
+ export const WriteFileSchema = z.object({
30
+ path: z.string().min(1, "Path is required"),
31
+ content: z.string(),
32
+ }).strict();
33
+ export const ReplaceTextSchema = z.object({
34
+ path: z.string().min(1, "Path is required"),
35
+ oldText: z.string().min(1, "oldText is required"),
36
+ newText: z.string(),
37
+ allowMultiple: z.boolean().default(false),
38
+ }).strict();
39
+ // ─── Search & Exploration
40
+ export const ListDirSchema = z.object({
41
+ path: z.string().default("."),
42
+ }).strict();
43
+ export const GrepSearchSchema = z.object({
44
+ pattern: z.string().min(1, "Pattern is required"),
45
+ includePattern: z.string().optional(),
46
+ excludePattern: z.string().optional(),
47
+ }).strict();
48
+ export const GetProjectMapSchema = z.object({
49
+ maxDepth: z.number().int().positive().default(3),
50
+ includeFiles: z.boolean().default(true),
51
+ }).strict();
52
+ export const GetProjectGapsSchema = z.object({
53
+ path: z.string().default("src"),
54
+ }).strict();
55
+ // ─── Batch & Patch
56
+ export const BatchSurgicalEditSchema = z.object({
57
+ edits: z.array(z.object({
58
+ path: z.string().min(1),
59
+ oldText: z.string().min(1),
60
+ newText: z.string(),
61
+ allowMultiple: z.boolean().default(false),
62
+ })),
63
+ }).strict();
64
+ export const PatchFileSchema = z.object({
65
+ path: z.string().min(1),
66
+ startLine: z.number().int().positive(),
67
+ endLine: z.number().int().positive(),
68
+ newContent: z.string(),
69
+ }).strict();
70
+ // ─── Framework & System
71
+ export const RunShellCommandSchema = z.object({
72
+ command: z.string().min(1),
73
+ }).strict();
74
+ export const RunTestsSchema = z.object({
75
+ command: z.string().optional(),
76
+ }).strict();
77
+ export const GetSystemHealthSchema = z.object({}).strict();
78
+ export const CheckPortsSchema = z.object({
79
+ filter: z.string().optional(),
80
+ }).strict();
81
+ export const GetFrameworkStatusSchema = z.object({}).strict();
82
+ export const ReadProjectMemorySchema = z.object({}).strict();
83
+ export const GetMemoryInsightsSchema = z.object({}).strict();
84
+ export const UpdateProjectMemorySchema = z.object({
85
+ section: z.string().min(1),
86
+ content: z.string().min(1),
87
+ }).strict();
88
+ export const OrchestrateLoopSchema = z.object({}).strict();
89
+ export const SubmitPlanSchema = z.object({
90
+ tasks: z.array(z.object({
91
+ id: TaskIDSchema,
92
+ agent: AgentIDSchema,
93
+ task: z.string().min(1),
94
+ dependencies: z.array(TaskIDSchema).optional(),
95
+ })),
96
+ }).strict();
97
+ export const AcquireLockSchema = z.object({
98
+ resource: z.string().min(1),
99
+ agent: AgentIDSchema,
100
+ ttl: z.number().int().positive().default(60),
101
+ }).strict();
102
+ export const ReleaseLockSchema = z.object({
103
+ resource: z.string().min(1),
104
+ agent: AgentIDSchema,
105
+ }).strict();
106
+ export const RegisterAgentSchema = z.object({
107
+ agent: AgentIDSchema,
108
+ role: z.string().min(1),
109
+ capability: z.number().int().min(1).max(10).default(5),
110
+ specialties: z.record(z.number()).optional(),
111
+ }).strict();
112
+ export const UpdateContractHashSchema = z.object({}).strict();
113
+ export const AuditDependenciesSchema = z.object({}).strict();
114
+ export const CheckLintSchema = z.object({}).strict();
115
+ // ─── Messaging (Hermes)
116
+ export const SendAgentMessageSchema = z.object({
117
+ from: AgentIDSchema,
118
+ to: AgentIDSchema,
119
+ category: z.enum(["ACTION", "DELEGATION", "SUBTASK", "REPLY", "ALERT"]),
120
+ content: z.string().min(1, "Content cannot be empty"),
121
+ traceId: TraceIDSchema,
122
+ parentId: TaskIDSchema.optional(),
123
+ priority: z.enum(["HIGH", "NORMAL", "LOW"]).default("NORMAL"),
124
+ requiresApproval: z.boolean().default(false),
125
+ }).strict();
126
+ export const LogAgentActionSchema = z.object({
127
+ agent: AgentIDSchema,
128
+ action: z.string().min(1),
129
+ traceId: TraceIDSchema,
130
+ status: z.enum(["SUCCESS", "FAILURE"]),
131
+ summary: z.string().min(1),
132
+ findings: z.string().optional(),
133
+ }).strict();
@@ -10,3 +10,7 @@ export function asTraceID(val) { return val; }
10
10
  export function asAgentID(val) { return val; }
11
11
  export function asPhaseID(val) { return val; }
12
12
  export function asProjectPath(val) { return val; }
13
+ export function asMessageID(val) { return val; }
14
+ export function asTaskID(val) { return val; }
15
+ export function asLogID(val) { return val; }
16
+ export function asPlanID(val) { return val; }