@elsikora/commitizen-plugin-commitlint-ai 2.0.0-dev.1 → 2.0.0
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 +71 -58
- package/dist/cjs/application/constant/config-file-directory.constant.d.ts +0 -1
- package/dist/cjs/application/constant/config-module-name.constant.d.ts +0 -1
- package/dist/cjs/application/constant/index.d.ts +2 -3
- package/dist/cjs/application/index.d.ts +2 -3
- package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts +0 -1
- package/dist/cjs/application/interface/cli-interface-service.interface.d.ts +1 -2
- package/dist/cjs/application/interface/command-service.interface.d.ts +0 -1
- package/dist/cjs/application/interface/commit-repository.interface.d.ts +1 -2
- package/dist/cjs/application/interface/commit-validator.interface.d.ts +2 -3
- package/dist/cjs/application/interface/config-service.interface.d.ts +2 -3
- package/dist/cjs/application/interface/config.interface.d.ts +2 -3
- package/dist/cjs/application/interface/file-system-service.interface.d.ts +0 -1
- package/dist/cjs/application/interface/index.d.ts +9 -10
- package/dist/cjs/application/interface/llm-service.interface.d.ts +2 -3
- package/dist/cjs/application/use-case/configure-llm.use-case.d.ts +11 -11
- package/dist/cjs/application/use-case/configure-llm.use-case.js +25 -19
- package/dist/cjs/application/use-case/configure-llm.use-case.js.map +1 -1
- package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts +8 -9
- package/dist/cjs/application/use-case/generate-commit-message.use-case.js +5 -5
- package/dist/cjs/application/use-case/index.d.ts +4 -5
- package/dist/cjs/application/use-case/manual-commit.use-case.d.ts +5 -6
- package/dist/cjs/application/use-case/manual-commit.use-case.js +4 -2
- package/dist/cjs/application/use-case/manual-commit.use-case.js.map +1 -1
- package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts +11 -12
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js +9 -8
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js.map +1 -1
- package/dist/cjs/domain/constant/index.d.ts +1 -2
- package/dist/cjs/domain/constant/numeric.constant.d.ts +0 -1
- package/dist/cjs/domain/entity/commit-message.entity.d.ts +19 -7
- package/dist/cjs/domain/entity/commit-message.entity.js +19 -4
- package/dist/cjs/domain/entity/commit-message.entity.js.map +1 -1
- package/dist/cjs/domain/entity/index.d.ts +2 -3
- package/dist/cjs/domain/entity/llm-configuration.entity.d.ts +25 -18
- package/dist/cjs/domain/entity/llm-configuration.entity.js +27 -16
- package/dist/cjs/domain/entity/llm-configuration.entity.js.map +1 -1
- package/dist/cjs/domain/enum/anthropic-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/commit-mode.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/google-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/index.d.ts +9 -10
- package/dist/cjs/domain/enum/llm-provider.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/log-level.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/ollama-model.enum.d.ts +0 -1
- package/dist/cjs/domain/enum/openai-model.enum.d.ts +0 -1
- package/dist/cjs/domain/index.d.ts +3 -4
- package/dist/cjs/domain/value-object/api-key.value-object.d.ts +5 -4
- package/dist/cjs/domain/value-object/api-key.value-object.js +5 -3
- package/dist/cjs/domain/value-object/api-key.value-object.js.map +1 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts +7 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.js +7 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.js.map +1 -1
- package/dist/cjs/domain/value-object/commit-header.value-object.d.ts +6 -1
- package/dist/cjs/domain/value-object/commit-header.value-object.js +6 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.js.map +1 -1
- package/dist/cjs/domain/value-object/index.d.ts +3 -4
- package/dist/cjs/index.d.ts +15 -4
- package/dist/cjs/index.js +17 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts +15 -16
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js +13 -13
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -1
- package/dist/cjs/infrastructure/commit-validator/index.d.ts +1 -2
- package/dist/cjs/infrastructure/di/container.d.ts +1 -2
- package/dist/cjs/infrastructure/di/container.js +1 -1
- package/dist/cjs/infrastructure/di/index.d.ts +1 -2
- package/dist/cjs/infrastructure/git/git-commit.repository.d.ts +9 -10
- package/dist/cjs/infrastructure/git/git-commit.repository.js +6 -6
- package/dist/cjs/infrastructure/git/index.d.ts +1 -2
- package/dist/cjs/infrastructure/index.d.ts +4 -5
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts +14 -15
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js +25 -12
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts +23 -24
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js +44 -35
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js +29 -16
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/google-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/google-llm.service.js +27 -14
- package/dist/cjs/infrastructure/llm/google-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/index.d.ts +6 -7
- package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js +39 -21
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts +16 -17
- package/dist/cjs/infrastructure/llm/openai-llm.service.js +27 -14
- package/dist/cjs/infrastructure/llm/openai-llm.service.js.map +1 -1
- package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts +20 -19
- package/dist/cjs/infrastructure/service/cosmic-config.service.js +17 -15
- package/dist/cjs/infrastructure/service/cosmic-config.service.js.map +1 -1
- package/dist/cjs/infrastructure/service/index.d.ts +4 -5
- package/dist/cjs/infrastructure/service/node-command.service.d.ts +14 -13
- package/dist/cjs/infrastructure/service/node-command.service.js +12 -10
- package/dist/cjs/infrastructure/service/node-command.service.js.map +1 -1
- package/dist/cjs/infrastructure/service/node-file-system.service.d.ts +22 -23
- package/dist/cjs/infrastructure/service/node-file-system.service.js +21 -21
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts +39 -37
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js +37 -34
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js.map +1 -1
- package/dist/cjs/presentation/commitizen.adapter.d.ts +7 -3
- package/dist/cjs/presentation/commitizen.adapter.js +23 -11
- package/dist/cjs/presentation/commitizen.adapter.js.map +1 -1
- package/dist/cjs/presentation/index.d.ts +1 -2
- package/dist/esm/application/constant/config-file-directory.constant.d.ts +0 -1
- package/dist/esm/application/constant/config-module-name.constant.d.ts +0 -1
- package/dist/esm/application/constant/index.d.ts +2 -3
- package/dist/esm/application/index.d.ts +2 -3
- package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts +0 -1
- package/dist/esm/application/interface/cli-interface-service.interface.d.ts +1 -2
- package/dist/esm/application/interface/command-service.interface.d.ts +0 -1
- package/dist/esm/application/interface/commit-repository.interface.d.ts +1 -2
- package/dist/esm/application/interface/commit-validator.interface.d.ts +2 -3
- package/dist/esm/application/interface/config-service.interface.d.ts +2 -3
- package/dist/esm/application/interface/config.interface.d.ts +2 -3
- package/dist/esm/application/interface/file-system-service.interface.d.ts +0 -1
- package/dist/esm/application/interface/index.d.ts +9 -10
- package/dist/esm/application/interface/llm-service.interface.d.ts +2 -3
- package/dist/esm/application/use-case/configure-llm.use-case.d.ts +11 -11
- package/dist/esm/application/use-case/configure-llm.use-case.js +25 -19
- package/dist/esm/application/use-case/configure-llm.use-case.js.map +1 -1
- package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts +8 -9
- package/dist/esm/application/use-case/generate-commit-message.use-case.js +5 -5
- package/dist/esm/application/use-case/index.d.ts +4 -5
- package/dist/esm/application/use-case/manual-commit.use-case.d.ts +5 -6
- package/dist/esm/application/use-case/manual-commit.use-case.js +4 -2
- package/dist/esm/application/use-case/manual-commit.use-case.js.map +1 -1
- package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts +11 -12
- package/dist/esm/application/use-case/validate-commit-message.use-case.js +9 -8
- package/dist/esm/application/use-case/validate-commit-message.use-case.js.map +1 -1
- package/dist/esm/domain/constant/index.d.ts +1 -2
- package/dist/esm/domain/constant/numeric.constant.d.ts +0 -1
- package/dist/esm/domain/entity/commit-message.entity.d.ts +19 -7
- package/dist/esm/domain/entity/commit-message.entity.js +19 -4
- package/dist/esm/domain/entity/commit-message.entity.js.map +1 -1
- package/dist/esm/domain/entity/index.d.ts +2 -3
- package/dist/esm/domain/entity/llm-configuration.entity.d.ts +25 -18
- package/dist/esm/domain/entity/llm-configuration.entity.js +27 -16
- package/dist/esm/domain/entity/llm-configuration.entity.js.map +1 -1
- package/dist/esm/domain/enum/anthropic-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/azure-openai-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/commit-mode.enum.d.ts +0 -1
- package/dist/esm/domain/enum/google-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/index.d.ts +9 -10
- package/dist/esm/domain/enum/llm-provider.enum.d.ts +0 -1
- package/dist/esm/domain/enum/log-level.enum.d.ts +0 -1
- package/dist/esm/domain/enum/ollama-model.enum.d.ts +0 -1
- package/dist/esm/domain/enum/openai-model.enum.d.ts +0 -1
- package/dist/esm/domain/index.d.ts +3 -4
- package/dist/esm/domain/value-object/api-key.value-object.d.ts +5 -4
- package/dist/esm/domain/value-object/api-key.value-object.js +5 -3
- package/dist/esm/domain/value-object/api-key.value-object.js.map +1 -1
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts +7 -1
- package/dist/esm/domain/value-object/commit-body.value-object.js +7 -0
- package/dist/esm/domain/value-object/commit-body.value-object.js.map +1 -1
- package/dist/esm/domain/value-object/commit-header.value-object.d.ts +6 -1
- package/dist/esm/domain/value-object/commit-header.value-object.js +6 -0
- package/dist/esm/domain/value-object/commit-header.value-object.js.map +1 -1
- package/dist/esm/domain/value-object/index.d.ts +3 -4
- package/dist/esm/index.d.ts +15 -4
- package/dist/esm/index.js +15 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts +15 -16
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js +13 -13
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -1
- package/dist/esm/infrastructure/commit-validator/index.d.ts +1 -2
- package/dist/esm/infrastructure/di/container.d.ts +1 -2
- package/dist/esm/infrastructure/di/container.js +1 -1
- package/dist/esm/infrastructure/di/index.d.ts +1 -2
- package/dist/esm/infrastructure/git/git-commit.repository.d.ts +9 -10
- package/dist/esm/infrastructure/git/git-commit.repository.js +6 -6
- package/dist/esm/infrastructure/git/index.d.ts +1 -2
- package/dist/esm/infrastructure/index.d.ts +4 -5
- package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts +14 -15
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js +25 -12
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts +23 -24
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js +37 -28
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js +29 -16
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/google-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/google-llm.service.js +27 -14
- package/dist/esm/infrastructure/llm/google-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/index.d.ts +6 -7
- package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/ollama-llm.service.js +39 -21
- package/dist/esm/infrastructure/llm/ollama-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/llm/openai-llm.service.d.ts +16 -17
- package/dist/esm/infrastructure/llm/openai-llm.service.js +27 -14
- package/dist/esm/infrastructure/llm/openai-llm.service.js.map +1 -1
- package/dist/esm/infrastructure/service/cosmic-config.service.d.ts +20 -19
- package/dist/esm/infrastructure/service/cosmic-config.service.js +17 -15
- package/dist/esm/infrastructure/service/cosmic-config.service.js.map +1 -1
- package/dist/esm/infrastructure/service/index.d.ts +4 -5
- package/dist/esm/infrastructure/service/node-command.service.d.ts +14 -13
- package/dist/esm/infrastructure/service/node-command.service.js +12 -10
- package/dist/esm/infrastructure/service/node-command.service.js.map +1 -1
- package/dist/esm/infrastructure/service/node-file-system.service.d.ts +22 -23
- package/dist/esm/infrastructure/service/node-file-system.service.js +21 -21
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts +39 -37
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js +37 -34
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js.map +1 -1
- package/dist/esm/package.json +19 -0
- package/dist/esm/presentation/commitizen.adapter.d.ts +7 -3
- package/dist/esm/presentation/commitizen.adapter.js +23 -11
- package/dist/esm/presentation/commitizen.adapter.js.map +1 -1
- package/dist/esm/presentation/index.d.ts +1 -2
- package/package.json +11 -3
- package/dist/cjs/application/constant/config-file-directory.constant.d.ts.map +0 -1
- package/dist/cjs/application/constant/config-module-name.constant.d.ts.map +0 -1
- package/dist/cjs/application/constant/index.d.ts.map +0 -1
- package/dist/cjs/application/index.d.ts.map +0 -1
- package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/cli-interface-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/command-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/commit-repository.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/commit-validator.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/config-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/config.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/file-system-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/interface/index.d.ts.map +0 -1
- package/dist/cjs/application/interface/llm-service.interface.d.ts.map +0 -1
- package/dist/cjs/application/use-case/configure-llm.use-case.d.ts.map +0 -1
- package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts.map +0 -1
- package/dist/cjs/application/use-case/index.d.ts.map +0 -1
- package/dist/cjs/application/use-case/manual-commit.use-case.d.ts.map +0 -1
- package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts.map +0 -1
- package/dist/cjs/domain/constant/index.d.ts.map +0 -1
- package/dist/cjs/domain/constant/numeric.constant.d.ts.map +0 -1
- package/dist/cjs/domain/entity/commit-message.entity.d.ts.map +0 -1
- package/dist/cjs/domain/entity/index.d.ts.map +0 -1
- package/dist/cjs/domain/entity/llm-configuration.entity.d.ts.map +0 -1
- package/dist/cjs/domain/enum/anthropic-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/commit-mode.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/google-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/index.d.ts.map +0 -1
- package/dist/cjs/domain/enum/llm-provider.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/log-level.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/ollama-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/enum/openai-model.enum.d.ts.map +0 -1
- package/dist/cjs/domain/index.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/api-key.value-object.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/commit-header.value-object.d.ts.map +0 -1
- package/dist/cjs/domain/value-object/index.d.ts.map +0 -1
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/commit-validator/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/di/container.d.ts.map +0 -1
- package/dist/cjs/infrastructure/di/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/git/git-commit.repository.d.ts.map +0 -1
- package/dist/cjs/infrastructure/git/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/google-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/index.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/node-command.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/node-file-system.service.d.ts.map +0 -1
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts.map +0 -1
- package/dist/cjs/presentation/commitizen.adapter.d.ts.map +0 -1
- package/dist/cjs/presentation/index.d.ts.map +0 -1
- package/dist/esm/application/constant/config-file-directory.constant.d.ts.map +0 -1
- package/dist/esm/application/constant/config-module-name.constant.d.ts.map +0 -1
- package/dist/esm/application/constant/index.d.ts.map +0 -1
- package/dist/esm/application/index.d.ts.map +0 -1
- package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/cli-interface-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/command-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/commit-repository.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/commit-validator.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/config-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/config.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/file-system-service.interface.d.ts.map +0 -1
- package/dist/esm/application/interface/index.d.ts.map +0 -1
- package/dist/esm/application/interface/llm-service.interface.d.ts.map +0 -1
- package/dist/esm/application/use-case/configure-llm.use-case.d.ts.map +0 -1
- package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts.map +0 -1
- package/dist/esm/application/use-case/index.d.ts.map +0 -1
- package/dist/esm/application/use-case/manual-commit.use-case.d.ts.map +0 -1
- package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts.map +0 -1
- package/dist/esm/domain/constant/index.d.ts.map +0 -1
- package/dist/esm/domain/constant/numeric.constant.d.ts.map +0 -1
- package/dist/esm/domain/entity/commit-message.entity.d.ts.map +0 -1
- package/dist/esm/domain/entity/index.d.ts.map +0 -1
- package/dist/esm/domain/entity/llm-configuration.entity.d.ts.map +0 -1
- package/dist/esm/domain/enum/anthropic-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/azure-openai-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/commit-mode.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/google-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/index.d.ts.map +0 -1
- package/dist/esm/domain/enum/llm-provider.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/log-level.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/ollama-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/enum/openai-model.enum.d.ts.map +0 -1
- package/dist/esm/domain/index.d.ts.map +0 -1
- package/dist/esm/domain/value-object/api-key.value-object.d.ts.map +0 -1
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts.map +0 -1
- package/dist/esm/domain/value-object/commit-header.value-object.d.ts.map +0 -1
- package/dist/esm/domain/value-object/index.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/commit-validator/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/di/container.d.ts.map +0 -1
- package/dist/esm/infrastructure/di/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/git/git-commit.repository.d.ts.map +0 -1
- package/dist/esm/infrastructure/git/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/google-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/llm/openai-llm.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/cosmic-config.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/index.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/node-command.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/node-file-system.service.d.ts.map +0 -1
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts.map +0 -1
- package/dist/esm/presentation/commitizen.adapter.d.ts.map +0 -1
- package/dist/esm/presentation/index.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -51,15 +51,18 @@ The plugin is built using clean architecture principles with clear separation of
|
|
|
51
51
|
### Layers
|
|
52
52
|
|
|
53
53
|
- **Domain Layer**: Core business logic, entities, and value objects
|
|
54
|
+
|
|
54
55
|
- Entities: `CommitMessage`, `LLMConfiguration`
|
|
55
56
|
- Value Objects: `ApiKey`, `CommitBody`, `CommitHeader`
|
|
56
57
|
- Enums: `ECommitMode`, `ELLMProvider`, `ELogLevel`
|
|
57
58
|
|
|
58
59
|
- **Application Layer**: Use cases and interfaces
|
|
60
|
+
|
|
59
61
|
- Use Cases: `GenerateCommitMessageUseCase`, `ValidateCommitMessageUseCase`, `ConfigureLLMUseCase`
|
|
60
62
|
- Interfaces: `ILLMService`, `ICommitValidator`, `IConfigService`, etc.
|
|
61
63
|
|
|
62
64
|
- **Infrastructure Layer**: External services and implementations
|
|
65
|
+
|
|
63
66
|
- LLM Services: `OpenAILLMService`, `AnthropicLLMService`, `GoogleLLMService`, `AzureOpenAILLMService`, `AWSBedrockLLMService`, `OllamaLLMService`
|
|
64
67
|
- Services: `CommitlintValidatorService`, `CosmicConfigService`, `PromptsCliInterface`
|
|
65
68
|
- Repositories: `GitCommitRepository`
|
|
@@ -98,6 +101,7 @@ git cz
|
|
|
98
101
|
```
|
|
99
102
|
|
|
100
103
|
The plugin will:
|
|
104
|
+
|
|
101
105
|
1. Ask for your commit mode preference (auto/manual)
|
|
102
106
|
2. If auto mode and no API key is configured, guide you through configuration
|
|
103
107
|
3. Generate or help you write a commit message
|
|
@@ -130,6 +134,7 @@ The plugin supports multiple configuration methods using [Cosmiconfig](https://g
|
|
|
130
134
|
### Configuration File Locations
|
|
131
135
|
|
|
132
136
|
Create a configuration file in any of these locations:
|
|
137
|
+
|
|
133
138
|
- `.commitlintairc`
|
|
134
139
|
- `.commitlintairc.json`
|
|
135
140
|
- `.commitlintairc.yaml`
|
|
@@ -145,29 +150,29 @@ Create a configuration file in any of these locations:
|
|
|
145
150
|
```javascript
|
|
146
151
|
// commitlintai.config.js
|
|
147
152
|
module.exports = {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
153
|
+
// AI provider: 'openai', 'anthropic', 'google', 'azure-openai', 'aws-bedrock', or 'ollama'
|
|
154
|
+
provider: "openai",
|
|
155
|
+
|
|
156
|
+
// Model to use (auto-migrates deprecated models)
|
|
157
|
+
model: "gpt-4o",
|
|
158
|
+
|
|
159
|
+
// Mode: 'auto' or 'manual'
|
|
160
|
+
mode: "auto",
|
|
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",
|
|
171
176
|
};
|
|
172
177
|
```
|
|
173
178
|
|
|
@@ -176,19 +181,21 @@ module.exports = {
|
|
|
176
181
|
## Supported LLM Providers
|
|
177
182
|
|
|
178
183
|
### OpenAI
|
|
184
|
+
|
|
179
185
|
- `gpt-4.1` (Latest 2025, most capable)
|
|
180
186
|
- `gpt-4.1-nano` (Fastest 4.1 model)
|
|
181
187
|
- `gpt-4.1-mini` (Balanced performance)
|
|
182
188
|
- `gpt-4o` (Enhanced creative writing)
|
|
183
189
|
- `gpt-4o-mini` (Faster, cost-effective)
|
|
184
|
-
- `gpt-4-turbo`
|
|
190
|
+
- `gpt-4-turbo`
|
|
185
191
|
- `gpt-4` (Original)
|
|
186
192
|
- `gpt-3.5-turbo` (Fastest, most economical)
|
|
187
193
|
- `o1` (Enhanced reasoning)
|
|
188
194
|
- `o1-mini` (Fast reasoning)
|
|
189
195
|
|
|
190
196
|
### Anthropic
|
|
191
|
-
|
|
197
|
+
|
|
198
|
+
- `claude-opus-4-20250514` (Latest 2025, most capable)
|
|
192
199
|
- `claude-sonnet-4-20250514` (Latest 2025, high-performance)
|
|
193
200
|
- `claude-3-7-sonnet-latest` (Extended thinking capabilities)
|
|
194
201
|
- `claude-3-5-sonnet-latest` (Previous flagship)
|
|
@@ -196,6 +203,7 @@ module.exports = {
|
|
|
196
203
|
- `claude-3-opus-latest` (Complex tasks)
|
|
197
204
|
|
|
198
205
|
### Google (Gemini)
|
|
206
|
+
|
|
199
207
|
- `gemini-2.5-pro` (Latest 2025, most capable)
|
|
200
208
|
- `gemini-2.5-flash` (Latest 2025, fast)
|
|
201
209
|
- `gemini-2.0-flash-exp` (Experimental)
|
|
@@ -205,12 +213,14 @@ module.exports = {
|
|
|
205
213
|
- `gemini-1.0-pro`
|
|
206
214
|
|
|
207
215
|
### Google (Gemma - Open Models for Vertex AI)
|
|
216
|
+
|
|
208
217
|
- `gemma-3-27b` (Most capable open model)
|
|
209
218
|
- `gemma-3-12b` (Strong language capabilities)
|
|
210
219
|
- `gemma-3-4b` (Balanced, multimodal support)
|
|
211
220
|
- `gemma-3-1b` (Lightweight for edge deployment)
|
|
212
221
|
|
|
213
222
|
### Azure OpenAI
|
|
223
|
+
|
|
214
224
|
- `gpt-4.1-turbo-2024-12-17` (Latest 2025, most capable)
|
|
215
225
|
- `gpt-4.1-preview-2024-12-17` (Latest preview)
|
|
216
226
|
- `gpt-4.1-mini-2024-12-17` (Fast 4.1 model)
|
|
@@ -222,6 +232,7 @@ module.exports = {
|
|
|
222
232
|
- `o4-mini-2024-12-17` (Fast reasoning)
|
|
223
233
|
|
|
224
234
|
### AWS Bedrock
|
|
235
|
+
|
|
225
236
|
- `anthropic.claude-opus-4-20250514-v1:0` (Claude Opus 4 - Latest 2025, most capable)
|
|
226
237
|
- `anthropic.claude-sonnet-4-20250514-v1:0` (Claude Sonnet 4 - Latest 2025, balanced)
|
|
227
238
|
- `anthropic.claude-3-5-sonnet-20241022-v2:0` (Claude 3.5 Sonnet v2)
|
|
@@ -233,6 +244,7 @@ module.exports = {
|
|
|
233
244
|
- `mistral.mistral-large-2411-v1:0` (Latest Mistral)
|
|
234
245
|
|
|
235
246
|
### Ollama (Local Models)
|
|
247
|
+
|
|
236
248
|
- `llama3.2` (Latest Llama)
|
|
237
249
|
- `llama3.1`
|
|
238
250
|
- `llama3`
|
|
@@ -246,14 +258,14 @@ module.exports = {
|
|
|
246
258
|
```javascript
|
|
247
259
|
// commitlint.config.js
|
|
248
260
|
export default {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
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
|
+
},
|
|
268
|
+
};
|
|
257
269
|
```
|
|
258
270
|
|
|
259
271
|
### Manual Mode
|
|
@@ -270,36 +282,36 @@ touch .elsikora/manual
|
|
|
270
282
|
|
|
271
283
|
```json
|
|
272
284
|
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
285
|
+
"commitlintai": {
|
|
286
|
+
"provider": "anthropic",
|
|
287
|
+
"model": "claude-3-5-sonnet-20241022",
|
|
288
|
+
"mode": "auto",
|
|
289
|
+
"maxGenerationRetries": 5
|
|
290
|
+
}
|
|
279
291
|
}
|
|
280
292
|
```
|
|
281
293
|
|
|
282
294
|
## 🛣 Roadmap
|
|
283
295
|
|
|
284
|
-
| Task / Feature
|
|
285
|
-
|
|
|
286
|
-
| AI-powered commit message generation using OpenAI or Anthropic models
|
|
287
|
-
| Full integration with Commitlint rules and configuration
|
|
288
|
-
| Support for both manual and automatic commit modes
|
|
289
|
-
| Clean architecture implementation
|
|
290
|
-
| Cosmiconfig support for flexible configuration
|
|
291
|
-
| Environment variable support with priority over config
|
|
292
|
-
| Automatic model migration for deprecated models
|
|
293
|
-
| Configurable retry mechanism with UI feedback
|
|
294
|
-
| Dependency injection with @elsikora/cladi
|
|
295
|
-
| Support for more AI providers (Google, Azure, AWS, Ollama)
|
|
296
|
-
| Enhanced diff analysis for better commit suggestions
|
|
297
|
-
| Custom prompt templates per project
|
|
298
|
-
| Integration with more Git hosting platforms
|
|
299
|
-
| Performance optimizations for large codebases
|
|
300
|
-
| Multi-language support for commit messages
|
|
301
|
-
| Team collaboration features
|
|
302
|
-
| Web UI for configuration management
|
|
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 |
|
|
303
315
|
|
|
304
316
|
## ❓ FAQ
|
|
305
317
|
|
|
@@ -323,6 +335,7 @@ A: Set the model to `custom` and include the model name in your API key: `localh
|
|
|
323
335
|
|
|
324
336
|
**Q: What's the difference between provider API key formats?**
|
|
325
337
|
A: Each provider has specific requirements:
|
|
338
|
+
|
|
326
339
|
- OpenAI/Anthropic/Google: Simple API key string
|
|
327
340
|
- Azure OpenAI: `endpoint|api-key|deployment-name`
|
|
328
341
|
- AWS Bedrock: `region|access-key-id|secret-access-key`
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './config-file-directory.constant';
|
|
2
|
+
export * from './config-module-name.constant';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export type * from
|
|
2
|
-
export * from
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export type * from './interface/index';
|
|
2
|
+
export * from './use-case/index';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICliInterfaceServiceSelectOptions } from
|
|
1
|
+
import type { ICliInterfaceServiceSelectOptions } from './cli-interface-service-select-options.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Interface for CLI user interaction services.
|
|
4
4
|
* Provides methods for displaying information and collecting input from users.
|
|
@@ -103,4 +103,3 @@ export interface ICliInterfaceService {
|
|
|
103
103
|
*/
|
|
104
104
|
warn(message: string): void;
|
|
105
105
|
}
|
|
106
|
-
//# sourceMappingURL=cli-interface-service.interface.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommitMessage } from
|
|
1
|
+
import type { CommitMessage } from '../../domain/entity/commit-message.entity';
|
|
2
2
|
/**
|
|
3
3
|
* Interface for commit repository operations
|
|
4
4
|
*/
|
|
@@ -30,4 +30,3 @@ export interface ICommitRepository {
|
|
|
30
30
|
*/
|
|
31
31
|
hasStagedChanges(): Promise<boolean>;
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=commit-repository.interface.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CommitMessage } from
|
|
2
|
-
import type { ILlmPromptContext } from
|
|
1
|
+
import type { CommitMessage } from '../../domain/entity/commit-message.entity';
|
|
2
|
+
import type { ILlmPromptContext } from './llm-service.interface';
|
|
3
3
|
/**
|
|
4
4
|
* Validation result for a commit message
|
|
5
5
|
*/
|
|
@@ -27,4 +27,3 @@ export interface ICommitValidator {
|
|
|
27
27
|
*/
|
|
28
28
|
validate(message: CommitMessage): Promise<ICommitValidationResult>;
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=commit-validator.interface.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IConfig } from
|
|
2
|
-
import type { IFileSystemService } from
|
|
1
|
+
import type { IConfig } from './config.interface';
|
|
2
|
+
import type { IFileSystemService } from './file-system-service.interface';
|
|
3
3
|
/**
|
|
4
4
|
* Interface for managing application configuration.
|
|
5
5
|
* Defines contract for reading, writing, and manipulating configuration settings.
|
|
@@ -45,4 +45,3 @@ export interface IConfigService {
|
|
|
45
45
|
*/
|
|
46
46
|
setProperty<K extends keyof IConfig>(property: K, value: IConfig[K]): Promise<void>;
|
|
47
47
|
}
|
|
48
|
-
//# sourceMappingURL=config-service.interface.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ECommitMode } from
|
|
2
|
-
import type { ELLMProvider } from
|
|
1
|
+
import type { ECommitMode } from '../../domain/enum/commit-mode.enum';
|
|
2
|
+
import type { ELLMProvider } from '../../domain/enum/llm-provider.enum';
|
|
3
3
|
/**
|
|
4
4
|
* Main configuration interface
|
|
5
5
|
*/
|
|
@@ -25,4 +25,3 @@ export interface IConfig {
|
|
|
25
25
|
*/
|
|
26
26
|
validationMaxRetries?: number;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=config.interface.d.ts.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export type * from
|
|
2
|
-
export type * from
|
|
3
|
-
export type * from
|
|
4
|
-
export type * from
|
|
5
|
-
export type * from
|
|
6
|
-
export type * from
|
|
7
|
-
export type * from
|
|
8
|
-
export type * from
|
|
9
|
-
export type * from
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export type * from './cli-interface-service-select-options.interface';
|
|
2
|
+
export type * from './cli-interface-service.interface';
|
|
3
|
+
export type * from './command-service.interface';
|
|
4
|
+
export type * from './commit-repository.interface';
|
|
5
|
+
export type * from './commit-validator.interface';
|
|
6
|
+
export type * from './config-service.interface';
|
|
7
|
+
export type * from './config.interface';
|
|
8
|
+
export type * from './file-system-service.interface';
|
|
9
|
+
export type * from './llm-service.interface';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CommitMessage } from
|
|
2
|
-
import type { LLMConfiguration } from
|
|
1
|
+
import type { CommitMessage } from '../../domain/entity/commit-message.entity';
|
|
2
|
+
import type { LLMConfiguration } from '../../domain/entity/llm-configuration.entity';
|
|
3
3
|
/**
|
|
4
4
|
* Context for generating commit messages
|
|
5
5
|
*/
|
|
@@ -41,4 +41,3 @@ export interface ILlmService {
|
|
|
41
41
|
*/
|
|
42
42
|
supports(configuration: LLMConfiguration): boolean;
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=llm-service.interface.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import type { ICliInterfaceService } from '../interface/cli-interface-service.interface';
|
|
2
|
+
import type { IConfigService } from '../interface/config-service.interface';
|
|
3
|
+
import { LLMConfiguration } from '../../domain/entity/llm-configuration.entity';
|
|
4
|
+
import { ECommitMode } from '../../domain/enum/commit-mode.enum';
|
|
5
5
|
/**
|
|
6
6
|
* Use case for configuring LLM settings
|
|
7
7
|
*/
|
|
@@ -11,29 +11,29 @@ export declare class ConfigureLLMUseCase {
|
|
|
11
11
|
constructor(configService: IConfigService, cliInterface: ICliInterfaceService);
|
|
12
12
|
/**
|
|
13
13
|
* Configure LLM settings interactively
|
|
14
|
-
* @returns Promise resolving to the new configuration
|
|
14
|
+
* @returns {Promise<LLMConfiguration>} Promise resolving to the new configuration
|
|
15
15
|
*/
|
|
16
16
|
configureInteractively(): Promise<LLMConfiguration>;
|
|
17
17
|
/**
|
|
18
18
|
* Get the current LLM configuration
|
|
19
|
-
* @returns Promise resolving to the current configuration or null if not configured
|
|
19
|
+
* @returns {Promise<LLMConfiguration | null>} Promise resolving to the current configuration or null if not configured
|
|
20
20
|
*/
|
|
21
21
|
getCurrentConfiguration(): Promise<LLMConfiguration | null>;
|
|
22
22
|
/**
|
|
23
23
|
* Check if the current configuration needs LLM details
|
|
24
|
-
* @returns Promise resolving to true if LLM details are needed
|
|
24
|
+
* @returns {Promise<boolean>} Promise resolving to true if LLM details are needed
|
|
25
25
|
*/
|
|
26
26
|
needsLLMDetails(): Promise<boolean>;
|
|
27
27
|
/**
|
|
28
28
|
* Save LLM configuration
|
|
29
|
-
* @param configuration - The configuration to save
|
|
29
|
+
* @param {LLMConfiguration} configuration - The configuration to save
|
|
30
|
+
* @returns {Promise<void>} Promise that resolves when configuration is saved
|
|
30
31
|
*/
|
|
31
32
|
saveConfiguration(configuration: LLMConfiguration): Promise<void>;
|
|
32
33
|
/**
|
|
33
34
|
* Update the commit mode
|
|
34
|
-
* @param mode - The new commit mode
|
|
35
|
-
* @returns Promise resolving to the updated configuration
|
|
35
|
+
* @param {ECommitMode} mode - The new commit mode
|
|
36
|
+
* @returns {Promise<LLMConfiguration | null>} Promise resolving to the updated configuration
|
|
36
37
|
*/
|
|
37
38
|
updateMode(mode: ECommitMode): Promise<LLMConfiguration | null>;
|
|
38
39
|
}
|
|
39
|
-
//# sourceMappingURL=configure-llm.use-case.d.ts.map
|
|
@@ -5,6 +5,7 @@ var llmConfiguration_entity = require('../../domain/entity/llm-configuration.ent
|
|
|
5
5
|
var anthropicModel_enum = require('../../domain/enum/anthropic-model.enum.js');
|
|
6
6
|
var awsBedrockModel_enum = require('../../domain/enum/aws-bedrock-model.enum.js');
|
|
7
7
|
var azureOpenaiModel_enum = require('../../domain/enum/azure-openai-model.enum.js');
|
|
8
|
+
var commitMode_enum = require('../../domain/enum/commit-mode.enum.js');
|
|
8
9
|
var googleModel_enum = require('../../domain/enum/google-model.enum.js');
|
|
9
10
|
var llmProvider_enum = require('../../domain/enum/llm-provider.enum.js');
|
|
10
11
|
var ollamaModel_enum = require('../../domain/enum/ollama-model.enum.js');
|
|
@@ -23,16 +24,16 @@ class ConfigureLLMUseCase {
|
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Configure LLM settings interactively
|
|
26
|
-
* @returns Promise resolving to the new configuration
|
|
27
|
+
* @returns {Promise<LLMConfiguration>} Promise resolving to the new configuration
|
|
27
28
|
*/
|
|
28
29
|
async configureInteractively() {
|
|
29
30
|
// First, select mode
|
|
30
31
|
const mode = await this.CLI_INTERFACE.select("Select commit mode:", [
|
|
31
|
-
{ label: "Auto (AI-powered)", value:
|
|
32
|
-
{ label: "Manual", value:
|
|
33
|
-
],
|
|
32
|
+
{ label: "Auto (AI-powered)", value: commitMode_enum.ECommitMode.AUTO },
|
|
33
|
+
{ label: "Manual", value: commitMode_enum.ECommitMode.MANUAL },
|
|
34
|
+
], commitMode_enum.ECommitMode.AUTO);
|
|
34
35
|
// If manual mode, create a minimal configuration
|
|
35
|
-
if (mode ===
|
|
36
|
+
if (mode === commitMode_enum.ECommitMode.MANUAL) {
|
|
36
37
|
// Create configuration with dummy values for manual mode
|
|
37
38
|
const configuration = new llmConfiguration_entity.LLMConfiguration("openai", // Default provider (won't be used)
|
|
38
39
|
new apiKey_valueObject.ApiKey("manual-mode"), // Dummy API key
|
|
@@ -146,7 +147,7 @@ class ConfigureLLMUseCase {
|
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
// Get API key
|
|
149
|
-
let
|
|
150
|
+
let credentialValue;
|
|
150
151
|
// Check environment variables first
|
|
151
152
|
const environmentVariableNames = {
|
|
152
153
|
anthropic: "ANTHROPIC_API_KEY",
|
|
@@ -156,11 +157,11 @@ class ConfigureLLMUseCase {
|
|
|
156
157
|
ollama: "OLLAMA_API_KEY",
|
|
157
158
|
openai: "OPENAI_API_KEY",
|
|
158
159
|
};
|
|
159
|
-
const environmentVariableName = environmentVariableNames[provider]
|
|
160
|
+
const environmentVariableName = environmentVariableNames[provider] ?? "";
|
|
160
161
|
const environmentApiKey = process.env[environmentVariableName];
|
|
161
162
|
if (environmentApiKey && environmentApiKey.trim().length > 0) {
|
|
162
163
|
this.CLI_INTERFACE.success(`Found API key in environment variable: ${environmentVariableName}`);
|
|
163
|
-
|
|
164
|
+
credentialValue = environmentApiKey;
|
|
164
165
|
}
|
|
165
166
|
else {
|
|
166
167
|
// Inform user about environment variable and format requirements
|
|
@@ -201,7 +202,7 @@ class ConfigureLLMUseCase {
|
|
|
201
202
|
}
|
|
202
203
|
this.CLI_INTERFACE.info(`API key will be read from ${environmentVariableName} environment variable${keyFormatInfo} or prompted each time.`);
|
|
203
204
|
// Use dummy value for configuration
|
|
204
|
-
|
|
205
|
+
credentialValue = "will-prompt-on-use";
|
|
205
206
|
}
|
|
206
207
|
// Ask for retry configuration (advanced settings)
|
|
207
208
|
const shouldConfigureAdvanced = await this.CLI_INTERFACE.confirm("Would you like to configure advanced settings (retry counts)?", false);
|
|
@@ -213,6 +214,8 @@ class ConfigureLLMUseCase {
|
|
|
213
214
|
if (Number.isNaN(parsedNumber) || parsedNumber < numeric_constant.MIN_RETRY_COUNT || parsedNumber > numeric_constant.MAX_RETRY_COUNT) {
|
|
214
215
|
return "Please enter a number between 1 and 10";
|
|
215
216
|
}
|
|
217
|
+
// eslint-disable-next-line @elsikora/sonar/no-redundant-jump
|
|
218
|
+
return;
|
|
216
219
|
});
|
|
217
220
|
maxRetries = Number.parseInt(retriesString, 10);
|
|
218
221
|
const validationRetriesString = await this.CLI_INTERFACE.text("Max retries for validation fixes (default: 3):", "3", "3", (value) => {
|
|
@@ -220,12 +223,14 @@ class ConfigureLLMUseCase {
|
|
|
220
223
|
if (Number.isNaN(parsedNumber) || parsedNumber < numeric_constant.MIN_RETRY_COUNT || parsedNumber > numeric_constant.MAX_RETRY_COUNT) {
|
|
221
224
|
return "Please enter a number between 1 and 10";
|
|
222
225
|
}
|
|
226
|
+
// eslint-disable-next-line @elsikora/sonar/no-redundant-jump
|
|
227
|
+
return;
|
|
223
228
|
});
|
|
224
229
|
validationMaxRetries = Number.parseInt(validationRetriesString, 10);
|
|
225
230
|
}
|
|
226
231
|
// Create configuration
|
|
227
232
|
// Create configuration - will save without API key
|
|
228
|
-
const configuration = new llmConfiguration_entity.LLMConfiguration(provider, new apiKey_valueObject.ApiKey(
|
|
233
|
+
const configuration = new llmConfiguration_entity.LLMConfiguration(provider, new apiKey_valueObject.ApiKey(credentialValue), mode, model, maxRetries, validationMaxRetries);
|
|
229
234
|
// Save configuration (without API key)
|
|
230
235
|
await this.saveConfiguration(configuration);
|
|
231
236
|
this.CLI_INTERFACE.success("Configuration saved successfully!");
|
|
@@ -235,7 +240,7 @@ class ConfigureLLMUseCase {
|
|
|
235
240
|
}
|
|
236
241
|
/**
|
|
237
242
|
* Get the current LLM configuration
|
|
238
|
-
* @returns Promise resolving to the current configuration or null if not configured
|
|
243
|
+
* @returns {Promise<LLMConfiguration | null>} Promise resolving to the current configuration or null if not configured
|
|
239
244
|
*/
|
|
240
245
|
async getCurrentConfiguration() {
|
|
241
246
|
const config = await this.CONFIG_SERVICE.get();
|
|
@@ -290,7 +295,7 @@ class ConfigureLLMUseCase {
|
|
|
290
295
|
}
|
|
291
296
|
}
|
|
292
297
|
// For manual mode, return configuration with dummy API key
|
|
293
|
-
if (config.mode ===
|
|
298
|
+
if (config.mode === commitMode_enum.ECommitMode.MANUAL) {
|
|
294
299
|
return new llmConfiguration_entity.LLMConfiguration(config.provider, new apiKey_valueObject.ApiKey("manual-mode"), config.mode, migratedModel, config.maxRetries ?? numeric_constant.DEFAULT_MAX_RETRIES, config.validationMaxRetries ?? numeric_constant.DEFAULT_VALIDATION_MAX_RETRIES);
|
|
295
300
|
}
|
|
296
301
|
// For auto mode, check environment variables
|
|
@@ -302,7 +307,7 @@ class ConfigureLLMUseCase {
|
|
|
302
307
|
ollama: "OLLAMA_API_KEY",
|
|
303
308
|
openai: "OPENAI_API_KEY",
|
|
304
309
|
};
|
|
305
|
-
const environmentVariableName = environmentVariableNames[config.provider]
|
|
310
|
+
const environmentVariableName = environmentVariableNames[config.provider] ?? "";
|
|
306
311
|
const environmentApiKey = process.env[environmentVariableName];
|
|
307
312
|
// If no API key in environment, return null (will prompt later)
|
|
308
313
|
if (!environmentApiKey || environmentApiKey.trim().length === 0) {
|
|
@@ -312,11 +317,11 @@ class ConfigureLLMUseCase {
|
|
|
312
317
|
}
|
|
313
318
|
/**
|
|
314
319
|
* Check if the current configuration needs LLM details
|
|
315
|
-
* @returns Promise resolving to true if LLM details are needed
|
|
320
|
+
* @returns {Promise<boolean>} Promise resolving to true if LLM details are needed
|
|
316
321
|
*/
|
|
317
322
|
async needsLLMDetails() {
|
|
318
323
|
const config = await this.CONFIG_SERVICE.get();
|
|
319
|
-
if (!config.mode || config.mode ===
|
|
324
|
+
if (!config.mode || config.mode === commitMode_enum.ECommitMode.MANUAL) {
|
|
320
325
|
return false;
|
|
321
326
|
}
|
|
322
327
|
// For auto mode, check if API key is in environment
|
|
@@ -328,14 +333,15 @@ class ConfigureLLMUseCase {
|
|
|
328
333
|
ollama: "OLLAMA_API_KEY",
|
|
329
334
|
openai: "OPENAI_API_KEY",
|
|
330
335
|
};
|
|
331
|
-
const environmentVariableName = environmentVariableNames[config.provider]
|
|
336
|
+
const environmentVariableName = environmentVariableNames[config.provider] ?? "";
|
|
332
337
|
const environmentApiKey = process.env[environmentVariableName];
|
|
333
338
|
// Need details if no API key in environment
|
|
334
339
|
return !environmentApiKey || environmentApiKey.trim().length === 0;
|
|
335
340
|
}
|
|
336
341
|
/**
|
|
337
342
|
* Save LLM configuration
|
|
338
|
-
* @param configuration - The configuration to save
|
|
343
|
+
* @param {LLMConfiguration} configuration - The configuration to save
|
|
344
|
+
* @returns {Promise<void>} Promise that resolves when configuration is saved
|
|
339
345
|
*/
|
|
340
346
|
async saveConfiguration(configuration) {
|
|
341
347
|
const config = {
|
|
@@ -349,8 +355,8 @@ class ConfigureLLMUseCase {
|
|
|
349
355
|
}
|
|
350
356
|
/**
|
|
351
357
|
* Update the commit mode
|
|
352
|
-
* @param mode - The new commit mode
|
|
353
|
-
* @returns Promise resolving to the updated configuration
|
|
358
|
+
* @param {ECommitMode} mode - The new commit mode
|
|
359
|
+
* @returns {Promise<LLMConfiguration | null>} Promise resolving to the updated configuration
|
|
354
360
|
*/
|
|
355
361
|
async updateMode(mode) {
|
|
356
362
|
const current = await this.getCurrentConfiguration();
|