Skip to content

Conversation

@D1m7asis
Copy link
Contributor

Hi! From #483

Introduces AIMLAPI as a new AI provider option. Updates the README, config validation, model list, and engine selection logic to support AIMLAPI. Implements the AimlApiEngine for handling chat completions via the AIMLAPI endpoint.

Tested, all works just fine:
image
image

di-sukharev and others added 30 commits March 11, 2025 11:36
This change allows opencommit to locate commitlint installed globally
(with opencommit), which is useful for project that does not use node.js
environment or dose not have opencommit and @commitlint installed locally.
feat(commitlint): add additional search path for @commitlint
This update introduces a new structure for generating commit messages by defining a constant for commit types and consolidating the logic into a single function. The changes enhance readability and maintainability while ensuring consistent formatting based on the OCO_OMIT_SCOPE configuration.
…ve-consistency-handling

refactor(prompts): streamline commit message generation logic
…and improve configurations

Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
feat(package.json): add overrides for ajv and whatwg-url packages
fix(deepseek.ts): correct import path for OpenAiEngine and OpenAiConfig
Fix the punycode deprecated message from the source (survives building from eslint.config.ts).
chore: update GitHub Actions workflows to use latest action versions and improve configurations
Extends di-sukharev#445 to other providers which many provides deepseek
Signed-off-by: Tiger Kaovilai <[email protected]>
… improved clarity and consistency

The commitlint configuration and prompts have been refactored to enhance
clarity and maintain consistency throughout the codebase. The type
assertion for commitLintConfig is updated to use 'as any' for better
type handling. Additionally, formatting adjustments are made in the
prompts to ensure proper readability and alignment with the defined
conventions. These changes aim to streamline the commit message
generation process and improve overall code maintainability.
…ved file management

Including rimraf in the project allows for easier and more efficient
removal of files and directories, enhancing the development workflow,
especially for tasks like cleaning up build artifacts.
Resolves persistent `ReferenceError: exports is not defined` errors
encountered during unit tests (`unit-test (20.x)` job) in the GitHub
Actions CI environment. These errors occurred specifically when
importing `cli-testing-library` in the global Jest setup file
(`test/jest-setup.ts`), despite tests passing locally with the same
Node.js version (v20.19.0).

After iterative testing, the following Jest configuration combination
was identified as necessary to ensure consistent ESM handling and test
success in both local and CI environments:

- Set preset to `ts-jest/presets/default-esm` for stricter ESM rules.

- Configured `transformIgnorePatterns` to ensure Jest transforms specific ESM dependencies (`cli-testing-library`, `@clack`, `cleye`) within `node_modules`.

- Expanded the `transform` pattern (`^.+\\.(ts|tsx|js|jsx|mjs)$`) to explicitly cover various script types handled by `ts-jest`.

- Included explicit `tsconfig` overrides (`module: 'ESNext'`, `target: 'ES2022'`) within the `ts-jest` transform options to resolve potential environment discrepancies.

- Retained `moduleNameMapper` for `.js` imports for reliable module resolution.

- Ensured `cli-testing-library` imports remain in the global setup (`test/jest-setup.ts`).

- Removed test cache clearing from the `test:unit` script in `package.json`.

This configuration now passes reliably across environments.
The space normalization logic is updated to replace only multiple spaces
and tabs with a single space, while preserving newlines. This change
ensures that the formatting of the content is maintained, especially
when dealing with empty line requirements and max line length.
…ved file management

Including rimraf in the project allows for easier and more efficient
removal of files and directories, enhancing the development workflow,
especially for tasks like cleaning up build artifacts.
Resolves persistent `ReferenceError: exports is not defined` errors
encountered during unit tests (`unit-test (20.x)` job) in the GitHub
Actions CI environment. These errors occurred specifically when
importing `cli-testing-library` in the global Jest setup file
(`test/jest-setup.ts`), despite tests passing locally with the same
Node.js version (v20.19.0).

After iterative testing, the following Jest configuration combination
was identified as necessary to ensure consistent ESM handling and test
success in both local and CI environments:

- Set preset to `ts-jest/presets/default-esm` for stricter ESM rules.

- Configured `transformIgnorePatterns` to ensure Jest transforms specific ESM dependencies (`cli-testing-library`, `@clack`, `cleye`) within `node_modules`.

