@evolith/smart-cli 1.1.0 → 1.1.2

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 (481) hide show
  1. package/ARCHITECTURE.md +1 -1
  2. package/LICENSE +21 -0
  3. package/README.es.md +31 -3
  4. package/README.md +915 -170
  5. package/package.json +50 -41
  6. package/shell/hooks.bash +68 -0
  7. package/shell/hooks.fish +57 -0
  8. package/shell/hooks.zsh +68 -0
  9. package/dist/app.module.d.ts +0 -2
  10. package/dist/app.module.js +0 -61
  11. package/dist/app.module.js.map +0 -1
  12. package/dist/app.module.spec.d.ts +0 -1
  13. package/dist/app.module.spec.js +0 -305
  14. package/dist/app.module.spec.js.map +0 -1
  15. package/dist/application/ports/webhook-notifier.port.d.ts +0 -4
  16. package/dist/application/ports/webhook-notifier.port.js +0 -3
  17. package/dist/application/ports/webhook-notifier.port.js.map +0 -1
  18. package/dist/application/services/index.d.ts +0 -64
  19. package/dist/application/services/index.js +0 -371
  20. package/dist/application/services/index.js.map +0 -1
  21. package/dist/application/services/initialize-project.spec.d.ts +0 -1
  22. package/dist/application/services/initialize-project.spec.js +0 -211
  23. package/dist/application/services/initialize-project.spec.js.map +0 -1
  24. package/dist/application/services/phase-transition.use-case.spec.d.ts +0 -1
  25. package/dist/application/services/phase-transition.use-case.spec.js +0 -297
  26. package/dist/application/services/phase-transition.use-case.spec.js.map +0 -1
  27. package/dist/application/services/services.test.d.ts +0 -1
  28. package/dist/application/services/services.test.js +0 -176
  29. package/dist/application/services/services.test.js.map +0 -1
  30. package/dist/application/use-cases/evaluate-gate.use-case.d.ts +0 -20
  31. package/dist/application/use-cases/evaluate-gate.use-case.js +0 -72
  32. package/dist/application/use-cases/evaluate-gate.use-case.js.map +0 -1
  33. package/dist/application/use-cases/validate-satellite.use-case.d.ts +0 -19
  34. package/dist/application/use-cases/validate-satellite.use-case.js +0 -96
  35. package/dist/application/use-cases/validate-satellite.use-case.js.map +0 -1
  36. package/dist/application/use-cases/validate-satellite.use-case.spec.d.ts +0 -1
  37. package/dist/application/use-cases/validate-satellite.use-case.spec.js +0 -102
  38. package/dist/application/use-cases/validate-satellite.use-case.spec.js.map +0 -1
  39. package/dist/commands/adr/adr.command.d.ts +0 -30
  40. package/dist/commands/adr/adr.command.js +0 -379
  41. package/dist/commands/adr/adr.command.js.map +0 -1
  42. package/dist/commands/adr/adr.command.spec.d.ts +0 -1
  43. package/dist/commands/adr/adr.command.spec.js +0 -409
  44. package/dist/commands/adr/adr.command.spec.js.map +0 -1
  45. package/dist/commands/architecture/scaffold.command.d.ts +0 -8
  46. package/dist/commands/architecture/scaffold.command.js +0 -184
  47. package/dist/commands/architecture/scaffold.command.js.map +0 -1
  48. package/dist/commands/architecture/scaffold.command.spec.d.ts +0 -1
  49. package/dist/commands/architecture/scaffold.command.spec.js +0 -207
  50. package/dist/commands/architecture/scaffold.command.spec.js.map +0 -1
  51. package/dist/commands/commands.test.d.ts +0 -1
  52. package/dist/commands/commands.test.js +0 -131
  53. package/dist/commands/commands.test.js.map +0 -1
  54. package/dist/commands/completion/completion.command.d.ts +0 -20
  55. package/dist/commands/completion/completion.command.js +0 -215
  56. package/dist/commands/completion/completion.command.js.map +0 -1
  57. package/dist/commands/completion/completion.command.spec.d.ts +0 -1
  58. package/dist/commands/completion/completion.command.spec.js +0 -240
  59. package/dist/commands/completion/completion.command.spec.js.map +0 -1
  60. package/dist/commands/docs/docs.command.d.ts +0 -14
  61. package/dist/commands/docs/docs.command.js +0 -233
  62. package/dist/commands/docs/docs.command.js.map +0 -1
  63. package/dist/commands/docs/docs.command.spec.d.ts +0 -1
  64. package/dist/commands/docs/docs.command.spec.js +0 -87
  65. package/dist/commands/docs/docs.command.spec.js.map +0 -1
  66. package/dist/commands/drift/drift.command.d.ts +0 -24
  67. package/dist/commands/drift/drift.command.js +0 -250
  68. package/dist/commands/drift/drift.command.js.map +0 -1
  69. package/dist/commands/drift/drift.command.spec.d.ts +0 -1
  70. package/dist/commands/drift/drift.command.spec.js +0 -327
  71. package/dist/commands/drift/drift.command.spec.js.map +0 -1
  72. package/dist/commands/gate/gate.command.d.ts +0 -23
  73. package/dist/commands/gate/gate.command.js +0 -210
  74. package/dist/commands/gate/gate.command.js.map +0 -1
  75. package/dist/commands/history/history.command.d.ts +0 -29
  76. package/dist/commands/history/history.command.js +0 -268
  77. package/dist/commands/history/history.command.js.map +0 -1
  78. package/dist/commands/history/history.command.spec.d.ts +0 -1
  79. package/dist/commands/history/history.command.spec.js +0 -392
  80. package/dist/commands/history/history.command.spec.js.map +0 -1
  81. package/dist/commands/init/agents.command.d.ts +0 -22
  82. package/dist/commands/init/agents.command.js +0 -502
  83. package/dist/commands/init/agents.command.js.map +0 -1
  84. package/dist/commands/init/agents.command.spec.d.ts +0 -1
  85. package/dist/commands/init/agents.command.spec.js +0 -550
  86. package/dist/commands/init/agents.command.spec.js.map +0 -1
  87. package/dist/commands/init/init.command.d.ts +0 -20
  88. package/dist/commands/init/init.command.js +0 -329
  89. package/dist/commands/init/init.command.js.map +0 -1
  90. package/dist/commands/init/init.command.spec.d.ts +0 -1
  91. package/dist/commands/init/init.command.spec.js +0 -272
  92. package/dist/commands/init/init.command.spec.js.map +0 -1
  93. package/dist/commands/init/upgrade.command.d.ts +0 -19
  94. package/dist/commands/init/upgrade.command.js +0 -210
  95. package/dist/commands/init/upgrade.command.js.map +0 -1
  96. package/dist/commands/init/upgrade.command.spec.d.ts +0 -1
  97. package/dist/commands/init/upgrade.command.spec.js +0 -378
  98. package/dist/commands/init/upgrade.command.spec.js.map +0 -1
  99. package/dist/commands/mcp/mcp-serve.command.d.ts +0 -15
  100. package/dist/commands/mcp/mcp-serve.command.js +0 -106
  101. package/dist/commands/mcp/mcp-serve.command.js.map +0 -1
  102. package/dist/commands/mcp/mcp-serve.command.spec.d.ts +0 -1
  103. package/dist/commands/mcp/mcp-serve.command.spec.js +0 -58
  104. package/dist/commands/mcp/mcp-serve.command.spec.js.map +0 -1
  105. package/dist/commands/sdlc/gate-status.command.d.ts +0 -7
  106. package/dist/commands/sdlc/gate-status.command.js +0 -189
  107. package/dist/commands/sdlc/gate-status.command.js.map +0 -1
  108. package/dist/commands/sdlc/gate-status.command.spec.d.ts +0 -1
  109. package/dist/commands/sdlc/gate-status.command.spec.js +0 -302
  110. package/dist/commands/sdlc/gate-status.command.spec.js.map +0 -1
  111. package/dist/commands/sdlc/generate-domain.command.d.ts +0 -7
  112. package/dist/commands/sdlc/generate-domain.command.js +0 -166
  113. package/dist/commands/sdlc/generate-domain.command.js.map +0 -1
  114. package/dist/commands/sdlc/generate-domain.command.spec.d.ts +0 -1
  115. package/dist/commands/sdlc/generate-domain.command.spec.js +0 -121
  116. package/dist/commands/sdlc/generate-domain.command.spec.js.map +0 -1
  117. package/dist/commands/sdlc/handoff.command.d.ts +0 -22
  118. package/dist/commands/sdlc/handoff.command.js +0 -273
  119. package/dist/commands/sdlc/handoff.command.js.map +0 -1
  120. package/dist/commands/sdlc/handoff.command.spec.d.ts +0 -1
  121. package/dist/commands/sdlc/handoff.command.spec.js +0 -395
  122. package/dist/commands/sdlc/handoff.command.spec.js.map +0 -1
  123. package/dist/commands/sdlc/sdlc.command.d.ts +0 -4
  124. package/dist/commands/sdlc/sdlc.command.js +0 -70
  125. package/dist/commands/sdlc/sdlc.command.js.map +0 -1
  126. package/dist/commands/sdlc/sdlc.command.spec.d.ts +0 -1
  127. package/dist/commands/sdlc/sdlc.command.spec.js +0 -79
  128. package/dist/commands/sdlc/sdlc.command.spec.js.map +0 -1
  129. package/dist/commands/standards/standards.command.d.ts +0 -27
  130. package/dist/commands/standards/standards.command.js +0 -308
  131. package/dist/commands/standards/standards.command.js.map +0 -1
  132. package/dist/commands/standards/standards.command.spec.d.ts +0 -1
  133. package/dist/commands/standards/standards.command.spec.js +0 -311
  134. package/dist/commands/standards/standards.command.spec.js.map +0 -1
  135. package/dist/commands/validate/validate.command.d.ts +0 -25
  136. package/dist/commands/validate/validate.command.js +0 -284
  137. package/dist/commands/validate/validate.command.js.map +0 -1
  138. package/dist/commands/validate/validate.command.spec.d.ts +0 -1
  139. package/dist/commands/validate/validate.command.spec.js +0 -368
  140. package/dist/commands/validate/validate.command.spec.js.map +0 -1
  141. package/dist/config/runtimes.json +0 -196
  142. package/dist/config/tool-catalog.json +0 -343
  143. package/dist/core/abstractions/index.d.ts +0 -6
  144. package/dist/core/abstractions/index.js +0 -23
  145. package/dist/core/abstractions/index.js.map +0 -1
  146. package/dist/core/abstractions/interfaces.d.ts +0 -61
  147. package/dist/core/abstractions/interfaces.js +0 -5
  148. package/dist/core/abstractions/interfaces.js.map +0 -1
  149. package/dist/core/abstractions/providers/config-parser.provider.d.ts +0 -15
  150. package/dist/core/abstractions/providers/config-parser.provider.js +0 -68
  151. package/dist/core/abstractions/providers/config-parser.provider.js.map +0 -1
  152. package/dist/core/abstractions/providers/config-parser.provider.spec.d.ts +0 -1
  153. package/dist/core/abstractions/providers/config-parser.provider.spec.js +0 -18
  154. package/dist/core/abstractions/providers/config-parser.provider.spec.js.map +0 -1
  155. package/dist/core/abstractions/providers/logger.provider.d.ts +0 -10
  156. package/dist/core/abstractions/providers/logger.provider.js +0 -84
  157. package/dist/core/abstractions/providers/logger.provider.js.map +0 -1
  158. package/dist/core/abstractions/providers/logger.provider.spec.d.ts +0 -1
  159. package/dist/core/abstractions/providers/logger.provider.spec.js +0 -212
  160. package/dist/core/abstractions/providers/logger.provider.spec.js.map +0 -1
  161. package/dist/core/abstractions/providers/mock-filesystem.provider.d.ts +0 -31
  162. package/dist/core/abstractions/providers/mock-filesystem.provider.js +0 -126
  163. package/dist/core/abstractions/providers/mock-filesystem.provider.js.map +0 -1
  164. package/dist/core/abstractions/providers/mock-filesystem.provider.spec.d.ts +0 -1
  165. package/dist/core/abstractions/providers/mock-filesystem.provider.spec.js +0 -56
  166. package/dist/core/abstractions/providers/mock-filesystem.provider.spec.js.map +0 -1
  167. package/dist/core/abstractions/providers/node-filesystem.provider.d.ts +0 -20
  168. package/dist/core/abstractions/providers/node-filesystem.provider.js +0 -108
  169. package/dist/core/abstractions/providers/node-filesystem.provider.js.map +0 -1
  170. package/dist/core/agents/agent-ruleset-builder.d.ts +0 -30
  171. package/dist/core/agents/agent-ruleset-builder.js +0 -75
  172. package/dist/core/agents/agent-ruleset-builder.js.map +0 -1
  173. package/dist/core/agents/agent-ruleset-builder.spec.d.ts +0 -1
  174. package/dist/core/agents/agent-ruleset-builder.spec.js +0 -135
  175. package/dist/core/agents/agent-ruleset-builder.spec.js.map +0 -1
  176. package/dist/core/architecture/nx-workspace.strategy.d.ts +0 -14
  177. package/dist/core/architecture/nx-workspace.strategy.js +0 -136
  178. package/dist/core/architecture/nx-workspace.strategy.js.map +0 -1
  179. package/dist/core/architecture/nx-workspace.strategy.spec.d.ts +0 -1
  180. package/dist/core/architecture/nx-workspace.strategy.spec.js +0 -187
  181. package/dist/core/architecture/nx-workspace.strategy.spec.js.map +0 -1
  182. package/dist/core/architecture/workspace-manager.strategy.d.ts +0 -8
  183. package/dist/core/architecture/workspace-manager.strategy.js +0 -3
  184. package/dist/core/architecture/workspace-manager.strategy.js.map +0 -1
  185. package/dist/core/config/config.service.d.ts +0 -15
  186. package/dist/core/config/config.service.js +0 -55
  187. package/dist/core/config/config.service.js.map +0 -1
  188. package/dist/core/config/config.service.spec.d.ts +0 -1
  189. package/dist/core/config/config.service.spec.js +0 -43
  190. package/dist/core/config/config.service.spec.js.map +0 -1
  191. package/dist/core/di/container.d.ts +0 -25
  192. package/dist/core/di/container.js +0 -87
  193. package/dist/core/di/container.js.map +0 -1
  194. package/dist/core/di/container.spec.d.ts +0 -1
  195. package/dist/core/di/container.spec.js +0 -301
  196. package/dist/core/di/container.spec.js.map +0 -1
  197. package/dist/core/errors/index.d.ts +0 -26
  198. package/dist/core/errors/index.js +0 -67
  199. package/dist/core/errors/index.js.map +0 -1
  200. package/dist/core/filesystem/file-manager.service.d.ts +0 -4
  201. package/dist/core/filesystem/file-manager.service.js +0 -96
  202. package/dist/core/filesystem/file-manager.service.js.map +0 -1
  203. package/dist/core/filesystem/file-manager.service.spec.d.ts +0 -1
  204. package/dist/core/filesystem/file-manager.service.spec.js +0 -103
  205. package/dist/core/filesystem/file-manager.service.spec.js.map +0 -1
  206. package/dist/core/generators/hexagonal-scaffolder.d.ts +0 -6
  207. package/dist/core/generators/hexagonal-scaffolder.js +0 -260
  208. package/dist/core/generators/hexagonal-scaffolder.js.map +0 -1
  209. package/dist/core/generators/hexagonal-scaffolder.spec.d.ts +0 -1
  210. package/dist/core/generators/hexagonal-scaffolder.spec.js +0 -164
  211. package/dist/core/generators/hexagonal-scaffolder.spec.js.map +0 -1
  212. package/dist/core/generators/mermaid-class-parser.d.ts +0 -38
  213. package/dist/core/generators/mermaid-class-parser.js +0 -183
  214. package/dist/core/generators/mermaid-class-parser.js.map +0 -1
  215. package/dist/core/generators/mermaid-class-parser.spec.d.ts +0 -1
  216. package/dist/core/generators/mermaid-class-parser.spec.js +0 -148
  217. package/dist/core/generators/mermaid-class-parser.spec.js.map +0 -1
  218. package/dist/core/mcp/mcp-server.service.d.ts +0 -7
  219. package/dist/core/mcp/mcp-server.service.js +0 -31
  220. package/dist/core/mcp/mcp-server.service.js.map +0 -1
  221. package/dist/core/mcp/metrics.service.d.ts +0 -37
  222. package/dist/core/mcp/metrics.service.js +0 -72
  223. package/dist/core/mcp/metrics.service.js.map +0 -1
  224. package/dist/core/mcp/metrics.service.spec.d.ts +0 -1
  225. package/dist/core/mcp/metrics.service.spec.js +0 -159
  226. package/dist/core/mcp/metrics.service.spec.js.map +0 -1
  227. package/dist/core/mcp/prompts/index.d.ts +0 -22
  228. package/dist/core/mcp/prompts/index.js +0 -211
  229. package/dist/core/mcp/prompts/index.js.map +0 -1
  230. package/dist/core/mcp/prompts/index.spec.d.ts +0 -1
  231. package/dist/core/mcp/prompts/index.spec.js +0 -150
  232. package/dist/core/mcp/prompts/index.spec.js.map +0 -1
  233. package/dist/core/mcp/resources/index.d.ts +0 -11
  234. package/dist/core/mcp/resources/index.js +0 -209
  235. package/dist/core/mcp/resources/index.js.map +0 -1
  236. package/dist/core/mcp/resources/index.spec.d.ts +0 -1
  237. package/dist/core/mcp/resources/index.spec.js +0 -212
  238. package/dist/core/mcp/resources/index.spec.js.map +0 -1
  239. package/dist/core/mcp/server.d.ts +0 -33
  240. package/dist/core/mcp/server.js +0 -693
  241. package/dist/core/mcp/server.js.map +0 -1
  242. package/dist/core/mcp/server.spec.d.ts +0 -1
  243. package/dist/core/mcp/server.spec.js +0 -579
  244. package/dist/core/mcp/server.spec.js.map +0 -1
  245. package/dist/core/mcp/tools/agent.d.ts +0 -41
  246. package/dist/core/mcp/tools/agent.js +0 -195
  247. package/dist/core/mcp/tools/agent.js.map +0 -1
  248. package/dist/core/mcp/tools/agent.spec.d.ts +0 -1
  249. package/dist/core/mcp/tools/agent.spec.js +0 -171
  250. package/dist/core/mcp/tools/agent.spec.js.map +0 -1
  251. package/dist/core/mcp/tools/architecture.d.ts +0 -29
  252. package/dist/core/mcp/tools/architecture.js +0 -234
  253. package/dist/core/mcp/tools/architecture.js.map +0 -1
  254. package/dist/core/mcp/tools/architecture.spec.d.ts +0 -1
  255. package/dist/core/mcp/tools/architecture.spec.js +0 -145
  256. package/dist/core/mcp/tools/architecture.spec.js.map +0 -1
  257. package/dist/core/mcp/tools/gate.d.ts +0 -1
  258. package/dist/core/mcp/tools/gate.js +0 -68
  259. package/dist/core/mcp/tools/gate.js.map +0 -1
  260. package/dist/core/mcp/tools/moscow.d.ts +0 -30
  261. package/dist/core/mcp/tools/moscow.js +0 -113
  262. package/dist/core/mcp/tools/moscow.js.map +0 -1
  263. package/dist/core/mcp/tools/moscow.spec.d.ts +0 -1
  264. package/dist/core/mcp/tools/moscow.spec.js +0 -209
  265. package/dist/core/mcp/tools/moscow.spec.js.map +0 -1
  266. package/dist/core/mcp/tools/sdlc.d.ts +0 -32
  267. package/dist/core/mcp/tools/sdlc.js +0 -190
  268. package/dist/core/mcp/tools/sdlc.js.map +0 -1
  269. package/dist/core/mcp/tools/sdlc.spec.d.ts +0 -1
  270. package/dist/core/mcp/tools/sdlc.spec.js +0 -170
  271. package/dist/core/mcp/tools/sdlc.spec.js.map +0 -1
  272. package/dist/core/mcp/tools/tool-utils.d.ts +0 -4
  273. package/dist/core/mcp/tools/tool-utils.js +0 -18
  274. package/dist/core/mcp/tools/tool-utils.js.map +0 -1
  275. package/dist/core/mcp/tools/validate.d.ts +0 -18
  276. package/dist/core/mcp/tools/validate.js +0 -56
  277. package/dist/core/mcp/tools/validate.js.map +0 -1
  278. package/dist/core/mcp/tools/validate.spec.d.ts +0 -1
  279. package/dist/core/mcp/tools/validate.spec.js +0 -130
  280. package/dist/core/mcp/tools/validate.spec.js.map +0 -1
  281. package/dist/core/mcp/watcher.service.d.ts +0 -8
  282. package/dist/core/mcp/watcher.service.js +0 -82
  283. package/dist/core/mcp/watcher.service.js.map +0 -1
  284. package/dist/core/mcp/watcher.service.spec.d.ts +0 -1
  285. package/dist/core/mcp/watcher.service.spec.js +0 -171
  286. package/dist/core/mcp/watcher.service.spec.js.map +0 -1
  287. package/dist/core/metrics/dora-calculator.d.ts +0 -18
  288. package/dist/core/metrics/dora-calculator.js +0 -146
  289. package/dist/core/metrics/dora-calculator.js.map +0 -1
  290. package/dist/core/metrics/dora-calculator.spec.d.ts +0 -1
  291. package/dist/core/metrics/dora-calculator.spec.js +0 -164
  292. package/dist/core/metrics/dora-calculator.spec.js.map +0 -1
  293. package/dist/core/metrics/git-log-reader.d.ts +0 -14
  294. package/dist/core/metrics/git-log-reader.js +0 -39
  295. package/dist/core/metrics/git-log-reader.js.map +0 -1
  296. package/dist/core/metrics/git-log-reader.spec.d.ts +0 -1
  297. package/dist/core/metrics/git-log-reader.spec.js +0 -108
  298. package/dist/core/metrics/git-log-reader.spec.js.map +0 -1
  299. package/dist/core/observability/command-watcher.d.ts +0 -45
  300. package/dist/core/observability/command-watcher.js +0 -168
  301. package/dist/core/observability/command-watcher.js.map +0 -1
  302. package/dist/core/observability/command-watcher.spec.d.ts +0 -1
  303. package/dist/core/observability/command-watcher.spec.js +0 -123
  304. package/dist/core/observability/command-watcher.spec.js.map +0 -1
  305. package/dist/core/observability/error-reporter.d.ts +0 -47
  306. package/dist/core/observability/error-reporter.js +0 -163
  307. package/dist/core/observability/error-reporter.js.map +0 -1
  308. package/dist/core/observability/error-reporter.spec.d.ts +0 -1
  309. package/dist/core/observability/error-reporter.spec.js +0 -291
  310. package/dist/core/observability/error-reporter.spec.js.map +0 -1
  311. package/dist/core/observability/index.d.ts +0 -5
  312. package/dist/core/observability/index.js +0 -26
  313. package/dist/core/observability/index.js.map +0 -1
  314. package/dist/core/observability/observability.test.d.ts +0 -1
  315. package/dist/core/observability/observability.test.js +0 -224
  316. package/dist/core/observability/observability.test.js.map +0 -1
  317. package/dist/core/observability/structured-logger.d.ts +0 -53
  318. package/dist/core/observability/structured-logger.js +0 -123
  319. package/dist/core/observability/structured-logger.js.map +0 -1
  320. package/dist/core/observability/structured-logger.spec.d.ts +0 -1
  321. package/dist/core/observability/structured-logger.spec.js +0 -197
  322. package/dist/core/observability/structured-logger.spec.js.map +0 -1
  323. package/dist/core/observability/timing.d.ts +0 -23
  324. package/dist/core/observability/timing.js +0 -140
  325. package/dist/core/observability/timing.js.map +0 -1
  326. package/dist/core/observability/timing.spec.d.ts +0 -1
  327. package/dist/core/observability/timing.spec.js +0 -216
  328. package/dist/core/observability/timing.spec.js.map +0 -1
  329. package/dist/core/observability/tool-usage-telemetry.service.d.ts +0 -46
  330. package/dist/core/observability/tool-usage-telemetry.service.js +0 -181
  331. package/dist/core/observability/tool-usage-telemetry.service.js.map +0 -1
  332. package/dist/core/services/command-executor.service.d.ts +0 -3
  333. package/dist/core/services/command-executor.service.js +0 -12
  334. package/dist/core/services/command-executor.service.js.map +0 -1
  335. package/dist/core/services/command-history.service.d.ts +0 -39
  336. package/dist/core/services/command-history.service.js +0 -150
  337. package/dist/core/services/command-history.service.js.map +0 -1
  338. package/dist/core/services/command-history.service.spec.d.ts +0 -1
  339. package/dist/core/services/command-history.service.spec.js +0 -257
  340. package/dist/core/services/command-history.service.spec.js.map +0 -1
  341. package/dist/core/services/command-providers.d.ts +0 -1
  342. package/dist/core/services/command-providers.js +0 -17
  343. package/dist/core/services/command-providers.js.map +0 -1
  344. package/dist/core/services/runtime-catalog.service.d.ts +0 -2
  345. package/dist/core/services/runtime-catalog.service.js +0 -7
  346. package/dist/core/services/runtime-catalog.service.js.map +0 -1
  347. package/dist/core/sync/sync.service.d.ts +0 -4
  348. package/dist/core/sync/sync.service.js +0 -81
  349. package/dist/core/sync/sync.service.js.map +0 -1
  350. package/dist/core/sync/sync.service.spec.d.ts +0 -1
  351. package/dist/core/sync/sync.service.spec.js +0 -63
  352. package/dist/core/sync/sync.service.spec.js.map +0 -1
  353. package/dist/core/upgrade/satellite-upgrade.service.d.ts +0 -48
  354. package/dist/core/upgrade/satellite-upgrade.service.js +0 -358
  355. package/dist/core/upgrade/satellite-upgrade.service.js.map +0 -1
  356. package/dist/core/upgrade/satellite-upgrade.service.spec.d.ts +0 -1
  357. package/dist/core/upgrade/satellite-upgrade.service.spec.js +0 -223
  358. package/dist/core/upgrade/satellite-upgrade.service.spec.js.map +0 -1
  359. package/dist/core/validators/architecture-drift.service.d.ts +0 -68
  360. package/dist/core/validators/architecture-drift.service.js +0 -266
  361. package/dist/core/validators/architecture-drift.service.js.map +0 -1
  362. package/dist/core/validators/architecture-drift.service.spec.d.ts +0 -1
  363. package/dist/core/validators/architecture-drift.service.spec.js +0 -315
  364. package/dist/core/validators/architecture-drift.service.spec.js.map +0 -1
  365. package/dist/core/validators/deep-architecture-analyzer.d.ts +0 -58
  366. package/dist/core/validators/deep-architecture-analyzer.js +0 -333
  367. package/dist/core/validators/deep-architecture-analyzer.js.map +0 -1
  368. package/dist/core/validators/deep-architecture-analyzer.spec.d.ts +0 -1
  369. package/dist/core/validators/deep-architecture-analyzer.spec.js +0 -186
  370. package/dist/core/validators/deep-architecture-analyzer.spec.js.map +0 -1
  371. package/dist/core/validators/evaluators/evaluator.interface.d.ts +0 -14
  372. package/dist/core/validators/evaluators/evaluator.interface.js +0 -3
  373. package/dist/core/validators/evaluators/evaluator.interface.js.map +0 -1
  374. package/dist/core/validators/evaluators/native-evaluator.d.ts +0 -31
  375. package/dist/core/validators/evaluators/native-evaluator.js +0 -461
  376. package/dist/core/validators/evaluators/native-evaluator.js.map +0 -1
  377. package/dist/core/validators/evaluators/opa-evaluator.d.ts +0 -20
  378. package/dist/core/validators/evaluators/opa-evaluator.js +0 -249
  379. package/dist/core/validators/evaluators/opa-evaluator.js.map +0 -1
  380. package/dist/core/validators/phase-gate-validator.service.d.ts +0 -75
  381. package/dist/core/validators/phase-gate-validator.service.js +0 -338
  382. package/dist/core/validators/phase-gate-validator.service.js.map +0 -1
  383. package/dist/core/validators/phase-gate-validator.service.spec.d.ts +0 -1
  384. package/dist/core/validators/phase-gate-validator.service.spec.js +0 -326
  385. package/dist/core/validators/phase-gate-validator.service.spec.js.map +0 -1
  386. package/dist/core/validators/rule-evaluation-engine.d.ts +0 -34
  387. package/dist/core/validators/rule-evaluation-engine.js +0 -187
  388. package/dist/core/validators/rule-evaluation-engine.js.map +0 -1
  389. package/dist/core/validators/rule-evaluation-engine.spec.d.ts +0 -1
  390. package/dist/core/validators/rule-evaluation-engine.spec.js +0 -243
  391. package/dist/core/validators/rule-evaluation-engine.spec.js.map +0 -1
  392. package/dist/core/validators/ruleset-validator-architecture.spec.d.ts +0 -1
  393. package/dist/core/validators/ruleset-validator-architecture.spec.js +0 -178
  394. package/dist/core/validators/ruleset-validator-architecture.spec.js.map +0 -1
  395. package/dist/core/validators/ruleset-validator.service.d.ts +0 -82
  396. package/dist/core/validators/ruleset-validator.service.js +0 -682
  397. package/dist/core/validators/ruleset-validator.service.js.map +0 -1
  398. package/dist/core/validators/ruleset-validator.service.spec.d.ts +0 -1
  399. package/dist/core/validators/ruleset-validator.service.spec.js +0 -469
  400. package/dist/core/validators/ruleset-validator.service.spec.js.map +0 -1
  401. package/dist/domain/entities/index.d.ts +0 -72
  402. package/dist/domain/entities/index.js +0 -119
  403. package/dist/domain/entities/index.js.map +0 -1
  404. package/dist/domain/gate-evidence.d.ts +0 -59
  405. package/dist/domain/gate-evidence.js +0 -38
  406. package/dist/domain/gate-evidence.js.map +0 -1
  407. package/dist/domain/interfaces.d.ts +0 -224
  408. package/dist/domain/interfaces.js +0 -3
  409. package/dist/domain/interfaces.js.map +0 -1
  410. package/dist/domain/services/adr.service.d.ts +0 -50
  411. package/dist/domain/services/adr.service.js +0 -129
  412. package/dist/domain/services/adr.service.js.map +0 -1
  413. package/dist/domain/services/adr.service.spec.d.ts +0 -1
  414. package/dist/domain/services/adr.service.spec.js +0 -141
  415. package/dist/domain/services/adr.service.spec.js.map +0 -1
  416. package/dist/domain/services/agent-registry.service.d.ts +0 -26
  417. package/dist/domain/services/agent-registry.service.js +0 -152
  418. package/dist/domain/services/agent-registry.service.js.map +0 -1
  419. package/dist/domain/services/agent-registry.service.spec.d.ts +0 -1
  420. package/dist/domain/services/agent-registry.service.spec.js +0 -162
  421. package/dist/domain/services/agent-registry.service.spec.js.map +0 -1
  422. package/dist/domain/services/index.d.ts +0 -34
  423. package/dist/domain/services/index.js +0 -128
  424. package/dist/domain/services/index.js.map +0 -1
  425. package/dist/domain/services/moscow-prioritization.service.d.ts +0 -44
  426. package/dist/domain/services/moscow-prioritization.service.js +0 -213
  427. package/dist/domain/services/moscow-prioritization.service.js.map +0 -1
  428. package/dist/domain/services/moscow-prioritization.service.spec.d.ts +0 -1
  429. package/dist/domain/services/moscow-prioritization.service.spec.js +0 -285
  430. package/dist/domain/services/moscow-prioritization.service.spec.js.map +0 -1
  431. package/dist/domain/services/services.test.d.ts +0 -1
  432. package/dist/domain/services/services.test.js +0 -236
  433. package/dist/domain/services/services.test.js.map +0 -1
  434. package/dist/domain/services/standards.service.d.ts +0 -47
  435. package/dist/domain/services/standards.service.js +0 -129
  436. package/dist/domain/services/standards.service.js.map +0 -1
  437. package/dist/domain/services/standards.service.spec.d.ts +0 -1
  438. package/dist/domain/services/standards.service.spec.js +0 -600
  439. package/dist/domain/services/standards.service.spec.js.map +0 -1
  440. package/dist/domain/services/tool-usage-telemetry.service.d.ts +0 -46
  441. package/dist/domain/services/tool-usage-telemetry.service.js +0 -181
  442. package/dist/domain/services/tool-usage-telemetry.service.js.map +0 -1
  443. package/dist/domain/services/tool-usage-telemetry.service.spec.d.ts +0 -1
  444. package/dist/domain/services/tool-usage-telemetry.service.spec.js +0 -180
  445. package/dist/domain/services/tool-usage-telemetry.service.spec.js.map +0 -1
  446. package/dist/infrastructure/adapters/webhook.adapter.d.ts +0 -5
  447. package/dist/infrastructure/adapters/webhook.adapter.js +0 -19
  448. package/dist/infrastructure/adapters/webhook.adapter.js.map +0 -1
  449. package/dist/infrastructure/catalog/catalog-loader.d.ts +0 -22
  450. package/dist/infrastructure/catalog/catalog-loader.js +0 -135
  451. package/dist/infrastructure/catalog/catalog-loader.js.map +0 -1
  452. package/dist/infrastructure/catalog/catalog-loader.test.d.ts +0 -1
  453. package/dist/infrastructure/catalog/catalog-loader.test.js +0 -184
  454. package/dist/infrastructure/catalog/catalog-loader.test.js.map +0 -1
  455. package/dist/infrastructure/cli/command-executor.d.ts +0 -20
  456. package/dist/infrastructure/cli/command-executor.js +0 -109
  457. package/dist/infrastructure/cli/command-executor.js.map +0 -1
  458. package/dist/infrastructure/cli/command-executor.spec.d.ts +0 -1
  459. package/dist/infrastructure/cli/command-executor.spec.js +0 -149
  460. package/dist/infrastructure/cli/command-executor.spec.js.map +0 -1
  461. package/dist/infrastructure/cli/command-executor.test.d.ts +0 -1
  462. package/dist/infrastructure/cli/command-executor.test.js +0 -98
  463. package/dist/infrastructure/cli/command-executor.test.js.map +0 -1
  464. package/dist/infrastructure/cli/providers/index.d.ts +0 -52
  465. package/dist/infrastructure/cli/providers/index.js +0 -175
  466. package/dist/infrastructure/cli/providers/index.js.map +0 -1
  467. package/dist/infrastructure/cli/providers/providers.spec.d.ts +0 -1
  468. package/dist/infrastructure/cli/providers/providers.spec.js +0 -251
  469. package/dist/infrastructure/cli/providers/providers.spec.js.map +0 -1
  470. package/dist/infrastructure/formatters/output-formatter.service.d.ts +0 -28
  471. package/dist/infrastructure/formatters/output-formatter.service.js +0 -198
  472. package/dist/infrastructure/formatters/output-formatter.service.js.map +0 -1
  473. package/dist/infrastructure/formatters/output-formatter.service.spec.d.ts +0 -1
  474. package/dist/infrastructure/formatters/output-formatter.service.spec.js +0 -164
  475. package/dist/infrastructure/formatters/output-formatter.service.spec.js.map +0 -1
  476. package/dist/main.d.ts +0 -2
  477. package/dist/main.js +0 -10
  478. package/dist/main.js.map +0 -1
  479. package/dist/test/mocks/index.d.ts +0 -44
  480. package/dist/test/mocks/index.js +0 -135
  481. package/dist/test/mocks/index.js.map +0 -1
