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
@@ -1,73 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { getFrameworkDir } from "../utils/memory.js";
4
- import { UI } from "../utils/ui.js";
5
- import { writeTextFile, appendFile } from "../utils/fs.js";
6
- import { ValidationError } from "../../shared/errors.js";
7
-
8
- import { HermesMessageSchema } from "./orchestrate.js";
9
-
10
- export async function approveCommand(traceId: string) {
11
- const frameworkDir = getFrameworkDir();
12
- const messagesDir = path.join(frameworkDir, "messages");
13
-
14
- if (!fs.existsSync(messagesDir)) {
15
- throw new ValidationError(
16
- "No messages directory found.",
17
- null,
18
- "Ensure the framework is initialized and the Hermes orchestrator has been run at least once."
19
- );
20
- }
21
-
22
- const files = fs.readdirSync(messagesDir).filter((f) => f.endsWith(".json"));
23
- let found = false;
24
-
25
- for (const file of files) {
26
- const filePath = path.join(messagesDir, file);
27
- try {
28
- const content = fs.readFileSync(filePath, "utf8").trim();
29
- if (!content) continue;
30
- const lines = content.split("\n");
31
- let updated = false;
32
- const newLines = lines.map((line) => {
33
- if (!line.trim()) return line;
34
- try {
35
- const parsed = JSON.parse(line);
36
- const msg = HermesMessageSchema.parse(parsed);
37
- if (msg.traceId === traceId && msg.status === "PENDING" && (msg.category === "ALERT" || msg.category === "ACTION")) {
38
- msg.status = "APPROVED";
39
- updated = true;
40
- found = true;
41
- UI.success(`Approved message from ${msg.from} to ${msg.to} (Action: ${msg.action || "None"})`);
42
- }
43
- return JSON.stringify(msg);
44
- } catch (e) {
45
- UI.error(`Skipping invalid Hermes message during approval: ${(e as Error).message}`);
46
- return line;
47
- }
48
- });
49
-
50
- if (updated) {
51
- writeTextFile(filePath, newLines.join("\n") + "\n");
52
- }
53
- } catch (e) {
54
- UI.error(`Error reading or updating message file ${file}: ${(e as Error).message}`);
55
- }
56
- }
57
-
58
- if (found) {
59
- // Log user approval to audit log
60
- const auditPath = path.join(frameworkDir, "observability/audit_log.md");
61
- if (fs.existsSync(auditPath)) {
62
- const logEntry = "\n- **[" + new Date().toISOString() + "]** USER -> @manager | APPROVED | Trace: " + traceId;
63
- appendFile(auditPath, logEntry);
64
- }
65
- UI.success("Successfully approved Trace: " + traceId);
66
- } else {
67
- throw new ValidationError(
68
- `No pending approval request found for Trace ID: ${traceId}`,
69
- null,
70
- "Run 'npx atabey status' to see active traces and ensure the ID is correct and pending approval."
71
- );
72
- }
73
- }
@@ -1,188 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { execSync } from "child_process";
4
-
5
- import { getFrameworkDir, getMemoryPath, getConfiguredPaths, isFrameworkDevelopmentRepo, readState } from "../utils/memory.js";
6
- import { getPackageVersion, getValidatorPath } from "../utils/pkg.js";
7
- import { UI } from "../utils/ui.js";
8
- import { logger } from "../../shared/logger.js";
9
- import { scanProjectCompliance } from "../utils/compliance.js";
10
- import { ALL_AGENTS } from "../../modules/agents/definitions.js";
11
- import { detectActiveAgentLayouts, findAgentInstruction } from "../adapters/paths.js";
12
-
13
- import { verifyApiContractCommand } from "./contract.js";
14
-
15
- export async function checkCommand() {
16
- UI.intent("Agent Atabey Health Check", `Checking system health and discipline rules (v${getPackageVersion()})...`);
17
- let issues = 0;
18
-
19
- const state = readState();
20
- if (!state) {
21
- UI.error("Memory state not found. Run 'init' first.");
22
- return;
23
- }
24
-
25
- const frameworkDir = getFrameworkDir();
26
- const memoryPath = getMemoryPath();
27
- const pathsMap = getConfiguredPaths();
28
-
29
- UI.success(`Using framework dir: ${frameworkDir}`);
30
-
31
- // --- Contract Gate (Phase 2+ Discipline) ---
32
- if (["PHASE_2", "PHASE_3", "PHASE_4"].includes(state.phase)) {
33
- console.warn("\n📝 Validating API Contracts (Phase 2+ Required)...");
34
- try {
35
- const contractOk = await verifyApiContractCommand({ silent: true });
36
- if (!contractOk) {
37
- UI.error("Contract verification FAILED! You cannot be in Phase 2+ with unverified contracts.");
38
- issues++;
39
- } else {
40
- UI.success("API Contracts verified and sealed.");
41
- }
42
- } catch {
43
- UI.error("Error during contract verification.");
44
- issues++;
45
- }
46
- }
47
-
48
- let knowledgeDir = "knowledge";
49
- if (frameworkDir === ".github") knowledgeDir = "instructions";
50
-
51
- const constitutionPath = fs.existsSync(path.join(process.cwd(), "ATABEY.md")) ? "ATABEY.md" : path.join(frameworkDir, "ATABEY.md");
52
-
53
- const rootPandaPath = path.join(process.cwd(), "panda.config.ts");
54
- const appPandaPath = path.join(pathsMap.frontend, "panda.config.ts");
55
-
56
- if (fs.existsSync(rootPandaPath)) {
57
- UI.error(`Panda CSS config must NOT be at the root directory! Move it to '${pathsMap.frontend}/panda.config.ts'.`);
58
- issues++;
59
- }
60
-
61
- const isFrameworkDevelopment = isFrameworkDevelopmentRepo();
62
-
63
- const checks = [
64
- { name: "Constitution (ATABEY.md)", path: constitutionPath },
65
- { name: "Memory (PROJECT_MEMORY.md)", path: path.relative(process.cwd(), memoryPath) },
66
- { name: "Command Map (cli-commands.json)", path: path.join(frameworkDir, "cli-commands.json") },
67
- { name: "Framework Config (config.json)", path: path.join(frameworkDir, "config.json") },
68
- { name: "Agent Status (STATUS.md)", path: path.join(frameworkDir, "STATUS.md") },
69
- { name: "MCP Config (mcp.json)", path: "mcp.json" },
70
- { name: "ESLint Config (eslint.config.js)", path: "eslint.config.js", optional: !isFrameworkDevelopment },
71
- { name: "ESLint Standards", path: path.join(frameworkDir, `${knowledgeDir}/eslint-standards.md`) },
72
- { name: "CRUD Governance Standards", path: path.join(frameworkDir, `${knowledgeDir}/crud-governance.md`) },
73
- { name: "Architecture Standards", path: path.join(frameworkDir, `${knowledgeDir}/architecture-standards.md`) },
74
- { name: "Frontend Standards", path: path.join(frameworkDir, `${knowledgeDir}/frontend-standards.md`) },
75
- { name: "Tailwind Standards", path: path.join(frameworkDir, `${knowledgeDir}/tailwind-standards.md`), optional: true },
76
- { name: "Mobile Standards", path: path.join(frameworkDir, `${knowledgeDir}/mobile-standards.md`) },
77
- { name: "Security Standards", path: path.join(frameworkDir, `${knowledgeDir}/security-standards.md`) },
78
- { name: "Quality & Discipline Standards", path: path.join(frameworkDir, `${knowledgeDir}/quality-standards.md`) },
79
- { name: "Logging & Secrets Standards", path: path.join(frameworkDir, `${knowledgeDir}/logging-and-secrets.md`) },
80
- { name: "Testing Standards", path: path.join(frameworkDir, `${knowledgeDir}/testing-standards.md`) },
81
- { name: "i18n Standards", path: path.join(frameworkDir, `${knowledgeDir}/i18n-standards.md`) },
82
- { name: ".env.example", path: ".env.example" },
83
- ...(isFrameworkDevelopment ? [{ name: "MCP Server", path: "framework-mcp/package.json" }] : []),
84
- { name: "Panda CSS Config", path: appPandaPath, optional: true },
85
- ];
86
-
87
- for (const check of checks) {
88
- const fullPath = path.isAbsolute(check.path) ? check.path : path.join(process.cwd(), check.path);
89
- if (fs.existsSync(fullPath)) {
90
- UI.success(`${check.name} found.`);
91
- } else {
92
- if (check.optional) {
93
- UI.warning(`${check.name} MISSING! (${check.path}) [Optional]`);
94
- } else {
95
- UI.error(`${check.name} MISSING! (${check.path})`);
96
- issues++;
97
- }
98
- }
99
- }
100
-
101
- // Agent Army Check
102
- console.warn("\n🛡️ Running Agent Army Compliance...");
103
- try {
104
- const validatorScript = getValidatorPath();
105
- execSync(`node "${validatorScript}"`, { stdio: "pipe" });
106
- UI.success("Agent Army AL validation PASSED.");
107
- } catch (error: unknown) {
108
- const err = error as Error & { stderr?: Buffer };
109
- UI.error(`Agent Army AL validation FAILED: ${err.message}`);
110
- if (err.stderr) console.error(err.stderr.toString());
111
- issues++;
112
- }
113
-
114
- // Agent Documentation Check (Live Integrity)
115
- console.warn("\n📚 Checking Agent Integrity (Instructions)...");
116
-
117
- const projectRoot = process.cwd();
118
- const activeLayouts = detectActiveAgentLayouts(projectRoot);
119
-
120
- if (activeLayouts.length > 0) {
121
- UI.success(`Active agent layout(s): ${activeLayouts.join(", ")}`);
122
- ALL_AGENTS.forEach((agent) => {
123
- const found = findAgentInstruction(projectRoot, agent.name);
124
- if (found) {
125
- UI.success(`Instructions for @${agent.name} found at ${found}`);
126
- } else {
127
- UI.error(`Instructions for @${agent.name} MISSING! Run 'atabey init' to scaffold.`);
128
- issues++;
129
- }
130
- });
131
- } else {
132
- UI.warning("No active agent instruction directory detected. Run 'atabey init [adapter]' first.");
133
- issues++;
134
- }
135
-
136
- // Code Quality - Using the new Compliance Scanner
137
- console.warn("\n⚖️ Checking Discipline (Code Quality)...");
138
- const complianceIssues = scanProjectCompliance();
139
- if (complianceIssues.length > 0) {
140
- complianceIssues.forEach(issue => {
141
- UI.error(`${issue.rule} in ${issue.file}:${issue.line}`);
142
- });
143
- issues += complianceIssues.length;
144
- } else {
145
- UI.success("No compliance issues detected.");
146
- }
147
-
148
- const rootTestFiles = checkRootTestFiles();
149
- if (rootTestFiles.length > 0) {
150
- UI.warning(`Test files found in the root directory: ${rootTestFiles.join(", ")}. It is recommended to place all test files under the 'tests/' folder or application-specific directories.`);
151
- }
152
-
153
- try {
154
- UI.intent("Type Check", "Running 'npx tsc --noEmit' (this may take a few seconds)...");
155
- execSync("npx tsc --noEmit", { stdio: "pipe" });
156
- UI.success("TypeScript type check PASSED.");
157
- } catch (err) {
158
- UI.warning("TypeScript type check FAILED or 'tsc' not found. This is a non-blocking warning for lightweight checks.");
159
- logger.debug("npx tsc --noEmit check failed", err);
160
- }
161
-
162
- if (issues === 0) {
163
- UI.success("\n🚀 All systems green! Agent Atabey is ready.");
164
- } else {
165
- UI.error(`\n⚠️ Found ${issues} issues. Please fix them.`);
166
- process.exit(1);
167
- }
168
- }
169
-
170
- function checkRootTestFiles(): string[] {
171
- const rootDir = process.cwd();
172
- if (!fs.existsSync(rootDir)) return [];
173
- const files = fs.readdirSync(rootDir);
174
- const testFiles: string[] = [];
175
- for (const file of files) {
176
- const fullPath = path.join(rootDir, file);
177
- try {
178
- if (fs.statSync(fullPath).isFile()) {
179
- if (file.includes(".test.") || file.includes(".spec.")) {
180
- testFiles.push(file);
181
- }
182
- }
183
- } catch (err) {
184
- logger.debug(`Failed to stat file ${fullPath} in checkRootTestFiles`, err);
185
- }
186
- }
187
- return testFiles;
188
- }
@@ -1,55 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
-
4
- import { collectFiles } from "../utils/fs.js";
5
-
6
- const targetDir = process.cwd(); // Assuming targetDir is process.cwd() in the CLI context
7
-
8
- export async function complianceCheckCommand(targetPath: string) {
9
- console.warn(`📜 Checking Constitution Compliance: ${targetPath}...`);
10
- const violations: string[] = [];
11
- const forbidden = ["@shadcn", "mui", "@chakra-ui", "tailwindcss"];
12
-
13
- // 1. package.json scan (Blind Spot 5)
14
- const pkgJsonPath = path.join(targetDir, "package.json");
15
- if (fs.existsSync(pkgJsonPath)) {
16
- try {
17
- const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8"));
18
- const allDeps = { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
19
- forbidden.forEach(lib => {
20
- if (allDeps[lib] || Object.keys(allDeps).some(d => d.toLowerCase().includes(lib.toLowerCase()))) {
21
- violations.push(`package.json: Forbidden library dependency '${lib}' found in package.json.`);
22
- }
23
- });
24
- } catch {
25
- // ignore
26
- }
27
- }
28
-
29
- // 2. Source files scan
30
- const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx", ".js", ".jsx", ".md"]);
31
- files.forEach(f => {
32
- const isTypesFile = f.includes("brands.ts") || f.includes("brands.js") || f.includes("brands.tsx") || f.includes("src/types/brands");
33
-
34
- const content = fs.readFileSync(f, "utf8");
35
- forbidden.forEach(lib => {
36
- if (content.includes(lib)) violations.push(`${path.relative(targetDir, f)}: Forbidden library '${lib}' found.`);
37
- });
38
-
39
- // Robust Branded Types validation (Blind Spot 4)
40
- if ((f.endsWith(".ts") || f.endsWith(".tsx")) && !isTypesFile && content.includes("interface")) {
41
- const plainIdMatches = content.match(/\b\w*(?:id|Id|ID)\??\s*:\s*(?:string|number)\b/g);
42
- if (plainIdMatches) {
43
- plainIdMatches.forEach(match => {
44
- violations.push(`${path.relative(targetDir, f)}: Potential Branded Types violation (plain identifier '${match.trim()}' found inside interface).`);
45
- });
46
- }
47
- }
48
- });
49
-
50
- if (violations.length === 0) {
51
- console.warn("✅ All systems compliant with ATABEY.md.");
52
- } else {
53
- violations.forEach(v => console.warn(`❌ ${v}`));
54
- }
55
- }
@@ -1,68 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import { getConfiguredPaths } from "../utils/memory.js";
4
- import { computeTypesHash, writeJsonFile } from "../utils/fs.js";
5
- import { ValidationError } from "../../shared/errors.js";
6
-
7
- /**
8
- * Verify type safety between backend and frontend contracts.
9
- */
10
- export async function verifyApiContractCommand(options: { silent?: boolean } = {}): Promise<boolean> {
11
- const projectRoot = process.cwd();
12
- const pathsMap = getConfiguredPaths();
13
- const sharedDir = path.join(projectRoot, pathsMap.backend, "src/types");
14
- const contractPath = path.join(projectRoot, pathsMap.backend, "contract.version.json");
15
-
16
- if (!fs.existsSync(sharedDir) || !fs.existsSync(contractPath)) {
17
- if (options.silent) return false;
18
- throw new ValidationError(
19
- "API types or contract version file missing.",
20
- null,
21
- "Ensure you have initialized the project and the backend directory is correctly configured in config.json."
22
- );
23
- }
24
-
25
- const currentHash = computeTypesHash(projectRoot, sharedDir);
26
- const contract = JSON.parse(fs.readFileSync(contractPath, "utf8"));
27
-
28
- if (contract.contract_hash === currentHash) {
29
- if (!options.silent) console.warn("✅ Contract is valid and synchronized.");
30
- return true;
31
- } else {
32
- if (options.silent) return false;
33
- throw new ValidationError(
34
- "Contract drift detected!",
35
- { stored: contract.contract_hash, actual: currentHash },
36
- "Run 'npx atabey update-contract' to re-synchronize the API contracts."
37
- );
38
- }
39
- }
40
-
41
- /**
42
- * Update and synchronize type safety between backend and frontend contracts.
43
- */
44
- export async function updateApiContractCommand() {
45
- const projectRoot = process.cwd();
46
- const pathsMap = getConfiguredPaths();
47
- const sharedDir = path.join(projectRoot, pathsMap.backend, "src/types");
48
- const contractPath = path.join(projectRoot, pathsMap.backend, "contract.version.json");
49
-
50
- if (!fs.existsSync(sharedDir)) {
51
- throw new ValidationError(
52
- "API types directory missing.",
53
- null,
54
- "The directory specified for backend types does not exist. Check your framework configuration."
55
- );
56
- }
57
-
58
- const currentHash = computeTypesHash(projectRoot, sharedDir);
59
-
60
- const contractData = {
61
- contract_hash: currentHash,
62
- last_updated: new Date().toISOString()
63
- };
64
-
65
- writeJsonFile(contractPath, contractData);
66
- console.warn(`✅ Contract successfully synchronized. New hash: ${currentHash}`);
67
- }
68
-
@@ -1,45 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
-
4
- import { collectFiles } from "../utils/fs.js";
5
-
6
- const targetDir = process.cwd();
7
-
8
- export async function explorerGraphCommand(targetPath: string) {
9
- console.warn(`🗺️ Generating Dependency Graph for: ${targetPath}...`);
10
- const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
11
- const edges: string[] = [];
12
- files.forEach((f) => {
13
- const content = fs.readFileSync(f, "utf8");
14
- const name = path.basename(f, path.extname(f));
15
- const imports = content.match(/from\s+['"]\.\.?\/[^'"]+['"]/g) || [];
16
- imports.forEach((imp) => {
17
- const target = path.basename(imp.split(/['"]/)[1]);
18
- edges.push(`${name} --> ${target}`);
19
- });
20
- });
21
- if (edges.length === 0) {
22
- console.warn("ℹ️ No internal dependencies found.");
23
- } else {
24
- console.warn(
25
- "```mermaid\ngraph TD\n" + Array.from(new Set(edges)).join("\n") + "\n```",
26
- );
27
- }
28
- }
29
-
30
- export async function explorerAuditCommand(targetPath: string) {
31
- console.warn(`🧠 Codebase Intelligence Scan: ${targetPath}...`);
32
- const files = collectFiles(path.join(targetDir, targetPath), [".ts", ".tsx"]);
33
- const complexity: string[] = [];
34
- files.forEach((f) => {
35
- const content = fs.readFileSync(f, "utf8");
36
- const lines = content.split("\n").length;
37
- if (lines > 300) complexity.push(`${path.relative(targetDir, f)} (${lines} lines)`);
38
- });
39
- if (complexity.length > 0) {
40
- console.warn("\n⚠️ Complexity Spikes:");
41
- complexity.forEach((c) => console.warn(`- ${c}`));
42
- } else {
43
- console.warn("✅ Codebase structure looks clean.");
44
- }
45
- }
@@ -1,39 +0,0 @@
1
- import cp from "child_process";
2
- import path from "path";
3
- import { getConfiguredPaths } from "../utils/memory.js";
4
-
5
- export async function gitCommitCommand(traceId: string) {
6
- try {
7
- const diff = cp.execSync("git diff --staged", { encoding: "utf8" });
8
- if (!diff) {
9
- console.warn("ℹ️ No staged changes found. Use 'git add' first.");
10
- return;
11
- }
12
- const files = cp.execSync("git diff --staged --name-only", { encoding: "utf8" })
13
- .split("\n")
14
- .filter(Boolean);
15
- const pathsMap = getConfiguredPaths();
16
- const backendTypesPath = path.join(pathsMap.backend, "src/types");
17
- let type = "feat";
18
- const scope = "code";
19
- if (files.some((f) => f.includes(".md"))) type = "docs";
20
- else if (files.some((f) => f.includes(backendTypesPath))) type = "arch";
21
- else if (files.some((f) => f.includes("bin/cli.js"))) type = "fix";
22
-
23
- const summary =
24
- files.length === 1 ? `update ${path.basename(files[0])}` : `update ${files.length} files`;
25
- console.warn(`\n### SUGGESTED COMMIT MESSAGE ###\n\n[${traceId}] ${type}(${scope}): ${summary}\n`);
26
- } catch {
27
- console.warn("❌ Git command failed.");
28
- }
29
- }
30
-
31
- export async function gitSyncCommand() {
32
- console.warn("🔄 Syncing with remote repository...");
33
- try {
34
- cp.execSync("git pull origin main --rebase", { stdio: "inherit" });
35
- console.warn("✅ Successfully synced and rebased.");
36
- } catch {
37
- console.warn("❌ Sync failed. Please resolve conflicts manually.");
38
- }
39
- }
@@ -1,136 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import {
4
- remapFrameworkContent,
5
- type AdapterConfig,
6
- type AdapterId,
7
- ADAPTERS
8
- } from "../../adapters/index.js";
9
- import { SHIM_TEMPLATES } from "../../shims.js";
10
- import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
11
- import { getPackageRoot, getPackageVersion } from "../../utils/pkg.js";
12
- import { ALL_AGENTS } from "../../../modules/agents/definitions.js";
13
-
14
- import { TRANSLATIONS, type SupportedLanguage } from "../../utils/i18n.js";
15
-
16
- const FRAMEWORK_NAME = "Agent Atabey";
17
-
18
- const COLOR_PALETTES = {
19
- "Modern Blue": { primary: "#0ea5e9", secondary: "#64748b", accent: "#f43f5e" },
20
- "Enterprise Slate": { primary: "#334155", secondary: "#94a3b8", accent: "#10b981" },
21
- "Deep Purple": { primary: "#8b5cf6", secondary: "#d8b4fe", accent: "#f59e0b" }
22
- };
23
-
24
- export function scaffoldConstitution(targetDir: string, frameworkDir: string, adapterId: AdapterId, dryRun: boolean, language: SupportedLanguage = "tr") {
25
- if (dryRun) return;
26
- const t = TRANSLATIONS[language];
27
- let content = `# 🎖️ ${t.constitution_title}\n\nDiscipline and Order.`;
28
- let readSuccess = false;
29
- try {
30
- const templatePath = path.join(getPackageRoot(), "ATABEY.md");
31
- if (fs.existsSync(templatePath)) {
32
- content = fs.readFileSync(templatePath, "utf8");
33
- readSuccess = true;
34
- }
35
- } catch (e) {
36
- console.warn(`⚠️ Failed to read global constitution template: ${e}`);
37
- }
38
- content = remapFrameworkContent(content, frameworkDir, adapterId);
39
- const destPath = path.join(targetDir, frameworkDir, "ATABEY.md");
40
- writeTextFile(destPath, content);
41
-
42
- console.warn(`✅ Constitution file created inside: ${frameworkDir}/ATABEY.md${readSuccess ? "" : " (default template)"}`);
43
- }
44
-
45
- export function scaffoldFrameworkConfigs(
46
- targetDir: string,
47
- fDir: string,
48
- adapter: AdapterConfig,
49
- dryRun: boolean,
50
- selectedPalette: string,
51
- options?: { unified?: boolean; adapters?: string[]; backendLanguage?: string; language?: SupportedLanguage }
52
- ) {
53
- if (dryRun) return;
54
- const frameworkDir = path.join(targetDir, fDir);
55
- const palette = COLOR_PALETTES[selectedPalette as keyof typeof COLOR_PALETTES] || COLOR_PALETTES["Modern Blue"];
56
- const language = options?.language || "tr";
57
- const t = TRANSLATIONS[language];
58
-
59
- const config = {
60
- name: FRAMEWORK_NAME,
61
- version: getPackageVersion(),
62
- unified: options?.unified || false,
63
- adapters: options?.adapters || [adapter.id],
64
- backendLanguage: options?.backendLanguage || "Node.js (TypeScript)",
65
- language: language,
66
- theme: {
67
- palette: selectedPalette,
68
- colors: palette
69
- }
70
- };
71
- writeJsonFile(path.join(frameworkDir, "config.json"), config, dryRun);
72
-
73
- // Scaffold shared-facts.json in memory-graph
74
- const graphDir = path.join(frameworkDir, "memory-graph");
75
- if (!fs.existsSync(graphDir)) fs.mkdirSync(graphDir, { recursive: true });
76
- const sharedFactsPath = path.join(graphDir, "shared-facts.json");
77
- if (!fs.existsSync(sharedFactsPath)) {
78
- writeJsonFile(sharedFactsPath, {
79
- project: FRAMEWORK_NAME,
80
- initializedAt: new Date().toISOString(),
81
- stack: [options?.backendLanguage || "Node.js (TypeScript)"],
82
- language: language,
83
- policies: []
84
- }, dryRun);
85
- }
86
-
87
- let statusContent = `# 🎖️ ${t.status_title}\n\n| Agent | State | Active Task | Last Updated | Notes | Extra | Backup |\n|---|---|---|---|---|---|---|\n`;
88
-
89
- const activeAgents = ALL_AGENTS;
90
-
91
- const initialStatusJson: Record<string, { state: string; task: string; lastUpdated: string }> = {};
92
- const now = new Date().toISOString();
93
-
94
- for (const ag of activeAgents) {
95
- statusContent += "| @" + ag.name + " | " + t.agent_ready + " | Idle | - | - | - | - |\n";
96
- initialStatusJson[ag.name] = { state: "READY", task: "Idle", lastUpdated: now };
97
- }
98
- writeTextFile(path.join(frameworkDir, "STATUS.md"), statusContent);
99
-
100
- // Populate initial status.json
101
- const statusJsonPath = path.join(frameworkDir, "memory", "status.json");
102
- if (!fs.existsSync(path.join(frameworkDir, "memory"))) fs.mkdirSync(path.join(frameworkDir, "memory"), { recursive: true });
103
- writeJsonFile(statusJsonPath, initialStatusJson, dryRun);
104
- }
105
-
106
- export function scaffoldShims(
107
- projectRoot: string,
108
- coreDir: string,
109
- adapterId: AdapterId,
110
- adapter: AdapterConfig,
111
- dryRun: boolean,
112
- unified: boolean = false
113
- ) {
114
- for (const [name, content] of Object.entries(SHIM_TEMPLATES)) {
115
- // Normalize: "antigravity-cli" template key needs exact match or prefix match
116
- const isSelectedAdapter = name === adapterId ||
117
- name.toLowerCase() === adapterId.split("-")[0].toLowerCase();
118
-
119
- if (unified || isSelectedAdapter) {
120
- const shimContent = remapFrameworkContent(content, coreDir, adapterId);
121
- // In unified mode, each adapter writes its OWN shimFile name.
122
- // In single-adapter mode, use selected adapter's shimFile.
123
- const shimAdapter = ADAPTERS[name as AdapterId] || adapter;
124
- const shimFileName = (unified && !isSelectedAdapter)
125
- ? (shimAdapter.shimFile || `${name.toUpperCase()}.md`) // each adapter's own file
126
- : (adapter.shimFile || `${name.toUpperCase()}.md`); // selected adapter's file
127
-
128
- if (!dryRun) writeTextFile(path.join(projectRoot, shimFileName), shimContent);
129
- if (isSelectedAdapter) {
130
- console.warn(`✅ Platform shim created: ${shimFileName}`);
131
- } else if (unified) {
132
- console.warn(`✅ Unified platform shim added: ${shimFileName}`);
133
- }
134
- }
135
- }
136
- }
@@ -1,44 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { writeTextFile } from "../../utils/fs.js";
4
- import { getPackageRoot } from "../../utils/pkg.js";
5
- import { logger } from "../../../shared/logger.js";
6
-
7
- export function scaffoldProjectDocs(projectRoot: string, options: { backendLanguage: string }, dryRun: boolean) {
8
- if (dryRun) return;
9
-
10
- const docsDir = path.join(projectRoot, "docs");
11
- if (!fs.existsSync(docsDir)) fs.mkdirSync(docsDir, { recursive: true });
12
-
13
- // Scaffold tech-stack.md with dynamic content
14
- const techStackPath = path.join(docsDir, "tech-stack.md");
15
- let techStackContent = "";
16
-
17
- try {
18
- const templatePath = path.join(getPackageRoot(), "docs/tech-stack.md");
19
- if (fs.existsSync(templatePath)) {
20
- techStackContent = fs.readFileSync(templatePath, "utf8");
21
-
22
- // Replace the backend language in the template
23
- // Assuming the template has a row like: | **Backend Altyapısı** | Node.js v20+ & TypeScript v5+ | ... |
24
- // We'll use a more generic replacement or just append/update the specific section.
25
- const lang = options.backendLanguage;
26
-
27
- // If it's a new project, we can just rewrite the table or use a placeholder in the template.
28
- // For now, let's assume we want to update the "Backend" or "Geliştirme Ortamı" row.
29
- techStackContent = techStackContent.replace(
30
- /\| \*\*Geliştirme Ortamı\*\* \| .* \|/,
31
- `| **Geliştirme Ortamı** | ${lang} |`
32
- );
33
- }
34
- } catch (e) {
35
- logger.debug("Failed to read tech-stack.md template", e);
36
- }
37
-
38
- if (!techStackContent) {
39
- techStackContent = `# 🛠️ Project Tech Stack\n\n- **Backend Language:** ${options.backendLanguage}\n`;
40
- }
41
-
42
- writeTextFile(techStackPath, techStackContent);
43
- console.warn(`✅ Project documentation updated: docs/tech-stack.md (Language: ${options.backendLanguage})`);
44
- }