@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.
- package/README.md +256 -57
- package/dist/cjs/application/constant/config-file-directory.constant.d.ts +4 -0
- package/dist/cjs/application/constant/config-file-directory.constant.js +9 -0
- package/dist/cjs/application/constant/config-file-directory.constant.js.map +1 -0
- package/dist/cjs/application/constant/config-module-name.constant.d.ts +4 -0
- package/dist/cjs/application/constant/config-module-name.constant.js +9 -0
- package/dist/cjs/application/constant/config-module-name.constant.js.map +1 -0
- package/dist/cjs/application/constant/index.d.ts +2 -0
- package/dist/cjs/application/index.d.ts +2 -0
- package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts +21 -0
- package/dist/cjs/application/interface/cli-interface-service.interface.d.ts +105 -0
- package/dist/cjs/application/interface/command-service.interface.d.ts +19 -0
- package/dist/cjs/application/interface/commit-repository.interface.d.ts +32 -0
- package/dist/cjs/application/interface/commit-validator.interface.d.ts +29 -0
- package/dist/cjs/application/interface/config-service.interface.d.ts +47 -0
- package/dist/cjs/application/interface/config.interface.d.ts +27 -0
- package/dist/cjs/application/interface/file-system-service.interface.d.ts +61 -0
- package/dist/cjs/application/interface/index.d.ts +9 -0
- package/dist/cjs/application/interface/llm-service.interface.d.ts +43 -0
- package/dist/cjs/application/use-case/configure-llm.use-case.d.ts +39 -0
- package/dist/cjs/application/use-case/configure-llm.use-case.js +373 -0
- package/dist/cjs/application/use-case/configure-llm.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts +18 -0
- package/dist/cjs/application/use-case/generate-commit-message.use-case.js +49 -0
- package/dist/cjs/application/use-case/generate-commit-message.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/index.d.ts +4 -0
- package/dist/cjs/application/use-case/manual-commit.use-case.d.ts +16 -0
- package/dist/cjs/application/use-case/manual-commit.use-case.js +81 -0
- package/dist/cjs/application/use-case/manual-commit.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts +26 -0
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js +76 -0
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js.map +1 -0
- package/dist/cjs/domain/constant/index.d.ts +1 -0
- package/dist/cjs/domain/constant/numeric.constant.d.ts +25 -0
- package/dist/cjs/domain/constant/numeric.constant.js +42 -0
- package/dist/cjs/domain/constant/numeric.constant.js.map +1 -0
- package/dist/cjs/domain/entity/commit-message.entity.d.ts +47 -0
- package/dist/cjs/domain/entity/commit-message.entity.js +71 -0
- package/dist/cjs/domain/entity/commit-message.entity.js.map +1 -0
- package/dist/cjs/domain/entity/index.d.ts +2 -0
- package/dist/cjs/domain/entity/llm-configuration.entity.d.ts +73 -0
- package/dist/cjs/domain/entity/llm-configuration.entity.js +107 -0
- package/dist/cjs/domain/entity/llm-configuration.entity.js.map +1 -0
- package/dist/cjs/domain/enum/anthropic-model.enum.d.ts +18 -0
- package/dist/cjs/domain/enum/anthropic-model.enum.js +26 -0
- package/dist/cjs/domain/enum/anthropic-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts +33 -0
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.js +47 -0
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts +17 -0
- package/dist/cjs/domain/enum/azure-openai-model.enum.js +26 -0
- package/dist/cjs/domain/enum/azure-openai-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/commit-mode.enum.d.ts +7 -0
- package/dist/cjs/domain/enum/commit-mode.enum.js +11 -0
- package/dist/cjs/domain/enum/commit-mode.enum.js.map +1 -0
- package/dist/cjs/domain/enum/google-model.enum.d.ts +16 -0
- package/dist/cjs/domain/enum/google-model.enum.js +25 -0
- package/dist/cjs/domain/enum/google-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/index.d.ts +9 -0
- package/dist/cjs/domain/enum/llm-provider.enum.d.ts +11 -0
- package/dist/cjs/domain/enum/llm-provider.enum.js +15 -0
- package/dist/cjs/domain/enum/llm-provider.enum.js.map +1 -0
- package/dist/cjs/domain/enum/log-level.enum.d.ts +9 -0
- package/dist/cjs/domain/enum/log-level.enum.js +13 -0
- package/dist/cjs/domain/enum/log-level.enum.js.map +1 -0
- package/dist/cjs/domain/enum/ollama-model.enum.d.ts +24 -0
- package/dist/cjs/domain/enum/ollama-model.enum.js +30 -0
- package/dist/cjs/domain/enum/ollama-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/openai-model.enum.d.ts +25 -0
- package/dist/cjs/domain/enum/openai-model.enum.js +35 -0
- package/dist/cjs/domain/enum/openai-model.enum.js.map +1 -0
- package/dist/cjs/domain/index.d.ts +3 -0
- package/dist/cjs/domain/value-object/api-key.value-object.d.ts +28 -0
- package/dist/cjs/domain/value-object/api-key.value-object.js +51 -0
- package/dist/cjs/domain/value-object/api-key.value-object.js.map +1 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts +39 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.js +66 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.js.map +1 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.d.ts +35 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.js +63 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.js.map +1 -0
- package/dist/cjs/domain/value-object/index.d.ts +3 -0
- package/dist/cjs/index.d.ts +14 -12
- package/dist/cjs/index.js +85 -83
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts +38 -0
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js +207 -0
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -0
- package/dist/cjs/infrastructure/commit-validator/index.d.ts +1 -0
- package/dist/cjs/infrastructure/di/container.d.ts +17 -0
- package/dist/cjs/infrastructure/di/container.js +76 -0
- package/dist/cjs/infrastructure/di/container.js.map +1 -0
- package/dist/cjs/infrastructure/di/index.d.ts +1 -0
- package/dist/cjs/infrastructure/git/git-commit.repository.d.ts +36 -0
- package/dist/cjs/infrastructure/git/git-commit.repository.js +78 -0
- package/dist/cjs/infrastructure/git/git-commit.repository.js.map +1 -0
- package/dist/cjs/infrastructure/git/index.d.ts +1 -0
- package/dist/cjs/infrastructure/index.d.ts +4 -0
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts +39 -0
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js +323 -0
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts +60 -0
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js +514 -0
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js +351 -0
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/google-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/google-llm.service.js +335 -0
- package/dist/cjs/infrastructure/llm/google-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/index.d.ts +6 -0
- package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js +387 -0
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/openai-llm.service.js +339 -0
- package/dist/cjs/infrastructure/llm/openai-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts +66 -0
- package/dist/cjs/infrastructure/service/cosmic-config.service.js +176 -0
- package/dist/cjs/infrastructure/service/cosmic-config.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/index.d.ts +4 -0
- package/dist/cjs/infrastructure/service/node-command.service.d.ts +45 -0
- package/dist/cjs/infrastructure/service/node-command.service.js +154 -0
- package/dist/cjs/infrastructure/service/node-command.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/node-file-system.service.d.ts +62 -0
- package/dist/cjs/infrastructure/service/node-file-system.service.js +102 -0
- package/dist/cjs/infrastructure/service/node-file-system.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts +117 -0
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js +318 -0
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js.map +1 -0
- package/dist/cjs/presentation/commitizen.adapter.d.ts +28 -0
- package/dist/cjs/presentation/commitizen.adapter.js +304 -0
- package/dist/cjs/presentation/commitizen.adapter.js.map +1 -0
- package/dist/cjs/presentation/index.d.ts +1 -0
- package/dist/esm/application/constant/config-file-directory.constant.d.ts +4 -0
- package/dist/esm/application/constant/config-file-directory.constant.js +7 -0
- package/dist/esm/application/constant/config-file-directory.constant.js.map +1 -0
- package/dist/esm/application/constant/config-module-name.constant.d.ts +4 -0
- package/dist/esm/application/constant/config-module-name.constant.js +7 -0
- package/dist/esm/application/constant/config-module-name.constant.js.map +1 -0
- package/dist/esm/application/constant/index.d.ts +2 -0
- package/dist/esm/application/index.d.ts +2 -0
- package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts +21 -0
- package/dist/esm/application/interface/cli-interface-service.interface.d.ts +105 -0
- package/dist/esm/application/interface/command-service.interface.d.ts +19 -0
- package/dist/esm/application/interface/commit-repository.interface.d.ts +32 -0
- package/dist/esm/application/interface/commit-validator.interface.d.ts +29 -0
- package/dist/esm/application/interface/config-service.interface.d.ts +47 -0
- package/dist/esm/application/interface/config.interface.d.ts +27 -0
- package/dist/esm/application/interface/file-system-service.interface.d.ts +61 -0
- package/dist/esm/application/interface/index.d.ts +9 -0
- package/dist/esm/application/interface/llm-service.interface.d.ts +43 -0
- package/dist/esm/application/use-case/configure-llm.use-case.d.ts +39 -0
- package/dist/esm/application/use-case/configure-llm.use-case.js +371 -0
- package/dist/esm/application/use-case/configure-llm.use-case.js.map +1 -0
- package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts +18 -0
- package/dist/esm/application/use-case/generate-commit-message.use-case.js +47 -0
- package/dist/esm/application/use-case/generate-commit-message.use-case.js.map +1 -0
- package/dist/esm/application/use-case/index.d.ts +4 -0
- package/dist/esm/application/use-case/manual-commit.use-case.d.ts +16 -0
- package/dist/esm/application/use-case/manual-commit.use-case.js +79 -0
- package/dist/esm/application/use-case/manual-commit.use-case.js.map +1 -0
- package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts +26 -0
- package/dist/esm/application/use-case/validate-commit-message.use-case.js +74 -0
- package/dist/esm/application/use-case/validate-commit-message.use-case.js.map +1 -0
- package/dist/esm/domain/constant/index.d.ts +1 -0
- package/dist/esm/domain/constant/numeric.constant.d.ts +25 -0
- package/dist/esm/domain/constant/numeric.constant.js +26 -0
- package/dist/esm/domain/constant/numeric.constant.js.map +1 -0
- package/dist/esm/domain/entity/commit-message.entity.d.ts +47 -0
- package/dist/esm/domain/entity/commit-message.entity.js +69 -0
- package/dist/esm/domain/entity/commit-message.entity.js.map +1 -0
- package/dist/esm/domain/entity/index.d.ts +2 -0
- package/dist/esm/domain/entity/llm-configuration.entity.d.ts +73 -0
- package/dist/esm/domain/entity/llm-configuration.entity.js +105 -0
- package/dist/esm/domain/entity/llm-configuration.entity.js.map +1 -0
- package/dist/esm/domain/enum/anthropic-model.enum.d.ts +18 -0
- package/dist/esm/domain/enum/anthropic-model.enum.js +26 -0
- package/dist/esm/domain/enum/anthropic-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts +33 -0
- package/dist/esm/domain/enum/aws-bedrock-model.enum.js +47 -0
- package/dist/esm/domain/enum/aws-bedrock-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/azure-openai-model.enum.d.ts +17 -0
- package/dist/esm/domain/enum/azure-openai-model.enum.js +26 -0
- package/dist/esm/domain/enum/azure-openai-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/commit-mode.enum.d.ts +7 -0
- package/dist/esm/domain/enum/commit-mode.enum.js +11 -0
- package/dist/esm/domain/enum/commit-mode.enum.js.map +1 -0
- package/dist/esm/domain/enum/google-model.enum.d.ts +16 -0
- package/dist/esm/domain/enum/google-model.enum.js +25 -0
- package/dist/esm/domain/enum/google-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/index.d.ts +9 -0
- package/dist/esm/domain/enum/llm-provider.enum.d.ts +11 -0
- package/dist/esm/domain/enum/llm-provider.enum.js +15 -0
- package/dist/esm/domain/enum/llm-provider.enum.js.map +1 -0
- package/dist/esm/domain/enum/log-level.enum.d.ts +9 -0
- package/dist/esm/domain/enum/log-level.enum.js +13 -0
- package/dist/esm/domain/enum/log-level.enum.js.map +1 -0
- package/dist/esm/domain/enum/ollama-model.enum.d.ts +24 -0
- package/dist/esm/domain/enum/ollama-model.enum.js +30 -0
- package/dist/esm/domain/enum/ollama-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/openai-model.enum.d.ts +25 -0
- package/dist/esm/domain/enum/openai-model.enum.js +35 -0
- package/dist/esm/domain/enum/openai-model.enum.js.map +1 -0
- package/dist/esm/domain/index.d.ts +3 -0
- package/dist/esm/domain/value-object/api-key.value-object.d.ts +28 -0
- package/dist/esm/domain/value-object/api-key.value-object.js +49 -0
- package/dist/esm/domain/value-object/api-key.value-object.js.map +1 -0
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts +39 -0
- package/dist/esm/domain/value-object/commit-body.value-object.js +64 -0
- package/dist/esm/domain/value-object/commit-body.value-object.js.map +1 -0
- package/dist/esm/domain/value-object/commit-header.value-object.d.ts +35 -0
- package/dist/esm/domain/value-object/commit-header.value-object.js +61 -0
- package/dist/esm/domain/value-object/commit-header.value-object.js.map +1 -0
- package/dist/esm/domain/value-object/index.d.ts +3 -0
- package/dist/esm/index.d.ts +14 -12
- package/dist/esm/index.js +38 -82
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts +38 -0
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js +205 -0
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -0
- package/dist/esm/infrastructure/commit-validator/index.d.ts +1 -0
- package/dist/esm/infrastructure/di/container.d.ts +17 -0
- package/dist/esm/infrastructure/di/container.js +63 -0
- package/dist/esm/infrastructure/di/container.js.map +1 -0
- package/dist/esm/infrastructure/di/index.d.ts +1 -0
- package/dist/esm/infrastructure/git/git-commit.repository.d.ts +36 -0
- package/dist/esm/infrastructure/git/git-commit.repository.js +76 -0
- package/dist/esm/infrastructure/git/git-commit.repository.js.map +1 -0
- package/dist/esm/infrastructure/git/index.d.ts +1 -0
- package/dist/esm/infrastructure/index.d.ts +4 -0
- package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts +39 -0
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js +321 -0
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts +60 -0
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js +512 -0
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js +349 -0
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/google-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/google-llm.service.js +333 -0
- package/dist/esm/infrastructure/llm/google-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/index.d.ts +6 -0
- package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/ollama-llm.service.js +385 -0
- package/dist/esm/infrastructure/llm/ollama-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/openai-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/openai-llm.service.js +337 -0
- package/dist/esm/infrastructure/llm/openai-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/service/cosmic-config.service.d.ts +66 -0
- package/dist/esm/infrastructure/service/cosmic-config.service.js +174 -0
- package/dist/esm/infrastructure/service/cosmic-config.service.js.map +1 -0
- package/dist/esm/infrastructure/service/index.d.ts +4 -0
- package/dist/esm/infrastructure/service/node-command.service.d.ts +45 -0
- package/dist/esm/infrastructure/service/node-command.service.js +152 -0
- package/dist/esm/infrastructure/service/node-command.service.js.map +1 -0
- package/dist/esm/infrastructure/service/node-file-system.service.d.ts +62 -0
- package/dist/esm/infrastructure/service/node-file-system.service.js +100 -0
- package/dist/esm/infrastructure/service/node-file-system.service.js.map +1 -0
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts +117 -0
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js +316 -0
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js.map +1 -0
- package/dist/esm/package.json +19 -0
- package/dist/esm/presentation/commitizen.adapter.d.ts +28 -0
- package/dist/esm/presentation/commitizen.adapter.js +302 -0
- package/dist/esm/presentation/commitizen.adapter.js.map +1 -0
- package/dist/esm/presentation/index.d.ts +1 -0
- package/index.cjs +1 -2
- package/package.json +42 -25
- package/dist/cjs/ManualProcess.d.ts +0 -6
- package/dist/cjs/ManualProcess.d.ts.map +0 -1
- package/dist/cjs/ManualProcess.js +0 -111
- package/dist/cjs/ManualProcess.js.map +0 -1
- package/dist/cjs/Process.d.ts +0 -6
- package/dist/cjs/Process.d.ts.map +0 -1
- package/dist/cjs/Process.js +0 -176
- package/dist/cjs/Process.js.map +0 -1
- package/dist/cjs/Question.d.ts +0 -46
- package/dist/cjs/Question.d.ts.map +0 -1
- package/dist/cjs/SectionBody.d.ts +0 -4
- package/dist/cjs/SectionBody.d.ts.map +0 -1
- package/dist/cjs/SectionFooter.d.ts +0 -13
- package/dist/cjs/SectionFooter.d.ts.map +0 -1
- package/dist/cjs/SectionHeader.d.ts +0 -15
- package/dist/cjs/SectionHeader.d.ts.map +0 -1
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/services/commitConfirmation.d.ts +0 -3
- package/dist/cjs/services/commitConfirmation.d.ts.map +0 -1
- package/dist/cjs/services/commitConfirmation.js +0 -122
- package/dist/cjs/services/commitConfirmation.js.map +0 -1
- package/dist/cjs/services/commitlintConfig.d.ts +0 -4
- package/dist/cjs/services/commitlintConfig.d.ts.map +0 -1
- package/dist/cjs/services/commitlintConfig.js +0 -198
- package/dist/cjs/services/commitlintConfig.js.map +0 -1
- package/dist/cjs/services/commitlintValidator.d.ts +0 -26
- package/dist/cjs/services/commitlintValidator.d.ts.map +0 -1
- package/dist/cjs/services/commitlintValidator.js +0 -146
- package/dist/cjs/services/commitlintValidator.js.map +0 -1
- package/dist/cjs/services/getRuleQuestionConfig.d.ts +0 -4
- package/dist/cjs/services/getRuleQuestionConfig.d.ts.map +0 -1
- package/dist/cjs/services/llm/anthropic.d.ts +0 -3
- package/dist/cjs/services/llm/anthropic.d.ts.map +0 -1
- package/dist/cjs/services/llm/anthropic.js +0 -118
- package/dist/cjs/services/llm/anthropic.js.map +0 -1
- package/dist/cjs/services/llm/config.d.ts +0 -5
- package/dist/cjs/services/llm/config.d.ts.map +0 -1
- package/dist/cjs/services/llm/config.js +0 -181
- package/dist/cjs/services/llm/config.js.map +0 -1
- package/dist/cjs/services/llm/index.d.ts +0 -6
- package/dist/cjs/services/llm/index.d.ts.map +0 -1
- package/dist/cjs/services/llm/index.js +0 -399
- package/dist/cjs/services/llm/index.js.map +0 -1
- package/dist/cjs/services/llm/models.d.ts +0 -34
- package/dist/cjs/services/llm/models.d.ts.map +0 -1
- package/dist/cjs/services/llm/models.js +0 -65
- package/dist/cjs/services/llm/models.js.map +0 -1
- package/dist/cjs/services/llm/openai.d.ts +0 -3
- package/dist/cjs/services/llm/openai.d.ts.map +0 -1
- package/dist/cjs/services/llm/openai.js +0 -111
- package/dist/cjs/services/llm/openai.js.map +0 -1
- package/dist/cjs/services/llm/types.d.ts +0 -71
- package/dist/cjs/services/llm/types.d.ts.map +0 -1
- package/dist/cjs/store/defaultPromptConfigs.d.ts +0 -33
- package/dist/cjs/store/defaultPromptConfigs.d.ts.map +0 -1
- package/dist/cjs/store/defaultPromptConfigs.js +0 -39
- package/dist/cjs/store/defaultPromptConfigs.js.map +0 -1
- package/dist/cjs/store/prompts.d.ts +0 -6
- package/dist/cjs/store/prompts.d.ts.map +0 -1
- package/dist/cjs/store/prompts.js +0 -40
- package/dist/cjs/store/prompts.js.map +0 -1
- package/dist/cjs/store/rules.d.ts +0 -7
- package/dist/cjs/store/rules.d.ts.map +0 -1
- package/dist/cjs/types.d.ts +0 -3
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/utils/case-function.d.ts +0 -9
- package/dist/cjs/utils/case-function.d.ts.map +0 -1
- package/dist/cjs/utils/full-stop-function.d.ts +0 -9
- package/dist/cjs/utils/full-stop-function.d.ts.map +0 -1
- package/dist/cjs/utils/leading-blank-function.d.ts +0 -8
- package/dist/cjs/utils/leading-blank-function.d.ts.map +0 -1
- package/dist/cjs/utils/rules.d.ts +0 -26
- package/dist/cjs/utils/rules.d.ts.map +0 -1
- package/dist/esm/ManualProcess.d.ts +0 -6
- package/dist/esm/ManualProcess.d.ts.map +0 -1
- package/dist/esm/ManualProcess.js +0 -107
- package/dist/esm/ManualProcess.js.map +0 -1
- package/dist/esm/Process.d.ts +0 -6
- package/dist/esm/Process.d.ts.map +0 -1
- package/dist/esm/Process.js +0 -172
- package/dist/esm/Process.js.map +0 -1
- package/dist/esm/Question.d.ts +0 -46
- package/dist/esm/Question.d.ts.map +0 -1
- package/dist/esm/SectionBody.d.ts +0 -4
- package/dist/esm/SectionBody.d.ts.map +0 -1
- package/dist/esm/SectionFooter.d.ts +0 -13
- package/dist/esm/SectionFooter.d.ts.map +0 -1
- package/dist/esm/SectionHeader.d.ts +0 -15
- package/dist/esm/SectionHeader.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/services/commitConfirmation.d.ts +0 -3
- package/dist/esm/services/commitConfirmation.d.ts.map +0 -1
- package/dist/esm/services/commitConfirmation.js +0 -120
- package/dist/esm/services/commitConfirmation.js.map +0 -1
- package/dist/esm/services/commitlintConfig.d.ts +0 -4
- package/dist/esm/services/commitlintConfig.d.ts.map +0 -1
- package/dist/esm/services/commitlintConfig.js +0 -196
- package/dist/esm/services/commitlintConfig.js.map +0 -1
- package/dist/esm/services/commitlintValidator.d.ts +0 -26
- package/dist/esm/services/commitlintValidator.d.ts.map +0 -1
- package/dist/esm/services/commitlintValidator.js +0 -142
- package/dist/esm/services/commitlintValidator.js.map +0 -1
- package/dist/esm/services/getRuleQuestionConfig.d.ts +0 -4
- package/dist/esm/services/getRuleQuestionConfig.d.ts.map +0 -1
- package/dist/esm/services/llm/anthropic.d.ts +0 -3
- package/dist/esm/services/llm/anthropic.d.ts.map +0 -1
- package/dist/esm/services/llm/anthropic.js +0 -116
- package/dist/esm/services/llm/anthropic.js.map +0 -1
- package/dist/esm/services/llm/config.d.ts +0 -5
- package/dist/esm/services/llm/config.d.ts.map +0 -1
- package/dist/esm/services/llm/config.js +0 -178
- package/dist/esm/services/llm/config.js.map +0 -1
- package/dist/esm/services/llm/index.d.ts +0 -6
- package/dist/esm/services/llm/index.d.ts.map +0 -1
- package/dist/esm/services/llm/index.js +0 -394
- package/dist/esm/services/llm/index.js.map +0 -1
- package/dist/esm/services/llm/models.d.ts +0 -34
- package/dist/esm/services/llm/models.d.ts.map +0 -1
- package/dist/esm/services/llm/models.js +0 -60
- package/dist/esm/services/llm/models.js.map +0 -1
- package/dist/esm/services/llm/openai.d.ts +0 -3
- package/dist/esm/services/llm/openai.d.ts.map +0 -1
- package/dist/esm/services/llm/openai.js +0 -109
- package/dist/esm/services/llm/openai.js.map +0 -1
- package/dist/esm/services/llm/types.d.ts +0 -71
- package/dist/esm/services/llm/types.d.ts.map +0 -1
- package/dist/esm/store/defaultPromptConfigs.d.ts +0 -33
- package/dist/esm/store/defaultPromptConfigs.d.ts.map +0 -1
- package/dist/esm/store/defaultPromptConfigs.js +0 -35
- package/dist/esm/store/defaultPromptConfigs.js.map +0 -1
- package/dist/esm/store/prompts.d.ts +0 -6
- package/dist/esm/store/prompts.d.ts.map +0 -1
- package/dist/esm/store/prompts.js +0 -38
- package/dist/esm/store/prompts.js.map +0 -1
- package/dist/esm/store/rules.d.ts +0 -7
- package/dist/esm/store/rules.d.ts.map +0 -1
- package/dist/esm/types.d.ts +0 -3
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/utils/case-function.d.ts +0 -9
- package/dist/esm/utils/case-function.d.ts.map +0 -1
- package/dist/esm/utils/full-stop-function.d.ts +0 -9
- package/dist/esm/utils/full-stop-function.d.ts.map +0 -1
- package/dist/esm/utils/leading-blank-function.d.ts +0 -8
- package/dist/esm/utils/leading-blank-function.d.ts.map +0 -1
- package/dist/esm/utils/rules.d.ts +0 -26
- package/dist/esm/utils/rules.d.ts.map +0 -1
- 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.
|
|
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
|
|
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
|
-
- ✨ **
|
|
36
|
-
- ✨ **
|
|
37
|
-
- ✨ **
|
|
38
|
-
- ✨ **
|
|
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
|
-
|
|
103
|
+
The plugin will:
|
|
68
104
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
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
|
-
|
|
128
|
+
Environment variables take precedence over stored configuration.
|
|
90
129
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
###
|
|
134
|
+
### Configuration File Locations
|
|
98
135
|
|
|
99
|
-
|
|
100
|
-
import { getLLMConfig, setLLMConfig } from "@elsikora/commitizen-plugin-commitlint-ai";
|
|
136
|
+
Create a configuration file in any of these locations:
|
|
101
137
|
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
155
|
+
|
|
156
|
+
// Model to use (auto-migrates deprecated models)
|
|
157
|
+
model: "gpt-4o",
|
|
158
|
+
|
|
159
|
+
// Mode: 'auto' or 'manual'
|
|
106
160
|
mode: "auto",
|
|
107
|
-
|
|
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
|
-
###
|
|
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
|
-
//
|
|
259
|
+
// commitlint.config.js
|
|
115
260
|
export default {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
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?**
|
|
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
|
|
336
|
+
**Q: What's the difference between provider API key formats?**
|
|
337
|
+
A: Each provider has specific requirements:
|
|
143
338
|
|
|
144
|
-
|
|
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:
|
|
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 @@
|
|
|
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 @@
|
|
|
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,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
|
+
}
|