@elsikora/commitizen-plugin-commitlint-ai 2.1.1-dev.2 → 2.1.1-dev.3

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.
@@ -0,0 +1,35 @@
1
+ import type { ILlmPromptContext, ILlmService } from '../../application/interface/llm-service.interface';
2
+ import type { LLMConfiguration } from '../../domain/entity/llm-configuration.entity';
3
+ import { CommitMessage } from '../../domain/entity/commit-message.entity';
4
+ /**
5
+ * Mock LLM service for testing without real API calls
6
+ * Activated when MOCK_LLM environment variable is set to "true"
7
+ */
8
+ export declare class MockLlmService implements ILlmService {
9
+ /**
10
+ * Generate a mock commit message based on context analysis
11
+ * @param {ILlmPromptContext} context - The context for generating the commit message
12
+ * @param {LLMConfiguration} _configuration - The LLM configuration (unused in mock)
13
+ * @returns {Promise<CommitMessage>} Promise resolving to the generated commit message
14
+ */
15
+ generateCommitMessage(context: ILlmPromptContext, _configuration: LLMConfiguration): Promise<CommitMessage>;
16
+ /**
17
+ * Check if the service supports the given configuration
18
+ * Mock service supports all providers when MOCK_LLM is enabled
19
+ * @param {LLMConfiguration} _configuration - The LLM configuration (unused)
20
+ * @returns {boolean} True if mock mode is enabled
21
+ */
22
+ supports(_configuration: LLMConfiguration): boolean;
23
+ /**
24
+ * Extract a numeric value from commitlint rules
25
+ * @param {unknown} rules - The commitlint rules
26
+ * @param {string} ruleName - The name of the rule to extract
27
+ * @returns {number | undefined} The numeric value or undefined
28
+ */
29
+ private extractRuleValue;
30
+ /**
31
+ * Check if mock mode is enabled via environment variable
32
+ * @returns {boolean} True if MOCK_LLM environment variable is set to "true" or "1"
33
+ */
34
+ private isMockEnabled;
35
+ }
@@ -0,0 +1,35 @@
1
+ import type { ILlmPromptContext, ILlmService } from '../../application/interface/llm-service.interface';
2
+ import type { LLMConfiguration } from '../../domain/entity/llm-configuration.entity';
3
+ import { CommitMessage } from '../../domain/entity/commit-message.entity';
4
+ /**
5
+ * Mock LLM service for testing without real API calls
6
+ * Activated when MOCK_LLM environment variable is set to "true"
7
+ */
8
+ export declare class MockLlmService implements ILlmService {
9
+ /**
10
+ * Generate a mock commit message based on context analysis
11
+ * @param {ILlmPromptContext} context - The context for generating the commit message
12
+ * @param {LLMConfiguration} _configuration - The LLM configuration (unused in mock)
13
+ * @returns {Promise<CommitMessage>} Promise resolving to the generated commit message
14
+ */
15
+ generateCommitMessage(context: ILlmPromptContext, _configuration: LLMConfiguration): Promise<CommitMessage>;
16
+ /**
17
+ * Check if the service supports the given configuration
18
+ * Mock service supports all providers when MOCK_LLM is enabled
19
+ * @param {LLMConfiguration} _configuration - The LLM configuration (unused)
20
+ * @returns {boolean} True if mock mode is enabled
21
+ */
22
+ supports(_configuration: LLMConfiguration): boolean;
23
+ /**
24
+ * Extract a numeric value from commitlint rules
25
+ * @param {unknown} rules - The commitlint rules
26
+ * @param {string} ruleName - The name of the rule to extract
27
+ * @returns {number | undefined} The numeric value or undefined
28
+ */
29
+ private extractRuleValue;
30
+ /**
31
+ * Check if mock mode is enabled via environment variable
32
+ * @returns {boolean} True if MOCK_LLM environment variable is set to "true" or "1"
33
+ */
34
+ private isMockEnabled;
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elsikora/commitizen-plugin-commitlint-ai",
3
- "version": "2.1.1-dev.2",
3
+ "version": "2.1.1-dev.3",
4
4
  "description": "AI-powered Commitizen adapter with Commitlint integration",
5
5
  "keywords": [
6
6
  "conventional-changelog",
@@ -36,7 +36,7 @@
36
36
  "build": "npm run prebuild && rollup -c",
37
37
  "build:test": "npm run prebuild && rollup -c rollup.test.config.js",
38
38
  "commit": "cz",
39
- "commit:test": "bash ./test-commit-edit.sh",
39
+ "commit:test": "bash ./test-commitlint-ai.sh",
40
40
  "format": "prettier --check .",
41
41
  "format:fix": "prettier --write .",
42
42
  "lint": "eslint ./",
@@ -1,14 +0,0 @@
1
- /**
2
- * Mock LLM provider for testing without real API calls
3
- * Set MOCK_LLM=true environment variable to use this mock
4
- */
5
- import type { CommitConfig, LLMPromptContext } from "./types.js";
6
- /**
7
- * Generate a mock commit message based on git diff analysis
8
- * @param context
9
- */
10
- export declare function generateCommitWithMock(context: LLMPromptContext): Promise<CommitConfig>;
11
- /**
12
- * Check if mock mode is enabled
13
- */
14
- export declare function isMockEnabled(): boolean;
@@ -1,14 +0,0 @@
1
- /**
2
- * Mock LLM provider for testing without real API calls
3
- * Set MOCK_LLM=true environment variable to use this mock
4
- */
5
- import type { CommitConfig, LLMPromptContext } from "./types.js";
6
- /**
7
- * Generate a mock commit message based on git diff analysis
8
- * @param context
9
- */
10
- export declare function generateCommitWithMock(context: LLMPromptContext): Promise<CommitConfig>;
11
- /**
12
- * Check if mock mode is enabled
13
- */
14
- export declare function isMockEnabled(): boolean;