atabey 0.0.6 → 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 (387) hide show
  1. package/ATABEY.md +4 -4
  2. package/README.md +35 -33
  3. package/bin/cli.js +2 -2
  4. package/bin/validate-agent-army.js +6 -6
  5. package/dist/framework-mcp/src/constants.js +1 -1
  6. package/dist/framework-mcp/src/constants.js.map +1 -1
  7. package/dist/framework-mcp/src/index.js +29 -5
  8. package/dist/framework-mcp/src/index.js.map +1 -1
  9. package/dist/framework-mcp/src/resources/index.d.ts +10 -0
  10. package/dist/framework-mcp/src/resources/index.js +59 -0
  11. package/dist/framework-mcp/src/resources/index.js.map +1 -0
  12. package/dist/framework-mcp/src/tools/control_plane/locking.js +3 -3
  13. package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
  14. package/dist/framework-mcp/src/tools/control_plane/registry.js +3 -2
  15. package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
  16. package/dist/framework-mcp/src/tools/definitions.js +33 -1
  17. package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
  18. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +1 -1
  19. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +8 -3
  20. package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
  21. package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +1 -1
  22. package/dist/framework-mcp/src/tools/file_system/patch_file.js +8 -3
  23. package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
  24. package/dist/framework-mcp/src/tools/file_system/read_file.js +3 -3
  25. package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
  26. package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +1 -1
  27. package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -3
  28. package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
  29. package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +1 -1
  30. package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -5
  31. package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
  32. package/dist/framework-mcp/src/tools/framework/audit_deps.js +2 -2
  33. package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -1
  34. package/dist/framework-mcp/src/tools/framework/run_tests.js +2 -2
  35. package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
  36. package/dist/framework-mcp/src/tools/framework/submit_plan.d.ts +10 -0
  37. package/dist/framework-mcp/src/tools/framework/submit_plan.js +14 -0
  38. package/dist/framework-mcp/src/tools/framework/submit_plan.js.map +1 -0
  39. package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
  40. package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
  41. package/dist/framework-mcp/src/tools/index.js +2 -0
  42. package/dist/framework-mcp/src/tools/index.js.map +1 -1
  43. package/dist/framework-mcp/src/tools/memory/get_insights.js +1 -1
  44. package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
  45. package/dist/framework-mcp/src/tools/messaging/log_action.js +1 -1
  46. package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
  47. package/dist/framework-mcp/src/tools/messaging/send_message.js +5 -5
  48. package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
  49. package/dist/framework-mcp/src/tools/observability/check_ports.js +1 -1
  50. package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
  51. package/dist/framework-mcp/src/tools/quality/check_lint.js +2 -2
  52. package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -1
  53. package/dist/framework-mcp/src/tools/search/get_gaps.js +1 -1
  54. package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
  55. package/dist/framework-mcp/src/tools/search/grep_search.js +3 -3
  56. package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
  57. package/dist/framework-mcp/src/tools/types.d.ts +1 -0
  58. package/dist/framework-mcp/src/utils/compliance.d.ts +6 -0
  59. package/dist/framework-mcp/src/utils/compliance.js +158 -5
  60. package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
  61. package/dist/framework-mcp/src/utils/permissions.d.ts +12 -0
  62. package/dist/framework-mcp/src/utils/permissions.js +72 -0
  63. package/dist/framework-mcp/src/utils/permissions.js.map +1 -0
  64. package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js +84 -0
  65. package/dist/framework-mcp/tests/tools/file_system/compliance-risk.test.js.map +1 -0
  66. package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +31 -31
  67. package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
  68. package/dist/framework-mcp/tests/tools/file_system/permissions.test.d.ts +1 -0
  69. package/dist/framework-mcp/tests/tools/file_system/permissions.test.js +92 -0
  70. package/dist/framework-mcp/tests/tools/file_system/permissions.test.js.map +1 -0
  71. package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
  72. package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
  73. package/dist/src/cli/adapters/core.js +1 -1
  74. package/dist/src/cli/adapters/core.js.map +1 -1
  75. package/dist/src/cli/adapters/scaffold.js +2 -2
  76. package/dist/src/cli/adapters/scaffold.js.map +1 -1
  77. package/dist/src/cli/commands/check.js +5 -3
  78. package/dist/src/cli/commands/check.js.map +1 -1
  79. package/dist/src/cli/commands/compliance.js +2 -2
  80. package/dist/src/cli/commands/compliance.js.map +1 -1
  81. package/dist/src/cli/commands/contract.js +2 -2
  82. package/dist/src/cli/commands/contract.js.map +1 -1
  83. package/dist/src/cli/commands/dashboard.d.ts +5 -0
  84. package/dist/src/cli/commands/dashboard.js +124 -0
  85. package/dist/src/cli/commands/dashboard.js.map +1 -0
  86. package/dist/src/cli/commands/explorer.js +3 -3
  87. package/dist/src/cli/commands/explorer.js.map +1 -1
  88. package/dist/src/cli/commands/git.js +3 -3
  89. package/dist/src/cli/commands/git.js.map +1 -1
  90. package/dist/src/cli/commands/init/create-agent.d.ts +4 -0
  91. package/dist/src/cli/commands/init/create-agent.js +59 -0
  92. package/dist/src/cli/commands/init/create-agent.js.map +1 -0
  93. package/dist/src/cli/commands/init/scaffold-core.d.ts +1 -0
  94. package/dist/src/cli/commands/init/scaffold-core.js +11 -7
  95. package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
  96. package/dist/src/cli/commands/init/scaffold-docs.d.ts +1 -0
  97. package/dist/src/cli/commands/init/scaffold-docs.js +4 -6
  98. package/dist/src/cli/commands/init/scaffold-docs.js.map +1 -1
  99. package/dist/src/cli/commands/init/scaffold-ops.js +4 -4
  100. package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
  101. package/dist/src/cli/commands/init/scaffold-standards.js +10 -8
  102. package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
  103. package/dist/src/cli/commands/init.js +26 -10
  104. package/dist/src/cli/commands/init.js.map +1 -1
  105. package/dist/src/cli/commands/knowledge.js +3 -3
  106. package/dist/src/cli/commands/knowledge.js.map +1 -1
  107. package/dist/src/cli/commands/lint.js +2 -2
  108. package/dist/src/cli/commands/lint.js.map +1 -1
  109. package/dist/src/cli/commands/log.js +6 -28
  110. package/dist/src/cli/commands/log.js.map +1 -1
  111. package/dist/src/cli/commands/orchestrate.d.ts +10 -17
  112. package/dist/src/cli/commands/orchestrate.js +92 -341
  113. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  114. package/dist/src/cli/commands/plan.d.ts +5 -0
  115. package/dist/src/cli/commands/plan.js +80 -59
  116. package/dist/src/cli/commands/plan.js.map +1 -1
  117. package/dist/src/cli/commands/script.js +3 -3
  118. package/dist/src/cli/commands/script.js.map +1 -1
  119. package/dist/src/cli/commands/security.js +2 -2
  120. package/dist/src/cli/commands/security.js.map +1 -1
  121. package/dist/src/cli/commands/status.js +65 -8
  122. package/dist/src/cli/commands/status.js.map +1 -1
  123. package/dist/src/cli/commands/trace.d.ts +4 -0
  124. package/dist/src/cli/commands/trace.js +83 -2
  125. package/dist/src/cli/commands/trace.js.map +1 -1
  126. package/dist/src/cli/index.js +68 -18
  127. package/dist/src/cli/index.js.map +1 -1
  128. package/dist/src/cli/shims.js +14 -14
  129. package/dist/src/cli/utils/claude.js +1 -1
  130. package/dist/src/cli/utils/claude.js.map +1 -1
  131. package/dist/src/cli/utils/compliance.js +7 -1
  132. package/dist/src/cli/utils/compliance.js.map +1 -1
  133. package/dist/src/cli/utils/fs.js +1 -1
  134. package/dist/src/cli/utils/fs.js.map +1 -1
  135. package/dist/src/cli/utils/i18n.d.ts +1 -0
  136. package/dist/src/cli/utils/i18n.js +2 -0
  137. package/dist/src/cli/utils/i18n.js.map +1 -1
  138. package/dist/src/cli/utils/memory.d.ts +12 -3
  139. package/dist/src/cli/utils/memory.js +39 -31
  140. package/dist/src/cli/utils/memory.js.map +1 -1
  141. package/dist/src/cli/utils/pkg.js +2 -2
  142. package/dist/src/cli/utils/pkg.js.map +1 -1
  143. package/dist/src/cli/utils/schemas.d.ts +8 -8
  144. package/dist/src/cli/utils/ui.js +4 -4
  145. package/dist/src/cli/utils/ui.js.map +1 -1
  146. package/dist/src/contracts/tasks.d.ts +2 -2
  147. package/dist/src/dashboard/vite.config.d.ts +2 -0
  148. package/dist/src/dashboard/vite.config.js +16 -0
  149. package/dist/src/dashboard/vite.config.js.map +1 -0
  150. package/dist/src/modules/adapters/definitions.js +10 -10
  151. package/dist/src/modules/adapters/definitions.js.map +1 -1
  152. package/dist/src/modules/adapters/shared.js +4 -4
  153. package/dist/src/modules/adapters/shared.js.map +1 -1
  154. package/dist/src/modules/agents/definitions.d.ts +19 -0
  155. package/dist/src/modules/agents/definitions.js +74 -21
  156. package/dist/src/modules/agents/definitions.js.map +1 -1
  157. package/dist/src/modules/agents/registry/backend.js +8 -0
  158. package/dist/src/modules/agents/registry/backend.js.map +1 -1
  159. package/dist/src/modules/agents/registry/database.js +7 -0
  160. package/dist/src/modules/agents/registry/database.js.map +1 -1
  161. package/dist/src/modules/agents/registry/devops.js +6 -0
  162. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  163. package/dist/src/modules/agents/registry/frontend.js +8 -0
  164. package/dist/src/modules/agents/registry/frontend.js.map +1 -1
  165. package/dist/src/modules/agents/registry/security.js +6 -0
  166. package/dist/src/modules/agents/registry/security.js.map +1 -1
  167. package/dist/src/modules/agents/types.d.ts +2 -0
  168. package/dist/src/modules/engines/evaluation-engine.d.ts +11 -0
  169. package/dist/src/modules/engines/evaluation-engine.js +103 -0
  170. package/dist/src/modules/engines/evaluation-engine.js.map +1 -0
  171. package/dist/src/modules/engines/health-engine.d.ts +16 -0
  172. package/dist/src/modules/engines/health-engine.js +50 -0
  173. package/dist/src/modules/engines/health-engine.js.map +1 -0
  174. package/dist/src/modules/engines/planning-engine.d.ts +25 -0
  175. package/dist/src/modules/engines/planning-engine.js +79 -0
  176. package/dist/src/modules/engines/planning-engine.js.map +1 -0
  177. package/dist/src/modules/engines/risk-engine.d.ts +18 -0
  178. package/dist/src/modules/engines/risk-engine.js +106 -0
  179. package/dist/src/modules/engines/risk-engine.js.map +1 -0
  180. package/dist/src/modules/engines/routing-engine.d.ts +11 -0
  181. package/dist/src/modules/engines/routing-engine.js +74 -0
  182. package/dist/src/modules/engines/routing-engine.js.map +1 -0
  183. package/dist/src/modules/engines/types.d.ts +47 -0
  184. package/dist/src/modules/engines/types.js +2 -0
  185. package/dist/src/modules/engines/types.js.map +1 -0
  186. package/dist/src/shared/constants.d.ts +5 -2
  187. package/dist/src/shared/constants.js +4 -1
  188. package/dist/src/shared/constants.js.map +1 -1
  189. package/dist/src/shared/fs.d.ts +1 -0
  190. package/dist/src/shared/fs.js +4 -0
  191. package/dist/src/shared/fs.js.map +1 -1
  192. package/dist/src/shared/storage.d.ts +60 -0
  193. package/dist/src/shared/storage.js +208 -0
  194. package/dist/src/shared/storage.js.map +1 -0
  195. package/dist/tests/agent-memory-v2.test.d.ts +1 -0
  196. package/dist/tests/agent-memory-v2.test.js +68 -0
  197. package/dist/tests/agent-memory-v2.test.js.map +1 -0
  198. package/dist/tests/agents-definitions.test.js +42 -0
  199. package/dist/tests/agents-definitions.test.js.map +1 -1
  200. package/dist/tests/integration/hermes_locking.test.js +7 -10
  201. package/dist/tests/integration/hermes_locking.test.js.map +1 -1
  202. package/dist/tests/orchestrate.test.js +5 -1
  203. package/dist/tests/orchestrate.test.js.map +1 -1
  204. package/dist/tests/orchestrator-dependencies.test.d.ts +1 -0
  205. package/dist/tests/orchestrator-dependencies.test.js +52 -0
  206. package/dist/tests/orchestrator-dependencies.test.js.map +1 -0
  207. package/dist/tests/plan.test.d.ts +1 -0
  208. package/dist/tests/plan.test.js +63 -0
  209. package/dist/tests/plan.test.js.map +1 -0
  210. package/dist/tests/planning-engine.test.d.ts +1 -0
  211. package/dist/tests/planning-engine.test.js +50 -0
  212. package/dist/tests/planning-engine.test.js.map +1 -0
  213. package/dist/tests/status-cost.test.d.ts +1 -0
  214. package/dist/tests/status-cost.test.js +54 -0
  215. package/dist/tests/status-cost.test.js.map +1 -0
  216. package/dist/tests/status.test.js +8 -7
  217. package/dist/tests/status.test.js.map +1 -1
  218. package/dist/tests/trace-replay.test.d.ts +1 -0
  219. package/dist/tests/trace-replay.test.js +65 -0
  220. package/dist/tests/trace-replay.test.js.map +1 -0
  221. package/dist/tests/trace.test.js +14 -7
  222. package/dist/tests/trace.test.js.map +1 -1
  223. package/dist/ui/assets/index-Bkt7APzu.css +1 -0
  224. package/dist/ui/assets/index-CeX-06mI.js +49 -0
  225. package/dist/ui/index.html +14 -0
  226. package/package.json +5 -4
  227. package/templates/prompts/contract-design-recipe.md +1 -1
  228. package/templates/prompts/db-management-recipe.md +3 -3
  229. package/templates/prompts/deployment-recipe.md +3 -3
  230. package/templates/prompts/performance-optimization-recipe.md +3 -3
  231. package/templates/prompts/pull-request-template.md +2 -2
  232. package/templates/prompts/security-audit-recipe.md +3 -3
  233. package/templates/standards/crud-governance.md +1 -1
  234. package/templates/standards/deployment-standards.md +1 -1
  235. package/templates/standards/governance-standards.md +1 -1
  236. package/templates/standards/llm-governance.md +1 -1
  237. package/templates/standards/nextjs-standards.md +13 -0
  238. package/templates/standards/observability-standards.md +1 -1
  239. package/templates/standards/security-audit-standards.md +1 -1
  240. package/templates/standards/security-standards.md +1 -1
  241. package/templates/standards/testing-standards.md +1 -1
  242. package/templates/standards/vite-standards.md +13 -0
  243. package/framework-mcp/dist/constants.js +0 -64
  244. package/framework-mcp/dist/index.js +0 -120
  245. package/framework-mcp/dist/tools/control_plane/locking.js +0 -82
  246. package/framework-mcp/dist/tools/control_plane/registry.js +0 -34
  247. package/framework-mcp/dist/tools/definitions.js +0 -290
  248. package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +0 -59
  249. package/framework-mcp/dist/tools/file_system/patch_file.js +0 -29
  250. package/framework-mcp/dist/tools/file_system/read_file.js +0 -51
  251. package/framework-mcp/dist/tools/file_system/replace_text.js +0 -45
  252. package/framework-mcp/dist/tools/file_system/write_file.js +0 -38
  253. package/framework-mcp/dist/tools/framework/audit_deps.js +0 -41
  254. package/framework-mcp/dist/tools/framework/get_status.js +0 -5
  255. package/framework-mcp/dist/tools/framework/orchestrate.js +0 -5
  256. package/framework-mcp/dist/tools/framework/run_tests.js +0 -27
  257. package/framework-mcp/dist/tools/framework/update_contract_hash.js +0 -5
  258. package/framework-mcp/dist/tools/framework/update_memory.js +0 -8
  259. package/framework-mcp/dist/tools/index.js +0 -60
  260. package/framework-mcp/dist/tools/memory/get_insights.js +0 -34
  261. package/framework-mcp/dist/tools/memory/read_memory.js +0 -28
  262. package/framework-mcp/dist/tools/messaging/log_action.js +0 -22
  263. package/framework-mcp/dist/tools/messaging/send_message.js +0 -94
  264. package/framework-mcp/dist/tools/observability/check_ports.js +0 -26
  265. package/framework-mcp/dist/tools/observability/get_health.js +0 -19
  266. package/framework-mcp/dist/tools/quality/check_lint.js +0 -30
  267. package/framework-mcp/dist/tools/search/get_gaps.js +0 -48
  268. package/framework-mcp/dist/tools/search/get_map.js +0 -43
  269. package/framework-mcp/dist/tools/search/grep_search.js +0 -75
  270. package/framework-mcp/dist/tools/search/list_dir.js +0 -28
  271. package/framework-mcp/dist/tools/shell/run_command.js +0 -56
  272. package/framework-mcp/dist/utils/cli.js +0 -59
  273. package/framework-mcp/dist/utils/compliance.js +0 -78
  274. package/framework-mcp/dist/utils/fs.js +0 -44
  275. package/framework-mcp/dist/utils/metrics.js +0 -56
  276. package/framework-mcp/dist/utils/security.js +0 -60
  277. package/framework-mcp/package-lock.json +0 -1191
  278. package/framework-mcp/package.json +0 -29
  279. package/framework-mcp/src/constants.ts +0 -78
  280. package/framework-mcp/src/declarations.d.ts +0 -17
  281. package/framework-mcp/src/index.ts +0 -145
  282. package/framework-mcp/src/tools/control_plane/locking.ts +0 -89
  283. package/framework-mcp/src/tools/control_plane/registry.ts +0 -38
  284. package/framework-mcp/src/tools/definitions.ts +0 -292
  285. package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +0 -79
  286. package/framework-mcp/src/tools/file_system/patch_file.ts +0 -39
  287. package/framework-mcp/src/tools/file_system/read_file.ts +0 -58
  288. package/framework-mcp/src/tools/file_system/replace_text.ts +0 -54
  289. package/framework-mcp/src/tools/file_system/write_file.ts +0 -45
  290. package/framework-mcp/src/tools/framework/audit_deps.ts +0 -49
  291. package/framework-mcp/src/tools/framework/get_status.ts +0 -7
  292. package/framework-mcp/src/tools/framework/orchestrate.ts +0 -7
  293. package/framework-mcp/src/tools/framework/run_tests.ts +0 -30
  294. package/framework-mcp/src/tools/framework/update_contract_hash.ts +0 -7
  295. package/framework-mcp/src/tools/framework/update_memory.ts +0 -10
  296. package/framework-mcp/src/tools/index.ts +0 -64
  297. package/framework-mcp/src/tools/memory/get_insights.ts +0 -41
  298. package/framework-mcp/src/tools/memory/read_memory.ts +0 -31
  299. package/framework-mcp/src/tools/messaging/log_action.ts +0 -28
  300. package/framework-mcp/src/tools/messaging/send_message.ts +0 -97
  301. package/framework-mcp/src/tools/observability/check_ports.ts +0 -30
  302. package/framework-mcp/src/tools/observability/get_health.ts +0 -24
  303. package/framework-mcp/src/tools/quality/check_lint.ts +0 -36
  304. package/framework-mcp/src/tools/search/get_gaps.ts +0 -54
  305. package/framework-mcp/src/tools/search/get_map.ts +0 -48
  306. package/framework-mcp/src/tools/search/grep_search.ts +0 -75
  307. package/framework-mcp/src/tools/search/list_dir.ts +0 -34
  308. package/framework-mcp/src/tools/shell/run_command.ts +0 -66
  309. package/framework-mcp/src/tools/types.ts +0 -89
  310. package/framework-mcp/src/utils/cli.ts +0 -53
  311. package/framework-mcp/src/utils/compliance.ts +0 -95
  312. package/framework-mcp/src/utils/fs.ts +0 -45
  313. package/framework-mcp/src/utils/metrics.ts +0 -73
  314. package/framework-mcp/src/utils/security.ts +0 -66
  315. package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +0 -212
  316. package/framework-mcp/tests/tools/messaging/send_message.test.ts +0 -136
  317. package/framework-mcp/tests/tools/quality/check_lint.test.ts +0 -46
  318. package/framework-mcp/tests/tools/shell/run_command.test.ts +0 -55
  319. package/framework-mcp/tsconfig.json +0 -14
  320. package/src/cli/adapters/core.ts +0 -91
  321. package/src/cli/adapters/index.ts +0 -5
  322. package/src/cli/adapters/paths.ts +0 -135
  323. package/src/cli/adapters/scaffold.ts +0 -95
  324. package/src/cli/adapters/utils.ts +0 -87
  325. package/src/cli/commands/approve.ts +0 -73
  326. package/src/cli/commands/check.ts +0 -188
  327. package/src/cli/commands/compliance.ts +0 -55
  328. package/src/cli/commands/contract.ts +0 -68
  329. package/src/cli/commands/explorer.ts +0 -45
  330. package/src/cli/commands/git.ts +0 -39
  331. package/src/cli/commands/init/scaffold-core.ts +0 -136
  332. package/src/cli/commands/init/scaffold-docs.ts +0 -44
  333. package/src/cli/commands/init/scaffold-ops.ts +0 -83
  334. package/src/cli/commands/init/scaffold-standards.ts +0 -67
  335. package/src/cli/commands/init.ts +0 -193
  336. package/src/cli/commands/knowledge.ts +0 -44
  337. package/src/cli/commands/lint.ts +0 -23
  338. package/src/cli/commands/log.ts +0 -37
  339. package/src/cli/commands/memory.ts +0 -6
  340. package/src/cli/commands/orchestrate.ts +0 -450
  341. package/src/cli/commands/plan.ts +0 -113
  342. package/src/cli/commands/script.ts +0 -20
  343. package/src/cli/commands/security.ts +0 -38
  344. package/src/cli/commands/status.ts +0 -44
  345. package/src/cli/commands/trace.ts +0 -31
  346. package/src/cli/index.ts +0 -322
  347. package/src/cli/shims.ts +0 -66
  348. package/src/cli/utils/claude.ts +0 -63
  349. package/src/cli/utils/compliance.ts +0 -191
  350. package/src/cli/utils/config-schema.ts +0 -48
  351. package/src/cli/utils/fs.ts +0 -170
  352. package/src/cli/utils/i18n.ts +0 -44
  353. package/src/cli/utils/memory.ts +0 -303
  354. package/src/cli/utils/pkg.ts +0 -317
  355. package/src/cli/utils/schemas.ts +0 -22
  356. package/src/cli/utils/string.ts +0 -55
  357. package/src/cli/utils/time.ts +0 -27
  358. package/src/cli/utils/ui.ts +0 -66
  359. package/src/contracts/index.ts +0 -1
  360. package/src/contracts/tasks.ts +0 -26
  361. package/src/modules/adapters/definitions.ts +0 -171
  362. package/src/modules/adapters/registry.ts +0 -27
  363. package/src/modules/adapters/shared.ts +0 -120
  364. package/src/modules/adapters/types.ts +0 -16
  365. package/src/modules/agents/definitions.ts +0 -460
  366. package/src/modules/agents/registry/analyst.ts +0 -44
  367. package/src/modules/agents/registry/architect.ts +0 -47
  368. package/src/modules/agents/registry/backend.ts +0 -46
  369. package/src/modules/agents/registry/database.ts +0 -43
  370. package/src/modules/agents/registry/devops.ts +0 -44
  371. package/src/modules/agents/registry/explorer.ts +0 -41
  372. package/src/modules/agents/registry/frontend.ts +0 -48
  373. package/src/modules/agents/registry/git.ts +0 -41
  374. package/src/modules/agents/registry/manager.ts +0 -58
  375. package/src/modules/agents/registry/mobile.ts +0 -44
  376. package/src/modules/agents/registry/native.ts +0 -44
  377. package/src/modules/agents/registry/quality.ts +0 -46
  378. package/src/modules/agents/registry/security.ts +0 -42
  379. package/src/modules/agents/types.ts +0 -37
  380. package/src/modules/skills/definitions.ts +0 -71
  381. package/src/schema/agent-lifecycle-schema.json +0 -59
  382. package/src/shared/constants.ts +0 -218
  383. package/src/shared/errors.ts +0 -75
  384. package/src/shared/fs.ts +0 -50
  385. package/src/shared/logger.ts +0 -139
  386. package/src/shared/types.ts +0 -20
  387. /package/{framework-mcp/dist/tools/types.js → dist/framework-mcp/tests/tools/file_system/compliance-risk.test.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atabey",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "The Supreme AI Governance & Autonomous Orchestration Framework for Enterprise Development. Supports Polyglot Backends (Go, Java, Python, .NET, Node.js) and Multi-Language Communication (TR/EN).",
5
5
  "author": "Yusuf BEKAR",
6
6
  "license": "MIT",
@@ -34,9 +34,7 @@
34
34
  "files": [
35
35
  "bin",
36
36
  "dist",
37
- "src",
38
37
  "templates",
39
- "framework-mcp",
40
38
  "README.md",
41
39
  "LICENSE",
42
40
  "mcp.json",
@@ -46,7 +44,8 @@
46
44
  "node": ">=18.0.0"
47
45
  },
48
46
  "scripts": {
49
- "build": "tsc && npm run build --prefix framework-mcp",
47
+ "build": "tsc && npm run build --prefix framework-mcp && npm run build:ui",
48
+ "build:ui": "npm run build --prefix src/dashboard",
50
49
  "atabey:build": "npm run build --prefix framework-mcp",
51
50
  "atabey:test": "vitest run",
52
51
  "atabey:test:watch": "vitest",
@@ -65,6 +64,7 @@
65
64
  "access": "public"
66
65
  },
67
66
  "dependencies": {
67
+ "better-sqlite3": "^12.10.1",
68
68
  "chalk": "^5.6.2",
69
69
  "js-yaml": "^4.2.0",
70
70
  "typescript": "^5.9.3",
@@ -74,6 +74,7 @@
74
74
  "@eslint/js": "^10.0.1",
75
75
  "@modelcontextprotocol/sdk": "^1.29.0",
76
76
  "@pandacss/dev": "^1.11.1",
77
+ "@types/better-sqlite3": "^7.6.13",
77
78
  "@types/node": "^25.9.1",
78
79
  "eslint": "^10.4.0",
79
80
  "globals": "^17.6.0",
@@ -16,6 +16,6 @@ This recipe governs the @architect agent's protocol for creating type-safe agree
16
16
  2. **Commitment:** Run `atabey update-contract` to generate new SHA-256 signatures for the updated types.
17
17
  3. **Audit:** Verify that `contract.version.json` accurately reflects the new architecture.
18
18
 
19
- ## 📡 Phase 4: Synchronization
19
+ ## [SIGNAL] Phase 4: Synchronization
20
20
  1. **Distribution:** Ensure the updated `src/types` directory is correctly linked or copied to both Frontend and Backend projects.
21
21
  2. **Verification:** Trigger @backend and @frontend agents to read the new contract and plan their implementations.
@@ -1,4 +1,4 @@
1
- # 🗄️ Engineering Recipe: Database Management & Migrations
1
+ # [DB] Engineering Recipe: Database Management & Migrations
2
2
 
3
3
  This recipe governs the @database agent's protocol for schema creation, table modifications, and data integrity.
4
4
 
@@ -6,7 +6,7 @@ This recipe governs the @database agent's protocol for schema creation, table mo
6
6
  1. **Type Mapping:** Define the new table or column in `src/types/models.ts` using Branded Types for IDs.
7
7
  2. **Validation:** Ensure the interface extends `BaseEntity` (id, createdAt, updatedAt).
8
8
 
9
- ## 🚀 Phase 2: Migration Generation
9
+ ## [START] Phase 2: Migration Generation
10
10
  1. **Scripting:** Write a reversible migration (up/down) using the project's migration tool (e.g., Kysely or SQL).
11
11
  2. **Atomic Changes:** One migration per logical feature. Never bundle unrelated schema changes.
12
12
  3. **Naming:** Use timestamp-prefixed naming (e.g., `20240101_add_customers_table.ts`).
@@ -19,7 +19,7 @@ This recipe governs the @database agent's protocol for schema creation, table mo
19
19
  1. **Repo Layer:** Create or update the Repository class to include the new query logic.
20
20
  2. **Strict Mode:** Ensure no raw SQL is used; leverage the query builder exclusively.
21
21
 
22
- ## Phase 5: Verification & Zero-Downtime Audit
22
+ ## [OK] Phase 5: Verification & Zero-Downtime Audit
23
23
  1. **Dry Run:** If supported, dry-run the migration to check for locking issues.
24
24
  2. **Validation:** Run `atabey verify-contract` to ensure code and schema are synced.
25
25
  3. **Handoff:** Update `PROJECT_MEMORY.md` with the new schema version.
@@ -1,4 +1,4 @@
1
- # 🚀 Engineering Recipe: Infrastructure Deployment
1
+ # [START] Engineering Recipe: Infrastructure Deployment
2
2
 
3
3
  This recipe governs the @devops agent's protocol for safe, traceable, and reversible system rollouts.
4
4
 
@@ -12,12 +12,12 @@ This recipe governs the @devops agent's protocol for safe, traceable, and revers
12
12
  2. **Contract Verify:** Run `atabey verify-contract` to ensure FE/BE synchronization.
13
13
  3. **Test Suite:** Execute the full test battery. Failure in a single test blocks deployment.
14
14
 
15
- ## 📡 Phase 3: Controlled Rollout
15
+ ## [SIGNAL] Phase 3: Controlled Rollout
16
16
  1. **Atomic Swap:** Deploy the new bundle/service using the project's orchestration scripts.
17
17
  2. **Database Sync:** If migrations are pending, follow the `db-management-recipe.md` first.
18
18
  3. **Log Monitoring:** Tail `logs/manager.json` for immediate post-deploy spikes in errors.
19
19
 
20
- ## Phase 4: Post-Deploy & Rollback Readiness
20
+ ## [OK] Phase 4: Post-Deploy & Rollback Readiness
21
21
  1. **Observability:** Verify system metrics stabilize within 5 minutes.
22
22
  2. **Traceability:** Record the deployment Trace ID and commit hash in `PROJECT_MEMORY.md`.
23
23
  3. **Rollback Check:** Ensure the previous stable version is tagged and reachable in Git.
@@ -2,12 +2,12 @@
2
2
 
3
3
  This recipe governs the protocol for identifying and resolving system bottlenecks (Frontend, Backend, or Database).
4
4
 
5
- ## 📊 Phase 1: Profiling & Bottleneck Identification
5
+ ## [DATA] Phase 1: Profiling & Bottleneck Identification
6
6
  1. **Metric Collection:** Read `observability/metrics.json` or run `get_system_health`.
7
7
  2. **Log Audit:** Scan `logs/manager.json` for slow actions or timeouts.
8
8
  3. **Trace Analysis:** Use `TraceID` to follow a slow request through all layers.
9
9
 
10
- ## 🧠 Phase 2: Root Cause Analysis
10
+ ## [MEMORY] Phase 2: Root Cause Analysis
11
11
  1. **SQL Audit:** Check for N+1 query patterns or missing indexes in `repository/` files.
12
12
  2. **Algorithm Audit:** Scan for O(n²) loops or heavy synchronous operations.
13
13
  3. **Frontend Audit:** Check for unnecessary re-renders or massive bundle sizes.
@@ -17,7 +17,7 @@ This recipe governs the protocol for identifying and resolving system bottleneck
17
17
  2. **Logic Level:** Implement caching (e.g., Redis or in-memory) for frequent read operations.
18
18
  3. **UI Level:** Apply memoization, virtualization (FlashList), or code-splitting.
19
19
 
20
- ## Phase 4: Validation & Comparison
20
+ ## [OK] Phase 4: Validation & Comparison
21
21
  1. **Benchmarking:** Re-run the action and compare new metrics with the baseline.
22
22
  2. **Regression Check:** Run `atabey check` and existing tests to ensure logic is intact.
23
23
  3. **Knowledge Update:** Record the optimization strategy in `knowledge/performance-history.md`.
@@ -7,14 +7,14 @@
7
7
  - **Trace ID:** [Link to Trace/Task or ID]
8
8
  - **Issue:** [Link to issue if applicable]
9
9
 
10
- ## 🛡️ Governance & Compliance Checklist
10
+ ## [SECURITY] Governance & Compliance Checklist
11
11
  - [ ] Code passes `npm run atabey:test`.
12
12
  - [ ] Code passes `npm run atabey:check` (Compliance Scanner).
13
13
  - [ ] No `any` type usage added.
14
14
  - [ ] No secrets or hardcoded API keys.
15
15
  - [ ] New functionality is registered in `src/modules/agents/definitions.ts` (if applicable).
16
16
 
17
- ## 🧪 Testing Notes
17
+ ## [SKILL] Testing Notes
18
18
  <!-- How did you verify the fix? -->
19
19
 
20
20
  ## 🛠️ Risk Assessment
@@ -1,4 +1,4 @@
1
- # 🛡️ Engineering Recipe: Advanced Security Audit
1
+ # [SECURITY] Engineering Recipe: Advanced Security Audit
2
2
 
3
3
  This recipe governs the @security agent's protocol for identifying and mitigating vulnerabilities within the Agent Atabey framework.
4
4
 
@@ -7,7 +7,7 @@ This recipe governs the @security agent's protocol for identifying and mitigatin
7
7
  2. **SQL Injection Audit:** Scan for `raw SQL` or template literals bypassing the query builder.
8
8
  3. **Auth Check:** Verify that all sensitive routes have active `auth` guards and Role-Based Access Control (RBAC).
9
9
 
10
- ## 🧠 Phase 2: Contextual Analysis
10
+ ## [MEMORY] Phase 2: Contextual Analysis
11
11
  1. **Impact Mapping:** For every identified risk, read the surrounding code to determine if it's exposed to the public internet.
12
12
  2. **Configuration Check:** Verify `.env.example` contains all required keys and no real secrets are committed to Git.
13
13
 
@@ -15,6 +15,6 @@ This recipe governs the @security agent's protocol for identifying and mitigatin
15
15
  1. **Fix:** Use `replace_text` to move hardcoded secrets to `.env` or refactor raw SQL to Kysely.
16
16
  2. **Sanitization:** Apply input validation using Zod schemas for all external data.
17
17
 
18
- ## Phase 4: Verification & Logging
18
+ ## [OK] Phase 4: Verification & Logging
19
19
  1. **Discipline Check:** Run `atabey check` to ensure no new violations were introduced.
20
20
  2. **Action Log:** Execute `log_agent_action` with a summary of found vs. fixed vulnerabilities.
@@ -1,4 +1,4 @@
1
- # 🏛️ Corporate CRUD and Governance Standards
1
+ # [GOV] Corporate CRUD and Governance Standards
2
2
 
3
3
  This document defines the strict rules applicable to data mutation and administrative operations in projects managed by the Agent Atabey army.
4
4
 
@@ -1,4 +1,4 @@
1
- # 🚀 Deployment and Release Standards
1
+ # [START] Deployment and Release Standards
2
2
 
3
3
  This document outlines the protocols for deploying, updating, and rolling back services managed by Agent Atabey.
4
4
 
@@ -1,4 +1,4 @@
1
- # 🎖️ Agent Atabey — Governance & Nizam Standards
1
+ # [ATABEY] Agent Atabey — Governance & Nizam Standards
2
2
 
3
3
  This document defines the supreme governance mandates of the Agent Atabey framework.
4
4
  All agents **must** internalize these rules before executing any task.
@@ -1,4 +1,4 @@
1
- # 🤖 LLM Governance and Data Protection
1
+ # [AI] LLM Governance and Data Protection
2
2
 
3
3
  This document outlines the security, safety, and discipline rules for interacting with Large Language Models within Atabey-managed projects. It aligns with the spirit of the EU AI Act, NIST AI RMF, and OWASP Top 10 for LLMs.
4
4
 
@@ -0,0 +1,13 @@
1
+ # ⚛️ Corporate Next.js Standards
2
+
3
+ This document defines the architectural and coding standards for Next.js (App Router) applications.
4
+
5
+ ## 1. Architecture Standards
6
+ - **App Router First:** Use the App Router (`app/` directory) exclusively. Page router is deprecated.
7
+ - **Server Component Default:** All components are React Server Components (RSC) by default. Add `"use client"` only when client-side interactivity, state, or effects are strictly required.
8
+ - **Route Handlers:** Place API routes under `app/api/` and follow route handler signatures (`GET`, `POST`, etc.).
9
+
10
+ ## 2. Performance & SEO
11
+ - **Metadata API:** Use the static or dynamic Metadata API for title/SEO tag definition.
12
+ - **Image Optimization:** Always use next/image `<Image>` with explicit width/height or fluid placeholders.
13
+ - **Layouts & Suspense:** Implement structured layouts and wrap slower fetching components in `<Suspense>` with skeleton UI fallbacks.
@@ -1,4 +1,4 @@
1
- # 📊 Observability and Monitoring Standards
1
+ # [DATA] Observability and Monitoring Standards
2
2
 
3
3
  This document defines the requirements for logging, tracing, metrics, and alerting within Atabey-managed projects, following the "three pillars" model (logs, metrics, traces).
4
4
 
@@ -1,4 +1,4 @@
1
- # 🛡️ Security Audit Standards
1
+ # [SECURITY] Security Audit Standards
2
2
 
3
3
  This document defines the security audit procedures required for all Agent Atabey-managed projects to ensure a "Defense-in-Depth" posture, aligned with OWASP ASVS and the OWASP Top 10.
4
4
 
@@ -1,4 +1,4 @@
1
- # 🛡️ Corporate Security and Data Protection Standards
1
+ # [SECURITY] Corporate Security and Data Protection Standards
2
2
 
3
3
  This document defines the security protocols and data protection standards for projects managed by Agent Atabey.
4
4
 
@@ -1,4 +1,4 @@
1
- # 🧪 Corporate Testing Standards
1
+ # [SKILL] Corporate Testing Standards
2
2
 
3
3
  This document defines the testing discipline and scope rules for projects managed by Agent Atabey. Code quality must be ensured with automated tests.
4
4
 
@@ -0,0 +1,13 @@
1
+ # ⚡ Corporate Vite Standards
2
+
3
+ This document defines the configuration and development standards for Vite-based frontend applications.
4
+
5
+ ## 1. Core Config Rules
6
+ - **TypeScript Integration:** Always use `vite-tsconfig-paths` to resolve TS path aliases automatically.
7
+ - **Port Discipline:** Keep development ports standardized. Default frontend port is `5173`.
8
+ - **Environment Variables:** Environment variables must be prefixed with `VITE_` and fully typed in `vite-env.d.ts`.
9
+
10
+ ## 2. Dev & Build Optimizations
11
+ - **Build Target:** Target modern browsers (`esnext` or minimum `es2022`).
12
+ - **Code Splitting:** Implement splitChunks (manualChunks) for vendor libraries (e.g. react, react-dom, react-router-dom) to keep bundle sizes under control.
13
+ - **Minification:** Use `esbuild` for maximum build speeds.
@@ -1,64 +0,0 @@
1
- import path from "path";
2
- /**
3
- * Agent Atabey — Single Source of Truth for framework constants.
4
- * Import from here instead of hardcoding paths, phases, or directory names.
5
- */
6
- // ─── Framework identity ───────────────────────────────────────────────────
7
- export const FRAMEWORK = {
8
- NAME: "Agent Atabey",
9
- CORE_DIR: ".atabey",
10
- // This is the hub for unified adapter layouts (e.g. .agents/gemini, .agents/claude)
11
- UNIFIED_HUB_DIR: ".agents",
12
- // This is the default directory to scaffold new apps into
13
- APPS_DIR: "apps",
14
- // This is where all skills are stored
15
- SKILLS_DIR: "skills",
16
- };
17
- export const FRAMEWORK_SUBDIRS = {
18
- AGENTS: "agents",
19
- SKILLS: "skills",
20
- KNOWLEDGE: "knowledge",
21
- MESSAGES: "messages",
22
- MEMORY: "memory",
23
- MEMORY_GRAPH: "memory-graph",
24
- LOGS: "logs",
25
- CONFIG: "config",
26
- };
27
- export const ROOT_CONFIG_FILES = {
28
- MCP: "mcp.json",
29
- NATIVE_MODULES: "native-modules.json",
30
- TSCONFIG: "tsconfig.json",
31
- ESLINT: "eslint.config.js",
32
- };
33
- export const MCP = {
34
- // Environment variable used by MCP to identify project root
35
- PROJECT_ROOT_ENV: "ATABEY_PROJECT_ROOT",
36
- // Environment variable for test mode
37
- TEST_DIR_ENV: "ATABEY_TEST_DIR",
38
- };
39
- export const MEMORY_FILES = {
40
- STATE: "state.json",
41
- SHARED_FACTS: "shared_facts.json",
42
- };
43
- export const NATIVE_AGENT_PATHS = {
44
- gemini: ".gemini/agents",
45
- claude: ".claude/agents",
46
- cursor: ".cursor/rules",
47
- codex: ".agents/instructions",
48
- grok: ".grok",
49
- "antigravity-cli": ".antigravity/agents",
50
- };
51
- // ─── Backward-compatible aliases ──────────────────────────────────────────
52
- export const CORE_FRAMEWORK_DIR = FRAMEWORK.CORE_DIR;
53
- export const UNIFIED_HUB_DIR = FRAMEWORK.UNIFIED_HUB_DIR;
54
- export const SKILLS_HUB_PATH = pathJoin(UNIFIED_HUB_DIR, FRAMEWORK_SUBDIRS.SKILLS);
55
- // ─── Path Helpers ─────────────────────────────────────────────────────────
56
- function pathJoin(...args) {
57
- return path.join(...args);
58
- }
59
- function corePath(subdir, filename) {
60
- return pathJoin(FRAMEWORK.CORE_DIR, subdir, filename);
61
- }
62
- export function knowledgePath(filename) {
63
- return corePath(FRAMEWORK_SUBDIRS.KNOWLEDGE, filename);
64
- }
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from "fs";
3
- import path from "path";
4
- import { fileURLToPath } from "url";
5
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
6
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
- import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
8
- import { TOOLS, toolHandlers } from "./tools/index.js";
9
- // ─── Server Setup ─────────────────────────────────────────────────
10
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
- // Robustly find package.json by walking up from __dirname
12
- function findPackageJson(startDir) {
13
- let currentDir = startDir;
14
- while (currentDir !== path.parse(currentDir).root) {
15
- const pkgPath = path.join(currentDir, "package.json");
16
- if (fs.existsSync(pkgPath))
17
- return pkgPath;
18
- currentDir = path.dirname(currentDir);
19
- }
20
- throw new Error("Could not find package.json for atabey-mcp");
21
- }
22
- const pkgPath = findPackageJson(__dirname);
23
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
24
- const serverVersion = pkg.version;
25
- const server = new Server({
26
- name: "atabey-mcp",
27
- version: serverVersion,
28
- }, {
29
- capabilities: {
30
- tools: {},
31
- },
32
- });
33
- // Basic Schema Validator for Required Fields
34
- function validateArgs(toolName, args) {
35
- const definition = TOOLS.find(t => t.name === toolName);
36
- if (!definition)
37
- return `Unknown tool: ${toolName}`;
38
- const required = definition.inputSchema.required || [];
39
- for (const field of required) {
40
- if (args[field] === undefined || args[field] === null || args[field] === "") {
41
- return `Missing required argument: '${field}' for tool '${toolName}'`;
42
- }
43
- }
44
- return null;
45
- }
46
- server.setRequestHandler(ListToolsRequestSchema, async (request) => {
47
- // 2026 Stateless Spec: Log client info from metadata if available
48
- const meta = request._meta;
49
- if (meta) {
50
- process.stderr.write(`[MCP] Stateless ListTools from ${meta.client?.name || "unknown"} v${meta.client?.version || "?.?"}\n`);
51
- }
52
- return { tools: TOOLS };
53
- });
54
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
55
- const req = request;
56
- const { name, arguments: args } = req.params;
57
- const meta = request._meta;
58
- // 2026 Stateless Spec: Prioritize metadata-driven context
59
- if (meta) {
60
- process.stderr.write(`[MCP] Stateless CallTool: ${name} (Client: ${meta.client?.name || "unknown"})\n`);
61
- }
62
- const projectRoot = process.env.ATABEY_PROJECT_ROOT || process.cwd();
63
- try {
64
- const handler = toolHandlers[name];
65
- if (!handler) {
66
- return {
67
- isError: true,
68
- content: [{ type: "text", text: `❌ Unknown tool: ${name}` }],
69
- };
70
- }
71
- // 🛡️ Runtime Validation
72
- const validationError = validateArgs(name, args || {});
73
- if (validationError) {
74
- return {
75
- isError: true,
76
- content: [{ type: "text", text: `❌ Validation Error: ${validationError}` }],
77
- };
78
- }
79
- return await handler(projectRoot, args || {});
80
- }
81
- catch (error) {
82
- const message = error instanceof Error ? error.message : "Unknown error occurred";
83
- return {
84
- isError: true,
85
- content: [{ type: "text", text: `❌ Execution failed: ${message}` }],
86
- };
87
- }
88
- });
89
- // ─── Graceful Startup & Shutdown ──────────────────────────────────
90
- async function run() {
91
- const transport = new StdioServerTransport();
92
- // Prevent unhandled errors from crashing the MCP stream
93
- process.on("uncaughtException", (error) => {
94
- process.stderr.write(`[atabey-mcp] Uncaught exception: ${error.message}
95
- `);
96
- });
97
- process.on("unhandledRejection", (reason) => {
98
- const message = reason instanceof Error ? reason.message : String(reason);
99
- process.stderr.write(`[atabey-mcp] Unhandled rejection: ${message}
100
- `);
101
- });
102
- // Graceful shutdown on SIGINT/SIGTERM
103
- const shutdown = async () => {
104
- try {
105
- await server.close();
106
- }
107
- catch {
108
- // Already closed or failed — safe to ignore
109
- }
110
- process.exit(0);
111
- };
112
- process.on("SIGINT", shutdown);
113
- process.on("SIGTERM", shutdown);
114
- await server.connect(transport);
115
- }
116
- run().catch((error) => {
117
- process.stderr.write(`[atabey-mcp] Fatal startup error: ${error.message}
118
- `);
119
- process.exit(1);
120
- });
@@ -1,82 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { resolveFrameworkDir } from "../../utils/security.js";
4
- /**
5
- * Handles acquiring a stateful lock on a resource.
6
- */
7
- export async function handleAcquireLock(projectRoot, args) {
8
- const { resource, agent, ttl = 60 } = args;
9
- const frameworkDir = resolveFrameworkDir(projectRoot);
10
- const lockDir = path.join(projectRoot, frameworkDir, "locks");
11
- const lockPath = path.join(lockDir, `${resource}.lock`);
12
- try {
13
- if (!fs.existsSync(lockDir))
14
- fs.mkdirSync(lockDir, { recursive: true });
15
- // Check for stale lock first
16
- if (fs.existsSync(lockPath)) {
17
- const stat = fs.statSync(lockPath);
18
- const now = new Date().getTime();
19
- const age = (now - stat.mtimeMs) / 1000;
20
- if (age < ttl) {
21
- return {
22
- isError: true,
23
- content: [{ type: "text", text: `Resource '${resource}' is currently locked by another agent.` }]
24
- };
25
- }
26
- // Lock expired, safe to override by renaming first (POSIX atomic operation)
27
- const tempLockPath = `${lockPath}.${Math.random().toString(36).substring(2)}.old`;
28
- try {
29
- fs.renameSync(lockPath, tempLockPath);
30
- fs.unlinkSync(tempLockPath);
31
- }
32
- catch {
33
- // If rename failed, it means another agent already evicting/deleting it.
34
- // Do not delete anything else; proceed and let writeFileSync (wx flag) fail if a new lock exists.
35
- }
36
- }
37
- // Use 'wx' flag for atomic file creation
38
- const lockData = JSON.stringify({ agent, timestamp: new Date().toISOString() });
39
- fs.writeFileSync(lockPath, lockData, { flag: "wx" });
40
- return {
41
- content: [{ type: "text", text: `✅ Lock acquired for resource '${resource}' by ${agent}.` }]
42
- };
43
- }
44
- catch (e) {
45
- const error = e;
46
- if (error.code === "EEXIST") {
47
- return {
48
- isError: true,
49
- content: [{ type: "text", text: `Resource '${resource}' was just acquired by another agent.` }]
50
- };
51
- }
52
- return {
53
- isError: true,
54
- content: [{ type: "text", text: `Failed to acquire lock: ${String(e)}` }]
55
- };
56
- }
57
- }
58
- /**
59
- * Handles releasing a lock.
60
- */
61
- export async function handleReleaseLock(projectRoot, args) {
62
- const { resource, agent } = args;
63
- const frameworkDir = resolveFrameworkDir(projectRoot);
64
- const lockPath = path.join(projectRoot, frameworkDir, "locks", `${resource}.lock`);
65
- try {
66
- if (!fs.existsSync(lockPath)) {
67
- return { content: [{ type: "text", text: `ℹ️ No lock found for resource '${resource}'.` }] };
68
- }
69
- const lockData = JSON.parse(fs.readFileSync(lockPath, "utf8"));
70
- if (lockData.agent !== agent) {
71
- return {
72
- isError: true,
73
- content: [{ type: "text", text: `❌ Denied: You do not own the lock for '${resource}'. Owned by ${lockData.agent}.` }]
74
- };
75
- }
76
- fs.unlinkSync(lockPath);
77
- return { content: [{ type: "text", text: `✅ Lock released for resource '${resource}' by ${agent}.` }] };
78
- }
79
- catch (e) {
80
- return { isError: true, content: [{ type: "text", text: `Failed to release lock: ${String(e)}` }] };
81
- }
82
- }
@@ -1,34 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { resolveFrameworkDir } from "../../utils/security.js";
4
- /**
5
- * Handles agent registration with the Control Plane.
6
- * This can be used to validate permissions and active status.
7
- */
8
- export async function handleRegisterAgent(projectRoot, args) {
9
- const { agent, role, capability = 5 } = args;
10
- const frameworkDir = resolveFrameworkDir(projectRoot);
11
- const registryDir = path.join(projectRoot, frameworkDir, "registry");
12
- const agentFile = path.join(registryDir, `${agent.replace("@", "")}_active.json`);
13
- try {
14
- if (!fs.existsSync(registryDir))
15
- fs.mkdirSync(registryDir, { recursive: true });
16
- const agentData = {
17
- agent,
18
- role,
19
- capability,
20
- last_seen: new Date().toISOString(),
21
- status: "ACTIVE"
22
- };
23
- fs.writeFileSync(agentFile, JSON.stringify(agentData, null, 2));
24
- return {
25
- content: [{ type: "text", text: `🎖️ Agent ${agent} (${role}) registered successfully in the Atabey Control Plane.` }]
26
- };
27
- }
28
- catch (e) {
29
- return {
30
- isError: true,
31
- content: [{ type: "text", text: `Failed to register agent: ${String(e)}` }]
32
- };
33
- }
34
- }