@elsikora/commitizen-plugin-commitlint-ai 2.1.1 → 2.2.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/dist/cjs/application/use-case/edit-commit.use-case.d.ts +78 -0
- package/dist/cjs/application/use-case/edit-commit.use-case.js +273 -0
- package/dist/cjs/application/use-case/edit-commit.use-case.js.map +1 -0
- package/dist/cjs/application/use-case/index.d.ts +1 -0
- package/dist/cjs/domain/entity/commit-message.entity.d.ts +6 -0
- package/dist/cjs/domain/entity/commit-message.entity.js +15 -2
- package/dist/cjs/domain/entity/commit-message.entity.js.map +1 -1
- package/dist/cjs/domain/value-object/commit-body.value-object.d.ts +9 -3
- package/dist/cjs/domain/value-object/commit-body.value-object.js +17 -8
- package/dist/cjs/domain/value-object/commit-body.value-object.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/infrastructure/di/container.d.ts +1 -0
- package/dist/cjs/infrastructure/di/container.js +7 -2
- package/dist/cjs/infrastructure/di/container.js.map +1 -1
- package/dist/cjs/infrastructure/llm/mock-llm.service.d.ts +35 -0
- package/dist/cjs/infrastructure/llm/mock-llm.service.js +203 -0
- package/dist/cjs/infrastructure/llm/mock-llm.service.js.map +1 -0
- package/dist/cjs/presentation/commitizen.adapter.d.ts +7 -0
- package/dist/cjs/presentation/commitizen.adapter.js +26 -8
- package/dist/cjs/presentation/commitizen.adapter.js.map +1 -1
- package/dist/esm/application/use-case/edit-commit.use-case.d.ts +78 -0
- package/dist/esm/application/use-case/edit-commit.use-case.js +271 -0
- package/dist/esm/application/use-case/edit-commit.use-case.js.map +1 -0
- package/dist/esm/application/use-case/index.d.ts +1 -0
- package/dist/esm/domain/entity/commit-message.entity.d.ts +6 -0
- package/dist/esm/domain/entity/commit-message.entity.js +15 -2
- package/dist/esm/domain/entity/commit-message.entity.js.map +1 -1
- package/dist/esm/domain/value-object/commit-body.value-object.d.ts +9 -3
- package/dist/esm/domain/value-object/commit-body.value-object.js +17 -8
- package/dist/esm/domain/value-object/commit-body.value-object.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/infrastructure/di/container.d.ts +1 -0
- package/dist/esm/infrastructure/di/container.js +7 -3
- package/dist/esm/infrastructure/di/container.js.map +1 -1
- package/dist/esm/infrastructure/llm/mock-llm.service.d.ts +35 -0
- package/dist/esm/infrastructure/llm/mock-llm.service.js +201 -0
- package/dist/esm/infrastructure/llm/mock-llm.service.js.map +1 -0
- package/dist/esm/presentation/commitizen.adapter.d.ts +7 -0
- package/dist/esm/presentation/commitizen.adapter.js +27 -9
- package/dist/esm/presentation/commitizen.adapter.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { LLMConfiguration } from '../../domain/entity/llm-configuration.entity';
|
|
2
|
+
import type { ICliInterfaceService } from '../interface/cli-interface-service.interface';
|
|
3
|
+
import type { ICommitValidator } from '../interface/commit-validator.interface';
|
|
4
|
+
import type { ILlmPromptContext } from '../interface/llm-service.interface';
|
|
5
|
+
import type { ILlmService } from '../interface/llm-service.interface';
|
|
6
|
+
import { CommitMessage } from '../../domain/entity/commit-message.entity';
|
|
7
|
+
/**
|
|
8
|
+
* Use case for editing existing commit messages with point editing capabilities
|
|
9
|
+
*/
|
|
10
|
+
export declare class EditCommitUseCase {
|
|
11
|
+
private readonly CLI_INTERFACE;
|
|
12
|
+
private readonly LLM_SERVICES;
|
|
13
|
+
private readonly VALIDATOR;
|
|
14
|
+
constructor(cliInterface: ICliInterfaceService, validator: ICommitValidator, llmServices: Array<ILlmService>);
|
|
15
|
+
/**
|
|
16
|
+
* Execute the commit editing workflow
|
|
17
|
+
* @param {CommitMessage} commitMessage - The initial commit message to edit
|
|
18
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
19
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration for regeneration
|
|
20
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
21
|
+
*/
|
|
22
|
+
execute(commitMessage: CommitMessage, context: ILlmPromptContext, llmConfig?: LLMConfiguration): Promise<CommitMessage>;
|
|
23
|
+
/**
|
|
24
|
+
* Handle changing commit body
|
|
25
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
26
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
27
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
28
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
29
|
+
*/
|
|
30
|
+
private handleChangeBody;
|
|
31
|
+
/**
|
|
32
|
+
* Handle changing commit scope
|
|
33
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
34
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
35
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
36
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
37
|
+
*/
|
|
38
|
+
private handleChangeScope;
|
|
39
|
+
/**
|
|
40
|
+
* Handle changing commit subject
|
|
41
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
42
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
43
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
44
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
45
|
+
*/
|
|
46
|
+
private handleChangeSubject;
|
|
47
|
+
/**
|
|
48
|
+
* Handle changing commit type
|
|
49
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
50
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
51
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
52
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
53
|
+
*/
|
|
54
|
+
private handleChangeType;
|
|
55
|
+
/**
|
|
56
|
+
* Handle AI regeneration of commit message
|
|
57
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
58
|
+
* @param {LLMConfiguration} llmConfig - The LLM configuration
|
|
59
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the regenerated commit message
|
|
60
|
+
*/
|
|
61
|
+
private handleRegenerate;
|
|
62
|
+
/**
|
|
63
|
+
* Handle toggling breaking change status
|
|
64
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
65
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
66
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
67
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
68
|
+
*/
|
|
69
|
+
private handleToggleBreaking;
|
|
70
|
+
/**
|
|
71
|
+
* Handle toggling footer/issues
|
|
72
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
73
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
74
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
75
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
76
|
+
*/
|
|
77
|
+
private handleToggleFooter;
|
|
78
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commitMessage_entity = require('../../domain/entity/commit-message.entity.js');
|
|
4
|
+
var commitBody_valueObject = require('../../domain/value-object/commit-body.value-object.js');
|
|
5
|
+
var commitHeader_valueObject = require('../../domain/value-object/commit-header.value-object.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use case for editing existing commit messages with point editing capabilities
|
|
9
|
+
*/
|
|
10
|
+
class EditCommitUseCase {
|
|
11
|
+
CLI_INTERFACE;
|
|
12
|
+
LLM_SERVICES;
|
|
13
|
+
VALIDATOR;
|
|
14
|
+
constructor(cliInterface, validator, llmServices) {
|
|
15
|
+
this.CLI_INTERFACE = cliInterface;
|
|
16
|
+
this.VALIDATOR = validator;
|
|
17
|
+
this.LLM_SERVICES = llmServices;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Execute the commit editing workflow
|
|
21
|
+
* @param {CommitMessage} commitMessage - The initial commit message to edit
|
|
22
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
23
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration for regeneration
|
|
24
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
25
|
+
*/
|
|
26
|
+
async execute(commitMessage, context, llmConfig) {
|
|
27
|
+
// Show current commit message
|
|
28
|
+
this.CLI_INTERFACE.log("\nCurrent commit message:");
|
|
29
|
+
this.CLI_INTERFACE.note("Commit Preview", commitMessage.toString());
|
|
30
|
+
// Validate current message
|
|
31
|
+
const validation = await this.VALIDATOR.validate(commitMessage);
|
|
32
|
+
if (validation.isValid) {
|
|
33
|
+
this.CLI_INTERFACE.success("✅ Validation: PASSED");
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.CLI_INTERFACE.warn("❌ Validation: FAILED");
|
|
37
|
+
if (validation.errors && validation.errors.length > 0) {
|
|
38
|
+
for (const error of validation.errors) {
|
|
39
|
+
this.CLI_INTERFACE.error(` - ${error}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Build edit options
|
|
44
|
+
const editOptions = [
|
|
45
|
+
{ label: "✅ Confirm and use this commit message", value: "confirm" },
|
|
46
|
+
{ isDisabled: true, label: "─────────────────────────────────", value: "separator1" },
|
|
47
|
+
{ label: "🏷️ Edit commit type", value: "changeType" },
|
|
48
|
+
{ label: "🎯 Edit commit scope", value: "changeScope" },
|
|
49
|
+
{ label: "💬 Edit commit subject", value: "changeSubject" },
|
|
50
|
+
{ label: commitMessage.getBody().getContent() ? "📄 Edit commit body" : "➕ Add commit body", value: "changeBody" },
|
|
51
|
+
{ isDisabled: true, label: "─────────────────────────────────", value: "separator2" },
|
|
52
|
+
{
|
|
53
|
+
label: commitMessage.getBody().getFooter() ? "➖ Remove footer/issues" : "➕ Add footer/issues",
|
|
54
|
+
value: "toggleFooter",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: commitMessage.isBreakingChange() ? "✔️ Unmark as breaking change" : "⚠️ Mark as breaking change",
|
|
58
|
+
value: "toggleBreaking",
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
// Add regenerate option if LLM is configured
|
|
62
|
+
if (llmConfig) {
|
|
63
|
+
editOptions.splice(1, 0, { label: "🔄 Regenerate with AI", value: "regenerate" });
|
|
64
|
+
}
|
|
65
|
+
const action = await this.CLI_INTERFACE.select("What would you like to do?", editOptions);
|
|
66
|
+
switch (action) {
|
|
67
|
+
case "changeBody": {
|
|
68
|
+
return this.handleChangeBody(commitMessage, context, llmConfig);
|
|
69
|
+
}
|
|
70
|
+
case "changeScope": {
|
|
71
|
+
return this.handleChangeScope(commitMessage, context, llmConfig);
|
|
72
|
+
}
|
|
73
|
+
case "changeSubject": {
|
|
74
|
+
return this.handleChangeSubject(commitMessage, context, llmConfig);
|
|
75
|
+
}
|
|
76
|
+
case "changeType": {
|
|
77
|
+
return this.handleChangeType(commitMessage, context, llmConfig);
|
|
78
|
+
}
|
|
79
|
+
case "confirm": {
|
|
80
|
+
return commitMessage;
|
|
81
|
+
}
|
|
82
|
+
case "regenerate": {
|
|
83
|
+
return this.handleRegenerate(context, llmConfig);
|
|
84
|
+
}
|
|
85
|
+
case "toggleBreaking": {
|
|
86
|
+
return this.handleToggleBreaking(commitMessage, context, llmConfig);
|
|
87
|
+
}
|
|
88
|
+
case "toggleFooter": {
|
|
89
|
+
return this.handleToggleFooter(commitMessage, context, llmConfig);
|
|
90
|
+
}
|
|
91
|
+
default: {
|
|
92
|
+
// Should never reach here
|
|
93
|
+
return commitMessage;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Handle changing commit body
|
|
99
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
100
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
101
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
102
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
103
|
+
*/
|
|
104
|
+
async handleChangeBody(commitMessage, context, llmConfig) {
|
|
105
|
+
const body = commitMessage.getBody();
|
|
106
|
+
this.CLI_INTERFACE.info("💡 Leave empty to remove body (clear all text and press Enter)");
|
|
107
|
+
const newBodyContent = await this.CLI_INTERFACE.text(context.body?.description ?? "Body description (optional):", body.getContent() ?? "");
|
|
108
|
+
const finalBodyContent = newBodyContent.trim() === "" ? undefined : newBodyContent.trim();
|
|
109
|
+
const newBody = new commitBody_valueObject.CommitBody(finalBodyContent, body.getBreakingChange(), body.getFooter());
|
|
110
|
+
const newMessage = commitMessage.withBody(newBody);
|
|
111
|
+
return this.execute(newMessage, context, llmConfig);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Handle changing commit scope
|
|
115
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
116
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
117
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
118
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
119
|
+
*/
|
|
120
|
+
async handleChangeScope(commitMessage, context, llmConfig) {
|
|
121
|
+
const header = commitMessage.getHeader();
|
|
122
|
+
// Scope is optional, use placeholder to allow deletion
|
|
123
|
+
const newScope = await this.CLI_INTERFACE.text(context.scopeDescription ?? "What is the scope of this change?", header.getScope() ?? "");
|
|
124
|
+
const finalScope = newScope.trim() === "" ? undefined : newScope.trim();
|
|
125
|
+
const newHeader = new commitHeader_valueObject.CommitHeader(header.getType(), header.getSubject(), finalScope);
|
|
126
|
+
const newMessage = commitMessage.withHeader(newHeader);
|
|
127
|
+
return this.execute(newMessage, context, llmConfig);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Handle changing commit subject
|
|
131
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
132
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
133
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
134
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
135
|
+
*/
|
|
136
|
+
async handleChangeSubject(commitMessage, context, llmConfig) {
|
|
137
|
+
const header = commitMessage.getHeader();
|
|
138
|
+
// Subject is required by commitlint rules, use initialValue to prevent deletion
|
|
139
|
+
const newSubject = await this.CLI_INTERFACE.text(context.subject?.description ?? "Write a short, imperative description of the change:", "", header.getSubject());
|
|
140
|
+
const newHeader = new commitHeader_valueObject.CommitHeader(header.getType(), newSubject.trim(), header.getScope());
|
|
141
|
+
const newMessage = commitMessage.withHeader(newHeader);
|
|
142
|
+
return this.execute(newMessage, context, llmConfig);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Handle changing commit type
|
|
146
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
147
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
148
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
149
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
150
|
+
*/
|
|
151
|
+
async handleChangeType(commitMessage, context, llmConfig) {
|
|
152
|
+
const header = commitMessage.getHeader();
|
|
153
|
+
// Build type options
|
|
154
|
+
const typeOptions = context.typeEnum?.map((type) => {
|
|
155
|
+
const desc = context.typeDescriptions?.[type]?.description ?? "";
|
|
156
|
+
const emoji = context.typeDescriptions?.[type]?.emoji ?? "";
|
|
157
|
+
let cleanDesc = desc;
|
|
158
|
+
if (emoji && desc.startsWith(emoji)) {
|
|
159
|
+
cleanDesc = desc.slice(emoji.length).trim();
|
|
160
|
+
}
|
|
161
|
+
const label = emoji ? `${type} ${emoji}: ${cleanDesc}` : `${type}: ${cleanDesc}`;
|
|
162
|
+
return { label, value: type };
|
|
163
|
+
}) ?? [];
|
|
164
|
+
const newType = await this.CLI_INTERFACE.select(context.typeDescription ?? "Select the type of change:", typeOptions, header.getType());
|
|
165
|
+
const newHeader = new commitHeader_valueObject.CommitHeader(newType, header.getSubject(), header.getScope());
|
|
166
|
+
const newMessage = commitMessage.withHeader(newHeader);
|
|
167
|
+
return this.execute(newMessage, context, llmConfig);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Handle AI regeneration of commit message
|
|
171
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
172
|
+
* @param {LLMConfiguration} llmConfig - The LLM configuration
|
|
173
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the regenerated commit message
|
|
174
|
+
*/
|
|
175
|
+
async handleRegenerate(context, llmConfig) {
|
|
176
|
+
this.CLI_INTERFACE.startSpinner("🔄 Regenerating commit message with AI...");
|
|
177
|
+
try {
|
|
178
|
+
const service = this.LLM_SERVICES.find((s) => s.supports(llmConfig));
|
|
179
|
+
if (!service) {
|
|
180
|
+
throw new Error(`No LLM service found for provider: ${llmConfig.getProvider()}`);
|
|
181
|
+
}
|
|
182
|
+
const newCommitMessage = await service.generateCommitMessage(context, llmConfig);
|
|
183
|
+
this.CLI_INTERFACE.stopSpinner();
|
|
184
|
+
// Validate the new message
|
|
185
|
+
const validation = await this.VALIDATOR.validate(newCommitMessage);
|
|
186
|
+
this.CLI_INTERFACE.success("✅ New commit message generated successfully!");
|
|
187
|
+
this.CLI_INTERFACE.log("\nRegenerated commit message:");
|
|
188
|
+
this.CLI_INTERFACE.note("New Commit", newCommitMessage.toString());
|
|
189
|
+
if (validation.isValid) {
|
|
190
|
+
this.CLI_INTERFACE.success("✅ Validation: PASSED");
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.CLI_INTERFACE.warn("❌ Validation: FAILED");
|
|
194
|
+
if (validation.errors) {
|
|
195
|
+
for (const error of validation.errors) {
|
|
196
|
+
this.CLI_INTERFACE.error(` - ${error}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Continue editing with the new message
|
|
201
|
+
return this.execute(newCommitMessage, context, llmConfig);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
this.CLI_INTERFACE.stopSpinner();
|
|
205
|
+
this.CLI_INTERFACE.error("Failed to regenerate commit message");
|
|
206
|
+
this.CLI_INTERFACE.handleError("Error:", error);
|
|
207
|
+
// Ask if user wants to try again or go back to editing
|
|
208
|
+
const retry = await this.CLI_INTERFACE.confirm("Would you like to try regenerating again?", false);
|
|
209
|
+
if (retry) {
|
|
210
|
+
return this.handleRegenerate(context, llmConfig);
|
|
211
|
+
}
|
|
212
|
+
// Return to edit menu with original message
|
|
213
|
+
return this.execute(new commitMessage_entity.CommitMessage(new commitHeader_valueObject.CommitHeader(context.typeEnum?.[0] || "feat", "fix: update"), new commitBody_valueObject.CommitBody()), context, llmConfig);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Handle toggling breaking change status
|
|
218
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
219
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
220
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
221
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
222
|
+
*/
|
|
223
|
+
async handleToggleBreaking(commitMessage, context, llmConfig) {
|
|
224
|
+
const body = commitMessage.getBody();
|
|
225
|
+
if (commitMessage.isBreakingChange()) {
|
|
226
|
+
// Remove breaking change
|
|
227
|
+
const newBody = new commitBody_valueObject.CommitBody(body.getContent(), undefined, body.getFooter());
|
|
228
|
+
const newMessage = commitMessage.withBody(newBody);
|
|
229
|
+
this.CLI_INTERFACE.success("✅ Removed breaking change marker");
|
|
230
|
+
return this.execute(newMessage, context, llmConfig);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
// Add breaking change
|
|
234
|
+
const breakingDescription = await this.CLI_INTERFACE.text("Describe the breaking change:", "", "");
|
|
235
|
+
const finalBreaking = breakingDescription.trim() === "" ? "BREAKING CHANGE" : breakingDescription.trim();
|
|
236
|
+
const newBody = new commitBody_valueObject.CommitBody(body.getContent(), finalBreaking, body.getFooter());
|
|
237
|
+
const newMessage = commitMessage.withBody(newBody);
|
|
238
|
+
this.CLI_INTERFACE.success("✅ Added breaking change marker");
|
|
239
|
+
return this.execute(newMessage, context, llmConfig);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Handle toggling footer/issues
|
|
244
|
+
* @param {CommitMessage} commitMessage - The current commit message
|
|
245
|
+
* @param {ILlmPromptContext} context - The LLM prompt context
|
|
246
|
+
* @param {LLMConfiguration | undefined} llmConfig - Optional LLM configuration
|
|
247
|
+
* @returns {Promise<CommitMessage>} Promise resolving to the edited commit message
|
|
248
|
+
*/
|
|
249
|
+
async handleToggleFooter(commitMessage, context, llmConfig) {
|
|
250
|
+
const body = commitMessage.getBody();
|
|
251
|
+
if (body.getFooter()) {
|
|
252
|
+
// Remove footer
|
|
253
|
+
const newBody = new commitBody_valueObject.CommitBody(body.getContent(), body.getBreakingChange(), undefined);
|
|
254
|
+
const newMessage = commitMessage.withBody(newBody);
|
|
255
|
+
this.CLI_INTERFACE.success("✅ Footer/issues removed");
|
|
256
|
+
return this.execute(newMessage, context, llmConfig);
|
|
257
|
+
}
|
|
258
|
+
// Add footer
|
|
259
|
+
this.CLI_INTERFACE.info("💡 Examples: 'Closes #123', 'Fixes #456', 'Refs #789'");
|
|
260
|
+
const footer = await this.CLI_INTERFACE.text("Footer (issues, references):", "");
|
|
261
|
+
if (footer.trim() === "") {
|
|
262
|
+
this.CLI_INTERFACE.warn("Footer cannot be empty. Skipping...");
|
|
263
|
+
return this.execute(commitMessage, context, llmConfig);
|
|
264
|
+
}
|
|
265
|
+
const newBody = new commitBody_valueObject.CommitBody(body.getContent(), body.getBreakingChange(), footer.trim());
|
|
266
|
+
const newMessage = commitMessage.withBody(newBody);
|
|
267
|
+
this.CLI_INTERFACE.success("✅ Footer/issues added");
|
|
268
|
+
return this.execute(newMessage, context, llmConfig);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
exports.EditCommitUseCase = EditCommitUseCase;
|
|
273
|
+
//# sourceMappingURL=edit-commit.use-case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-commit.use-case.js","sources":["../../../../../src/application/use-case/edit-commit.use-case.ts"],"sourcesContent":[null],"names":["CommitBody","CommitHeader","CommitMessage"],"mappings":";;;;;;AAUA;;AAEG;MACU,iBAAiB,CAAA;AACZ,IAAA,aAAa;AAEb,IAAA,YAAY;AAEZ,IAAA,SAAS;AAE1B,IAAA,WAAA,CAAY,YAAkC,EAAE,SAA2B,EAAE,WAA+B,EAAA;AAC3G,QAAA,IAAI,CAAC,aAAa,GAAG,YAAY;AACjC,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,QAAA,IAAI,CAAC,YAAY,GAAG,WAAW;IAChC;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,OAAO,CAAC,aAA4B,EAAE,OAA0B,EAAE,SAA4B,EAAA;;AAEnG,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,2BAA2B,CAAC;AACnD,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;;QAGnE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC;AAE/D,QAAA,IAAI,UAAU,CAAC,OAAO,EAAE;AACvB,YAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,sBAAsB,CAAC;QACnD;aAAO;AACN,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,sBAAsB,CAAC;AAE/C,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
|
30
30
|
/**
|
|
31
31
|
* Format the complete commit message
|
|
32
|
+
* Follows conventional commits format:
|
|
33
|
+
* <header>
|
|
34
|
+
*
|
|
35
|
+
* <body>
|
|
36
|
+
*
|
|
37
|
+
* <footer>
|
|
32
38
|
* @returns {string} The formatted commit message
|
|
33
39
|
*/
|
|
34
40
|
toString(): string;
|
|
@@ -40,12 +40,25 @@ class CommitMessage {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Format the complete commit message
|
|
43
|
+
* Follows conventional commits format:
|
|
44
|
+
* <header>
|
|
45
|
+
*
|
|
46
|
+
* <body>
|
|
47
|
+
*
|
|
48
|
+
* <footer>
|
|
43
49
|
* @returns {string} The formatted commit message
|
|
44
50
|
*/
|
|
45
51
|
toString() {
|
|
46
52
|
const parts = [this.HEADER.toString()];
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
// Add body (content + breaking change) if not empty
|
|
54
|
+
const bodyText = this.BODY.toString();
|
|
55
|
+
if (bodyText) {
|
|
56
|
+
parts.push(bodyText);
|
|
57
|
+
}
|
|
58
|
+
// Add footer separately (for proper commitlint parsing)
|
|
59
|
+
const footer = this.BODY.getFooter();
|
|
60
|
+
if (footer) {
|
|
61
|
+
parts.push(footer);
|
|
49
62
|
}
|
|
50
63
|
return parts.join("\n\n");
|
|
51
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-message.entity.js","sources":["../../../../../src/domain/entity/commit-message.entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;MACU,aAAa,CAAA;AACR,IAAA,IAAI;AAEJ,IAAA,MAAM;IAEvB,WAAA,CAAY,MAAoB,EAAE,IAAgB,EAAA;AACjD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AACpB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;IACjB;AAEA;;;AAGG;IACH,OAAO,GAAA;QACN,OAAO,IAAI,CAAC,IAAI;IACjB;AAEA;;;AAGG;IACH,iBAAiB,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;IACrC;AAEA;;;AAGG;IACH,SAAS,GAAA;QACR,OAAO,IAAI,CAAC,MAAM;IACnB;AAEA;;;AAGG;IACH,gBAAgB,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;IACrC;AAEA
|
|
1
|
+
{"version":3,"file":"commit-message.entity.js","sources":["../../../../../src/domain/entity/commit-message.entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;AAEG;MACU,aAAa,CAAA;AACR,IAAA,IAAI;AAEJ,IAAA,MAAM;IAEvB,WAAA,CAAY,MAAoB,EAAE,IAAgB,EAAA;AACjD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AACpB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;IACjB;AAEA;;;AAGG;IACH,OAAO,GAAA;QACN,OAAO,IAAI,CAAC,IAAI;IACjB;AAEA;;;AAGG;IACH,iBAAiB,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;IACrC;AAEA;;;AAGG;IACH,SAAS,GAAA;QACR,OAAO,IAAI,CAAC,MAAM;IACnB;AAEA;;;AAGG;IACH,gBAAgB,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;IACrC;AAEA;;;;;;;;;AASG;IACH,QAAQ,GAAA;QACP,MAAM,KAAK,GAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;;QAGrD,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAE7C,IAAI,QAAQ,EAAE;AACb,YAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrB;;QAGA,MAAM,MAAM,GAAuB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAExD,IAAI,MAAM,EAAE;AACX,YAAA,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;QACnB;AAEA,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B;AAEA;;;;AAIG;AACH,IAAA,QAAQ,CAAC,IAAgB,EAAA;QACxB,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5C;AAEA;;;;AAIG;AACH,IAAA,UAAU,CAAC,MAAoB,EAAA;QAC9B,OAAO,IAAI,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;IAC5C;AACA;;;;"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
export declare class CommitBody {
|
|
5
5
|
private readonly BREAKING_CHANGE;
|
|
6
6
|
private readonly CONTENT;
|
|
7
|
-
|
|
7
|
+
private readonly FOOTER;
|
|
8
|
+
constructor(content?: string, breakingChange?: string, footer?: string);
|
|
8
9
|
/**
|
|
9
10
|
* Check if two bodies are equal
|
|
10
11
|
* @param {CommitBody} other - The other commit body to compare with
|
|
@@ -21,6 +22,11 @@ export declare class CommitBody {
|
|
|
21
22
|
* @returns {string | undefined} The body content or undefined
|
|
22
23
|
*/
|
|
23
24
|
getContent(): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Get the footer (issues, references, etc.)
|
|
27
|
+
* @returns {string | undefined} The footer or undefined
|
|
28
|
+
*/
|
|
29
|
+
getFooter(): string | undefined;
|
|
24
30
|
/**
|
|
25
31
|
* Check if there is a breaking change
|
|
26
32
|
* @returns {boolean} True if there is a breaking change
|
|
@@ -32,8 +38,8 @@ export declare class CommitBody {
|
|
|
32
38
|
*/
|
|
33
39
|
isEmpty(): boolean;
|
|
34
40
|
/**
|
|
35
|
-
* Format the body as a string
|
|
36
|
-
* @returns {string} The formatted body text
|
|
41
|
+
* Format the body as a string (without footer)
|
|
42
|
+
* @returns {string} The formatted body text (content + breaking change only)
|
|
37
43
|
*/
|
|
38
44
|
toString(): string;
|
|
39
45
|
}
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
class CommitBody {
|
|
7
7
|
BREAKING_CHANGE;
|
|
8
8
|
CONTENT;
|
|
9
|
-
|
|
9
|
+
FOOTER;
|
|
10
|
+
constructor(content, breakingChange, footer) {
|
|
10
11
|
this.CONTENT = content?.trim() ?? undefined;
|
|
11
12
|
this.BREAKING_CHANGE = breakingChange?.trim() ?? undefined;
|
|
13
|
+
this.FOOTER = footer?.trim() ?? undefined;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Check if two bodies are equal
|
|
@@ -16,7 +18,7 @@ class CommitBody {
|
|
|
16
18
|
* @returns {boolean} True if the bodies are equal
|
|
17
19
|
*/
|
|
18
20
|
equals(other) {
|
|
19
|
-
return this.CONTENT === other.CONTENT && this.BREAKING_CHANGE === other.BREAKING_CHANGE;
|
|
21
|
+
return this.CONTENT === other.CONTENT && this.BREAKING_CHANGE === other.BREAKING_CHANGE && this.FOOTER === other.FOOTER;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Get the breaking change description
|
|
@@ -32,6 +34,13 @@ class CommitBody {
|
|
|
32
34
|
getContent() {
|
|
33
35
|
return this.CONTENT;
|
|
34
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the footer (issues, references, etc.)
|
|
39
|
+
* @returns {string | undefined} The footer or undefined
|
|
40
|
+
*/
|
|
41
|
+
getFooter() {
|
|
42
|
+
return this.FOOTER;
|
|
43
|
+
}
|
|
35
44
|
/**
|
|
36
45
|
* Check if there is a breaking change
|
|
37
46
|
* @returns {boolean} True if there is a breaking change
|
|
@@ -44,20 +53,20 @@ class CommitBody {
|
|
|
44
53
|
* @returns {boolean} True if the body is empty
|
|
45
54
|
*/
|
|
46
55
|
isEmpty() {
|
|
47
|
-
return !this.CONTENT && !this.BREAKING_CHANGE;
|
|
56
|
+
return !this.CONTENT && !this.BREAKING_CHANGE && !this.FOOTER;
|
|
48
57
|
}
|
|
49
58
|
/**
|
|
50
|
-
* Format the body as a string
|
|
51
|
-
* @returns {string} The formatted body text
|
|
59
|
+
* Format the body as a string (without footer)
|
|
60
|
+
* @returns {string} The formatted body text (content + breaking change only)
|
|
52
61
|
*/
|
|
53
62
|
toString() {
|
|
54
63
|
const parts = [];
|
|
55
|
-
if (this.BREAKING_CHANGE) {
|
|
56
|
-
parts.push(`BREAKING CHANGE: ${this.BREAKING_CHANGE}`);
|
|
57
|
-
}
|
|
58
64
|
if (this.CONTENT) {
|
|
59
65
|
parts.push(this.CONTENT);
|
|
60
66
|
}
|
|
67
|
+
if (this.BREAKING_CHANGE) {
|
|
68
|
+
parts.push(`BREAKING CHANGE: ${this.BREAKING_CHANGE}`);
|
|
69
|
+
}
|
|
61
70
|
return parts.join("\n\n");
|
|
62
71
|
}
|
|
63
72
|
}
|
|
@@ -1 +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;
|
|
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;AAEP,IAAA,MAAM;AAEvB,IAAA,WAAA,CAAY,OAAgB,EAAE,cAAuB,EAAE,MAAe,EAAA;QACrE,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,SAAS;QAC3C,IAAI,CAAC,eAAe,GAAG,cAAc,EAAE,IAAI,EAAE,IAAI,SAAS;QAC1D,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,SAAS;IAC1C;AAEA;;;;AAIG;AACH,IAAA,MAAM,CAAC,KAAiB,EAAA;QACvB,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;IACxH;AAEA;;;AAGG;IACH,iBAAiB,GAAA;QAChB,OAAO,IAAI,CAAC,eAAe;IAC5B;AAEA;;;AAGG;IACH,UAAU,GAAA;QACT,OAAO,IAAI,CAAC,OAAO;IACpB;AAEA;;;AAGG;IACH,SAAS,GAAA;QACR,OAAO,IAAI,CAAC,MAAM;IACnB;AAEA;;;AAGG;IACH,iBAAiB,GAAA;AAChB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe;IAC9B;AAEA;;;AAGG;IACH,OAAO,GAAA;AACN,QAAA,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,MAAM;IAC9D;AAEA;;;AAGG;IACH,QAAQ,GAAA;QACP,MAAM,KAAK,GAAkB,EAAE;AAE/B,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AACjB,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QACzB;AAEA,QAAA,IAAI,IAAI,CAAC,eAAe,EAAE;YACzB,KAAK,CAAC,IAAI,CAAC,CAAA,iBAAA,EAAoB,IAAI,CAAC,eAAe,CAAA,CAAE,CAAC;QACvD;AAEA,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B;AACA;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var container = require('./infrastructure/di/container.js');
|
|
|
6
6
|
var commitizen_adapter = require('./presentation/commitizen.adapter.js');
|
|
7
7
|
require('dotenv/config');
|
|
8
8
|
var configureLlm_useCase = require('./application/use-case/configure-llm.use-case.js');
|
|
9
|
+
var editCommit_useCase = require('./application/use-case/edit-commit.use-case.js');
|
|
9
10
|
var generateCommitMessage_useCase = require('./application/use-case/generate-commit-message.use-case.js');
|
|
10
11
|
var manualCommit_useCase = require('./application/use-case/manual-commit.use-case.js');
|
|
11
12
|
var validateCommitMessage_useCase = require('./application/use-case/validate-commit-message.use-case.js');
|
|
@@ -45,6 +46,7 @@ var index = {
|
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
exports.ConfigureLLMUseCase = configureLlm_useCase.ConfigureLLMUseCase;
|
|
49
|
+
exports.EditCommitUseCase = editCommit_useCase.EditCommitUseCase;
|
|
48
50
|
exports.GenerateCommitMessageUseCase = generateCommitMessage_useCase.GenerateCommitMessageUseCase;
|
|
49
51
|
exports.ManualCommitUseCase = manualCommit_useCase.ManualCommitUseCase;
|
|
50
52
|
exports.ValidateCommitMessageUseCase = validateCommitMessage_useCase.ValidateCommitMessageUseCase;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":[null],"names":["createAppContainer","CommitizenAdapter"],"mappings":"
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,6 +10,7 @@ export declare const GenerateCommitMessageUseCaseToken: symbol;
|
|
|
10
10
|
export declare const ValidateCommitMessageUseCaseToken: symbol;
|
|
11
11
|
export declare const ConfigureLLMUseCaseToken: symbol;
|
|
12
12
|
export declare const ManualCommitUseCaseToken: symbol;
|
|
13
|
+
export declare const EditCommitUseCaseToken: symbol;
|
|
13
14
|
/**
|
|
14
15
|
* Create and configure the application DI container
|
|
15
16
|
* @returns {IContainer} The configured DI container
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var cladi = require('@elsikora/cladi');
|
|
4
4
|
var configureLlm_useCase = require('../../application/use-case/configure-llm.use-case.js');
|
|
5
|
+
var editCommit_useCase = require('../../application/use-case/edit-commit.use-case.js');
|
|
5
6
|
var generateCommitMessage_useCase = require('../../application/use-case/generate-commit-message.use-case.js');
|
|
6
7
|
var manualCommit_useCase = require('../../application/use-case/manual-commit.use-case.js');
|
|
7
8
|
var validateCommitMessage_useCase = require('../../application/use-case/validate-commit-message.use-case.js');
|
|
@@ -11,6 +12,7 @@ var anthropicLlm_service = require('../llm/anthropic-llm.service.js');
|
|
|
11
12
|
var awsBedrockLlm_service = require('../llm/aws-bedrock-llm.service.js');
|
|
12
13
|
var azureOpenaiLlm_service = require('../llm/azure-openai-llm.service.js');
|
|
13
14
|
var googleLlm_service = require('../llm/google-llm.service.js');
|
|
15
|
+
var mockLlm_service = require('../llm/mock-llm.service.js');
|
|
14
16
|
var ollamaLlm_service = require('../llm/ollama-llm.service.js');
|
|
15
17
|
var openaiLlm_service = require('../llm/openai-llm.service.js');
|
|
16
18
|
var cosmicConfig_service = require('../service/cosmic-config.service.js');
|
|
@@ -31,6 +33,7 @@ const GenerateCommitMessageUseCaseToken = Symbol("GenerateCommitMessageUseCase")
|
|
|
31
33
|
const ValidateCommitMessageUseCaseToken = Symbol("ValidateCommitMessageUseCase");
|
|
32
34
|
const ConfigureLLMUseCaseToken = Symbol("ConfigureLLMUseCase");
|
|
33
35
|
const ManualCommitUseCaseToken = Symbol("ManualCommitUseCase");
|
|
36
|
+
const EditCommitUseCaseToken = Symbol("EditCommitUseCase");
|
|
34
37
|
/**
|
|
35
38
|
* Create and configure the application DI container
|
|
36
39
|
* @returns {IContainer} The configured DI container
|
|
@@ -46,8 +49,8 @@ function createAppContainer() {
|
|
|
46
49
|
container.register(CommandServiceToken, new nodeCommand_service.NodeCommandService(cliInterface));
|
|
47
50
|
const commandService = container.get(CommandServiceToken) ?? new nodeCommand_service.NodeCommandService(cliInterface);
|
|
48
51
|
container.register(CommitRepositoryToken, new gitCommit_repository.GitCommitRepository(commandService));
|
|
49
|
-
// Register LLM services
|
|
50
|
-
const llmServices = [new openaiLlm_service.OpenAILlmService(), new anthropicLlm_service.AnthropicLlmService(), new googleLlm_service.GoogleLlmService(), new azureOpenaiLlm_service.AzureOpenAILlmService(), new awsBedrockLlm_service.AWSBedrockLlmService(), new ollamaLlm_service.OllamaLlmService()];
|
|
52
|
+
// Register LLM services - MockLlmService must be first to intercept when MOCK_LLM=true
|
|
53
|
+
const llmServices = [new mockLlm_service.MockLlmService(), new openaiLlm_service.OpenAILlmService(), new anthropicLlm_service.AnthropicLlmService(), new googleLlm_service.GoogleLlmService(), new azureOpenaiLlm_service.AzureOpenAILlmService(), new awsBedrockLlm_service.AWSBedrockLlmService(), new ollamaLlm_service.OllamaLlmService()];
|
|
51
54
|
container.register(LLMServicesToken, llmServices);
|
|
52
55
|
// Register commit validator with LLM services
|
|
53
56
|
container.register(CommitValidatorToken, new commitlintValidator_service.CommitlintValidatorService(llmServices));
|
|
@@ -58,6 +61,7 @@ function createAppContainer() {
|
|
|
58
61
|
container.register(GenerateCommitMessageUseCaseToken, new generateCommitMessage_useCase.GenerateCommitMessageUseCase(llmServices));
|
|
59
62
|
container.register(ValidateCommitMessageUseCaseToken, new validateCommitMessage_useCase.ValidateCommitMessageUseCase(validator));
|
|
60
63
|
container.register(ManualCommitUseCaseToken, new manualCommit_useCase.ManualCommitUseCase(cliInterface));
|
|
64
|
+
container.register(EditCommitUseCaseToken, new editCommit_useCase.EditCommitUseCase(cliInterface, validator, llmServices));
|
|
61
65
|
return container;
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -67,6 +71,7 @@ exports.CommitRepositoryToken = CommitRepositoryToken;
|
|
|
67
71
|
exports.CommitValidatorToken = CommitValidatorToken;
|
|
68
72
|
exports.ConfigServiceToken = ConfigServiceToken;
|
|
69
73
|
exports.ConfigureLLMUseCaseToken = ConfigureLLMUseCaseToken;
|
|
74
|
+
exports.EditCommitUseCaseToken = EditCommitUseCaseToken;
|
|
70
75
|
exports.FileSystemServiceToken = FileSystemServiceToken;
|
|
71
76
|
exports.GenerateCommitMessageUseCaseToken = GenerateCommitMessageUseCaseToken;
|
|
72
77
|
exports.LLMServicesToken = LLMServicesToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sources":["../../../../../src/infrastructure/di/container.ts"],"sourcesContent":[null],"names":["createContainer","NodeFileSystemService","PromptsCliInterface","CosmicConfigService","NodeCommandService","GitCommitRepository","OpenAILlmService","AnthropicLlmService","GoogleLlmService","AzureOpenAILlmService","AWSBedrockLlmService","OllamaLlmService","CommitlintValidatorService","ConfigureLLMUseCaseImpl","GenerateCommitMessageUseCaseImpl","ValidateCommitMessageUseCaseImpl","ManualCommitUseCaseImpl"],"mappings":"
|
|
1
|
+
{"version":3,"file":"container.js","sources":["../../../../../src/infrastructure/di/container.ts"],"sourcesContent":[null],"names":["createContainer","NodeFileSystemService","PromptsCliInterface","CosmicConfigService","NodeCommandService","GitCommitRepository","MockLlmService","OpenAILlmService","AnthropicLlmService","GoogleLlmService","AzureOpenAILlmService","AWSBedrockLlmService","OllamaLlmService","CommitlintValidatorService","ConfigureLLMUseCaseImpl","GenerateCommitMessageUseCaseImpl","ValidateCommitMessageUseCaseImpl","ManualCommitUseCaseImpl","EditCommitUseCaseImpl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA;MACa,sBAAsB,GAAW,MAAM,CAAC,mBAAmB;MAC3D,wBAAwB,GAAW,MAAM,CAAC,qBAAqB;MAC/D,mBAAmB,GAAW,MAAM,CAAC,gBAAgB;MACrD,kBAAkB,GAAW,MAAM,CAAC,eAAe;MACnD,oBAAoB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