@snapcommit/cli 3.8.5 → 3.8.7
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/ai/gemini-client.js
CHANGED
|
@@ -13,7 +13,7 @@ const retry_1 = require("../utils/retry");
|
|
|
13
13
|
const genAI = new generative_ai_1.GoogleGenerativeAI(process.env.GOOGLE_AI_API_KEY || '');
|
|
14
14
|
async function generateCommitMessageGemini(diff) {
|
|
15
15
|
try {
|
|
16
|
-
const model = genAI.getGenerativeModel({ model: 'gemini-2.
|
|
16
|
+
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-pro' });
|
|
17
17
|
const prompt = `You are an expert software engineer writing commit messages.
|
|
18
18
|
|
|
19
19
|
Analyze this git diff and generate a professional conventional commit message.
|
|
@@ -51,7 +51,7 @@ Reply with ONLY the commit message, nothing else.`;
|
|
|
51
51
|
}
|
|
52
52
|
async function interpretGitCommandGemini(userInput, context) {
|
|
53
53
|
try {
|
|
54
|
-
const model = genAI.getGenerativeModel({ model: 'gemini-2.
|
|
54
|
+
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-pro' });
|
|
55
55
|
const prompt = `You are a Git expert assistant. Interpret the user's natural language request into a structured Git operation.
|
|
56
56
|
|
|
57
57
|
User request: "${userInput}"
|
|
@@ -107,7 +107,7 @@ Respond with ONLY the JSON object, no other text.`;
|
|
|
107
107
|
*/
|
|
108
108
|
async function needsClarificationGemini(userInput) {
|
|
109
109
|
try {
|
|
110
|
-
const model = genAI.getGenerativeModel({ model: 'gemini-2.
|
|
110
|
+
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-pro' });
|
|
111
111
|
const prompt = `You are a helpful Git assistant. Determine if this user request is ambiguous and requires clarification.
|
|
112
112
|
|
|
113
113
|
User request: "${userInput}"
|
|
@@ -151,7 +151,7 @@ Respond with ONLY the JSON object, no other text.`;
|
|
|
151
151
|
*/
|
|
152
152
|
async function solveGitProblemGemini(userInput, context) {
|
|
153
153
|
try {
|
|
154
|
-
const model = genAI.getGenerativeModel({ model: 'gemini-2.
|
|
154
|
+
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-pro' });
|
|
155
155
|
const prompt = `You are an expert Git problem solver. A user encountered an issue.
|
|
156
156
|
|
|
157
157
|
User's problem: "${userInput}"
|
|
@@ -191,7 +191,13 @@ async function executeCommitWithAI(intent) {
|
|
|
191
191
|
rlFileSelect.question(chalk_1.default.cyan('Select files: ') +
|
|
192
192
|
chalk_1.default.gray('(Enter=all, 1-3=specific, 1,3,5=multiple): '), (ans) => {
|
|
193
193
|
// Don't close - just resolve and let it clean up
|
|
194
|
-
setImmediate(() =>
|
|
194
|
+
setImmediate(() => {
|
|
195
|
+
rlFileSelect.close();
|
|
196
|
+
// Resume stdin for parent REPL
|
|
197
|
+
if (process.stdin.isPaused()) {
|
|
198
|
+
process.stdin.resume();
|
|
199
|
+
}
|
|
200
|
+
});
|
|
195
201
|
resolve(ans.trim());
|
|
196
202
|
});
|
|
197
203
|
});
|
|
@@ -255,7 +261,13 @@ async function executeCommitWithAI(intent) {
|
|
|
255
261
|
const response = await new Promise((resolve) => {
|
|
256
262
|
rlCommit.question(chalk_1.default.gray('→ Press Enter to commit, or edit message: '), (ans) => {
|
|
257
263
|
// Don't close - just resolve and let it clean up
|
|
258
|
-
setImmediate(() =>
|
|
264
|
+
setImmediate(() => {
|
|
265
|
+
rlCommit.close();
|
|
266
|
+
// Resume stdin for parent REPL
|
|
267
|
+
if (process.stdin.isPaused()) {
|
|
268
|
+
process.stdin.resume();
|
|
269
|
+
}
|
|
270
|
+
});
|
|
259
271
|
resolve(ans.trim());
|
|
260
272
|
});
|
|
261
273
|
});
|