@elsikora/commitizen-plugin-commitlint-ai 1.2.0 → 2.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +256 -57
- package/dist/cjs/application/constant/config-file-directory.constant.d.ts +4 -0
- package/dist/cjs/application/constant/config-file-directory.constant.js +9 -0
- package/dist/cjs/application/constant/config-file-directory.constant.js.map +1 -0
- package/dist/cjs/application/constant/config-module-name.constant.d.ts +4 -0
- package/dist/cjs/application/constant/config-module-name.constant.js +9 -0
- package/dist/cjs/application/constant/config-module-name.constant.js.map +1 -0
- package/dist/cjs/application/constant/index.d.ts +2 -0
- package/dist/cjs/application/index.d.ts +2 -0
- package/dist/cjs/application/interface/cli-interface-service-select-options.interface.d.ts +21 -0
- package/dist/cjs/application/interface/cli-interface-service.interface.d.ts +105 -0
- package/dist/cjs/application/interface/command-service.interface.d.ts +19 -0
- package/dist/cjs/application/interface/commit-repository.interface.d.ts +32 -0
- package/dist/cjs/application/interface/commit-validator.interface.d.ts +29 -0
- package/dist/cjs/application/interface/config-service.interface.d.ts +47 -0
- package/dist/cjs/application/interface/config.interface.d.ts +27 -0
- package/dist/cjs/application/interface/file-system-service.interface.d.ts +61 -0
- package/dist/cjs/application/interface/index.d.ts +9 -0
- package/dist/cjs/application/interface/llm-service.interface.d.ts +43 -0
- package/dist/cjs/application/use-case/configure-llm.use-case.d.ts +39 -0
- package/dist/cjs/application/use-case/configure-llm.use-case.js +373 -0
- package/dist/cjs/application/use-case/configure-llm.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/generate-commit-message.use-case.d.ts +18 -0
- package/dist/cjs/application/use-case/generate-commit-message.use-case.js +49 -0
- package/dist/cjs/application/use-case/generate-commit-message.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/index.d.ts +4 -0
- package/dist/cjs/application/use-case/manual-commit.use-case.d.ts +16 -0
- package/dist/cjs/application/use-case/manual-commit.use-case.js +81 -0
- package/dist/cjs/application/use-case/manual-commit.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/validate-commit-message.use-case.d.ts +26 -0
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js +76 -0
- package/dist/cjs/application/use-case/validate-commit-message.use-case.js.map +1 -0
- package/dist/cjs/domain/constant/index.d.ts +1 -0
- package/dist/cjs/domain/constant/numeric.constant.d.ts +25 -0
- package/dist/cjs/domain/constant/numeric.constant.js +42 -0
- package/dist/cjs/domain/constant/numeric.constant.js.map +1 -0
- package/dist/cjs/domain/entity/commit-message.entity.d.ts +47 -0
- package/dist/cjs/domain/entity/commit-message.entity.js +71 -0
- package/dist/cjs/domain/entity/commit-message.entity.js.map +1 -0
- package/dist/cjs/domain/entity/index.d.ts +2 -0
- package/dist/cjs/domain/entity/llm-configuration.entity.d.ts +73 -0
- package/dist/cjs/domain/entity/llm-configuration.entity.js +107 -0
- package/dist/cjs/domain/entity/llm-configuration.entity.js.map +1 -0
- package/dist/cjs/domain/enum/anthropic-model.enum.d.ts +18 -0
- package/dist/cjs/domain/enum/anthropic-model.enum.js +26 -0
- package/dist/cjs/domain/enum/anthropic-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.d.ts +33 -0
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.js +47 -0
- package/dist/cjs/domain/enum/aws-bedrock-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/azure-openai-model.enum.d.ts +17 -0
- package/dist/cjs/domain/enum/azure-openai-model.enum.js +26 -0
- package/dist/cjs/domain/enum/azure-openai-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/commit-mode.enum.d.ts +7 -0
- package/dist/cjs/domain/enum/commit-mode.enum.js +11 -0
- package/dist/cjs/domain/enum/commit-mode.enum.js.map +1 -0
- package/dist/cjs/domain/enum/google-model.enum.d.ts +16 -0
- package/dist/cjs/domain/enum/google-model.enum.js +25 -0
- package/dist/cjs/domain/enum/google-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/index.d.ts +9 -0
- package/dist/cjs/domain/enum/llm-provider.enum.d.ts +11 -0
- package/dist/cjs/domain/enum/llm-provider.enum.js +15 -0
- package/dist/cjs/domain/enum/llm-provider.enum.js.map +1 -0
- package/dist/cjs/domain/enum/log-level.enum.d.ts +9 -0
- package/dist/cjs/domain/enum/log-level.enum.js +13 -0
- package/dist/cjs/domain/enum/log-level.enum.js.map +1 -0
- package/dist/cjs/domain/enum/ollama-model.enum.d.ts +24 -0
- package/dist/cjs/domain/enum/ollama-model.enum.js +30 -0
- package/dist/cjs/domain/enum/ollama-model.enum.js.map +1 -0
- package/dist/cjs/domain/enum/openai-model.enum.d.ts +25 -0
- package/dist/cjs/domain/enum/openai-model.enum.js +35 -0
- package/dist/cjs/domain/enum/openai-model.enum.js.map +1 -0
- package/dist/cjs/domain/index.d.ts +3 -0
- package/dist/cjs/domain/value-object/api-key.value-object.d.ts +28 -0
- package/dist/cjs/domain/value-object/api-key.value-object.js +51 -0
- package/dist/cjs/domain/value-object/api-key.value-object.js.map +1 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts +39 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.js +66 -0
- package/dist/cjs/domain/value-object/commit-body.value-object.js.map +1 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.d.ts +35 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.js +63 -0
- package/dist/cjs/domain/value-object/commit-header.value-object.js.map +1 -0
- package/dist/cjs/domain/value-object/index.d.ts +3 -0
- package/dist/cjs/index.d.ts +14 -12
- package/dist/cjs/index.js +85 -83
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.d.ts +38 -0
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js +207 -0
- package/dist/cjs/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -0
- package/dist/cjs/infrastructure/commit-validator/index.d.ts +1 -0
- package/dist/cjs/infrastructure/di/container.d.ts +17 -0
- package/dist/cjs/infrastructure/di/container.js +76 -0
- package/dist/cjs/infrastructure/di/container.js.map +1 -0
- package/dist/cjs/infrastructure/di/index.d.ts +1 -0
- package/dist/cjs/infrastructure/git/git-commit.repository.d.ts +36 -0
- package/dist/cjs/infrastructure/git/git-commit.repository.js +78 -0
- package/dist/cjs/infrastructure/git/git-commit.repository.js.map +1 -0
- package/dist/cjs/infrastructure/git/index.d.ts +1 -0
- package/dist/cjs/infrastructure/index.d.ts +4 -0
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.d.ts +39 -0
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js +323 -0
- package/dist/cjs/infrastructure/llm/anthropic-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.d.ts +60 -0
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js +514 -0
- package/dist/cjs/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js +351 -0
- package/dist/cjs/infrastructure/llm/azure-openai-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/google-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/google-llm.service.js +335 -0
- package/dist/cjs/infrastructure/llm/google-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/index.d.ts +6 -0
- package/dist/cjs/infrastructure/llm/ollama-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js +387 -0
- package/dist/cjs/infrastructure/llm/ollama-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/llm/openai-llm.service.d.ts +45 -0
- package/dist/cjs/infrastructure/llm/openai-llm.service.js +339 -0
- package/dist/cjs/infrastructure/llm/openai-llm.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/cosmic-config.service.d.ts +66 -0
- package/dist/cjs/infrastructure/service/cosmic-config.service.js +176 -0
- package/dist/cjs/infrastructure/service/cosmic-config.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/index.d.ts +4 -0
- package/dist/cjs/infrastructure/service/node-command.service.d.ts +45 -0
- package/dist/cjs/infrastructure/service/node-command.service.js +154 -0
- package/dist/cjs/infrastructure/service/node-command.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/node-file-system.service.d.ts +62 -0
- package/dist/cjs/infrastructure/service/node-file-system.service.js +102 -0
- package/dist/cjs/infrastructure/service/node-file-system.service.js.map +1 -0
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.d.ts +117 -0
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js +318 -0
- package/dist/cjs/infrastructure/service/prompts-cli-interface.service.js.map +1 -0
- package/dist/cjs/presentation/commitizen.adapter.d.ts +28 -0
- package/dist/cjs/presentation/commitizen.adapter.js +304 -0
- package/dist/cjs/presentation/commitizen.adapter.js.map +1 -0
- package/dist/cjs/presentation/index.d.ts +1 -0
- package/dist/esm/application/constant/config-file-directory.constant.d.ts +4 -0
- package/dist/esm/application/constant/config-file-directory.constant.js +7 -0
- package/dist/esm/application/constant/config-file-directory.constant.js.map +1 -0
- package/dist/esm/application/constant/config-module-name.constant.d.ts +4 -0
- package/dist/esm/application/constant/config-module-name.constant.js +7 -0
- package/dist/esm/application/constant/config-module-name.constant.js.map +1 -0
- package/dist/esm/application/constant/index.d.ts +2 -0
- package/dist/esm/application/index.d.ts +2 -0
- package/dist/esm/application/interface/cli-interface-service-select-options.interface.d.ts +21 -0
- package/dist/esm/application/interface/cli-interface-service.interface.d.ts +105 -0
- package/dist/esm/application/interface/command-service.interface.d.ts +19 -0
- package/dist/esm/application/interface/commit-repository.interface.d.ts +32 -0
- package/dist/esm/application/interface/commit-validator.interface.d.ts +29 -0
- package/dist/esm/application/interface/config-service.interface.d.ts +47 -0
- package/dist/esm/application/interface/config.interface.d.ts +27 -0
- package/dist/esm/application/interface/file-system-service.interface.d.ts +61 -0
- package/dist/esm/application/interface/index.d.ts +9 -0
- package/dist/esm/application/interface/llm-service.interface.d.ts +43 -0
- package/dist/esm/application/use-case/configure-llm.use-case.d.ts +39 -0
- package/dist/esm/application/use-case/configure-llm.use-case.js +371 -0
- package/dist/esm/application/use-case/configure-llm.use-case.js.map +1 -0
- package/dist/esm/application/use-case/generate-commit-message.use-case.d.ts +18 -0
- package/dist/esm/application/use-case/generate-commit-message.use-case.js +47 -0
- package/dist/esm/application/use-case/generate-commit-message.use-case.js.map +1 -0
- package/dist/esm/application/use-case/index.d.ts +4 -0
- package/dist/esm/application/use-case/manual-commit.use-case.d.ts +16 -0
- package/dist/esm/application/use-case/manual-commit.use-case.js +79 -0
- package/dist/esm/application/use-case/manual-commit.use-case.js.map +1 -0
- package/dist/esm/application/use-case/validate-commit-message.use-case.d.ts +26 -0
- package/dist/esm/application/use-case/validate-commit-message.use-case.js +74 -0
- package/dist/esm/application/use-case/validate-commit-message.use-case.js.map +1 -0
- package/dist/esm/domain/constant/index.d.ts +1 -0
- package/dist/esm/domain/constant/numeric.constant.d.ts +25 -0
- package/dist/esm/domain/constant/numeric.constant.js +26 -0
- package/dist/esm/domain/constant/numeric.constant.js.map +1 -0
- package/dist/esm/domain/entity/commit-message.entity.d.ts +47 -0
- package/dist/esm/domain/entity/commit-message.entity.js +69 -0
- package/dist/esm/domain/entity/commit-message.entity.js.map +1 -0
- package/dist/esm/domain/entity/index.d.ts +2 -0
- package/dist/esm/domain/entity/llm-configuration.entity.d.ts +73 -0
- package/dist/esm/domain/entity/llm-configuration.entity.js +105 -0
- package/dist/esm/domain/entity/llm-configuration.entity.js.map +1 -0
- package/dist/esm/domain/enum/anthropic-model.enum.d.ts +18 -0
- package/dist/esm/domain/enum/anthropic-model.enum.js +26 -0
- package/dist/esm/domain/enum/anthropic-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/aws-bedrock-model.enum.d.ts +33 -0
- package/dist/esm/domain/enum/aws-bedrock-model.enum.js +47 -0
- package/dist/esm/domain/enum/aws-bedrock-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/azure-openai-model.enum.d.ts +17 -0
- package/dist/esm/domain/enum/azure-openai-model.enum.js +26 -0
- package/dist/esm/domain/enum/azure-openai-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/commit-mode.enum.d.ts +7 -0
- package/dist/esm/domain/enum/commit-mode.enum.js +11 -0
- package/dist/esm/domain/enum/commit-mode.enum.js.map +1 -0
- package/dist/esm/domain/enum/google-model.enum.d.ts +16 -0
- package/dist/esm/domain/enum/google-model.enum.js +25 -0
- package/dist/esm/domain/enum/google-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/index.d.ts +9 -0
- package/dist/esm/domain/enum/llm-provider.enum.d.ts +11 -0
- package/dist/esm/domain/enum/llm-provider.enum.js +15 -0
- package/dist/esm/domain/enum/llm-provider.enum.js.map +1 -0
- package/dist/esm/domain/enum/log-level.enum.d.ts +9 -0
- package/dist/esm/domain/enum/log-level.enum.js +13 -0
- package/dist/esm/domain/enum/log-level.enum.js.map +1 -0
- package/dist/esm/domain/enum/ollama-model.enum.d.ts +24 -0
- package/dist/esm/domain/enum/ollama-model.enum.js +30 -0
- package/dist/esm/domain/enum/ollama-model.enum.js.map +1 -0
- package/dist/esm/domain/enum/openai-model.enum.d.ts +25 -0
- package/dist/esm/domain/enum/openai-model.enum.js +35 -0
- package/dist/esm/domain/enum/openai-model.enum.js.map +1 -0
- package/dist/esm/domain/index.d.ts +3 -0
- package/dist/esm/domain/value-object/api-key.value-object.d.ts +28 -0
- package/dist/esm/domain/value-object/api-key.value-object.js +49 -0
- package/dist/esm/domain/value-object/api-key.value-object.js.map +1 -0
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts +39 -0
- package/dist/esm/domain/value-object/commit-body.value-object.js +64 -0
- package/dist/esm/domain/value-object/commit-body.value-object.js.map +1 -0
- package/dist/esm/domain/value-object/commit-header.value-object.d.ts +35 -0
- package/dist/esm/domain/value-object/commit-header.value-object.js +61 -0
- package/dist/esm/domain/value-object/commit-header.value-object.js.map +1 -0
- package/dist/esm/domain/value-object/index.d.ts +3 -0
- package/dist/esm/index.d.ts +14 -12
- package/dist/esm/index.js +38 -82
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.d.ts +38 -0
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js +205 -0
- package/dist/esm/infrastructure/commit-validator/commitlint-validator.service.js.map +1 -0
- package/dist/esm/infrastructure/commit-validator/index.d.ts +1 -0
- package/dist/esm/infrastructure/di/container.d.ts +17 -0
- package/dist/esm/infrastructure/di/container.js +63 -0
- package/dist/esm/infrastructure/di/container.js.map +1 -0
- package/dist/esm/infrastructure/di/index.d.ts +1 -0
- package/dist/esm/infrastructure/git/git-commit.repository.d.ts +36 -0
- package/dist/esm/infrastructure/git/git-commit.repository.js +76 -0
- package/dist/esm/infrastructure/git/git-commit.repository.js.map +1 -0
- package/dist/esm/infrastructure/git/index.d.ts +1 -0
- package/dist/esm/infrastructure/index.d.ts +4 -0
- package/dist/esm/infrastructure/llm/anthropic-llm.service.d.ts +39 -0
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js +321 -0
- package/dist/esm/infrastructure/llm/anthropic-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.d.ts +60 -0
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js +512 -0
- package/dist/esm/infrastructure/llm/aws-bedrock-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js +349 -0
- package/dist/esm/infrastructure/llm/azure-openai-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/google-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/google-llm.service.js +333 -0
- package/dist/esm/infrastructure/llm/google-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/index.d.ts +6 -0
- package/dist/esm/infrastructure/llm/ollama-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/ollama-llm.service.js +385 -0
- package/dist/esm/infrastructure/llm/ollama-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/llm/openai-llm.service.d.ts +45 -0
- package/dist/esm/infrastructure/llm/openai-llm.service.js +337 -0
- package/dist/esm/infrastructure/llm/openai-llm.service.js.map +1 -0
- package/dist/esm/infrastructure/service/cosmic-config.service.d.ts +66 -0
- package/dist/esm/infrastructure/service/cosmic-config.service.js +174 -0
- package/dist/esm/infrastructure/service/cosmic-config.service.js.map +1 -0
- package/dist/esm/infrastructure/service/index.d.ts +4 -0
- package/dist/esm/infrastructure/service/node-command.service.d.ts +45 -0
- package/dist/esm/infrastructure/service/node-command.service.js +152 -0
- package/dist/esm/infrastructure/service/node-command.service.js.map +1 -0
- package/dist/esm/infrastructure/service/node-file-system.service.d.ts +62 -0
- package/dist/esm/infrastructure/service/node-file-system.service.js +100 -0
- package/dist/esm/infrastructure/service/node-file-system.service.js.map +1 -0
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.d.ts +117 -0
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js +316 -0
- package/dist/esm/infrastructure/service/prompts-cli-interface.service.js.map +1 -0
- package/dist/esm/package.json +19 -0
- package/dist/esm/presentation/commitizen.adapter.d.ts +28 -0
- package/dist/esm/presentation/commitizen.adapter.js +302 -0
- package/dist/esm/presentation/commitizen.adapter.js.map +1 -0
- package/dist/esm/presentation/index.d.ts +1 -0
- package/index.cjs +1 -2
- package/package.json +42 -25
- package/dist/cjs/ManualProcess.d.ts +0 -6
- package/dist/cjs/ManualProcess.d.ts.map +0 -1
- package/dist/cjs/ManualProcess.js +0 -111
- package/dist/cjs/ManualProcess.js.map +0 -1
- package/dist/cjs/Process.d.ts +0 -6
- package/dist/cjs/Process.d.ts.map +0 -1
- package/dist/cjs/Process.js +0 -176
- package/dist/cjs/Process.js.map +0 -1
- package/dist/cjs/Question.d.ts +0 -46
- package/dist/cjs/Question.d.ts.map +0 -1
- package/dist/cjs/SectionBody.d.ts +0 -4
- package/dist/cjs/SectionBody.d.ts.map +0 -1
- package/dist/cjs/SectionFooter.d.ts +0 -13
- package/dist/cjs/SectionFooter.d.ts.map +0 -1
- package/dist/cjs/SectionHeader.d.ts +0 -15
- package/dist/cjs/SectionHeader.d.ts.map +0 -1
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/services/commitConfirmation.d.ts +0 -3
- package/dist/cjs/services/commitConfirmation.d.ts.map +0 -1
- package/dist/cjs/services/commitConfirmation.js +0 -122
- package/dist/cjs/services/commitConfirmation.js.map +0 -1
- package/dist/cjs/services/commitlintConfig.d.ts +0 -4
- package/dist/cjs/services/commitlintConfig.d.ts.map +0 -1
- package/dist/cjs/services/commitlintConfig.js +0 -198
- package/dist/cjs/services/commitlintConfig.js.map +0 -1
- package/dist/cjs/services/commitlintValidator.d.ts +0 -26
- package/dist/cjs/services/commitlintValidator.d.ts.map +0 -1
- package/dist/cjs/services/commitlintValidator.js +0 -146
- package/dist/cjs/services/commitlintValidator.js.map +0 -1
- package/dist/cjs/services/getRuleQuestionConfig.d.ts +0 -4
- package/dist/cjs/services/getRuleQuestionConfig.d.ts.map +0 -1
- package/dist/cjs/services/llm/anthropic.d.ts +0 -3
- package/dist/cjs/services/llm/anthropic.d.ts.map +0 -1
- package/dist/cjs/services/llm/anthropic.js +0 -118
- package/dist/cjs/services/llm/anthropic.js.map +0 -1
- package/dist/cjs/services/llm/config.d.ts +0 -5
- package/dist/cjs/services/llm/config.d.ts.map +0 -1
- package/dist/cjs/services/llm/config.js +0 -181
- package/dist/cjs/services/llm/config.js.map +0 -1
- package/dist/cjs/services/llm/index.d.ts +0 -6
- package/dist/cjs/services/llm/index.d.ts.map +0 -1
- package/dist/cjs/services/llm/index.js +0 -399
- package/dist/cjs/services/llm/index.js.map +0 -1
- package/dist/cjs/services/llm/models.d.ts +0 -34
- package/dist/cjs/services/llm/models.d.ts.map +0 -1
- package/dist/cjs/services/llm/models.js +0 -65
- package/dist/cjs/services/llm/models.js.map +0 -1
- package/dist/cjs/services/llm/openai.d.ts +0 -3
- package/dist/cjs/services/llm/openai.d.ts.map +0 -1
- package/dist/cjs/services/llm/openai.js +0 -111
- package/dist/cjs/services/llm/openai.js.map +0 -1
- package/dist/cjs/services/llm/types.d.ts +0 -71
- package/dist/cjs/services/llm/types.d.ts.map +0 -1
- package/dist/cjs/store/defaultPromptConfigs.d.ts +0 -33
- package/dist/cjs/store/defaultPromptConfigs.d.ts.map +0 -1
- package/dist/cjs/store/defaultPromptConfigs.js +0 -39
- package/dist/cjs/store/defaultPromptConfigs.js.map +0 -1
- package/dist/cjs/store/prompts.d.ts +0 -6
- package/dist/cjs/store/prompts.d.ts.map +0 -1
- package/dist/cjs/store/prompts.js +0 -40
- package/dist/cjs/store/prompts.js.map +0 -1
- package/dist/cjs/store/rules.d.ts +0 -7
- package/dist/cjs/store/rules.d.ts.map +0 -1
- package/dist/cjs/types.d.ts +0 -3
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/utils/case-function.d.ts +0 -9
- package/dist/cjs/utils/case-function.d.ts.map +0 -1
- package/dist/cjs/utils/full-stop-function.d.ts +0 -9
- package/dist/cjs/utils/full-stop-function.d.ts.map +0 -1
- package/dist/cjs/utils/leading-blank-function.d.ts +0 -8
- package/dist/cjs/utils/leading-blank-function.d.ts.map +0 -1
- package/dist/cjs/utils/rules.d.ts +0 -26
- package/dist/cjs/utils/rules.d.ts.map +0 -1
- package/dist/esm/ManualProcess.d.ts +0 -6
- package/dist/esm/ManualProcess.d.ts.map +0 -1
- package/dist/esm/ManualProcess.js +0 -107
- package/dist/esm/ManualProcess.js.map +0 -1
- package/dist/esm/Process.d.ts +0 -6
- package/dist/esm/Process.d.ts.map +0 -1
- package/dist/esm/Process.js +0 -172
- package/dist/esm/Process.js.map +0 -1
- package/dist/esm/Question.d.ts +0 -46
- package/dist/esm/Question.d.ts.map +0 -1
- package/dist/esm/SectionBody.d.ts +0 -4
- package/dist/esm/SectionBody.d.ts.map +0 -1
- package/dist/esm/SectionFooter.d.ts +0 -13
- package/dist/esm/SectionFooter.d.ts.map +0 -1
- package/dist/esm/SectionHeader.d.ts +0 -15
- package/dist/esm/SectionHeader.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/services/commitConfirmation.d.ts +0 -3
- package/dist/esm/services/commitConfirmation.d.ts.map +0 -1
- package/dist/esm/services/commitConfirmation.js +0 -120
- package/dist/esm/services/commitConfirmation.js.map +0 -1
- package/dist/esm/services/commitlintConfig.d.ts +0 -4
- package/dist/esm/services/commitlintConfig.d.ts.map +0 -1
- package/dist/esm/services/commitlintConfig.js +0 -196
- package/dist/esm/services/commitlintConfig.js.map +0 -1
- package/dist/esm/services/commitlintValidator.d.ts +0 -26
- package/dist/esm/services/commitlintValidator.d.ts.map +0 -1
- package/dist/esm/services/commitlintValidator.js +0 -142
- package/dist/esm/services/commitlintValidator.js.map +0 -1
- package/dist/esm/services/getRuleQuestionConfig.d.ts +0 -4
- package/dist/esm/services/getRuleQuestionConfig.d.ts.map +0 -1
- package/dist/esm/services/llm/anthropic.d.ts +0 -3
- package/dist/esm/services/llm/anthropic.d.ts.map +0 -1
- package/dist/esm/services/llm/anthropic.js +0 -116
- package/dist/esm/services/llm/anthropic.js.map +0 -1
- package/dist/esm/services/llm/config.d.ts +0 -5
- package/dist/esm/services/llm/config.d.ts.map +0 -1
- package/dist/esm/services/llm/config.js +0 -178
- package/dist/esm/services/llm/config.js.map +0 -1
- package/dist/esm/services/llm/index.d.ts +0 -6
- package/dist/esm/services/llm/index.d.ts.map +0 -1
- package/dist/esm/services/llm/index.js +0 -394
- package/dist/esm/services/llm/index.js.map +0 -1
- package/dist/esm/services/llm/models.d.ts +0 -34
- package/dist/esm/services/llm/models.d.ts.map +0 -1
- package/dist/esm/services/llm/models.js +0 -60
- package/dist/esm/services/llm/models.js.map +0 -1
- package/dist/esm/services/llm/openai.d.ts +0 -3
- package/dist/esm/services/llm/openai.d.ts.map +0 -1
- package/dist/esm/services/llm/openai.js +0 -109
- package/dist/esm/services/llm/openai.js.map +0 -1
- package/dist/esm/services/llm/types.d.ts +0 -71
- package/dist/esm/services/llm/types.d.ts.map +0 -1
- package/dist/esm/store/defaultPromptConfigs.d.ts +0 -33
- package/dist/esm/store/defaultPromptConfigs.d.ts.map +0 -1
- package/dist/esm/store/defaultPromptConfigs.js +0 -35
- package/dist/esm/store/defaultPromptConfigs.js.map +0 -1
- package/dist/esm/store/prompts.d.ts +0 -6
- package/dist/esm/store/prompts.d.ts.map +0 -1
- package/dist/esm/store/prompts.js +0 -38
- package/dist/esm/store/prompts.js.map +0 -1
- package/dist/esm/store/rules.d.ts +0 -7
- package/dist/esm/store/rules.d.ts.map +0 -1
- package/dist/esm/types.d.ts +0 -3
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/utils/case-function.d.ts +0 -9
- package/dist/esm/utils/case-function.d.ts.map +0 -1
- package/dist/esm/utils/full-stop-function.d.ts +0 -9
- package/dist/esm/utils/full-stop-function.d.ts.map +0 -1
- package/dist/esm/utils/leading-blank-function.d.ts +0 -8
- package/dist/esm/utils/leading-blank-function.d.ts.map +0 -1
- package/dist/esm/utils/rules.d.ts +0 -26
- package/dist/esm/utils/rules.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Value object representing a commit message body
|
|
5
|
+
*/
|
|
6
|
+
class CommitBody {
|
|
7
|
+
BREAKING_CHANGE;
|
|
8
|
+
CONTENT;
|
|
9
|
+
constructor(content, breakingChange) {
|
|
10
|
+
this.CONTENT = content?.trim() ?? undefined;
|
|
11
|
+
this.BREAKING_CHANGE = breakingChange?.trim() ?? undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Check if two bodies are equal
|
|
15
|
+
* @param {CommitBody} other - The other commit body to compare with
|
|
16
|
+
* @returns {boolean} True if the bodies are equal
|
|
17
|
+
*/
|
|
18
|
+
equals(other) {
|
|
19
|
+
return this.CONTENT === other.CONTENT && this.BREAKING_CHANGE === other.BREAKING_CHANGE;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the breaking change description
|
|
23
|
+
* @returns {string | undefined} The breaking change description or undefined
|
|
24
|
+
*/
|
|
25
|
+
getBreakingChange() {
|
|
26
|
+
return this.BREAKING_CHANGE;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the body content
|
|
30
|
+
* @returns {string | undefined} The body content or undefined
|
|
31
|
+
*/
|
|
32
|
+
getContent() {
|
|
33
|
+
return this.CONTENT;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if there is a breaking change
|
|
37
|
+
* @returns {boolean} True if there is a breaking change
|
|
38
|
+
*/
|
|
39
|
+
hasBreakingChange() {
|
|
40
|
+
return !!this.BREAKING_CHANGE;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if the body is empty
|
|
44
|
+
* @returns {boolean} True if the body is empty
|
|
45
|
+
*/
|
|
46
|
+
isEmpty() {
|
|
47
|
+
return !this.CONTENT && !this.BREAKING_CHANGE;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Format the body as a string
|
|
51
|
+
* @returns {string} The formatted body text
|
|
52
|
+
*/
|
|
53
|
+
toString() {
|
|
54
|
+
const parts = [];
|
|
55
|
+
if (this.BREAKING_CHANGE) {
|
|
56
|
+
parts.push(`BREAKING CHANGE: ${this.BREAKING_CHANGE}`);
|
|
57
|
+
}
|
|
58
|
+
if (this.CONTENT) {
|
|
59
|
+
parts.push(this.CONTENT);
|
|
60
|
+
}
|
|
61
|
+
return parts.join("\n\n");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
exports.CommitBody = CommitBody;
|
|
66
|
+
//# sourceMappingURL=commit-body.value-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-body.value-object.js","sources":["../../../../../src/domain/value-object/commit-body.value-object.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;AAEG;MACU,UAAU,CAAA;AACL,IAAA,eAAe;AAEf,IAAA,OAAO;IAExB,WAAY,CAAA,OAAgB,EAAE,cAAuB,EAAA;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,SAAS;QAC3C,IAAI,CAAC,eAAe,GAAG,cAAc,EAAE,IAAI,EAAE,IAAI,SAAS;;AAG3D;;;;AAIG;AACH,IAAA,MAAM,CAAC,KAAiB,EAAA;AACvB,QAAA,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe;;AAGxF;;;AAGG;IACH,iBAAiB,GAAA;QAChB,OAAO,IAAI,CAAC,eAAe;;AAG5B;;;AAGG;IACH,UAAU,GAAA;QACT,OAAO,IAAI,CAAC,OAAO;;AAGpB;;;AAGG;IACH,iBAAiB,GAAA;AAChB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe;;AAG9B;;;AAGG;IACH,OAAO,GAAA;QACN,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe;;AAG9C;;;AAGG;IACH,QAAQ,GAAA;QACP,MAAM,KAAK,GAAkB,EAAE;AAE/B,QAAA,IAAI,IAAI,CAAC,eAAe,EAAE;YACzB,KAAK,CAAC,IAAI,CAAC,CAAA,iBAAA,EAAoB,IAAI,CAAC,eAAe,CAAE,CAAA,CAAC;;AAGvD,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AACjB,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;;AAGzB,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;;AAE1B;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value object representing a commit message header
|
|
3
|
+
*/
|
|
4
|
+
export declare class CommitHeader {
|
|
5
|
+
private readonly SCOPE;
|
|
6
|
+
private readonly SUBJECT;
|
|
7
|
+
private readonly TYPE;
|
|
8
|
+
constructor(type: string, subject: string, scope?: string);
|
|
9
|
+
/**
|
|
10
|
+
* Check if two headers are equal
|
|
11
|
+
* @param {CommitHeader} other - The other commit header to compare with
|
|
12
|
+
* @returns {boolean} True if the headers are equal
|
|
13
|
+
*/
|
|
14
|
+
equals(other: CommitHeader): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Get the commit scope
|
|
17
|
+
* @returns {string | undefined} The commit scope or undefined
|
|
18
|
+
*/
|
|
19
|
+
getScope(): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Get the commit subject
|
|
22
|
+
* @returns {string} The commit subject
|
|
23
|
+
*/
|
|
24
|
+
getSubject(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the commit type
|
|
27
|
+
* @returns {string} The commit type
|
|
28
|
+
*/
|
|
29
|
+
getType(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Format the header as a string
|
|
32
|
+
* @returns {string} The formatted header
|
|
33
|
+
*/
|
|
34
|
+
toString(): string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Value object representing a commit message header
|
|
5
|
+
*/
|
|
6
|
+
class CommitHeader {
|
|
7
|
+
SCOPE;
|
|
8
|
+
SUBJECT;
|
|
9
|
+
TYPE;
|
|
10
|
+
constructor(type, subject, scope) {
|
|
11
|
+
if (!type || type.trim().length === 0) {
|
|
12
|
+
throw new Error("Commit type cannot be empty");
|
|
13
|
+
}
|
|
14
|
+
if (!subject || subject.trim().length === 0) {
|
|
15
|
+
throw new Error("Commit subject cannot be empty");
|
|
16
|
+
}
|
|
17
|
+
this.TYPE = type.trim();
|
|
18
|
+
this.SUBJECT = subject.trim();
|
|
19
|
+
this.SCOPE = scope?.trim();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if two headers are equal
|
|
23
|
+
* @param {CommitHeader} other - The other commit header to compare with
|
|
24
|
+
* @returns {boolean} True if the headers are equal
|
|
25
|
+
*/
|
|
26
|
+
equals(other) {
|
|
27
|
+
return this.TYPE === other.getType() && this.SCOPE === other.getScope() && this.SUBJECT === other.getSubject();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the commit scope
|
|
31
|
+
* @returns {string | undefined} The commit scope or undefined
|
|
32
|
+
*/
|
|
33
|
+
getScope() {
|
|
34
|
+
return this.SCOPE;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get the commit subject
|
|
38
|
+
* @returns {string} The commit subject
|
|
39
|
+
*/
|
|
40
|
+
getSubject() {
|
|
41
|
+
return this.SUBJECT;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the commit type
|
|
45
|
+
* @returns {string} The commit type
|
|
46
|
+
*/
|
|
47
|
+
getType() {
|
|
48
|
+
return this.TYPE;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Format the header as a string
|
|
52
|
+
* @returns {string} The formatted header
|
|
53
|
+
*/
|
|
54
|
+
toString() {
|
|
55
|
+
if (this.SCOPE) {
|
|
56
|
+
return `${this.TYPE}(${this.SCOPE}): ${this.SUBJECT}`;
|
|
57
|
+
}
|
|
58
|
+
return `${this.TYPE}: ${this.SUBJECT}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.CommitHeader = CommitHeader;
|
|
63
|
+
//# sourceMappingURL=commit-header.value-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-header.value-object.js","sources":["../../../../../src/domain/value-object/commit-header.value-object.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;AAEG;MACU,YAAY,CAAA;AACP,IAAA,KAAK;AAEL,IAAA,OAAO;AAEP,IAAA,IAAI;AAErB,IAAA,WAAA,CAAY,IAAY,EAAE,OAAe,EAAE,KAAc,EAAA;AACxD,QAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;AACtC,YAAA,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;;AAG/C,QAAA,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;AAC5C,YAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;;AAGlD,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;AACvB,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;AAC7B,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,EAAE,IAAI,EAAE;;AAG3B;;;;AAIG;AACH,IAAA,MAAM,CAAC,KAAmB,EAAA;QACzB,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,UAAU,EAAE;;AAG/G;;;AAGG;IACH,QAAQ,GAAA;QACP,OAAO,IAAI,CAAC,KAAK;;AAGlB;;;AAGG;IACH,UAAU,GAAA;QACT,OAAO,IAAI,CAAC,OAAO;;AAGpB;;;AAGG;IACH,OAAO,GAAA;QACN,OAAO,IAAI,CAAC,IAAI;;AAGjB;;;AAGG;IACH,QAAQ,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,KAAK,EAAE;AACf,YAAA,OAAO,CAAG,EAAA,IAAI,CAAC,IAAI,CAAI,CAAA,EAAA,IAAI,CAAC,KAAK,CAAM,GAAA,EAAA,IAAI,CAAC,OAAO,EAAE;;QAGtD,OAAO,CAAA,EAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,CAAA,CAAE;;AAEvC;;;;"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { getLLMConfig, setLLMConfig } from "./services/llm/index.js";
|
|
3
|
-
export type { CommitMode, LLMConfig, LLMConfigStorage, LLMModel, LLMProvider } from "./services/llm/types.js";
|
|
4
|
-
type Commit = (message: string) => void;
|
|
1
|
+
import "dotenv/config";
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
3
|
+
* Commitizen adapter entry point
|
|
4
|
+
* This function is called by Commitizen when running `git cz`
|
|
5
|
+
* It delegates to the CommitizenAdapter to handle the interactive commit process
|
|
6
|
+
* @param {unknown} inquirerInstance - The inquirer instance provided by Commitizen
|
|
7
|
+
* @param {(message: string) => void} commit - Callback function to execute the commit with the generated message
|
|
8
|
+
* @returns {Promise<void>} Promise that resolves when the commit process is complete
|
|
10
9
|
*/
|
|
11
|
-
export declare function prompter(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export declare function prompter(inquirerInstance: unknown, commit: (message: string) => void): Promise<void>;
|
|
11
|
+
declare const _default: {
|
|
12
|
+
prompter: typeof prompter;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
export * from './application/index';
|
|
16
|
+
export * from './domain/index';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,92 +1,94 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var node_path = require('node:path');
|
|
5
|
-
var load = require('@commitlint/load');
|
|
6
|
-
var chalk = require('chalk');
|
|
7
|
-
var dotenv = require('dotenv');
|
|
8
|
-
var inquirer = require('inquirer');
|
|
9
|
-
var Process = require('./Process.js');
|
|
10
|
-
require('./services/llm/index.js');
|
|
11
|
-
var config = require('./services/llm/config.js');
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return "auto";
|
|
40
|
-
}
|
|
41
|
-
};
|
|
5
|
+
var container = require('./infrastructure/di/container.js');
|
|
6
|
+
var commitizen_adapter = require('./presentation/commitizen.adapter.js');
|
|
7
|
+
require('dotenv/config');
|
|
8
|
+
var configureLlm_useCase = require('./application/use-case/configure-llm.use-case.js');
|
|
9
|
+
var generateCommitMessage_useCase = require('./application/use-case/generate-commit-message.use-case.js');
|
|
10
|
+
var manualCommit_useCase = require('./application/use-case/manual-commit.use-case.js');
|
|
11
|
+
var validateCommitMessage_useCase = require('./application/use-case/validate-commit-message.use-case.js');
|
|
12
|
+
var commitMessage_entity = require('./domain/entity/commit-message.entity.js');
|
|
13
|
+
var llmConfiguration_entity = require('./domain/entity/llm-configuration.entity.js');
|
|
14
|
+
var anthropicModel_enum = require('./domain/enum/anthropic-model.enum.js');
|
|
15
|
+
var awsBedrockModel_enum = require('./domain/enum/aws-bedrock-model.enum.js');
|
|
16
|
+
var azureOpenaiModel_enum = require('./domain/enum/azure-openai-model.enum.js');
|
|
17
|
+
var commitMode_enum = require('./domain/enum/commit-mode.enum.js');
|
|
18
|
+
var googleModel_enum = require('./domain/enum/google-model.enum.js');
|
|
19
|
+
var llmProvider_enum = require('./domain/enum/llm-provider.enum.js');
|
|
20
|
+
var logLevel_enum = require('./domain/enum/log-level.enum.js');
|
|
21
|
+
var ollamaModel_enum = require('./domain/enum/ollama-model.enum.js');
|
|
22
|
+
var openaiModel_enum = require('./domain/enum/openai-model.enum.js');
|
|
23
|
+
var apiKey_valueObject = require('./domain/value-object/api-key.value-object.js');
|
|
24
|
+
var commitBody_valueObject = require('./domain/value-object/commit-body.value-object.js');
|
|
25
|
+
var commitHeader_valueObject = require('./domain/value-object/commit-header.value-object.js');
|
|
26
|
+
|
|
27
|
+
// Initialize the DI container
|
|
28
|
+
container.createAppContainer();
|
|
29
|
+
// Create adapter instance
|
|
30
|
+
const adapter = new commitizen_adapter.CommitizenAdapter();
|
|
42
31
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
32
|
+
* Commitizen adapter entry point
|
|
33
|
+
* This function is called by Commitizen when running `git cz`
|
|
34
|
+
* It delegates to the CommitizenAdapter to handle the interactive commit process
|
|
35
|
+
* @param {unknown} inquirerInstance - The inquirer instance provided by Commitizen
|
|
36
|
+
* @param {(message: string) => void} commit - Callback function to execute the commit with the generated message
|
|
37
|
+
* @returns {Promise<void>} Promise that resolves when the commit process is complete
|
|
47
38
|
*/
|
|
48
|
-
async function prompter(
|
|
49
|
-
|
|
50
|
-
await load().then(async ({ prompt = {}, rules }) => {
|
|
51
|
-
// Use process (AI mode) unless manual mode is enabled
|
|
52
|
-
const commitMode = getCommitMode();
|
|
53
|
-
if (commitMode === "manual") {
|
|
54
|
-
const { useExisting } = await inquirer.prompt([
|
|
55
|
-
{
|
|
56
|
-
// eslint-disable-next-line @elsikora-typescript/naming-convention
|
|
57
|
-
default: true,
|
|
58
|
-
message: `Use manual configuration?`,
|
|
59
|
-
name: "useExisting",
|
|
60
|
-
type: "confirm",
|
|
61
|
-
},
|
|
62
|
-
]);
|
|
63
|
-
if (useExisting) {
|
|
64
|
-
console.log(chalk.blue("Using manual commit mode..."));
|
|
65
|
-
// Import manualProcess dynamically to avoid loading AI deps when not needed
|
|
66
|
-
// eslint-disable-next-line @elsikora-typescript/typedef
|
|
67
|
-
await Promise.resolve().then(function () { return require('./ManualProcess.js'); }).then(async ({ default: manualProcess }) => {
|
|
68
|
-
await manualProcess(rules, prompt, inquirerIns).then(commit);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
console.log(chalk.blue("Using AI-powered commit mode..."));
|
|
73
|
-
// eslint-disable-next-line @elsikora/typescript/no-non-null-assertion
|
|
74
|
-
const oldConfig = config.getLLMConfig();
|
|
75
|
-
config.setLLMConfig({
|
|
76
|
-
...oldConfig,
|
|
77
|
-
mode: "auto",
|
|
78
|
-
});
|
|
79
|
-
await Process.default(rules, prompt, inquirerIns).then(commit);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
console.log(chalk.blue("Using AI-powered commit mode..."));
|
|
84
|
-
await Process.default(rules, prompt, inquirerIns).then(commit);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
39
|
+
async function prompter(inquirerInstance, commit) {
|
|
40
|
+
return adapter.prompter(inquirerInstance, commit);
|
|
87
41
|
}
|
|
42
|
+
// Export the prompter function for Commitizen
|
|
43
|
+
var index = {
|
|
44
|
+
prompter,
|
|
45
|
+
};
|
|
88
46
|
|
|
89
|
-
exports.
|
|
90
|
-
exports.
|
|
47
|
+
exports.ConfigureLLMUseCase = configureLlm_useCase.ConfigureLLMUseCase;
|
|
48
|
+
exports.GenerateCommitMessageUseCase = generateCommitMessage_useCase.GenerateCommitMessageUseCase;
|
|
49
|
+
exports.ManualCommitUseCase = manualCommit_useCase.ManualCommitUseCase;
|
|
50
|
+
exports.ValidateCommitMessageUseCase = validateCommitMessage_useCase.ValidateCommitMessageUseCase;
|
|
51
|
+
exports.CommitMessage = commitMessage_entity.CommitMessage;
|
|
52
|
+
exports.LLMConfiguration = llmConfiguration_entity.LLMConfiguration;
|
|
53
|
+
Object.defineProperty(exports, "EAnthropicModel", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return anthropicModel_enum.EAnthropicModel; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "EAWSBedrockModel", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return awsBedrockModel_enum.EAWSBedrockModel; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "EAzureOpenAIModel", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return azureOpenaiModel_enum.EAzureOpenAIModel; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "ECommitMode", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return commitMode_enum.ECommitMode; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "EGoogleModel", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return googleModel_enum.EGoogleModel; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "ELLMProvider", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return llmProvider_enum.ELLMProvider; }
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "ELogLevel", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () { return logLevel_enum.ELogLevel; }
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "EOllamaModel", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return ollamaModel_enum.EOllamaModel; }
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "EOpenAIModel", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () { return openaiModel_enum.EOpenAIModel; }
|
|
88
|
+
});
|
|
89
|
+
exports.ApiKey = apiKey_valueObject.ApiKey;
|
|
90
|
+
exports.CommitBody = commitBody_valueObject.CommitBody;
|
|
91
|
+
exports.CommitHeader = commitHeader_valueObject.CommitHeader;
|
|
92
|
+
exports.default = index;
|
|
91
93
|
exports.prompter = prompter;
|
|
92
94
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":[null],"names":["createAppContainer","CommitizenAdapter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACAA,4BAAkB,EAAE;AAEpB;AACA,MAAM,OAAO,GAAsB,IAAIC,oCAAiB,EAAE;AAE1D;;;;;;;AAOG;AACI,eAAe,QAAQ,CAAC,gBAAyB,EAAE,MAAiC,EAAA;IAC1F,OAAO,OAAO,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;AAClD;AAEA;AACA,YAAe;IACd,QAAQ;CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ICommitValidationResult, ICommitValidator } from '../../application/interface/commit-validator.interface';
|
|
2
|
+
import type { ILlmPromptContext, ILlmService } from '../../application/interface/llm-service.interface';
|
|
3
|
+
import type { CommitMessage } from '../../domain/entity/commit-message.entity';
|
|
4
|
+
import type { LLMConfiguration } from '../../domain/entity/llm-configuration.entity';
|
|
5
|
+
/**
|
|
6
|
+
* Commitlint implementation of the commit validator
|
|
7
|
+
*/
|
|
8
|
+
export declare class CommitlintValidatorService implements ICommitValidator {
|
|
9
|
+
private readonly LLM_SERVICES?;
|
|
10
|
+
private llmConfiguration?;
|
|
11
|
+
constructor(llmServices?: Array<ILlmService>);
|
|
12
|
+
/**
|
|
13
|
+
* Attempt to fix a commit message based on validation errors
|
|
14
|
+
* @param {CommitMessage} message - The commit message to fix
|
|
15
|
+
* @param {ICommitValidationResult} validationResult - The validation result containing errors
|
|
16
|
+
* @param {ILlmPromptContext} context - Optional original context for LLM-based fixing
|
|
17
|
+
* @returns {Promise<CommitMessage | null>} Promise resolving to the fixed commit message or null if unfixable
|
|
18
|
+
*/
|
|
19
|
+
fix(message: CommitMessage, validationResult: ICommitValidationResult, context?: ILlmPromptContext): Promise<CommitMessage | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Set the LLM configuration for this validator
|
|
22
|
+
* @param {LLMConfiguration} configuration - The LLM configuration to set
|
|
23
|
+
*/
|
|
24
|
+
setLLMConfiguration(configuration: LLMConfiguration): void;
|
|
25
|
+
/**
|
|
26
|
+
* Validate a commit message using commitlint
|
|
27
|
+
* @param {CommitMessage} message - The commit message to validate
|
|
28
|
+
* @returns {Promise<ICommitValidationResult>} Promise resolving to the validation result
|
|
29
|
+
*/
|
|
30
|
+
validate(message: CommitMessage): Promise<ICommitValidationResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Wrap text to ensure no line exceeds the specified length
|
|
33
|
+
* @param {string | undefined} text - The text to wrap
|
|
34
|
+
* @param {number} maxLength - Maximum line length
|
|
35
|
+
* @returns {string | undefined} The wrapped text
|
|
36
|
+
*/
|
|
37
|
+
private wrapText;
|
|
38
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var lint = require('@commitlint/lint');
|
|
4
|
+
var load = require('@commitlint/load');
|
|
5
|
+
var numeric_constant = require('../../domain/constant/numeric.constant.js');
|
|
6
|
+
var commitBody_valueObject = require('../../domain/value-object/commit-body.value-object.js');
|
|
7
|
+
var commitHeader_valueObject = require('../../domain/value-object/commit-header.value-object.js');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Commitlint implementation of the commit validator
|
|
11
|
+
*/
|
|
12
|
+
class CommitlintValidatorService {
|
|
13
|
+
LLM_SERVICES;
|
|
14
|
+
llmConfiguration;
|
|
15
|
+
constructor(llmServices) {
|
|
16
|
+
this.LLM_SERVICES = llmServices;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Attempt to fix a commit message based on validation errors
|
|
20
|
+
* @param {CommitMessage} message - The commit message to fix
|
|
21
|
+
* @param {ICommitValidationResult} validationResult - The validation result containing errors
|
|
22
|
+
* @param {ILlmPromptContext} context - Optional original context for LLM-based fixing
|
|
23
|
+
* @returns {Promise<CommitMessage | null>} Promise resolving to the fixed commit message or null if unfixable
|
|
24
|
+
*/
|
|
25
|
+
async fix(message, validationResult, context) {
|
|
26
|
+
if (!validationResult.errors || validationResult.errors.length === 0) {
|
|
27
|
+
return message;
|
|
28
|
+
}
|
|
29
|
+
// If we have context and LLM services, use LLM to regenerate
|
|
30
|
+
if (context && this.LLM_SERVICES && this.llmConfiguration) {
|
|
31
|
+
const service = this.LLM_SERVICES.find((s) => {
|
|
32
|
+
const config = this.llmConfiguration;
|
|
33
|
+
return config ? s.supports(config) : false;
|
|
34
|
+
});
|
|
35
|
+
if (service) {
|
|
36
|
+
process.stdout.write("Using LLM to intelligently fix validation errors...\n");
|
|
37
|
+
try {
|
|
38
|
+
// Create a minimal context for fixing - no need to send diff again
|
|
39
|
+
const fixContext = {
|
|
40
|
+
body: context.body,
|
|
41
|
+
// Explicitly exclude diff and files
|
|
42
|
+
diff: undefined,
|
|
43
|
+
files: undefined,
|
|
44
|
+
rules: {
|
|
45
|
+
...(typeof context.rules === "object" && !Array.isArray(context.rules) ? context.rules : {}),
|
|
46
|
+
instructions: "Fix the commit message to comply with the validation rules. Do not change the meaning or content, only fix the format to pass validation.",
|
|
47
|
+
previousAttempt: message.toString(),
|
|
48
|
+
validationErrors: validationResult.errors,
|
|
49
|
+
},
|
|
50
|
+
scopeDescription: context.scopeDescription,
|
|
51
|
+
subject: context.subject,
|
|
52
|
+
typeDescription: context.typeDescription,
|
|
53
|
+
typeDescriptions: context.typeDescriptions,
|
|
54
|
+
typeEnum: context.typeEnum,
|
|
55
|
+
};
|
|
56
|
+
// Generate a new commit message with the minimal context
|
|
57
|
+
const fixedMessage = await service.generateCommitMessage(fixContext, this.llmConfiguration);
|
|
58
|
+
// Validate the new message
|
|
59
|
+
const fixedValidation = await this.validate(fixedMessage);
|
|
60
|
+
if (fixedValidation.isValid) {
|
|
61
|
+
process.stdout.write("LLM fix successful!\n");
|
|
62
|
+
return fixedMessage;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
process.stdout.write("LLM fix still has validation errors, falling back to simple fixes\n");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
process.stderr.write(`Failed to fix commit message with LLM: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
70
|
+
// Fall through to simple fixes
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
process.stdout.write("Attempting simple rule-based fixes...\n");
|
|
75
|
+
// Fallback to simple fixes
|
|
76
|
+
let fixedMessage = message;
|
|
77
|
+
// Try to fix common errors
|
|
78
|
+
for (const error of validationResult.errors) {
|
|
79
|
+
if (error.includes("subject may not be empty")) {
|
|
80
|
+
// Can't fix empty subject
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (error.includes("type may not be empty")) {
|
|
84
|
+
// Can't fix empty type
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
// Fix subject case issues
|
|
88
|
+
if (error.includes("subject must not be sentence-case")) {
|
|
89
|
+
const header = fixedMessage.getHeader();
|
|
90
|
+
const subject = header.getSubject();
|
|
91
|
+
const fixedSubject = subject.charAt(0).toLowerCase() + subject.slice(1);
|
|
92
|
+
const newHeader = new commitHeader_valueObject.CommitHeader(header.getType(), fixedSubject, header.getScope());
|
|
93
|
+
fixedMessage = fixedMessage.withHeader(newHeader);
|
|
94
|
+
}
|
|
95
|
+
// Fix subject trailing period
|
|
96
|
+
if (error.includes("subject may not end with period")) {
|
|
97
|
+
const header = fixedMessage.getHeader();
|
|
98
|
+
const subject = header.getSubject();
|
|
99
|
+
const fixedSubject = subject.replace(/\.$/, "");
|
|
100
|
+
const newHeader = new commitHeader_valueObject.CommitHeader(header.getType(), fixedSubject, header.getScope());
|
|
101
|
+
fixedMessage = fixedMessage.withHeader(newHeader);
|
|
102
|
+
}
|
|
103
|
+
// Fix header max length
|
|
104
|
+
if (error.includes("header must not be longer than")) {
|
|
105
|
+
const maxLengthNumbers = error.match(/\d+/g) ?? [];
|
|
106
|
+
if (maxLengthNumbers.length > 0 && maxLengthNumbers[0]) {
|
|
107
|
+
const maxLength = Number.parseInt(maxLengthNumbers[0], 10);
|
|
108
|
+
const header = fixedMessage.getHeader();
|
|
109
|
+
const currentLength = header.toString().length;
|
|
110
|
+
if (currentLength > maxLength) {
|
|
111
|
+
// Try to shorten the subject
|
|
112
|
+
const overhead = currentLength - maxLength;
|
|
113
|
+
const subject = header.getSubject();
|
|
114
|
+
const shortenedSubject = subject.slice(0, Math.max(0, subject.length - overhead - numeric_constant.ELLIPSIS_LENGTH)) + "...";
|
|
115
|
+
const newHeader = new commitHeader_valueObject.CommitHeader(header.getType(), shortenedSubject, header.getScope());
|
|
116
|
+
fixedMessage = fixedMessage.withHeader(newHeader);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Fix body/footer line length
|
|
121
|
+
if (error.includes("footer's lines must not be longer than") || error.includes("body's lines must not be longer than")) {
|
|
122
|
+
const maxLengthNumbers = error.match(/\d+/g) ?? [];
|
|
123
|
+
if (maxLengthNumbers.length > 0 && maxLengthNumbers[0]) {
|
|
124
|
+
const maxLength = Number.parseInt(maxLengthNumbers[0], 10);
|
|
125
|
+
const body = fixedMessage.getBody();
|
|
126
|
+
// Wrap body lines
|
|
127
|
+
const wrappedBody = this.wrapText(body.getContent(), maxLength);
|
|
128
|
+
const wrappedBreaking = this.wrapText(body.getBreakingChange(), maxLength);
|
|
129
|
+
const newBody = new commitBody_valueObject.CommitBody(wrappedBody, wrappedBreaking);
|
|
130
|
+
fixedMessage = fixedMessage.withBody(newBody);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Validate the fixed message
|
|
135
|
+
const fixedValidation = await this.validate(fixedMessage);
|
|
136
|
+
if (fixedValidation.isValid) {
|
|
137
|
+
process.stdout.write("Simple fixes successful!\n");
|
|
138
|
+
return fixedMessage;
|
|
139
|
+
}
|
|
140
|
+
// If still invalid, return null
|
|
141
|
+
process.stdout.write("Simple fixes failed to resolve all validation errors\n");
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Set the LLM configuration for this validator
|
|
146
|
+
* @param {LLMConfiguration} configuration - The LLM configuration to set
|
|
147
|
+
*/
|
|
148
|
+
setLLMConfiguration(configuration) {
|
|
149
|
+
this.llmConfiguration = configuration;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Validate a commit message using commitlint
|
|
153
|
+
* @param {CommitMessage} message - The commit message to validate
|
|
154
|
+
* @returns {Promise<ICommitValidationResult>} Promise resolving to the validation result
|
|
155
|
+
*/
|
|
156
|
+
async validate(message) {
|
|
157
|
+
const loadResult = await load();
|
|
158
|
+
const { rules = {} } = loadResult;
|
|
159
|
+
const result = await lint(message.toString(), rules);
|
|
160
|
+
return {
|
|
161
|
+
errors: result.errors.map((error) => error.message),
|
|
162
|
+
isValid: result.valid,
|
|
163
|
+
warnings: result.warnings.map((warning) => warning.message),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Wrap text to ensure no line exceeds the specified length
|
|
168
|
+
* @param {string | undefined} text - The text to wrap
|
|
169
|
+
* @param {number} maxLength - Maximum line length
|
|
170
|
+
* @returns {string | undefined} The wrapped text
|
|
171
|
+
*/
|
|
172
|
+
wrapText(text, maxLength) {
|
|
173
|
+
if (!text) {
|
|
174
|
+
return text;
|
|
175
|
+
}
|
|
176
|
+
const lines = text.split("\n");
|
|
177
|
+
const wrappedLines = [];
|
|
178
|
+
for (const line of lines) {
|
|
179
|
+
if (line.length <= maxLength) {
|
|
180
|
+
wrappedLines.push(line);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
// Simple word wrap
|
|
184
|
+
const words = line.split(" ");
|
|
185
|
+
let currentLine = "";
|
|
186
|
+
for (const word of words) {
|
|
187
|
+
if (currentLine.length + word.length + 1 <= maxLength) {
|
|
188
|
+
currentLine += (currentLine ? " " : "") + word;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
if (currentLine) {
|
|
192
|
+
wrappedLines.push(currentLine);
|
|
193
|
+
}
|
|
194
|
+
currentLine = word;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (currentLine) {
|
|
198
|
+
wrappedLines.push(currentLine);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return wrappedLines.join("\n");
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
exports.CommitlintValidatorService = CommitlintValidatorService;
|
|
207
|
+
//# sourceMappingURL=commitlint-validator.service.js.map
|