@@ -1,693 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.startMcpServer = startMcpServer;
37
- const common_1 = require("@nestjs/common");
38
- const http = __importStar(require("node:http"));
39
- const ruleset_validator_service_1 = require("../validators/ruleset-validator.service");
40
- const validate_1 = require("./tools/validate");
41
- const agent_1 = require("./tools/agent");
42
- const architecture_1 = require("./tools/architecture");
43
- const sdlc_1 = require("./tools/sdlc");
44
- const moscow_1 = require("./tools/moscow");
45
- const gate_1 = require("./tools/gate");
46
- const metrics_service_1 = require("./metrics.service");
47
- const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
48
- class MinimalStdioTransport {
49
- constructor(stdin, stdout) {
50
- this.readBuffer = '';
51
- this.stdin = stdin || process.stdin;
52
- this.stdout = stdout || process.stdout;
53
- this.readBuffer = '';
54
- this.started = false;
55
- this.handleData = (chunk) => {
56
- this.readBuffer += chunk.toString();
57
- let newlineIndex;
58
- while ((newlineIndex = this.readBuffer.indexOf('\n')) !== -1) {
59
- const line = this.readBuffer.slice(0, newlineIndex).trim();
60
- this.readBuffer = this.readBuffer.slice(newlineIndex + 1);
61
- if (line) {
62
- try {
63
- const message = JSON.parse(line);
64
- if (this.onmessage) {
65
- this.onmessage(message);
66
- }
67
- }
68
- catch {
69
- if (this.onerror) {
70
- this.onerror(new Error(`Invalid JSON: ${line}`));
71
- }
72
- }
73
- }
74
- }
75
- };
76
- this.handleEnd = () => {
77
- if (this.onclose) {
78
- this.onclose();
79
- }
80
- };
81
- this.handleError = (err) => {
82
- if (this.onerror) {
83
- this.onerror(err);
84
- }
85
- };
86
- }
87
- async start() {
88
- if (this.started)
89
- return;
90
- this.started = true;
91
- this.stdin.on('data', this.handleData);
92
- this.stdin.on('end', this.handleEnd);
93
- this.stdin.on('error', this.handleError);
94
- }
95
- async close() {
96
- if (!this.started)
97
- return;
98
- this.stdin.off('data', this.handleData);
99
- this.stdin.off('end', this.handleEnd);
100
- this.stdin.off('error', this.handleError);
101
- this.onmessage = undefined;
102
- this.onerror = undefined;
103
- this.onclose = undefined;
104
- this.readBuffer = '';
105
- this.started = false;
106
- }
107
- async send(message) {
108
- return new Promise((resolve, reject) => {
109
- const json = JSON.stringify(message) + '\n';
110
- this.stdout.write(json, (err) => {
111
- if (err)
112
- reject(err);
113
- else
114
- resolve();
115
- });
116
- });
117
- }
118
- }
119
- class McpHttpTransportWrapper {
120
- constructor(port, apiKey) {
121
- this.server = null;
122
- this.logger = new common_1.Logger(McpHttpTransportWrapper.name);
123
- this.started = false;
124
- this.port = port;
125
- this.apiKey = apiKey;
126
- this.mcpTransport = new streamableHttp_js_1.StreamableHTTPServerTransport({
127
- sessionIdGenerator: () => Math.random().toString(36).substring(2, 10)
128
- });
129
- this.mcpTransport.onerror = (error) => {
130
- if (this.onerror)
131
- this.onerror(error);
132
- };
133
- this.mcpTransport.onclose = () => {
134
- if (this.onclose)
135
- this.onclose();
136
- };
137
- this.mcpTransport.onmessage = (message) => {
138
- if (this.onmessage)
139
- this.onmessage(message);
140
- };
141
- }
142
- async start() {
143
- if (this.started)
144
- return;
145
- this.started = true;
146
- this.server = http.createServer((req, res) => {
147
- this.handleRequest(req, res);
148
- });
149
- this.server.on('error', (error) => {
150
- this.logger.error(`HTTP server error: ${error.message}`);
151
- if (this.onerror) {
152
- this.onerror(error);
153
- }
154
- });
155
- this.server.on('close', () => {
156
- if (this.onclose) {
157
- this.onclose();
158
- }
159
- });
160
- await new Promise((resolve, reject) => {
161
- this.server.listen(this.port, '127.0.0.1', () => {
162
- this.logger.log(`Evolith MCP HTTP server listening on http://127.0.0.1:${this.port}`);
163
- resolve();
164
- });
165
- this.server.on('error', reject);
166
- });
167
- }
168
- async close() {
169
- this.started = false;
170
- await this.mcpTransport.close();
171
- if (this.server) {
172
- await new Promise((resolve) => {
173
- this.server.close(() => resolve());
174
- });
175
- this.server = null;
176
- }
177
- }
178
- async send(message) {
179
- await this.mcpTransport.send(message);
180
- }
181
- handleRequest(req, res) {
182
- const url = new URL(req.url || '/', `http://127.0.0.1:${this.port}`);
183
- if (!this.validateAuth(req, res)) {
184
- return;
185
- }
186
- if (req.method === 'GET' && url.pathname === '/health') {
187
- res.writeHead(200, { 'Content-Type': 'application/json' });
188
- res.end(JSON.stringify({ status: 'ok', transport: 'http', protocol: 'mcp' }));
189
- return;
190
- }
191
- this.mcpTransport.handleRequest(req, res).catch((err) => {
192
- this.logger.error(`MCP Transport error: ${err.message}`);
193
- });
194
- }
195
- validateAuth(req, res) {
196
- if (!this.apiKey)
197
- return true;
198
- const authHeader = req.headers.authorization || '';
199
- const bearerToken = authHeader.startsWith('Bearer ') ? authHeader.slice(7) : '';
200
- const apiKeyHeader = req.headers['x-api-key'];
201
- if (bearerToken !== this.apiKey && apiKeyHeader !== this.apiKey) {
202
- res.writeHead(401, { 'Content-Type': 'application/json' });
203
- res.end(JSON.stringify({ error: 'Unauthorized', message: 'Invalid or missing API key' }));
204
- return false;
205
- }
206
- return true;
207
- }
208
- }
209
- class DirectMcpServer {
210
- constructor(transportType = 'stdio', port = 49100, apiKey, rulesetValidator, metricsService, stdin, stdout) {
211
- this.logger = new common_1.Logger(DirectMcpServer.name);
212
- this.transportType = transportType;
213
- this.rulesetValidator = rulesetValidator || new ruleset_validator_service_1.RulesetValidatorService();
214
- this.metricsService = metricsService || new metrics_service_1.McpMetricsService();
215
- if (transportType === 'http') {
216
- this.transport = new McpHttpTransportWrapper(port, apiKey);
217
- }
218
- else {
219
- this.transport = new MinimalStdioTransport(stdin, stdout);
220
- }
221
- }
222
- async start() {
223
- const transport = this.transport;
224
- transport.onmessage = async (message) => {
225
- await this.handleMessage(message);
226
- };
227
- transport.onerror = (error) => {
228
- this.logger.error(`Transport error: ${error.message}`);
229
- };
230
- transport.onclose = () => {
231
- this.logger.log('Transport closed');
232
- };
233
- await transport.start();
234
- this.logger.log(`Evolith MCP Server started on ${this.transportType}`);
235
- }
236
- async stop() {
237
- await this.transport.close();
238
- }
239
- async handleMessage(rawMessage) {
240
- try {
241
- const request = rawMessage;
242
- this.logger.debug(`Received: ${JSON.stringify(request)}`);
243
- if (request.method === 'initialize') {
244
- const response = {
245
- jsonrpc: '2.0',
246
- id: request.id,
247
- result: {
248
- protocolVersion: '2024-11-05',
249
- capabilities: {
250
- tools: {},
251
- resources: {},
252
- prompts: {},
253
- },
254
- serverInfo: {
255
- name: 'evolith-mcp-server',
256
- version: '1.0.0',
257
- },
258
- },
259
- };
260
- await this.transport.send(response);
261
- return;
262
- }
263
- let result;
264
- try {
265
- result = await this.dispatchRequest(request.method, request.params || {});
266
- }
267
- catch (error) {
268
- const errorResponse = {
269
- jsonrpc: '2.0',
270
- id: request.id,
271
- error: {
272
- code: -32603,
273
- message: error instanceof Error ? error.message : String(error),
274
- },
275
- };
276
- await this.transport.send(errorResponse);
277
- return;
278
- }
279
- const response = {
280
- jsonrpc: '2.0',
281
- id: request.id,
282
- result,
283
- };
284
- await this.transport.send(response);
285
- }
286
- catch (error) {
287
- this.logger.error(`Error handling message: ${error}`);
288
- const errorResponse = {
289
- jsonrpc: '2.0',
290
- id: null,
291
- error: {
292
- code: -32603,
293
- message: error instanceof Error ? error.message : String(error),
294
- },
295
- };
296
- try {
297
- await this.transport.send(errorResponse);
298
- }
299
- catch {
300
- }
301
- }
302
- }
303
- async dispatchRequest(method, params) {
304
- switch (method) {
305
- case 'tools/list':
306
- return this.handleListTools();
307
- case 'tools/call':
308
- return this.handleCallTool(params);
309
- case 'resources/list':
310
- return this.handleListResources();
311
- case 'resources/read':
312
- return this.handleReadResource(params);
313
- case 'prompts/list':
314
- return this.handleListPrompts();
315
- case 'prompts/get':
316
- return this.handleGetPrompt(params);
317
- default:
318
- throw new Error(`Method not found: ${method}`);
319
- }
320
- }
321
- handleListTools() {
322
- return {
323
- tools: [
324
- {
325
- name: 'evolith-validate',
326
- description: 'Validate a repository against Evolith governance rules',
327
- inputSchema: {
328
- type: 'object',
329
- properties: {
330
- path: { type: 'string', description: 'Path to the repository to validate' },
331
- format: { type: 'string', description: 'Output format: json, summary, table', default: 'json' },
332
- ruleset: { type: 'string', description: 'Specific ruleset to validate' },
333
- corePath: { type: 'string', description: 'Path to Evolith Core' },
334
- },
335
- required: ['path'],
336
- },
337
- },
338
- {
339
- name: 'evolith-gate-evaluate',
340
- description: 'Evaluate a specific SDLC phase gate',
341
- inputSchema: {
342
- type: 'object',
343
- properties: {
344
- phase: { type: 'string', description: 'Phase identifier (discovery, design, construction, qa, release)' },
345
- projectPath: { type: 'string', description: 'Path to the repository to validate' },
346
- rulesetRef: { type: 'string', description: 'Optional ruleset reference' },
347
- evidenceMode: { type: 'string', description: 'full or summary', default: 'full' },
348
- evaluatedBy: { type: 'string', description: 'human, agent, or ci', default: 'agent' },
349
- initiative: { type: 'string', description: 'Optional initiative context' },
350
- tenant: { type: 'string', description: 'Optional tenant context' },
351
- },
352
- required: ['phase', 'projectPath'],
353
- },
354
- },
355
- {
356
- name: 'evolith-agent-install',
357
- description: 'Install a new Evolith agent',
358
- inputSchema: {
359
- type: 'object',
360
- properties: {
361
- name: { type: 'string', description: 'Name of the agent to install' },
362
- template: { type: 'string', description: 'Template: standard, minimal, enterprise', default: 'standard' },
363
- dir: { type: 'string', description: 'Directory to install into' },
364
- },
365
- required: ['name'],
366
- },
367
- },
368
- {
369
- name: 'evolith-agent-list',
370
- description: 'List all installed Evolith agents',
371
- inputSchema: {
372
- type: 'object',
373
- properties: {
374
- dir: { type: 'string', description: 'Directory to search' },
375
- },
376
- },
377
- },
378
- {
379
- name: 'evolith-agent-validate',
380
- description: 'Validate a specific agent ruleset',
381
- inputSchema: {
382
- type: 'object',
383
- properties: {
384
- name: { type: 'string' },
385
- dir: { type: 'string' },
386
- },
387
- required: ['name'],
388
- },
389
- },
390
- {
391
- name: 'evolith-agent-upgrade',
392
- description: 'Upgrade an existing Evolith agent',
393
- inputSchema: {
394
- type: 'object',
395
- properties: {
396
- name: { type: 'string' },
397
- dir: { type: 'string' },
398
- },
399
- required: ['name'],
400
- },
401
- },
402
- {
403
- name: 'evolith-agent-remove',
404
- description: 'Remove an Evolith agent',
405
- inputSchema: {
406
- type: 'object',
407
- properties: {
408
- name: { type: 'string' },
409
- dir: { type: 'string' },
410
- },
411
- required: ['name'],
412
- },
413
- },
414
- {
415
- name: 'evolith-architecture-validate',
416
- description: 'Validate repository architecture against F1/F2/F3 rules. Use deep=true for import graph analysis, layer violations, and coupling metrics.',
417
- inputSchema: {
418
- type: 'object',
419
- properties: {
420
- path: { type: 'string' },
421
- level: { type: 'string', description: 'F1, F2, or F3' },
422
- deep: { type: 'boolean', description: 'Enable deep static analysis (import graph, layer violations, coupling metrics)', default: false },
423
- },
424
- required: ['path'],
425
- },
426
- },
427
- {
428
- name: 'evolith-sdlc-handoff',
429
- description: 'Generate SDLC phase handoff artifact manifest',
430
- inputSchema: {
431
- type: 'object',
432
- properties: {
433
- path: { type: 'string' },
434
- fromPhase: { type: 'string' },
435
- toPhase: { type: 'string' },
436
- },
437
- required: ['path', 'fromPhase', 'toPhase'],
438
- },
439
- },
440
- {
441
- name: 'evolith-sdlc-status',
442
- description: 'Show current SDLC phase gate status',
443
- inputSchema: {
444
- type: 'object',
445
- properties: {
446
- path: { type: 'string' },
447
- },
448
- required: ['path'],
449
- },
450
- },
451
- {
452
- name: 'evolith-config-get',
453
- description: 'Get Evolith configuration value',
454
- inputSchema: {
455
- type: 'object',
456
- properties: {
457
- key: { type: 'string' },
458
- dir: { type: 'string' },
459
- },
460
- required: ['key'],
461
- },
462
- },
463
- {
464
- name: 'evolith-config-set',
465
- description: 'Set Evolith configuration value',
466
- inputSchema: {
467
- type: 'object',
468
- properties: {
469
- key: { type: 'string' },
470
- value: { type: 'string' },
471
- dir: { type: 'string' },
472
- },
473
- required: ['key', 'value'],
474
- },
475
- },
476
- {
477
- name: 'evolith-metrics',
478
- description: 'Get MCP server metrics',
479
- inputSchema: {
480
- type: 'object',
481
- properties: {},
482
- },
483
- },
484
- {
485
- name: 'evolith-moscow-create',
486
- description: 'Create a new MoSCoW prioritization analysis for a phase',
487
- inputSchema: {
488
- type: 'object',
489
- properties: {
490
- path: { type: 'string', description: 'Path to the repository' },
491
- phase: { type: 'string', description: 'Phase identifier (e.g., phase-0)', default: 'phase-0' },
492
- items: { type: 'array', description: 'Array of MoSCoW items with description, priority, category, rationale' },
493
- },
494
- required: ['path', 'items'],
495
- },
496
- },
497
- {
498
- name: 'evolith-moscow-load',
499
- description: 'Load an existing MoSCoW analysis for a phase',
500
- inputSchema: {
501
- type: 'object',
502
- properties: {
503
- path: { type: 'string' },
504
- phase: { type: 'string', default: 'phase-0' },
505
- },
506
- required: ['path'],
507
- },
508
- },
509
- {
510
- name: 'evolith-moscow-update',
511
- description: 'Update an item in a MoSCoW analysis',
512
- inputSchema: {
513
- type: 'object',
514
- properties: {
515
- path: { type: 'string' },
516
- phase: { type: 'string', default: 'phase-0' },
517
- itemId: { type: 'string' },
518
- updates: { type: 'object' },
519
- },
520
- required: ['path', 'itemId'],
521
- },
522
- },
523
- {
524
- name: 'evolith-moscow-remove',
525
- description: 'Remove an item from a MoSCoW analysis',
526
- inputSchema: {
527
- type: 'object',
528
- properties: {
529
- path: { type: 'string' },
530
- phase: { type: 'string', default: 'phase-0' },
531
- itemId: { type: 'string' },
532
- },
533
- required: ['path', 'itemId'],
534
- },
535
- },
536
- {
537
- name: 'evolith-moscow-list',
538
- description: 'List all MoSCoW analyses for a repository',
539
- inputSchema: {
540
- type: 'object',
541
- properties: {
542
- path: { type: 'string' },
543
- },
544
- required: ['path'],
545
- },
546
- },
547
- {
548
- name: 'evolith-moscow-validate',
549
- description: 'Validate a MoSCoW analysis for correctness',
550
- inputSchema: {
551
- type: 'object',
552
- properties: {
553
- path: { type: 'string' },
554
- phase: { type: 'string', default: 'phase-0' },
555
- },
556
- required: ['path'],
557
- },
558
- },
559
- {
560
- name: 'evolith-moscow-report',
561
- description: 'Generate a markdown report from a MoSCoW analysis',
562
- inputSchema: {
563
- type: 'object',
564
- properties: {
565
- path: { type: 'string' },
566
- phase: { type: 'string', default: 'phase-0' },
567
- },
568
- required: ['path'],
569
- },
570
- },
571
- ],
572
- };
573
- }
574
- async handleCallTool(params) {
575
- const name = params.name;
576
- const args = params.arguments || {};
577
- const startTime = Date.now();
578
- try {
579
- let result;
580
- if (name === 'evolith-validate') {
581
- result = await (0, validate_1.handleValidateTool)(args, this.rulesetValidator);
582
- }
583
- else if (name === 'evolith-gate-evaluate') {
584
- result = await (0, gate_1.handleGateEvaluateTool)(args);
585
- }
586
- else if (name.startsWith('evolith-agent')) {
587
- result = await (0, agent_1.handleAgentTools)(name, args);
588
- }
589
- else if (name === 'evolith-architecture-validate') {
590
- result = await (0, architecture_1.handleArchitectureTools)(args);
591
- }
592
- else if (name.startsWith('evolith-sdlc')) {
593
- result = await (0, sdlc_1.handleSdlcTools)(name, args);
594
- }
595
- else if (name === 'evolith-config-get' || name === 'evolith-config-set') {
596
- result = await this.handleConfigTools(name, args);
597
- }
598
- else if (name === 'evolith-metrics') {
599
- result = this.metricsService.getMetrics();
600
- }
601
- else if (name.startsWith('evolith-moscow')) {
602
- result = await (0, moscow_1.handleMoscowTools)(name, args);
603
- }
604
- else {
605
- throw new Error(`Unknown tool: ${name}`);
606
- }
607
- const latencyMs = Date.now() - startTime;
608
- this.metricsService.recordToolCall(name, latencyMs, true);
609
- return {
610
- content: [
611
- {
612
- type: 'text',
613
- text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),
614
- },
615
- ],
616
- };
617
- }
618
- catch (error) {
619
- const latencyMs = Date.now() - startTime;
620
- const message = error instanceof Error ? error.message : String(error);
621
- this.metricsService.recordToolCall(name, latencyMs, false);
622
- this.metricsService.recordError(message.substring(0, 50));
623
- return {
624
- content: [
625
- {
626
- type: 'text',
627
- text: JSON.stringify({ error: true, message }),
628
- },
629
- ],
630
- isError: true,
631
- };
632
- }
633
- }
634
- async handleConfigTools(name, args) {
635
- const fs = await Promise.resolve().then(() => __importStar(require('fs-extra')));
636
- const path = await Promise.resolve().then(() => __importStar(require('path')));
637
- const yaml = await Promise.resolve().then(() => __importStar(require('yaml')));
638
- const dir = args.dir || process.cwd();
639
- const configPath = path.join(dir, 'evolith.yaml');
640
- if (!(await fs.pathExists(configPath))) {
641
- throw new Error('evolith.yaml not found');
642
- }
643
- const config = yaml.parse(await fs.readFile(configPath, 'utf-8'));
644
- if (name === 'evolith-config-get') {
645
- const key = args.key;
646
- const keys = key.split('.');
647
- let value = config;
648
- for (const k of keys) {
649
- value = value?.[k];
650
- }
651
- return { key, value: value ?? null };
652
- }
653
- else {
654
- const key = args.key;
655
- const value = args.value;
656
- const keys = key.split('.');
657
- let target = config;
658
- for (let i = 0; i < keys.length - 1; i++) {
659
- if (!target[keys[i]]) {
660
- target[keys[i]] = {};
661
- }
662
- target = target[keys[i]];
663
- }
664
- target[keys[keys.length - 1]] = value;
665
- await fs.writeFile(configPath, yaml.stringify(config));
666
- return { key, value, updated: true };
667
- }
668
- }
669
- async handleListResources() {
670
- const { listResources } = await Promise.resolve().then(() => __importStar(require('./resources')));
671
- return listResources();
672
- }
673
- async handleReadResource(params) {
674
- const { readResource } = await Promise.resolve().then(() => __importStar(require('./resources')));
675
- return readResource(params);
676
- }
677
- async handleListPrompts() {
678
- const { listPrompts } = await Promise.resolve().then(() => __importStar(require('./prompts')));
679
- return listPrompts();
680
- }
681
- async handleGetPrompt(params) {
682
- const { getPrompt } = await Promise.resolve().then(() => __importStar(require('./prompts')));
683
- return getPrompt(params);
684
- }
685
- }
686
- async function startMcpServer(options = {}) {
687
- const transport = options.transport || 'stdio';
688
- const port = options.port || 49100;
689
- const server = new DirectMcpServer(transport, port, options.apiKey, options.rulesetValidator, options.metricsService, options.stdin, options.stdout);
690
- await server.start();
691
- return server;
692
- }
693
- //# sourceMappingURL=server.js.map