@elsikora/commitizen-plugin-commitlint-ai 2.0.0-dev.1 → 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 +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
|
@@ -8,10 +8,10 @@ import path from 'node:path';
|
|
|
8
8
|
class NodeFileSystemService {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a directory at the specified path.
|
|
11
|
-
* @param directoryPath - The path to the directory to create
|
|
12
|
-
* @param options - Optional configuration for directory creation
|
|
13
|
-
* @param options.isRecursive - Whether to create parent directories if they don't exist
|
|
14
|
-
* @returns Promise that resolves when the directory is created
|
|
11
|
+
* @param {string} directoryPath - The path to the directory to create
|
|
12
|
+
* @param {{ isRecursive: boolean }} options - Optional configuration for directory creation
|
|
13
|
+
* @param {boolean} options.isRecursive - Whether to create parent directories if they don't exist
|
|
14
|
+
* @returns {Promise<void>} Promise that resolves when the directory is created
|
|
15
15
|
*/
|
|
16
16
|
async createDirectory(directoryPath, options) {
|
|
17
17
|
directoryPath = path.dirname(directoryPath);
|
|
@@ -20,32 +20,32 @@ class NodeFileSystemService {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Deletes a file at the specified path.
|
|
23
|
-
* @param filePath - The path to the file to delete
|
|
24
|
-
* @returns Promise that resolves when the file is deleted
|
|
23
|
+
* @param {string} filePath - The path to the file to delete
|
|
24
|
+
* @returns {Promise<void>} Promise that resolves when the file is deleted
|
|
25
25
|
*/
|
|
26
26
|
async deleteFile(filePath) {
|
|
27
27
|
await fs.unlink(filePath);
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Gets the directory name from a file path.
|
|
31
|
-
* @param filePath
|
|
32
|
-
* @returns The directory name
|
|
31
|
+
* @param {string} filePath - The file path to extract the directory from
|
|
32
|
+
* @returns {string} The directory name
|
|
33
33
|
*/
|
|
34
34
|
getDirectoryNameFromFilePath(filePath) {
|
|
35
35
|
return path.dirname(filePath);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Gets the extension from a file path.
|
|
39
|
-
* @param filePath
|
|
40
|
-
* @returns The file extension
|
|
39
|
+
* @param {string} filePath - The file path to extract the extension from
|
|
40
|
+
* @returns {string} The file extension
|
|
41
41
|
*/
|
|
42
42
|
getExtensionFromFilePath(filePath) {
|
|
43
43
|
return path.extname(filePath);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Checks if any of the provided paths exist and returns the first existing path.
|
|
47
|
-
* @param paths - Array of paths to check
|
|
48
|
-
* @returns Promise that resolves to the first existing path or undefined if none exist
|
|
47
|
+
* @param {Array<string>} paths - Array of paths to check
|
|
48
|
+
* @returns {Promise<string | undefined>} Promise that resolves to the first existing path or undefined if none exist
|
|
49
49
|
*/
|
|
50
50
|
async isOneOfPathsExists(paths) {
|
|
51
51
|
let existingFilePath = undefined;
|
|
@@ -59,8 +59,8 @@ class NodeFileSystemService {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Checks if a file or directory exists at the specified path.
|
|
62
|
-
* @param filePath - The path to check
|
|
63
|
-
* @returns Promise that resolves to true if the path exists, false otherwise
|
|
62
|
+
* @param {string} filePath - The path to check
|
|
63
|
+
* @returns {Promise<boolean>} Promise that resolves to true if the path exists, false otherwise
|
|
64
64
|
*/
|
|
65
65
|
async isPathExists(filePath) {
|
|
66
66
|
try {
|
|
@@ -73,9 +73,9 @@ class NodeFileSystemService {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Reads the contents of a file.
|
|
76
|
-
* @param filePath - The path to the file to read
|
|
77
|
-
* @param encoding - The encoding to use when reading the file, defaults to "utf8"
|
|
78
|
-
* @returns Promise that resolves to the file contents as a string
|
|
76
|
+
* @param {string} filePath - The path to the file to read
|
|
77
|
+
* @param {string} encoding - The encoding to use when reading the file, defaults to "utf8"
|
|
78
|
+
* @returns {Promise<string>} Promise that resolves to the file contents as a string
|
|
79
79
|
*/
|
|
80
80
|
// eslint-disable-next-line @elsikora/javascript/no-undef
|
|
81
81
|
async readFile(filePath, encoding = "utf8") {
|
|
@@ -83,10 +83,10 @@ class NodeFileSystemService {
|
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Writes content to a file, creating the file and parent directories if they don't exist.
|
|
86
|
-
* @param filePath - The path to the file to write
|
|
87
|
-
* @param content - The content to write to the file
|
|
88
|
-
* @param encoding - The encoding to use when writing the file, defaults to "utf8"
|
|
89
|
-
* @returns Promise that resolves when the file is written
|
|
86
|
+
* @param {string} filePath - The path to the file to write
|
|
87
|
+
* @param {string} content - The content to write to the file
|
|
88
|
+
* @param {string} encoding - The encoding to use when writing the file, defaults to "utf8"
|
|
89
|
+
* @returns {Promise<void>} Promise that resolves when the file is written
|
|
90
90
|
*/
|
|
91
91
|
// eslint-disable-next-line @elsikora/javascript/no-undef
|
|
92
92
|
async writeFile(filePath, content, encoding = "utf8") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ICliInterfaceServiceSelectOptions } from
|
|
2
|
-
import type { ICliInterfaceService } from
|
|
1
|
+
import type { ICliInterfaceServiceSelectOptions } from '../../application/interface/cli-interface-service-select-options.interface';
|
|
2
|
+
import type { ICliInterfaceService } from '../../application/interface/cli-interface-service.interface';
|
|
3
3
|
/**
|
|
4
4
|
* Implementation of the CLI interface service using the prompts library.
|
|
5
5
|
* Provides methods for interacting with the user through the command line.
|
|
@@ -18,98 +18,100 @@ export declare class PromptsCliInterface implements ICliInterfaceService {
|
|
|
18
18
|
clear(): void;
|
|
19
19
|
/**
|
|
20
20
|
* Displays a confirmation prompt to the user.
|
|
21
|
-
* @param message - The message to display to the user
|
|
22
|
-
* @param isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
23
|
-
* @returns Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
21
|
+
* @param {string} message - The message to display to the user
|
|
22
|
+
* @param {boolean} isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
23
|
+
* @returns {Promise<boolean>} Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
24
24
|
*/
|
|
25
25
|
confirm(message: string, isConfirmedByDefault?: boolean): Promise<boolean>;
|
|
26
26
|
/**
|
|
27
27
|
* Displays an error message to the user.
|
|
28
|
-
* @param message - The error message to display
|
|
28
|
+
* @param {string} message - The error message to display
|
|
29
29
|
*/
|
|
30
30
|
error(message: string): void;
|
|
31
31
|
/**
|
|
32
32
|
* Displays a grouped multi-select prompt to the user.
|
|
33
|
-
* @param message - The message to display to the user
|
|
34
|
-
* @param options - Record of groups and their options
|
|
35
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
36
|
-
* @param initialValues - Initial selected values
|
|
37
|
-
* @returns Promise that resolves to an array of selected values
|
|
33
|
+
* @param {string} message - The message to display to the user
|
|
34
|
+
* @param {Record<string, Array<ICliInterfaceServiceSelectOptions>>} options - Record of groups and their options
|
|
35
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
36
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
37
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
38
|
+
* @template T - The type of the selected values
|
|
38
39
|
*/
|
|
39
40
|
groupMultiselect<T>(message: string, options: Record<string, Array<ICliInterfaceServiceSelectOptions>>, isRequired?: boolean, initialValues?: Array<string>): Promise<Array<T>>;
|
|
40
41
|
/**
|
|
41
42
|
* Handles and displays an error message with additional error details.
|
|
42
|
-
* @param message - The error message to display
|
|
43
|
-
* @param error - The error object or details
|
|
43
|
+
* @param {string} message - The error message to display
|
|
44
|
+
* @param {unknown} error - The error object or details
|
|
44
45
|
*/
|
|
45
46
|
handleError(message: string, error: unknown): void;
|
|
46
47
|
/**
|
|
47
48
|
* Displays an informational message to the user.
|
|
48
|
-
* @param message - The info message to display
|
|
49
|
+
* @param {string} message - The info message to display
|
|
49
50
|
*/
|
|
50
51
|
info(message: string): void;
|
|
51
52
|
/**
|
|
52
53
|
* Displays a standard message to the user.
|
|
53
|
-
* @param message - The message to display
|
|
54
|
+
* @param {string} message - The message to display
|
|
54
55
|
*/
|
|
55
56
|
log(message: string): void;
|
|
56
57
|
/**
|
|
57
58
|
* Displays a multi-select prompt to the user.
|
|
58
|
-
* @param message - The message to display to the user
|
|
59
|
-
* @param options - Array of options to select from
|
|
60
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
61
|
-
* @param initialValues - Initial selected values
|
|
62
|
-
* @returns Promise that resolves to an array of selected values
|
|
59
|
+
* @param {string} message - The message to display to the user
|
|
60
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
61
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
62
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
63
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
64
|
+
* @template T - The type of the selected values
|
|
63
65
|
*/
|
|
64
66
|
multiselect<T>(message: string, options: Array<ICliInterfaceServiceSelectOptions>, isRequired?: boolean, initialValues?: Array<string>): Promise<Array<T>>;
|
|
65
67
|
/**
|
|
66
68
|
* Displays a note to the user with a title and message.
|
|
67
|
-
* @param title - The title of the note
|
|
68
|
-
* @param message - The message content of the note
|
|
69
|
+
* @param {string} title - The title of the note
|
|
70
|
+
* @param {string} message - The message content of the note
|
|
69
71
|
*/
|
|
70
72
|
note(title: string, message: string): void;
|
|
71
73
|
/**
|
|
72
74
|
* Displays a single select prompt to the user.
|
|
73
|
-
* @param message - The message to display to the user
|
|
74
|
-
* @param options - Array of options to select from
|
|
75
|
-
* @param initialValue - Initial selected value
|
|
76
|
-
* @returns Promise that resolves to the selected value
|
|
75
|
+
* @param {string} message - The message to display to the user
|
|
76
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
77
|
+
* @param {string} initialValue - Initial selected value
|
|
78
|
+
* @returns {Promise<T>} Promise that resolves to the selected value
|
|
79
|
+
* @template T - The type of the selected value
|
|
77
80
|
*/
|
|
78
81
|
select<T>(message: string, options: Array<ICliInterfaceServiceSelectOptions>, initialValue?: string): Promise<T>;
|
|
79
82
|
/**
|
|
80
83
|
* Starts a spinner with the specified message.
|
|
81
84
|
* Stops any existing spinner first.
|
|
82
|
-
* @param message - The message to display while the spinner is active
|
|
85
|
+
* @param {string} message - The message to display while the spinner is active
|
|
83
86
|
*/
|
|
84
87
|
startSpinner(message: string): void;
|
|
85
88
|
/**
|
|
86
89
|
* Stops the current spinner with an optional completion message.
|
|
87
|
-
* @param message - Optional message to display when the spinner stops
|
|
90
|
+
* @param {string} message - Optional message to display when the spinner stops
|
|
88
91
|
*/
|
|
89
92
|
stopSpinner(message?: string): void;
|
|
90
93
|
/**
|
|
91
94
|
* Displays a success message to the user.
|
|
92
|
-
* @param message - The success message to display
|
|
95
|
+
* @param {string} message - The success message to display
|
|
93
96
|
*/
|
|
94
97
|
success(message: string): void;
|
|
95
98
|
/**
|
|
96
99
|
* Displays a text input prompt to the user.
|
|
97
|
-
* @param message - The message to display to the user
|
|
98
|
-
* @param
|
|
99
|
-
* @param initialValue - Optional initial value for the input field
|
|
100
|
-
* @param validate - Optional validation function for the input
|
|
101
|
-
* @returns Promise that resolves to the user's input text
|
|
100
|
+
* @param {string} message - The message to display to the user
|
|
101
|
+
* @param {string} _placeholder - Optional placeholder text for the input field (unused)
|
|
102
|
+
* @param {string} initialValue - Optional initial value for the input field
|
|
103
|
+
* @param {(value: string) => Error | string | undefined} validate - Optional validation function for the input
|
|
104
|
+
* @returns {Promise<string>} Promise that resolves to the user's input text
|
|
102
105
|
*/
|
|
103
106
|
text(message: string, _placeholder?: string, initialValue?: string, validate?: (value: string) => Error | string | undefined): Promise<string>;
|
|
104
107
|
/**
|
|
105
108
|
* Update the spinner message without stopping it.
|
|
106
|
-
* @param message - The new message to display
|
|
109
|
+
* @param {string} message - The new message to display
|
|
107
110
|
*/
|
|
108
111
|
updateSpinner(message: string): void;
|
|
109
112
|
/**
|
|
110
113
|
* Displays a warning message to the user.
|
|
111
|
-
* @param message - The warning message to display
|
|
114
|
+
* @param {string} message - The warning message to display
|
|
112
115
|
*/
|
|
113
116
|
warn(message: string): void;
|
|
114
117
|
}
|
|
115
|
-
//# sourceMappingURL=prompts-cli-interface.service.d.ts.map
|
|
@@ -25,9 +25,9 @@ class PromptsCliInterface {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Displays a confirmation prompt to the user.
|
|
28
|
-
* @param message - The message to display to the user
|
|
29
|
-
* @param isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
30
|
-
* @returns Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
28
|
+
* @param {string} message - The message to display to the user
|
|
29
|
+
* @param {boolean} isConfirmedByDefault - The default value for the confirmation, defaults to false
|
|
30
|
+
* @returns {Promise<boolean>} Promise that resolves to the user's response (true for confirmed, false for declined)
|
|
31
31
|
*/
|
|
32
32
|
async confirm(message, isConfirmedByDefault = false) {
|
|
33
33
|
try {
|
|
@@ -53,18 +53,19 @@ class PromptsCliInterface {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Displays an error message to the user.
|
|
56
|
-
* @param message - The error message to display
|
|
56
|
+
* @param {string} message - The error message to display
|
|
57
57
|
*/
|
|
58
58
|
error(message) {
|
|
59
59
|
process.stderr.write(`${chalk.red(message)}\n`);
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Displays a grouped multi-select prompt to the user.
|
|
63
|
-
* @param message - The message to display to the user
|
|
64
|
-
* @param options - Record of groups and their options
|
|
65
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
66
|
-
* @param initialValues - Initial selected values
|
|
67
|
-
* @returns Promise that resolves to an array of selected values
|
|
63
|
+
* @param {string} message - The message to display to the user
|
|
64
|
+
* @param {Record<string, Array<ICliInterfaceServiceSelectOptions>>} options - Record of groups and their options
|
|
65
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
66
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
67
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
68
|
+
* @template T - The type of the selected values
|
|
68
69
|
*/
|
|
69
70
|
async groupMultiselect(message, options, isRequired = false, initialValues) {
|
|
70
71
|
// Convert options to a flat array with group prefixes
|
|
@@ -103,8 +104,8 @@ class PromptsCliInterface {
|
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
105
106
|
* Handles and displays an error message with additional error details.
|
|
106
|
-
* @param message - The error message to display
|
|
107
|
-
* @param error - The error object or details
|
|
107
|
+
* @param {string} message - The error message to display
|
|
108
|
+
* @param {unknown} error - The error object or details
|
|
108
109
|
*/
|
|
109
110
|
handleError(message, error) {
|
|
110
111
|
process.stderr.write(`${chalk.red(message)}\n`);
|
|
@@ -112,25 +113,26 @@ class PromptsCliInterface {
|
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
114
115
|
* Displays an informational message to the user.
|
|
115
|
-
* @param message - The info message to display
|
|
116
|
+
* @param {string} message - The info message to display
|
|
116
117
|
*/
|
|
117
118
|
info(message) {
|
|
118
119
|
process.stdout.write(`${chalk.blue(message)}\n`);
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
122
|
* Displays a standard message to the user.
|
|
122
|
-
* @param message - The message to display
|
|
123
|
+
* @param {string} message - The message to display
|
|
123
124
|
*/
|
|
124
125
|
log(message) {
|
|
125
126
|
process.stdout.write(`${message}\n`);
|
|
126
127
|
}
|
|
127
128
|
/**
|
|
128
129
|
* Displays a multi-select prompt to the user.
|
|
129
|
-
* @param message - The message to display to the user
|
|
130
|
-
* @param options - Array of options to select from
|
|
131
|
-
* @param isRequired - Whether a selection is required, defaults to false
|
|
132
|
-
* @param initialValues - Initial selected values
|
|
133
|
-
* @returns Promise that resolves to an array of selected values
|
|
130
|
+
* @param {string} message - The message to display to the user
|
|
131
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
132
|
+
* @param {boolean} isRequired - Whether a selection is required, defaults to false
|
|
133
|
+
* @param {Array<string>} initialValues - Initial selected values
|
|
134
|
+
* @returns {Promise<Array<T>>} Promise that resolves to an array of selected values
|
|
135
|
+
* @template T - The type of the selected values
|
|
134
136
|
*/
|
|
135
137
|
async multiselect(message, options, isRequired = false, initialValues) {
|
|
136
138
|
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
@@ -163,8 +165,8 @@ class PromptsCliInterface {
|
|
|
163
165
|
}
|
|
164
166
|
/**
|
|
165
167
|
* Displays a note to the user with a title and message.
|
|
166
|
-
* @param title - The title of the note
|
|
167
|
-
* @param message - The message content of the note
|
|
168
|
+
* @param {string} title - The title of the note
|
|
169
|
+
* @param {string} message - The message content of the note
|
|
168
170
|
*/
|
|
169
171
|
note(title, message) {
|
|
170
172
|
const lines = message.split("\n");
|
|
@@ -193,10 +195,11 @@ class PromptsCliInterface {
|
|
|
193
195
|
}
|
|
194
196
|
/**
|
|
195
197
|
* Displays a single select prompt to the user.
|
|
196
|
-
* @param message - The message to display to the user
|
|
197
|
-
* @param options - Array of options to select from
|
|
198
|
-
* @param initialValue - Initial selected value
|
|
199
|
-
* @returns Promise that resolves to the selected value
|
|
198
|
+
* @param {string} message - The message to display to the user
|
|
199
|
+
* @param {Array<ICliInterfaceServiceSelectOptions>} options - Array of options to select from
|
|
200
|
+
* @param {string} initialValue - Initial selected value
|
|
201
|
+
* @returns {Promise<T>} Promise that resolves to the selected value
|
|
202
|
+
* @template T - The type of the selected value
|
|
200
203
|
*/
|
|
201
204
|
async select(message, options, initialValue) {
|
|
202
205
|
const choices = options.map((opt) => ({
|
|
@@ -226,7 +229,7 @@ class PromptsCliInterface {
|
|
|
226
229
|
/**
|
|
227
230
|
* Starts a spinner with the specified message.
|
|
228
231
|
* Stops any existing spinner first.
|
|
229
|
-
* @param message - The message to display while the spinner is active
|
|
232
|
+
* @param {string} message - The message to display while the spinner is active
|
|
230
233
|
*/
|
|
231
234
|
startSpinner(message) {
|
|
232
235
|
this.spinner.stop();
|
|
@@ -234,7 +237,7 @@ class PromptsCliInterface {
|
|
|
234
237
|
}
|
|
235
238
|
/**
|
|
236
239
|
* Stops the current spinner with an optional completion message.
|
|
237
|
-
* @param message - Optional message to display when the spinner stops
|
|
240
|
+
* @param {string} message - Optional message to display when the spinner stops
|
|
238
241
|
*/
|
|
239
242
|
stopSpinner(message) {
|
|
240
243
|
this.spinner.stop();
|
|
@@ -244,18 +247,18 @@ class PromptsCliInterface {
|
|
|
244
247
|
}
|
|
245
248
|
/**
|
|
246
249
|
* Displays a success message to the user.
|
|
247
|
-
* @param message - The success message to display
|
|
250
|
+
* @param {string} message - The success message to display
|
|
248
251
|
*/
|
|
249
252
|
success(message) {
|
|
250
253
|
process.stdout.write(`${chalk.green(message)}\n`);
|
|
251
254
|
}
|
|
252
255
|
/**
|
|
253
256
|
* Displays a text input prompt to the user.
|
|
254
|
-
* @param message - The message to display to the user
|
|
255
|
-
* @param
|
|
256
|
-
* @param initialValue - Optional initial value for the input field
|
|
257
|
-
* @param validate - Optional validation function for the input
|
|
258
|
-
* @returns Promise that resolves to the user's input text
|
|
257
|
+
* @param {string} message - The message to display to the user
|
|
258
|
+
* @param {string} _placeholder - Optional placeholder text for the input field (unused)
|
|
259
|
+
* @param {string} initialValue - Optional initial value for the input field
|
|
260
|
+
* @param {(value: string) => Error | string | undefined} validate - Optional validation function for the input
|
|
261
|
+
* @returns {Promise<string>} Promise that resolves to the user's input text
|
|
259
262
|
*/
|
|
260
263
|
async text(message, _placeholder, initialValue, validate) {
|
|
261
264
|
// Convert the validate function to match prompts' expected format
|
|
@@ -293,7 +296,7 @@ class PromptsCliInterface {
|
|
|
293
296
|
}
|
|
294
297
|
/**
|
|
295
298
|
* Update the spinner message without stopping it.
|
|
296
|
-
* @param message - The new message to display
|
|
299
|
+
* @param {string} message - The new message to display
|
|
297
300
|
*/
|
|
298
301
|
updateSpinner(message) {
|
|
299
302
|
if (this.spinner?.isSpinning) {
|
|
@@ -302,7 +305,7 @@ class PromptsCliInterface {
|
|
|
302
305
|
}
|
|
303
306
|
/**
|
|
304
307
|
* Displays a warning message to the user.
|
|
305
|
-
* @param message - The warning message to display
|
|
308
|
+
* @param {string} message - The warning message to display
|
|
306
309
|
*/
|
|
307
310
|
warn(message) {
|
|
308
311
|
process.stdout.write(`${chalk.yellow(message)}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts-cli-interface.service.js","sources":["../../../../../src/infrastructure/service/prompts-cli-interface.service.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAgBA;;;AAGG;MACU,mBAAmB,CAAA;;;AAGvB,IAAA,OAAO;AAEf;;;AAGG;AACH,IAAA,WAAA,GAAA;AACC,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE;;AAGrB;;AAEG;IACH,KAAK,GAAA;AACJ,QAAA,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;;AAGhC;;;;;AAKG;AACH,IAAA,MAAM,OAAO,CAAC,OAAe,EAAE,uBAAgC,KAAK,EAAA;AACnE,QAAA,IAAI;AACH,YAAA,MAAM,QAAQ,GAA4B,MAAM,OAAO,CAAC;AACvD,gBAAA,MAAM,EAAE,KAAK;AACb,gBAAA,QAAQ,EAAE,IAAI;;AAEd,gBAAA,OAAO,EAAE,oBAAoB;gBAC7B,OAAO;AACP,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,IAAI,EAAE,QAAQ;AACd,aAAA,CAAC;AAEF,YAAA,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;AACjC,gBAAA,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC;AAEzC,gBAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;;YAGhB,OAAO,QAAQ,CAAC,KAAgB;;AAC/B,QAAA,MAAM;AACP,YAAA,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC;AACzC,YAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;;;AAIjB;;;AAGG;AACH,IAAA,KAAK,CAAC,OAAe,EAAA;AACpB,QAAA,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAG,EAAA,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA,EAAA,CAAI,CAAC;;AAGhD
|
|
1
|
+
{"version":3,"file":"prompts-cli-interface.service.js","sources":["../../../../../src/infrastructure/service/prompts-cli-interface.service.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAgBA;;;AAGG;MACU,mBAAmB,CAAA;;;AAGvB,IAAA,OAAO;AAEf;;;AAGG;AACH,IAAA,WAAA,GAAA;AACC,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE;;AAGrB;;AAEG;IACH,KAAK,GAAA;AACJ,QAAA,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;;AAGhC;;;;;AAKG;AACH,IAAA,MAAM,OAAO,CAAC,OAAe,EAAE,uBAAgC,KAAK,EAAA;AACnE,QAAA,IAAI;AACH,YAAA,MAAM,QAAQ,GAA4B,MAAM,OAAO,CAAC;AACvD,gBAAA,MAAM,EAAE,KAAK;AACb,gBAAA,QAAQ,EAAE,IAAI;;AAEd,gBAAA,OAAO,EAAE,oBAAoB;gBAC7B,OAAO;AACP,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,IAAI,EAAE,QAAQ;AACd,aAAA,CAAC;AAEF,YAAA,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;AACjC,gBAAA,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC;AAEzC,gBAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;;YAGhB,OAAO,QAAQ,CAAC,KAAgB;;AAC/B,QAAA,MAAM;AACP,YAAA,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC;AACzC,YAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;;;AAIjB;;;AAGG;A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CAAC,OAAO,CAAC,CAAA,EAAA,CAAI,CAAC;;AAEnD;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@anthropic-ai/sdk": "^0.52.0",
|
|
5
|
+
"@aws-sdk/client-bedrock-runtime": "^3.726.0",
|
|
6
|
+
"@commitlint/lint": "^19.8.1",
|
|
7
|
+
"@commitlint/load": "^19.8.1",
|
|
8
|
+
"@elsikora/cladi": "^2.0.2",
|
|
9
|
+
"@google/generative-ai": "^0.21.0",
|
|
10
|
+
"chalk": "^5.4.1",
|
|
11
|
+
"cosmiconfig": "^9.0.0",
|
|
12
|
+
"dotenv": "^16.5.0",
|
|
13
|
+
"javascript-stringify": "^2.1.0",
|
|
14
|
+
"openai": "^4.103.0",
|
|
15
|
+
"ora": "^8.2.0",
|
|
16
|
+
"prompts": "^2.4.2",
|
|
17
|
+
"yaml": "^2.8.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -7,18 +7,22 @@ export declare class CommitizenAdapter {
|
|
|
7
7
|
constructor();
|
|
8
8
|
/**
|
|
9
9
|
* Main entry point for commitizen
|
|
10
|
-
* @param
|
|
11
|
-
* @param commit - Callback to execute with complete commit message
|
|
10
|
+
* @param {unknown} _inquirerIns - Instance passed by commitizen (unused in our implementation)
|
|
11
|
+
* @param {TCommit} commit - Callback to execute with complete commit message
|
|
12
12
|
*/
|
|
13
13
|
prompter(_inquirerIns: unknown, commit: TCommit): Promise<void>;
|
|
14
14
|
/**
|
|
15
15
|
* Extract LLM prompt context from commitlint rules and prompts
|
|
16
|
+
* @param {QualifiedRules} rules - The commitlint rules
|
|
17
|
+
* @param {UserPromptConfig} prompts - The user prompt configuration
|
|
18
|
+
* @returns {ILlmPromptContext} The extracted LLM prompt context
|
|
16
19
|
*/
|
|
17
20
|
private extractLlmPromptContext;
|
|
18
21
|
/**
|
|
19
22
|
* Get API key prompt information based on provider
|
|
23
|
+
* @param {string} provider - The LLM provider name
|
|
24
|
+
* @returns {{ hint: string; prompt: string }} The hint and prompt text for API key input
|
|
20
25
|
*/
|
|
21
26
|
private getApiKeyPromptInfo;
|
|
22
27
|
}
|
|
23
28
|
export {};
|
|
24
|
-
//# sourceMappingURL=commitizen.adapter.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import load from '@commitlint/load';
|
|
2
2
|
import { DEFAULT_MAX_RETRIES, DEFAULT_VALIDATION_MAX_RETRIES } from '../domain/constant/numeric.constant.js';
|
|
3
3
|
import { LLMConfiguration } from '../domain/entity/llm-configuration.entity.js';
|
|
4
|
+
import { ECommitMode } from '../domain/enum/commit-mode.enum.js';
|
|
4
5
|
import { ApiKey } from '../domain/value-object/api-key.value-object.js';
|
|
5
6
|
import { CommitlintValidatorService } from '../infrastructure/commit-validator/commitlint-validator.service.js';
|
|
6
7
|
import { createAppContainer, ConfigureLLMUseCaseToken, GenerateCommitMessageUseCaseToken, ValidateCommitMessageUseCaseToken, ManualCommitUseCaseToken, CliInterfaceServiceToken, CommitRepositoryToken, ConfigServiceToken, CommitValidatorToken } from '../infrastructure/di/container.js';
|
|
@@ -17,8 +18,8 @@ class CommitizenAdapter {
|
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Main entry point for commitizen
|
|
20
|
-
* @param
|
|
21
|
-
* @param commit - Callback to execute with complete commit message
|
|
21
|
+
* @param {unknown} _inquirerIns - Instance passed by commitizen (unused in our implementation)
|
|
22
|
+
* @param {TCommit} commit - Callback to execute with complete commit message
|
|
22
23
|
*/
|
|
23
24
|
async prompter(_inquirerIns, commit) {
|
|
24
25
|
const loadResult = await load();
|
|
@@ -48,7 +49,7 @@ class CommitizenAdapter {
|
|
|
48
49
|
// Configuration exists - load it first to show details
|
|
49
50
|
const config = await configService.get();
|
|
50
51
|
// Ask if they want to use existing configuration
|
|
51
|
-
const modeInfo = config.mode ===
|
|
52
|
+
const modeInfo = config.mode === ECommitMode.AUTO ? `${config.mode} mode, ${config.provider} provider` : `${config.mode} mode`;
|
|
52
53
|
const isUseExisting = await cliInterface.confirm(`Found existing configuration (${modeInfo}). Use it?`, true);
|
|
53
54
|
if (!isUseExisting) {
|
|
54
55
|
cliInterface.info("Let's reconfigure...");
|
|
@@ -57,16 +58,18 @@ class CommitizenAdapter {
|
|
|
57
58
|
if (llmConfig.isAutoMode() && llmConfig.getApiKey().getValue() === "will-prompt-on-use") {
|
|
58
59
|
// Ask for API key
|
|
59
60
|
const { hint, prompt } = this.getApiKeyPromptInfo(llmConfig.getProvider());
|
|
60
|
-
const
|
|
61
|
+
const credentialValue = await cliInterface.text(prompt, hint, "", (value) => {
|
|
61
62
|
if (!value || value.trim().length === 0) {
|
|
62
63
|
return "API key is required";
|
|
63
64
|
}
|
|
65
|
+
// eslint-disable-next-line @elsikora/sonar/no-redundant-jump
|
|
66
|
+
return;
|
|
64
67
|
});
|
|
65
68
|
// Create new configuration with the provided API key
|
|
66
|
-
llmConfig = new LLMConfiguration(llmConfig.getProvider(), new ApiKey(
|
|
69
|
+
llmConfig = new LLMConfiguration(llmConfig.getProvider(), new ApiKey(credentialValue), llmConfig.getMode(), llmConfig.getModel(), llmConfig.getMaxRetries(), llmConfig.getValidationMaxRetries());
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
else if (config.mode ===
|
|
72
|
+
else if (config.mode === ECommitMode.AUTO && !llmConfig) {
|
|
70
73
|
// User wants to use existing config but API key is missing
|
|
71
74
|
const environmentVariableNames = {
|
|
72
75
|
anthropic: "ANTHROPIC_API_KEY",
|
|
@@ -76,19 +79,21 @@ class CommitizenAdapter {
|
|
|
76
79
|
ollama: "OLLAMA_API_KEY",
|
|
77
80
|
openai: "OPENAI_API_KEY",
|
|
78
81
|
};
|
|
79
|
-
const environmentVariableName = environmentVariableNames[config.provider]
|
|
82
|
+
const environmentVariableName = environmentVariableNames[config.provider] ?? "";
|
|
80
83
|
cliInterface.warn(`API key not found in ${environmentVariableName} environment variable.`);
|
|
81
84
|
// Ask for API key
|
|
82
85
|
const { hint, prompt } = this.getApiKeyPromptInfo(config.provider);
|
|
83
|
-
const
|
|
86
|
+
const credentialValue = await cliInterface.text(prompt, hint, "", (value) => {
|
|
84
87
|
if (!value || value.trim().length === 0) {
|
|
85
88
|
return "API key is required";
|
|
86
89
|
}
|
|
90
|
+
// eslint-disable-next-line @elsikora/sonar/no-redundant-jump
|
|
91
|
+
return;
|
|
87
92
|
});
|
|
88
93
|
// Create new configuration with the provided API key
|
|
89
94
|
const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
90
95
|
const validationMaxRetries = config.validationMaxRetries ?? DEFAULT_VALIDATION_MAX_RETRIES;
|
|
91
|
-
llmConfig = new LLMConfiguration(config.provider, new ApiKey(
|
|
96
|
+
llmConfig = new LLMConfiguration(config.provider, new ApiKey(credentialValue), config.mode, config.model, maxRetries, validationMaxRetries);
|
|
92
97
|
}
|
|
93
98
|
}
|
|
94
99
|
else {
|
|
@@ -99,13 +104,15 @@ class CommitizenAdapter {
|
|
|
99
104
|
if (llmConfig.isAutoMode() && llmConfig.getApiKey().getValue() === "will-prompt-on-use") {
|
|
100
105
|
// Ask for API key
|
|
101
106
|
const { hint, prompt } = this.getApiKeyPromptInfo(llmConfig.getProvider());
|
|
102
|
-
const
|
|
107
|
+
const credentialValue = await cliInterface.text(prompt, hint, "", (value) => {
|
|
103
108
|
if (!value || value.trim().length === 0) {
|
|
104
109
|
return "API key is required";
|
|
105
110
|
}
|
|
111
|
+
// eslint-disable-next-line @elsikora/sonar/no-redundant-jump
|
|
112
|
+
return;
|
|
106
113
|
});
|
|
107
114
|
// Create new configuration with the provided API key
|
|
108
|
-
llmConfig = new LLMConfiguration(llmConfig.getProvider(), new ApiKey(
|
|
115
|
+
llmConfig = new LLMConfiguration(llmConfig.getProvider(), new ApiKey(credentialValue), llmConfig.getMode(), llmConfig.getModel(), llmConfig.getMaxRetries(), llmConfig.getValidationMaxRetries());
|
|
109
116
|
}
|
|
110
117
|
}
|
|
111
118
|
// Configuration should exist at this point
|
|
@@ -200,6 +207,9 @@ class CommitizenAdapter {
|
|
|
200
207
|
}
|
|
201
208
|
/**
|
|
202
209
|
* Extract LLM prompt context from commitlint rules and prompts
|
|
210
|
+
* @param {QualifiedRules} rules - The commitlint rules
|
|
211
|
+
* @param {UserPromptConfig} prompts - The user prompt configuration
|
|
212
|
+
* @returns {ILlmPromptContext} The extracted LLM prompt context
|
|
203
213
|
*/
|
|
204
214
|
extractLlmPromptContext(rules, prompts) {
|
|
205
215
|
const context = {
|
|
@@ -258,6 +268,8 @@ class CommitizenAdapter {
|
|
|
258
268
|
}
|
|
259
269
|
/**
|
|
260
270
|
* Get API key prompt information based on provider
|
|
271
|
+
* @param {string} provider - The LLM provider name
|
|
272
|
+
* @returns {{ hint: string; prompt: string }} The hint and prompt text for API key input
|
|
261
273
|
*/
|
|
262
274
|
getApiKeyPromptInfo(provider) {
|
|
263
275
|
switch (provider) {
|