- Expanded the `transform` pattern (`^.+\\.(ts|tsx|js|jsx|mjs)$`) to explicitly cover various script types handled by `ts-jest`.

- Included explicit `tsconfig` overrides (`module: 'ESNext'`, `target: 'ES2022'`) within the `ts-jest` transform options to resolve potential environment discrepancies.

- Retained `moduleNameMapper` for `.js` imports for reliable module resolution.

- Ensured `cli-testing-library` imports remain in the global setup (`test/jest-setup.ts`).

- Removed test cache clearing from the `test:unit` script in `package.json`.

This configuration now passes reliably across environments.
The space normalization logic is updated to replace only multiple spaces
and tabs with a single space, while preserving newlines. This change
ensures that the formatting of the content is maintained, especially
when dealing with empty line requirements and max line length.
refactor(commitlint): update commitlint configuration and prompts
Add OCO_API_CUSTOM_HEADERS variable to README, config enum,
and env parsing to allow JSON string of custom headers.
Validate that custom headers are valid JSON in config validator.
Extend AiEngineConfig with customHeaders and pass headers to
OllamaEngine and OpenAiEngine clients when creating requests.
Parse custom headers in utils/engine and warn on invalid format.
Add unit tests to ensure OCO_API_CUSTOM_HEADERS is handled
correctly and merged from env over global config.

This enables users to send additional headers such as
Authorization or tracing headers with LLM API calls.
Use OpenAI.ClientOptions for stronger typing and clarity
Extract custom headers parsing into parseCustomHeaders util
Simplify getEngine by delegating header parsing to helper
Improve maintainability and reduce code duplication
- export parseCustomHeaders from src/utils/engine.ts
- use parseCustomHeaders in OpenAiEngine for config.customHeaders
- remove try/catch and inline JSON.parse logic
- update config test to expect headers as object and drop JSON.parse

Centralize header parsing for reuse and simplify engine code
Update tests to match new header format for clarity
di-sukharev and others added 27 commits June 8, 2025 10:42
Add OpenRouterEngine class and integrate it into the configuration
system. OpenRouter provides access to 300+ AI models through a
unified API, expanding model availability for commit message
generation beyond existing providers.
✨ add openrouter AI provider support with comprehensive model list
- Add prettier job to GitHub Actions workflow to enforce code formatting
- Add format:check script to package.json for checking formatting
- Include failure message when prettier check fails in CI
- Fix inconsistent indentation across multiple engine files
- Remove trailing whitespace and add missing newlines
- Improve code formatting in prompt generation functions
- Break long lines for better readability
- Standardize spacing and brackets placement
chore: Add Prettier format check to CI and format code
The changes:
1. Expanded the skip condition to include additional AI providers (DEEPSEEK, GROQ, MISTRAL, MLX, OPENROUTER) beyond just TEST
2. Maintained existing TEST provider skip behavior
3. Added explicit comment explaining the skip logic

The why:
Prevents migration execution for unsupported AI providers to avoid potential runtime errors or data inconsistencies, ensuring migrations only run for properly handled configurations.
fix(migrations): skip unhandled AI providers during migration execution
… a divider and instructions for better user guidance
feat(prepare-commit-msg-hook): enhance commit message formatting with a divider and instructions for better user guidance
…t message hook behavior to conditionally uncomment the message
feat(config): add OCO_HOOK_AUTO_UNCOMMENT config key and update commit message hook behavior to conditionally uncomment the message
feat(commit.ts): enable users to edit commit message before committing
fix(i18n): correct typo in Korean translation for 'feat' commit type
…-dir

Fix git commands when executed from subdirectories
Fix TypeScript build error and add missing confirm import (regression from di-sukharev#491)
…plementation docs: update README to include AIML API provider in environment variable options fix: include AIML API provider in configuration and validation logic

Introduces AIMLAPI as a new AI provider option. Updates the README, config validation, model list, and engine selection logic to support AIMLAPI. Implements the AimlApiEngine for handling chat completions via the AIMLAPI endpoint.
@D1m7asis D1m7asis changed the base branch from master to dev August 1, 2025 11:10
@D1m7asis D1m7asis closed this Aug 1, 2025
@OctavianTheI
Copy link

the new PR (to the dev branch) can be found at #505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.