@elsikora/commitizen-plugin-commitlint-ai 1.2.0 → 2.0.0-dev.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 (417) hide show
  1. package/README.md +256 -57
  2. package/dist/cjs/application/constant/config-file-directory.constant.d.ts +4 -0
  3. package/dist/cjs/application/constant/config-file-directory.constant.js +9 -0
  4. package/dist/cjs/application/constant/config-file-directory.constant.js.map +1 -0
  5. package/dist/cjs/application/constant/config-module-name.constant.d.ts +4 -0
  6. package/dist/cjs/application/constant/config-module-name.constant.js +9 -0
  7. package/dist/cjs/application/constant/config-module-name.constant.js.map +1 -0
  8. package/dist/cjs/application/constant/index.d.ts +2 -0
  9. package/dist/cjs/application/index.d.ts +2 -0
  10. package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts +21 -0
  11. package/dist/cjs/application/interface/cli-interface-service.interface.d.ts +105 -0
  12. package/dist/cjs/application/interface/command-service.interface.d.ts +19 -0
  13. package/dist/cjs/application/interface/commit-repository.interface.d.ts +32 -0
  14. package/dist/cjs/application/interface/commit-validator.interface.d.ts +29 -0
  15. package/dist/cjs/application/interface/config-service.interface.d.ts +47 -0
  16. package/dist/cjs/application/interface/config.interface.d.ts +27 -0
  17. package/dist/cjs/application/interface/file-system-service.interface.d.ts +61 -0
  18. package/dist/cjs/application/interface/index.d.ts +9 -0
  19. package/dist/cjs/application/interface/llm-service.interface.d.ts +43 -0
  20. package/dist/cjs/application/use-case/configure-llm.use-case.d.ts +39 -0
  21. package/dist/cjs/application/use-case/configure-llm.use-case.js +373 -0
  22. package/dist/cjs/application/use-case/configure-llm.use-case.js.map +1 -0
  23. package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts +18 -0
  24. package/dist/cjs/application/use-case/generate-commit-message.use-case.js +49 -0
  25. package/dist/cjs/application/use-case/generate-commit-message.use-case.js.map +1 -0
  26. package/dist/cjs/application/use-case/index.d.ts +4 -0
  27. package/dist/cjs/application/use-case/manual-commit.use-case.d.ts +16 -0
  28. package/dist/cjs/application/use-case/manual-commit.use-case.js +81 -0
  29. package/dist/cjs/application/use-case/manual-commit.use-case.js.map +1 -0
  30. package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts +26 -0
  31. package/dist/cjs/application/use-case/validate-commit-message.use-case.js +76 -0
  32. package/dist/cjs/application/use-case/validate-commit-message.use-case.js.map +1 -0
  33. package/dist/cjs/domain/constant/index.d.ts +1 -0
  34. package/dist/cjs/domain/constant/numeric.constant.d.ts +25 -0
  35. package/dist/cjs/domain/constant/numeric.constant.js +42 -0
  36. package/dist/cjs/domain/constant/numeric.constant.js.map +1 -0
  37. package/dist/cjs/domain/entity/commit-message.entity.d.ts +47 -0
  38. package/dist/cjs/domain/entity/commit-message.entity.js +71 -0
  39. package/dist/cjs/domain/entity/commit-message.entity.js.map +1 -0
  40. package/dist/cjs/domain/entity/index.d.ts +2 -0
  41. package/dist/cjs/domain/entity/llm-configuration.entity.d.ts +73 -0
  42. package/dist/cjs/domain/entity/llm-configuration.entity.js +107 -0
  43. package/dist/cjs/domain/entity/llm-configuration.entity.js.map +1 -0
  44. package/dist/cjs/domain/enum/anthropic-model.enum.d.ts +18 -0
  45. package/dist/cjs/domain/enum/anthropic-model.enum.js +26 -0
  46. package/dist/cjs/domain/enum/anthropic-model.enum.js.map +1 -0
  47. package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts +33 -0
  48. package/dist/cjs/domain/enum/aws-bedrock-model.enum.js +47 -0
  49. package/dist/cjs/domain/enum/aws-bedrock-model.enum.js.map +1 -0
  50. package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts +17 -0
  51. package/dist/cjs/domain/enum/azure-openai-model.enum.js +26 -0
  52. package/dist/cjs/domain/enum/azure-openai-model.enum.js.map +1 -0
  53. package/dist/cjs/domain/enum/commit-mode.enum.d.ts +7 -0
  54. package/dist/cjs/domain/enum/commit-mode.enum.js +11 -0
  55. package/dist/cjs/domain/enum/commit-mode.enum.js.map +1 -0
  56. package/dist/cjs/domain/enum/google-model.enum.d.ts +16 -0
  57. package/dist/cjs/domain/enum/google-model.enum.js +25 -0
  58. package/dist/cjs/domain/enum/google-model.enum.js.map +1 -0
  59. package/dist/cjs/domain/enum/index.d.ts +9 -0
  60. package/dist/cjs/domain/enum/llm-provider.enum.d.ts +11 -0
  61. package/dist/cjs/domain/enum/llm-provider.enum.js +15 -0
  62. package/dist/cjs/domain/enum/llm-provider.enum.js.map +1 -0
  63. package/dist/cjs/domain/enum/log-level.enum.d.ts +9 -0
  64. package/dist/cjs/domain/enum/log-level.enum.js +13 -0
  65. package/dist/cjs/domain/enum/log-level.enum.js.map +1 -0
  66. package/dist/cjs/domain/enum/ollama-model.enum.d.ts +24 -0
  67. package/dist/cjs/domain/enum/ollama-model.enum.js +30 -0
  68. package/dist/cjs/domain/enum/ollama-model.enum.js.map +1 -0
  69. package/dist/cjs/domain/enum/openai-model.enum.d.ts +25 -0
  70. package/dist/cjs/domain/enum/openai-model.enum.js +35 -0
  71. package/dist/cjs/domain/enum/openai-model.enum.js.map +1 -0
  72. package/dist/cjs/domain/index.d.ts +3 -0
  73. package/dist/cjs/domain/value-object/api-key.value-object.d.ts +28 -0
  74. package/dist/cjs/domain/value-object/api-key.value-object.js +51 -0
  75. package/dist/cjs/domain/value-object/api-key.value-object.js.map +1 -0
  76. package/dist/cjs/domain/value-object/commit-body.value-object.d.ts +39 -0
  77. package/dist/cjs/domain/value-object/commit-body.value-object.js +66 -0
  78. package/dist/cjs/domain/value-object/commit-body.value-object.js.map +1 -0
  79. package/dist/cjs/domain/value-object/commit-header.value-object.d.ts +35 -0
  80. package/dist/cjs/domain/value-object/commit-header.value-object.js +63 -0
  81. package/dist/cjs/domain/value-object/commit-header.value-object.js.map +1 -0
  82. package/dist/cjs/domain/value-object/index.d.ts +3 -0
  83. package/dist/cjs/index.d.ts +14 -12
  84. package/dist/cjs/index.js +85 -83
  85. package/dist/cjs/index.js.map +1 -1
  86. package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts +38 -0
  87. package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js +207 -0
  88. package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -0
  89. package/dist/cjs/infrastructure/commit-validator/index.d.ts +1 -0
  90. package/dist/cjs/infrastructure/di/container.d.ts +17 -0
  91. package/dist/cjs/infrastructure/di/container.js +76 -0
  92. package/dist/cjs/infrastructure/di/container.js.map +1 -0
  93. package/dist/cjs/infrastructure/di/index.d.ts +1 -0
  94. package/dist/cjs/infrastructure/git/git-commit.repository.d.ts +36 -0
  95. package/dist/cjs/infrastructure/git/git-commit.repository.js +78 -0
  96. package/dist/cjs/infrastructure/git/git-commit.repository.js.map +1 -0
  97. package/dist/cjs/infrastructure/git/index.d.ts +1 -0
  98. package/dist/cjs/infrastructure/index.d.ts +4 -0
  99. package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts +39 -0
  100. package/dist/cjs/infrastructure/llm/anthropic-llm.service.js +323 -0
  101. package/dist/cjs/infrastructure/llm/anthropic-llm.service.js.map +1 -0
  102. package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts +60 -0
  103. package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js +514 -0
  104. package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -0
  105. package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts +45 -0
  106. package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js +351 -0
  107. package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js.map +1 -0
  108. package/dist/cjs/infrastructure/llm/google-llm.service.d.ts +45 -0
  109. package/dist/cjs/infrastructure/llm/google-llm.service.js +335 -0
  110. package/dist/cjs/infrastructure/llm/google-llm.service.js.map +1 -0
  111. package/dist/cjs/infrastructure/llm/index.d.ts +6 -0
  112. package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts +45 -0
  113. package/dist/cjs/infrastructure/llm/ollama-llm.service.js +387 -0
  114. package/dist/cjs/infrastructure/llm/ollama-llm.service.js.map +1 -0
  115. package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts +45 -0
  116. package/dist/cjs/infrastructure/llm/openai-llm.service.js +339 -0
  117. package/dist/cjs/infrastructure/llm/openai-llm.service.js.map +1 -0
  118. package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts +66 -0
  119. package/dist/cjs/infrastructure/service/cosmic-config.service.js +176 -0
  120. package/dist/cjs/infrastructure/service/cosmic-config.service.js.map +1 -0
  121. package/dist/cjs/infrastructure/service/index.d.ts +4 -0
  122. package/dist/cjs/infrastructure/service/node-command.service.d.ts +45 -0
  123. package/dist/cjs/infrastructure/service/node-command.service.js +154 -0
  124. package/dist/cjs/infrastructure/service/node-command.service.js.map +1 -0
  125. package/dist/cjs/infrastructure/service/node-file-system.service.d.ts +62 -0
  126. package/dist/cjs/infrastructure/service/node-file-system.service.js +102 -0
  127. package/dist/cjs/infrastructure/service/node-file-system.service.js.map +1 -0
  128. package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts +117 -0
  129. package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js +318 -0
  130. package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js.map +1 -0
  131. package/dist/cjs/presentation/commitizen.adapter.d.ts +28 -0
  132. package/dist/cjs/presentation/commitizen.adapter.js +304 -0
  133. package/dist/cjs/presentation/commitizen.adapter.js.map +1 -0
  134. package/dist/cjs/presentation/index.d.ts +1 -0
  135. package/dist/esm/application/constant/config-file-directory.constant.d.ts +4 -0
  136. package/dist/esm/application/constant/config-file-directory.constant.js +7 -0
  137. package/dist/esm/application/constant/config-file-directory.constant.js.map +1 -0
  138. package/dist/esm/application/constant/config-module-name.constant.d.ts +4 -0
  139. package/dist/esm/application/constant/config-module-name.constant.js +7 -0
  140. package/dist/esm/application/constant/config-module-name.constant.js.map +1 -0
  141. package/dist/esm/application/constant/index.d.ts +2 -0
  142. package/dist/esm/application/index.d.ts +2 -0
  143. package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts +21 -0
  144. package/dist/esm/application/interface/cli-interface-service.interface.d.ts +105 -0
  145. package/dist/esm/application/interface/command-service.interface.d.ts +19 -0
  146. package/dist/esm/application/interface/commit-repository.interface.d.ts +32 -0
  147. package/dist/esm/application/interface/commit-validator.interface.d.ts +29 -0
  148. package/dist/esm/application/interface/config-service.interface.d.ts +47 -0
  149. package/dist/esm/application/interface/config.interface.d.ts +27 -0
  150. package/dist/esm/application/interface/file-system-service.interface.d.ts +61 -0
  151. package/dist/esm/application/interface/index.d.ts +9 -0
  152. package/dist/esm/application/interface/llm-service.interface.d.ts +43 -0
  153. package/dist/esm/application/use-case/configure-llm.use-case.d.ts +39 -0
  154. package/dist/esm/application/use-case/configure-llm.use-case.js +371 -0
  155. package/dist/esm/application/use-case/configure-llm.use-case.js.map +1 -0
  156. package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts +18 -0
  157. package/dist/esm/application/use-case/generate-commit-message.use-case.js +47 -0
  158. package/dist/esm/application/use-case/generate-commit-message.use-case.js.map +1 -0
  159. package/dist/esm/application/use-case/index.d.ts +4 -0
  160. package/dist/esm/application/use-case/manual-commit.use-case.d.ts +16 -0
  161. package/dist/esm/application/use-case/manual-commit.use-case.js +79 -0
  162. package/dist/esm/application/use-case/manual-commit.use-case.js.map +1 -0
  163. package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts +26 -0
  164. package/dist/esm/application/use-case/validate-commit-message.use-case.js +74 -0
  165. package/dist/esm/application/use-case/validate-commit-message.use-case.js.map +1 -0
  166. package/dist/esm/domain/constant/index.d.ts +1 -0
  167. package/dist/esm/domain/constant/numeric.constant.d.ts +25 -0
  168. package/dist/esm/domain/constant/numeric.constant.js +26 -0
  169. package/dist/esm/domain/constant/numeric.constant.js.map +1 -0
  170. package/dist/esm/domain/entity/commit-message.entity.d.ts +47 -0
  171. package/dist/esm/domain/entity/commit-message.entity.js +69 -0
  172. package/dist/esm/domain/entity/commit-message.entity.js.map +1 -0
  173. package/dist/esm/domain/entity/index.d.ts +2 -0
  174. package/dist/esm/domain/entity/llm-configuration.entity.d.ts +73 -0
  175. package/dist/esm/domain/entity/llm-configuration.entity.js +105 -0
  176. package/dist/esm/domain/entity/llm-configuration.entity.js.map +1 -0
  177. package/dist/esm/domain/enum/anthropic-model.enum.d.ts +18 -0
  178. package/dist/esm/domain/enum/anthropic-model.enum.js +26 -0
  179. package/dist/esm/domain/enum/anthropic-model.enum.js.map +1 -0
  180. package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts +33 -0
  181. package/dist/esm/domain/enum/aws-bedrock-model.enum.js +47 -0
  182. package/dist/esm/domain/enum/aws-bedrock-model.enum.js.map +1 -0
  183. package/dist/esm/domain/enum/azure-openai-model.enum.d.ts +17 -0
  184. package/dist/esm/domain/enum/azure-openai-model.enum.js +26 -0
  185. package/dist/esm/domain/enum/azure-openai-model.enum.js.map +1 -0
  186. package/dist/esm/domain/enum/commit-mode.enum.d.ts +7 -0
  187. package/dist/esm/domain/enum/commit-mode.enum.js +11 -0
  188. package/dist/esm/domain/enum/commit-mode.enum.js.map +1 -0
  189. package/dist/esm/domain/enum/google-model.enum.d.ts +16 -0
  190. package/dist/esm/domain/enum/google-model.enum.js +25 -0
  191. package/dist/esm/domain/enum/google-model.enum.js.map +1 -0
  192. package/dist/esm/domain/enum/index.d.ts +9 -0
  193. package/dist/esm/domain/enum/llm-provider.enum.d.ts +11 -0
  194. package/dist/esm/domain/enum/llm-provider.enum.js +15 -0
  195. package/dist/esm/domain/enum/llm-provider.enum.js.map +1 -0
  196. package/dist/esm/domain/enum/log-level.enum.d.ts +9 -0
  197. package/dist/esm/domain/enum/log-level.enum.js +13 -0
  198. package/dist/esm/domain/enum/log-level.enum.js.map +1 -0
  199. package/dist/esm/domain/enum/ollama-model.enum.d.ts +24 -0
  200. package/dist/esm/domain/enum/ollama-model.enum.js +30 -0
  201. package/dist/esm/domain/enum/ollama-model.enum.js.map +1 -0
  202. package/dist/esm/domain/enum/openai-model.enum.d.ts +25 -0
  203. package/dist/esm/domain/enum/openai-model.enum.js +35 -0
  204. package/dist/esm/domain/enum/openai-model.enum.js.map +1 -0
  205. package/dist/esm/domain/index.d.ts +3 -0
  206. package/dist/esm/domain/value-object/api-key.value-object.d.ts +28 -0
  207. package/dist/esm/domain/value-object/api-key.value-object.js +49 -0
  208. package/dist/esm/domain/value-object/api-key.value-object.js.map +1 -0
  209. package/dist/esm/domain/value-object/commit-body.value-object.d.ts +39 -0
  210. package/dist/esm/domain/value-object/commit-body.value-object.js +64 -0
  211. package/dist/esm/domain/value-object/commit-body.value-object.js.map +1 -0
  212. package/dist/esm/domain/value-object/commit-header.value-object.d.ts +35 -0
  213. package/dist/esm/domain/value-object/commit-header.value-object.js +61 -0
  214. package/dist/esm/domain/value-object/commit-header.value-object.js.map +1 -0
  215. package/dist/esm/domain/value-object/index.d.ts +3 -0
  216. package/dist/esm/index.d.ts +14 -12
  217. package/dist/esm/index.js +38 -82
  218. package/dist/esm/index.js.map +1 -1
  219. package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts +38 -0
  220. package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js +205 -0
  221. package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -0
  222. package/dist/esm/infrastructure/commit-validator/index.d.ts +1 -0
  223. package/dist/esm/infrastructure/di/container.d.ts +17 -0
  224. package/dist/esm/infrastructure/di/container.js +63 -0
  225. package/dist/esm/infrastructure/di/container.js.map +1 -0
  226. package/dist/esm/infrastructure/di/index.d.ts +1 -0
  227. package/dist/esm/infrastructure/git/git-commit.repository.d.ts +36 -0
  228. package/dist/esm/infrastructure/git/git-commit.repository.js +76 -0
  229. package/dist/esm/infrastructure/git/git-commit.repository.js.map +1 -0
  230. package/dist/esm/infrastructure/git/index.d.ts +1 -0
  231. package/dist/esm/infrastructure/index.d.ts +4 -0
  232. package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts +39 -0
  233. package/dist/esm/infrastructure/llm/anthropic-llm.service.js +321 -0
  234. package/dist/esm/infrastructure/llm/anthropic-llm.service.js.map +1 -0
  235. package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts +60 -0
  236. package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js +512 -0
  237. package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -0
  238. package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts +45 -0
  239. package/dist/esm/infrastructure/llm/azure-openai-llm.service.js +349 -0
  240. package/dist/esm/infrastructure/llm/azure-openai-llm.service.js.map +1 -0
  241. package/dist/esm/infrastructure/llm/google-llm.service.d.ts +45 -0
  242. package/dist/esm/infrastructure/llm/google-llm.service.js +333 -0
  243. package/dist/esm/infrastructure/llm/google-llm.service.js.map +1 -0
  244. package/dist/esm/infrastructure/llm/index.d.ts +6 -0
  245. package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts +45 -0
  246. package/dist/esm/infrastructure/llm/ollama-llm.service.js +385 -0
  247. package/dist/esm/infrastructure/llm/ollama-llm.service.js.map +1 -0
  248. package/dist/esm/infrastructure/llm/openai-llm.service.d.ts +45 -0
  249. package/dist/esm/infrastructure/llm/openai-llm.service.js +337 -0
  250. package/dist/esm/infrastructure/llm/openai-llm.service.js.map +1 -0
  251. package/dist/esm/infrastructure/service/cosmic-config.service.d.ts +66 -0
  252. package/dist/esm/infrastructure/service/cosmic-config.service.js +174 -0
  253. package/dist/esm/infrastructure/service/cosmic-config.service.js.map +1 -0
  254. package/dist/esm/infrastructure/service/index.d.ts +4 -0
  255. package/dist/esm/infrastructure/service/node-command.service.d.ts +45 -0
  256. package/dist/esm/infrastructure/service/node-command.service.js +152 -0
  257. package/dist/esm/infrastructure/service/node-command.service.js.map +1 -0
  258. package/dist/esm/infrastructure/service/node-file-system.service.d.ts +62 -0
  259. package/dist/esm/infrastructure/service/node-file-system.service.js +100 -0
  260. package/dist/esm/infrastructure/service/node-file-system.service.js.map +1 -0
  261. package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts +117 -0
  262. package/dist/esm/infrastructure/service/prompts-cli-interface.service.js +316 -0
  263. package/dist/esm/infrastructure/service/prompts-cli-interface.service.js.map +1 -0
  264. package/dist/esm/package.json +19 -0
  265. package/dist/esm/presentation/commitizen.adapter.d.ts +28 -0
  266. package/dist/esm/presentation/commitizen.adapter.js +302 -0
  267. package/dist/esm/presentation/commitizen.adapter.js.map +1 -0
  268. package/dist/esm/presentation/index.d.ts +1 -0
  269. package/index.cjs +1 -2
  270. package/package.json +42 -25
  271. package/dist/cjs/ManualProcess.d.ts +0 -6
  272. package/dist/cjs/ManualProcess.d.ts.map +0 -1
  273. package/dist/cjs/ManualProcess.js +0 -111
  274. package/dist/cjs/ManualProcess.js.map +0 -1
  275. package/dist/cjs/Process.d.ts +0 -6
  276. package/dist/cjs/Process.d.ts.map +0 -1
  277. package/dist/cjs/Process.js +0 -176
  278. package/dist/cjs/Process.js.map +0 -1
  279. package/dist/cjs/Question.d.ts +0 -46
  280. package/dist/cjs/Question.d.ts.map +0 -1
  281. package/dist/cjs/SectionBody.d.ts +0 -4
  282. package/dist/cjs/SectionBody.d.ts.map +0 -1
  283. package/dist/cjs/SectionFooter.d.ts +0 -13
  284. package/dist/cjs/SectionFooter.d.ts.map +0 -1
  285. package/dist/cjs/SectionHeader.d.ts +0 -15
  286. package/dist/cjs/SectionHeader.d.ts.map +0 -1
  287. package/dist/cjs/index.d.ts.map +0 -1
  288. package/dist/cjs/services/commitConfirmation.d.ts +0 -3
  289. package/dist/cjs/services/commitConfirmation.d.ts.map +0 -1
  290. package/dist/cjs/services/commitConfirmation.js +0 -122
  291. package/dist/cjs/services/commitConfirmation.js.map +0 -1
  292. package/dist/cjs/services/commitlintConfig.d.ts +0 -4
  293. package/dist/cjs/services/commitlintConfig.d.ts.map +0 -1
  294. package/dist/cjs/services/commitlintConfig.js +0 -198
  295. package/dist/cjs/services/commitlintConfig.js.map +0 -1
  296. package/dist/cjs/services/commitlintValidator.d.ts +0 -26
  297. package/dist/cjs/services/commitlintValidator.d.ts.map +0 -1
  298. package/dist/cjs/services/commitlintValidator.js +0 -146
  299. package/dist/cjs/services/commitlintValidator.js.map +0 -1
  300. package/dist/cjs/services/getRuleQuestionConfig.d.ts +0 -4
  301. package/dist/cjs/services/getRuleQuestionConfig.d.ts.map +0 -1
  302. package/dist/cjs/services/llm/anthropic.d.ts +0 -3
  303. package/dist/cjs/services/llm/anthropic.d.ts.map +0 -1
  304. package/dist/cjs/services/llm/anthropic.js +0 -118
  305. package/dist/cjs/services/llm/anthropic.js.map +0 -1
  306. package/dist/cjs/services/llm/config.d.ts +0 -5
  307. package/dist/cjs/services/llm/config.d.ts.map +0 -1
  308. package/dist/cjs/services/llm/config.js +0 -181
  309. package/dist/cjs/services/llm/config.js.map +0 -1
  310. package/dist/cjs/services/llm/index.d.ts +0 -6
  311. package/dist/cjs/services/llm/index.d.ts.map +0 -1
  312. package/dist/cjs/services/llm/index.js +0 -399
  313. package/dist/cjs/services/llm/index.js.map +0 -1
  314. package/dist/cjs/services/llm/models.d.ts +0 -34
  315. package/dist/cjs/services/llm/models.d.ts.map +0 -1
  316. package/dist/cjs/services/llm/models.js +0 -65
  317. package/dist/cjs/services/llm/models.js.map +0 -1
  318. package/dist/cjs/services/llm/openai.d.ts +0 -3
  319. package/dist/cjs/services/llm/openai.d.ts.map +0 -1
  320. package/dist/cjs/services/llm/openai.js +0 -111
  321. package/dist/cjs/services/llm/openai.js.map +0 -1
  322. package/dist/cjs/services/llm/types.d.ts +0 -71
  323. package/dist/cjs/services/llm/types.d.ts.map +0 -1
  324. package/dist/cjs/store/defaultPromptConfigs.d.ts +0 -33
  325. package/dist/cjs/store/defaultPromptConfigs.d.ts.map +0 -1
  326. package/dist/cjs/store/defaultPromptConfigs.js +0 -39
  327. package/dist/cjs/store/defaultPromptConfigs.js.map +0 -1
  328. package/dist/cjs/store/prompts.d.ts +0 -6
  329. package/dist/cjs/store/prompts.d.ts.map +0 -1
  330. package/dist/cjs/store/prompts.js +0 -40
  331. package/dist/cjs/store/prompts.js.map +0 -1
  332. package/dist/cjs/store/rules.d.ts +0 -7
  333. package/dist/cjs/store/rules.d.ts.map +0 -1
  334. package/dist/cjs/types.d.ts +0 -3
  335. package/dist/cjs/types.d.ts.map +0 -1
  336. package/dist/cjs/utils/case-function.d.ts +0 -9
  337. package/dist/cjs/utils/case-function.d.ts.map +0 -1
  338. package/dist/cjs/utils/full-stop-function.d.ts +0 -9
  339. package/dist/cjs/utils/full-stop-function.d.ts.map +0 -1
  340. package/dist/cjs/utils/leading-blank-function.d.ts +0 -8
  341. package/dist/cjs/utils/leading-blank-function.d.ts.map +0 -1
  342. package/dist/cjs/utils/rules.d.ts +0 -26
  343. package/dist/cjs/utils/rules.d.ts.map +0 -1
  344. package/dist/esm/ManualProcess.d.ts +0 -6
  345. package/dist/esm/ManualProcess.d.ts.map +0 -1
  346. package/dist/esm/ManualProcess.js +0 -107
  347. package/dist/esm/ManualProcess.js.map +0 -1
  348. package/dist/esm/Process.d.ts +0 -6
  349. package/dist/esm/Process.d.ts.map +0 -1
  350. package/dist/esm/Process.js +0 -172
  351. package/dist/esm/Process.js.map +0 -1
  352. package/dist/esm/Question.d.ts +0 -46
  353. package/dist/esm/Question.d.ts.map +0 -1
  354. package/dist/esm/SectionBody.d.ts +0 -4
  355. package/dist/esm/SectionBody.d.ts.map +0 -1
  356. package/dist/esm/SectionFooter.d.ts +0 -13
  357. package/dist/esm/SectionFooter.d.ts.map +0 -1
  358. package/dist/esm/SectionHeader.d.ts +0 -15
  359. package/dist/esm/SectionHeader.d.ts.map +0 -1
  360. package/dist/esm/index.d.ts.map +0 -1
  361. package/dist/esm/services/commitConfirmation.d.ts +0 -3
  362. package/dist/esm/services/commitConfirmation.d.ts.map +0 -1
  363. package/dist/esm/services/commitConfirmation.js +0 -120
  364. package/dist/esm/services/commitConfirmation.js.map +0 -1
  365. package/dist/esm/services/commitlintConfig.d.ts +0 -4
  366. package/dist/esm/services/commitlintConfig.d.ts.map +0 -1
  367. package/dist/esm/services/commitlintConfig.js +0 -196
  368. package/dist/esm/services/commitlintConfig.js.map +0 -1
  369. package/dist/esm/services/commitlintValidator.d.ts +0 -26
  370. package/dist/esm/services/commitlintValidator.d.ts.map +0 -1
  371. package/dist/esm/services/commitlintValidator.js +0 -142
  372. package/dist/esm/services/commitlintValidator.js.map +0 -1
  373. package/dist/esm/services/getRuleQuestionConfig.d.ts +0 -4
  374. package/dist/esm/services/getRuleQuestionConfig.d.ts.map +0 -1
  375. package/dist/esm/services/llm/anthropic.d.ts +0 -3
  376. package/dist/esm/services/llm/anthropic.d.ts.map +0 -1
  377. package/dist/esm/services/llm/anthropic.js +0 -116
  378. package/dist/esm/services/llm/anthropic.js.map +0 -1
  379. package/dist/esm/services/llm/config.d.ts +0 -5
  380. package/dist/esm/services/llm/config.d.ts.map +0 -1
  381. package/dist/esm/services/llm/config.js +0 -178
  382. package/dist/esm/services/llm/config.js.map +0 -1
  383. package/dist/esm/services/llm/index.d.ts +0 -6
  384. package/dist/esm/services/llm/index.d.ts.map +0 -1
  385. package/dist/esm/services/llm/index.js +0 -394
  386. package/dist/esm/services/llm/index.js.map +0 -1
  387. package/dist/esm/services/llm/models.d.ts +0 -34
  388. package/dist/esm/services/llm/models.d.ts.map +0 -1
  389. package/dist/esm/services/llm/models.js +0 -60
  390. package/dist/esm/services/llm/models.js.map +0 -1
  391. package/dist/esm/services/llm/openai.d.ts +0 -3
  392. package/dist/esm/services/llm/openai.d.ts.map +0 -1
  393. package/dist/esm/services/llm/openai.js +0 -109
  394. package/dist/esm/services/llm/openai.js.map +0 -1
  395. package/dist/esm/services/llm/types.d.ts +0 -71
  396. package/dist/esm/services/llm/types.d.ts.map +0 -1
  397. package/dist/esm/store/defaultPromptConfigs.d.ts +0 -33
  398. package/dist/esm/store/defaultPromptConfigs.d.ts.map +0 -1
  399. package/dist/esm/store/defaultPromptConfigs.js +0 -35
  400. package/dist/esm/store/defaultPromptConfigs.js.map +0 -1
  401. package/dist/esm/store/prompts.d.ts +0 -6
  402. package/dist/esm/store/prompts.d.ts.map +0 -1
  403. package/dist/esm/store/prompts.js +0 -38
  404. package/dist/esm/store/prompts.js.map +0 -1
  405. package/dist/esm/store/rules.d.ts +0 -7
  406. package/dist/esm/store/rules.d.ts.map +0 -1
  407. package/dist/esm/types.d.ts +0 -3
  408. package/dist/esm/types.d.ts.map +0 -1
  409. package/dist/esm/utils/case-function.d.ts +0 -9
  410. package/dist/esm/utils/case-function.d.ts.map +0 -1
  411. package/dist/esm/utils/full-stop-function.d.ts +0 -9
  412. package/dist/esm/utils/full-stop-function.d.ts.map +0 -1
  413. package/dist/esm/utils/leading-blank-function.d.ts +0 -8
  414. package/dist/esm/utils/leading-blank-function.d.ts.map +0 -1
  415. package/dist/esm/utils/rules.d.ts +0 -26
  416. package/dist/esm/utils/rules.d.ts.map +0 -1
  417. package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  </p>
4
4
 
5
5
  <h1 align="center">Commitizen Plugin Commitlint AI 🤖</h1>
6
- <p align="center"><em>AI-powered Commitizen adapter that generates conventional commits with Commitlint integration</em></p>
6
+ <p align="center"><em>AI-powered Commitizen adapter that generates conventional commits with Commitlint integration, built with clean architecture principles</em></p>
7
7
 
8
8
  <p align="center">
9
9
  <a aria-label="ElsiKora logo" href="https://elsikora.com">
@@ -15,29 +15,65 @@
15
15
 
16
16
  - [Description](#-description)
17
17
  - [Features](#-features)
18
+ - [Architecture](#-architecture)
18
19
  - [Installation](#-installation)
19
20
  - [Usage](#-usage)
21
+ - [Configuration](#-configuration)
20
22
  - [Roadmap](#-roadmap)
21
23
  - [FAQ](#-faq)
22
24
  - [License](#-license)
23
25
 
24
26
  ## 📖 Description
25
27
 
26
- This plugin enhances your Git workflow by combining the power of AI with conventional commit standards. It intelligently analyzes your code changes and generates meaningful commit messages that follow your project's commitlint rules. Whether you're working solo or in a team, this tool helps maintain consistent, high-quality commit history while reducing the cognitive load of writing commit messages.
28
+ This plugin enhances your Git workflow by combining the power of AI with conventional commit standards. Built with clean architecture principles, it intelligently analyzes your code changes and generates meaningful commit messages that follow your project's commitlint rules. Whether you're working solo or in a team, this tool helps maintain consistent, high-quality commit history while reducing the cognitive load of writing commit messages.
27
29
 
28
30
  ## 🚀 Features
29
31
 
30
- - ✨ **AI-powered commit message generation using OpenAI or Anthropic models**
32
+ - ✨ **AI-powered commit message generation using OpenAI, Anthropic, Google, Azure OpenAI, AWS Bedrock, or Ollama models**
31
33
  - ✨ **Full integration with Commitlint rules and configuration**
34
+ - ✨ **Flexible configuration with Cosmiconfig support**
35
+ - ✨ **Environment variable support for API keys (prioritized over config)**
36
+ - ✨ **Automatic model migration for deprecated models**
37
+ - ✨ **Configurable retry mechanism for generation and validation**
32
38
  - ✨ **Support for both manual and automatic commit modes**
33
39
  - ✨ **Smart scope detection based on changed files**
34
40
  - ✨ **Breaking change detection and documentation**
35
- - ✨ **Customizable commit message format**
36
- - ✨ **Interactive commit message confirmation**
37
- - ✨ **Supports multiple AI models including GPT-4, Claude 3, and more**
38
- - ✨ **Environment variable support for API keys**
41
+ - ✨ **Interactive commit message confirmation with validation**
42
+ - ✨ **Clean architecture with dependency injection**
43
+ - ✨ **Real-time retry status updates in the UI**
44
+ - ✨ **Supports latest AI models including GPT-4.1 and Claude 4**
39
45
  - ✨ **Fallback to manual mode if AI generation fails**
40
46
 
47
+ ## 🏗 Architecture
48
+
49
+ The plugin is built using clean architecture principles with clear separation of concerns:
50
+
51
+ ### Layers
52
+
53
+ - **Domain Layer**: Core business logic, entities, and value objects
54
+
55
+ - Entities: `CommitMessage`, `LLMConfiguration`
56
+ - Value Objects: `ApiKey`, `CommitBody`, `CommitHeader`
57
+ - Enums: `ECommitMode`, `ELLMProvider`, `ELogLevel`
58
+
59
+ - **Application Layer**: Use cases and interfaces
60
+
61
+ - Use Cases: `GenerateCommitMessageUseCase`, `ValidateCommitMessageUseCase`, `ConfigureLLMUseCase`
62
+ - Interfaces: `ILLMService`, `ICommitValidator`, `IConfigService`, etc.
63
+
64
+ - **Infrastructure Layer**: External services and implementations
65
+
66
+ - LLM Services: `OpenAILLMService`, `AnthropicLLMService`, `GoogleLLMService`, `AzureOpenAILLMService`, `AWSBedrockLLMService`, `OllamaLLMService`
67
+ - Services: `CommitlintValidatorService`, `CosmicConfigService`, `PromptsCliInterface`
68
+ - Repositories: `GitCommitRepository`
69
+
70
+ - **Presentation Layer**: User interface adapters
71
+ - `CommitizenAdapter` as the main entry point
72
+
73
+ ### Dependency Injection
74
+
75
+ The plugin uses `@elsikora/cladi` for dependency injection, ensuring loose coupling and testability.
76
+
41
77
  ## 🛠 Installation
42
78
 
43
79
  ```bash
@@ -64,86 +100,249 @@ git add .
64
100
  git cz
65
101
  ```
66
102
 
67
- ### Configuration
103
+ The plugin will:
68
104
 
69
- ```javascript
70
- // commitlint.config.js
71
- module export default {
72
- extends: ['@commitlint/config-conventional'],
73
- rules: {
74
- 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'style', 'refactor']],
75
- 'scope-case': [2, 'always', 'lower-case']
76
- }
77
- }
78
- ```
105
+ 1. Ask for your commit mode preference (auto/manual)
106
+ 2. If auto mode and no API key is configured, guide you through configuration
107
+ 3. Generate or help you write a commit message
108
+ 4. Validate against your commitlint rules
109
+ 5. Allow you to confirm or edit before committing
79
110
 
80
111
  ### Environment Variables
81
112
 
82
113
  ```bash
83
- # .env
84
- OPENAI_API_KEY=your-api-key
114
+ # .env or shell environment
115
+ OPENAI_API_KEY=your-openai-api-key
116
+ # or
117
+ ANTHROPIC_API_KEY=your-anthropic-api-key
85
118
  # or
86
- ANTHROPIC_API_KEY=your-api-key
119
+ GOOGLE_API_KEY=your-google-api-key
120
+ # or (for Azure OpenAI, use pipe-separated format)
121
+ AZURE_OPENAI_API_KEY=https://your-resource.openai.azure.com|your-api-key|your-deployment-name
122
+ # or (for AWS Bedrock, use pipe-separated format)
123
+ AWS_BEDROCK_API_KEY=us-east-1|your-access-key-id|your-secret-access-key
124
+ # or (for Ollama, specify host and optional model)
125
+ OLLAMA_API_KEY=localhost:11434|custom-model-name
87
126
  ```
88
127
 
89
- ### Manual Mode
128
+ Environment variables take precedence over stored configuration.
90
129
 
91
- ```bash
92
- # Create .elsikora/manual file to enable manual mode
93
- mkdir -p .elsikora
94
- touch .elsikora/manual
95
- ```
130
+ ## ⚙️ Configuration
131
+
132
+ The plugin supports multiple configuration methods using [Cosmiconfig](https://github.com/davidtheclark/cosmiconfig):
96
133
 
97
- ### Advanced Usage with TypeScript
134
+ ### Configuration File Locations
98
135
 
99
- ```typescript
100
- import { getLLMConfig, setLLMConfig } from "@elsikora/commitizen-plugin-commitlint-ai";
136
+ Create a configuration file in any of these locations:
101
137
 
102
- // Configure AI provider
103
- setLLMConfig({
138
+ - `.commitlintairc`
139
+ - `.commitlintairc.json`
140
+ - `.commitlintairc.yaml`
141
+ - `.commitlintairc.yml`
142
+ - `.commitlintairc.js`
143
+ - `.commitlintairc.cjs`
144
+ - `commitlintai.config.js`
145
+ - `commitlintai.config.cjs`
146
+ - `package.json` (under `"commitlintai"` key)
147
+
148
+ ### Configuration Options
149
+
150
+ ```javascript
151
+ // commitlintai.config.js
152
+ module.exports = {
153
+ // AI provider: 'openai', 'anthropic', 'google', 'azure-openai', 'aws-bedrock', or 'ollama'
104
154
  provider: "openai",
105
- model: "gpt-4",
155
+
156
+ // Model to use (auto-migrates deprecated models)
157
+ model: "gpt-4o",
158
+
159
+ // Mode: 'auto' or 'manual'
106
160
  mode: "auto",
107
- apiKey: process.env.OPENAI_API_KEY,
108
- });
161
+
162
+ // API key (optional - env vars recommended)
163
+ // Format varies by provider:
164
+ // - OpenAI/Anthropic/Google: 'your-api-key'
165
+ // - Azure OpenAI: 'endpoint|api-key|deployment-name'
166
+ // - AWS Bedrock: 'region|access-key-id|secret-access-key'
167
+ // - Ollama: 'host:port' or 'host:port|custom-model-name'
168
+ apiKey: "your-api-key",
169
+
170
+ // Retry configuration
171
+ maxGenerationRetries: 3,
172
+ maxValidationRetries: 3,
173
+
174
+ // Custom instructions for AI
175
+ instructions: "Focus on user-facing changes",
176
+ };
109
177
  ```
110
178
 
111
- ### Custom Prompt Configuration
179
+ ### Available Models
180
+
181
+ ## Supported LLM Providers
182
+
183
+ ### OpenAI
184
+
185
+ - `gpt-4.1` (Latest 2025, most capable)
186
+ - `gpt-4.1-nano` (Fastest 4.1 model)
187
+ - `gpt-4.1-mini` (Balanced performance)
188
+ - `gpt-4o` (Enhanced creative writing)
189
+ - `gpt-4o-mini` (Faster, cost-effective)
190
+ - `gpt-4-turbo`
191
+ - `gpt-4` (Original)
192
+ - `gpt-3.5-turbo` (Fastest, most economical)
193
+ - `o1` (Enhanced reasoning)
194
+ - `o1-mini` (Fast reasoning)
195
+
196
+ ### Anthropic
197
+
198
+ - `claude-opus-4-20250514` (Latest 2025, most capable)
199
+ - `claude-sonnet-4-20250514` (Latest 2025, high-performance)
200
+ - `claude-3-7-sonnet-latest` (Extended thinking capabilities)
201
+ - `claude-3-5-sonnet-latest` (Previous flagship)
202
+ - `claude-3-5-haiku-latest` (Fastest)
203
+ - `claude-3-opus-latest` (Complex tasks)
204
+
205
+ ### Google (Gemini)
206
+
207
+ - `gemini-2.5-pro` (Latest 2025, most capable)
208
+ - `gemini-2.5-flash` (Latest 2025, fast)
209
+ - `gemini-2.0-flash-exp` (Experimental)
210
+ - `gemini-1.5-pro` (Stable, capable)
211
+ - `gemini-1.5-flash` (Fast, stable)
212
+ - `gemini-1.5-flash-8b` (Lightweight)
213
+ - `gemini-1.0-pro`
214
+
215
+ ### Google (Gemma - Open Models for Vertex AI)
216
+
217
+ - `gemma-3-27b` (Most capable open model)
218
+ - `gemma-3-12b` (Strong language capabilities)
219
+ - `gemma-3-4b` (Balanced, multimodal support)
220
+ - `gemma-3-1b` (Lightweight for edge deployment)
221
+
222
+ ### Azure OpenAI
223
+
224
+ - `gpt-4.1-turbo-2024-12-17` (Latest 2025, most capable)
225
+ - `gpt-4.1-preview-2024-12-17` (Latest preview)
226
+ - `gpt-4.1-mini-2024-12-17` (Fast 4.1 model)
227
+ - `gpt-4o-2024-11-20` (Enhanced creative)
228
+ - `gpt-4o-mini-2024-07-18`
229
+ - `gpt-4-turbo`
230
+ - `gpt-3.5-turbo`
231
+ - `o3-2024-12-17` (Enhanced reasoning)
232
+ - `o4-mini-2024-12-17` (Fast reasoning)
233
+
234
+ ### AWS Bedrock
235
+
236
+ - `anthropic.claude-opus-4-20250514-v1:0` (Claude Opus 4 - Latest 2025, most capable)
237
+ - `anthropic.claude-sonnet-4-20250514-v1:0` (Claude Sonnet 4 - Latest 2025, balanced)
238
+ - `anthropic.claude-3-5-sonnet-20241022-v2:0` (Claude 3.5 Sonnet v2)
239
+ - `anthropic.claude-3-5-haiku-20241022-v1:0` (Fast)
240
+ - `anthropic.claude-3-5-sonnet-20240620-v1:0`
241
+ - `us.amazon.nova-pro-v1:0` (Latest Amazon model)
242
+ - `us.deepseek.deepseek-r1:0` (Advanced reasoning)
243
+ - `us.meta.llama3-2-90b-instruct-v1:0` (Open source)
244
+ - `mistral.mistral-large-2411-v1:0` (Latest Mistral)
245
+
246
+ ### Ollama (Local Models)
247
+
248
+ - `llama3.2` (Latest Llama)
249
+ - `llama3.1`
250
+ - `llama3`
251
+ - `mistral`
252
+ - `codellama`
253
+ - `deepseek-coder`
254
+ - `custom` (specify any Ollama model)
255
+
256
+ ### Commitlint Configuration
112
257
 
113
258
  ```javascript
114
- // .elsikora/commitlint-ai.config.js
259
+ // commitlint.config.js
115
260
  export default {
116
- provider: "anthropic",
117
- model: "claude-3-opus-20240229",
118
- mode: "auto",
261
+ extends: ["@commitlint/config-conventional"],
262
+ rules: {
263
+ "type-enum": [2, "always", ["feat", "fix", "docs", "style", "refactor"]],
264
+ "scope-case": [2, "always", "lower-case"],
265
+ "subject-max-length": [2, "always", 72],
266
+ "body-max-line-length": [2, "always", 100],
267
+ },
119
268
  };
120
269
  ```
121
270
 
271
+ ### Manual Mode
272
+
273
+ To force manual mode without prompting:
274
+
275
+ ```bash
276
+ # Create .elsikora/manual file
277
+ mkdir -p .elsikora
278
+ touch .elsikora/manual
279
+ ```
280
+
281
+ ### Package.json Configuration
282
+
283
+ ```json
284
+ {
285
+ "commitlintai": {
286
+ "provider": "anthropic",
287
+ "model": "claude-3-5-sonnet-20241022",
288
+ "mode": "auto",
289
+ "maxGenerationRetries": 5
290
+ }
291
+ }
292
+ ```
293
+
122
294
  ## 🛣 Roadmap
123
295
 
124
- | Task / Feature | Status |
125
- | ---------------------------------------------------------------------------- | -------------- |
126
- | Future development plans include: | 🚧 In Progress |
127
- | - Support for more AI providers | 🚧 In Progress |
128
- | - Enhanced diff analysis for better commit suggestions | 🚧 In Progress |
129
- | - Custom prompt templates | 🚧 In Progress |
130
- | - Integration with more Git hosting platforms | 🚧 In Progress |
131
- | - Performance optimizations for large codebases | 🚧 In Progress |
132
- | - Multi-language support for commit messages | 🚧 In Progress |
133
- | - Team collaboration features | 🚧 In Progress |
134
- | (done) AI-powered commit message generation using OpenAI or Anthropic models | 🚧 In Progress |
135
- | (done) Full integration with Commitlint rules and configuration | 🚧 In Progress |
136
- | (done) Support for both manual and automatic commit modes | 🚧 In Progress |
296
+ | Task / Feature | Status |
297
+ | --------------------------------------------------------------------- | ----------- |
298
+ | AI-powered commit message generation using OpenAI or Anthropic models | ✅ Complete |
299
+ | Full integration with Commitlint rules and configuration | Complete |
300
+ | Support for both manual and automatic commit modes | Complete |
301
+ | Clean architecture implementation | Complete |
302
+ | Cosmiconfig support for flexible configuration | Complete |
303
+ | Environment variable support with priority over config | Complete |
304
+ | Automatic model migration for deprecated models | Complete |
305
+ | Configurable retry mechanism with UI feedback | Complete |
306
+ | Dependency injection with @elsikora/cladi | Complete |
307
+ | Support for more AI providers (Google, Azure, AWS, Ollama) | Complete |
308
+ | Enhanced diff analysis for better commit suggestions | 🚧 Planned |
309
+ | Custom prompt templates per project | 🚧 Planned |
310
+ | Integration with more Git hosting platforms | 🚧 Planned |
311
+ | Performance optimizations for large codebases | 🚧 Planned |
312
+ | Multi-language support for commit messages | 🚧 Planned |
313
+ | Team collaboration features | 🚧 Planned |
314
+ | Web UI for configuration management | 🚧 Planned |
137
315
 
138
316
  ## ❓ FAQ
139
317
 
140
- **Q: How does the AI generate commit messages?** A: The plugin analyzes your git diff and changed files, then uses AI to understand the changes and generate appropriate conventional commit messages that comply with your commitlint rules.
318
+ **Q: How does the AI generate commit messages?**
319
+ A: The plugin analyzes your git diff and changed files, then uses AI to understand the changes and generate appropriate conventional commit messages that comply with your commitlint rules.
320
+
321
+ **Q: What happens if the AI service is unavailable?**
322
+ A: The plugin has a configurable retry mechanism and will automatically fall back to manual mode after exhausting retries, allowing you to enter commit messages traditionally.
323
+
324
+ **Q: Can I use custom commit message formats?**
325
+ A: Yes, the plugin respects your commitlint configuration and generates messages accordingly. You can also provide custom instructions to guide the AI.
326
+
327
+ **Q: Is my code sent to the AI service?**
328
+ A: Only the git diff and file names are sent to generate accurate commit messages. No full source code is transmitted unless it appears in the diff.
329
+
330
+ **Q: How do I switch between providers or models?**
331
+ A: You can reconfigure at any time by running `git cz` and choosing to reconfigure when prompted, or by updating your configuration file.
332
+
333
+ **Q: How do I use Ollama with custom models?**
334
+ A: Set the model to `custom` and include the model name in your API key: `localhost:11434|your-custom-model`.
141
335
 
142
- **Q: What happens if the AI service is unavailable?** A: The plugin automatically falls back to manual mode, allowing you to enter commit messages traditionally.
336
+ **Q: What's the difference between provider API key formats?**
337
+ A: Each provider has specific requirements:
143
338
 
144
- **Q: Can I use custom commit message formats?** A: Yes, the plugin respects your commitlint configuration and generates messages accordingly.
339
+ - OpenAI/Anthropic/Google: Simple API key string
340
+ - Azure OpenAI: `endpoint|api-key|deployment-name`
341
+ - AWS Bedrock: `region|access-key-id|secret-access-key`
342
+ - Ollama: `host:port` or `host:port|custom-model-name`
145
343
 
146
- **Q: Is my code sent to the AI service?** A: Only the git diff and file names are sent to generate accurate commit messages. No full source code is transmitted.
344
+ **Q: What if I'm using an older model that's deprecated?**
345
+ A: The plugin automatically migrates deprecated models to their latest versions (e.g., `claude-3-5-sonnet-20240620` → `claude-3-5-sonnet-20241022`).
147
346
 
148
347
  ## 🔒 License
149
348
 
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Directory where configuration files are stored
3
+ */
4
+ export declare const CONFIG_FILE_DIRECTORY: string;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Directory where configuration files are stored
5
+ */
6
+ const CONFIG_FILE_DIRECTORY = ".elsikora";
7
+
8
+ exports.CONFIG_FILE_DIRECTORY = CONFIG_FILE_DIRECTORY;
9
+ //# sourceMappingURL=config-file-directory.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-file-directory.constant.js","sources":["../../../../../src/application/constant/config-file-directory.constant.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;AAEG;AACI,MAAM,qBAAqB,GAAW;;;;"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Module name for configuration
3
+ */
4
+ export declare const CONFIG_MODULE_NAME: string;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Module name for configuration
5
+ */
6
+ const CONFIG_MODULE_NAME = "commitlint-ai";
7
+
8
+ exports.CONFIG_MODULE_NAME = CONFIG_MODULE_NAME;
9
+ //# sourceMappingURL=config-module-name.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-module-name.constant.js","sources":["../../../../../src/application/constant/config-module-name.constant.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;AAEG;AACI,MAAM,kBAAkB,GAAW;;;;"}
@@ -0,0 +1,2 @@
1
+ export * from './config-file-directory.constant';
2
+ export * from './config-module-name.constant';
@@ -0,0 +1,2 @@
1
+ export type * from './interface/index';
2
+ export * from './use-case/index';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Options for select inputs in the CLI interface
3
+ */
4
+ export interface ICliInterfaceServiceSelectOptions {
5
+ /**
6
+ * Optional hint text for the option
7
+ */
8
+ hint?: string;
9
+ /**
10
+ * Whether the option is disabled
11
+ */
12
+ isDisabled?: boolean;
13
+ /**
14
+ * Display label for the option
15
+ */
16
+ label: string;
17
+ /**
18
+ * Value to be returned when the option is selected
19
+ */
20
+ value: string;
21
+ }
@@ -0,0 +1,105 @@
1
+ import type { ICliInterfaceServiceSelectOptions } from './cli-interface-service-select-options.interface';
2
+ /**
3
+ * Interface for CLI user interaction services.
4
+ * Provides methods for displaying information and collecting input from users.
5
+ */
6
+ export interface ICliInterfaceService {
7
+ /**
8
+ * Clears the console screen.
9
+ */
10
+ clear(): void;
11
+ /**
12
+ * Displays a confirmation prompt to the user.
13
+ * @param message - The message to display to the user
14
+ * @param isConfirmedByDefault - The default value for the confirmation, defaults to false
15
+ * @returns Promise that resolves to the user's response (true for confirmed, false for declined)
16
+ */
17
+ confirm(message: string, isConfirmedByDefault?: boolean): Promise<boolean>;
18
+ /**
19
+ * Displays an error message to the user.
20
+ * @param message - The error message to display
21
+ */
22
+ error(message: string): void;
23
+ /**
24
+ * Displays a grouped multi-select prompt to the user.
25
+ * @param message - The message to display to the user
26
+ * @param options - Record of groups and their options
27
+ * @param isRequired - Whether a selection is required, defaults to false
28
+ * @param initialValue - Initial selected values
29
+ * @returns Promise that resolves to an array of selected values
30
+ */
31
+ groupMultiselect<T>(message: string, options: Record<string, Array<ICliInterfaceServiceSelectOptions>>, isRequired?: boolean, initialValue?: Array<string>): Promise<Array<T>>;
32
+ /**
33
+ * Handles and displays an error message with additional error details.
34
+ * @param message - The error message to display
35
+ * @param error - The error object or details
36
+ */
37
+ handleError(message: string, error: unknown): void;
38
+ /**
39
+ * Displays an informational message to the user.
40
+ * @param message - The info message to display
41
+ */
42
+ info(message: string): void;
43
+ /**
44
+ * Displays a standard message to the user.
45
+ * @param message - The message to display
46
+ */
47
+ log(message: string): void;
48
+ /**
49
+ * Displays a multi-select prompt to the user.
50
+ * @param message - The message to display to the user
51
+ * @param options - Array of options to select from
52
+ * @param isRequired - Whether a selection is required, defaults to false
53
+ * @param initialValue - Initial selected values
54
+ * @returns Promise that resolves to an array of selected values
55
+ */
56
+ multiselect<T>(message: string, options: Array<ICliInterfaceServiceSelectOptions>, isRequired?: boolean, initialValue?: Array<string>): Promise<Array<T>>;
57
+ /**
58
+ * Displays a note to the user with a title and message.
59
+ * @param title - The title of the note
60
+ * @param message - The message content of the note
61
+ */
62
+ note(title: string, message: string): void;
63
+ /**
64
+ * Displays a single select prompt to the user.
65
+ * @param message - The message to display to the user
66
+ * @param options - Array of options to select from
67
+ * @param initialValue - Initial selected value
68
+ * @returns Promise that resolves to the selected value
69
+ */
70
+ select<T>(message: string, options: Array<ICliInterfaceServiceSelectOptions>, initialValue?: string): Promise<T>;
71
+ /**
72
+ * Starts a spinner with the specified message.
73
+ * @param message - The message to display while the spinner is active
74
+ */
75
+ startSpinner(message: string): void;
76
+ /**
77
+ * Stops the current spinner with an optional completion message.
78
+ * @param message - Optional message to display when the spinner stops
79
+ */
80
+ stopSpinner(message?: string): void;
81
+ /**
82
+ * Displays a success message to the user.
83
+ * @param message - The success message to display
84
+ */
85
+ success(message: string): void;
86
+ /**
87
+ * Displays a text input prompt to the user.
88
+ * @param message - The message to display to the user
89
+ * @param placeholder - Optional placeholder text for the input field
90
+ * @param initialValue - Optional initial value for the input field
91
+ * @param validate - Optional validation function for the input
92
+ * @returns Promise that resolves to the user's input text
93
+ */
94
+ text(message: string, placeholder?: string, initialValue?: string, validate?: (value: string) => Error | string | undefined): Promise<string>;
95
+ /**
96
+ * Updates the spinner message.
97
+ * @param message - The new message to display
98
+ */
99
+ updateSpinner(message: string): void;
100
+ /**
101
+ * Displays a warning message to the user.
102
+ * @param message - The warning message to display
103
+ */
104
+ warn(message: string): void;
105
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Interface for executing commands.
3
+ * Provides a method for executing shell commands.
4
+ */
5
+ export interface ICommandService {
6
+ /**
7
+ * Executes a shell command.
8
+ * @param command - The shell command to execute
9
+ * @returns Promise that resolves when the command completes successfully
10
+ * @throws May throw an error if the command execution fails
11
+ */
12
+ execute(command: string): Promise<void>;
13
+ /**
14
+ * Execute a command and return its output
15
+ * @param command - The command to execute
16
+ * @returns Promise that resolves to the command output
17
+ */
18
+ executeWithOutput(command: string): Promise<string>;
19
+ }
@@ -0,0 +1,32 @@
1
+ import type { CommitMessage } from '../../domain/entity/commit-message.entity';
2
+ /**
3
+ * Interface for commit repository operations
4
+ */
5
+ export interface ICommitRepository {
6
+ /**
7
+ * Create a commit with the given message
8
+ * @param message - The commit message
9
+ * @returns Promise that resolves when the commit is created
10
+ */
11
+ commit(message: CommitMessage): Promise<void>;
12
+ /**
13
+ * Get the current branch name
14
+ * @returns Promise resolving to the current branch name
15
+ */
16
+ getCurrentBranch(): Promise<string>;
17
+ /**
18
+ * Get the staged diff
19
+ * @returns Promise resolving to the staged diff
20
+ */
21
+ getStagedDiff(): Promise<string>;
22
+ /**
23
+ * Get the list of staged files
24
+ * @returns Promise resolving to the list of staged files
25
+ */
26
+ getStagedFiles(): Promise<Array<string>>;
27
+ /**
28
+ * Check if there are staged changes
29
+ * @returns Promise resolving to true if there are staged changes
30
+ */
31
+ hasStagedChanges(): Promise<boolean>;
32
+ }
@@ -0,0 +1,29 @@
1
+ import type { CommitMessage } from '../../domain/entity/commit-message.entity';
2
+ import type { ILlmPromptContext } from './llm-service.interface';
3
+ /**
4
+ * Validation result for a commit message
5
+ */
6
+ export interface ICommitValidationResult {
7
+ errors?: Array<string>;
8
+ isValid: boolean;
9
+ warnings?: Array<string>;
10
+ }
11
+ /**
12
+ * Interface for commit message validators
13
+ */
14
+ export interface ICommitValidator {
15
+ /**
16
+ * Attempt to fix a commit message based on validation errors
17
+ * @param message - The commit message to fix
18
+ * @param validationResult - The validation result containing errors
19
+ * @param context - Optional original context (diff, files, etc.) for better fixing
20
+ * @returns Promise resolving to the fixed commit message or null if unfixable
21
+ */
22
+ fix(message: CommitMessage, validationResult: ICommitValidationResult, context?: ILlmPromptContext): Promise<CommitMessage | null>;
23
+ /**
24
+ * Validate a commit message
25
+ * @param message - The commit message to validate
26
+ * @returns Promise resolving to the validation result
27
+ */
28
+ validate(message: CommitMessage): Promise<ICommitValidationResult>;
29
+ }