You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -361,7 +385,7 @@ async function getRecentBranchCommits(branchName) {
361
385
// --- AI Enhancement ---
362
386
363
387
/**
364
-
* Enhances the commit message using the Gemini API.
388
+
* Enhances the commit message using the Z.AI API.
365
389
* @param {string} originalMessage - The original commit message.
366
390
* @param {string} diff - The summarized code diff.
367
391
* @param {string} branchName - The current Git branch name.
@@ -376,8 +400,7 @@ async function enhanceCommitMessage(originalMessage, diff, branchName, dirSummar
376
400
? `* **Recent Steps on Branch (${branchName}):**\n${recentCommits.map(s=>` * ${s}`).join('\n')}`
377
401
: `* **Recent Steps on Branch (${branchName}):** (This appears to be the first commit on this branch since merging from the base branch)`;
378
402
379
-
constprompt=`
380
-
You are an expert developer assistant tasked with refining Git commit messages for the "Raspberry Ninja" project. Your goal is to create a message that follows Conventional Commits format (e.g., "feat:", "fix:", "chore:", "refactor:", "style:", "test:", "docs:", "build:", "ci:") and provides clear, concise, and informative context about the changes.
403
+
constsystemPrompt=`You are an expert developer assistant tasked with refining Git commit messages for the "Raspberry Ninja" project. Your goal is to create a message that follows Conventional Commits format (e.g., "feat:", "fix:", "chore:", "refactor:", "style:", "test:", "docs:", "build:", "ci:") and provides clear, concise, and informative context about the changes.
381
404
382
405
**Project Context: Raspberry Ninja**
383
406
@@ -386,9 +409,7 @@ You are an expert developer assistant tasked with refining Git commit messages f
* **Technology Stack:** Python, Bash scripting, GStreamer, FFmpeg, system services (systemd), hardware video encoders (H.264/H.265), WebRTC (via VDO.Ninja integration).
388
411
389
-
**Task:**
390
-
391
-
Analyze the provided information (original message, code diff, branch context, directory summary, recent commits) and generate an improved commit message adhering to the following guidelines:
412
+
**Guidelines:**
392
413
393
414
1. **Format:** Use the Conventional Commits specification (<type>[optional scope]: <description>). Choose the most appropriate type (feat, fix, chore, refactor, style, test, docs, build, ci). The scope (e.g., \`feat(api)\`, \`fix(twitch)\`, \`chore(deps)\`) is optional but encouraged if the change primarily affects a specific component.
394
415
2. **Subject Line:**
@@ -399,12 +420,12 @@ Analyze the provided information (original message, code diff, branch context, d
399
420
* Separate the subject from the body with a blank line.
400
421
* Explain the *what* and *why* of the change in more detail.
401
422
* Use bullet points (-) for distinct changes if applicable.
402
-
* Reference specific files, components (e.g., \`dock.html\`, TTS module, GitHub Actions), or features affected.
423
+
* Reference specific files, components (e.g., \`publish.py\`, platform directories, GitHub Actions), or features affected.
403
424
* Incorporate context from the branch name, directory summary, and recent commits if relevant (e.g., "Continues work on feature X from previous commits").
404
425
4. **Tone:** Professional and clear.
405
-
5. **Focus:** The message should *only* contain the commit message itself, starting directly with the type/scope. Do not add introductions like "Here is the enhanced commit message:". Crucially, do not include bracketed tags like '[skip ci]', '[auto-enhanced]', '[skip pages]', etc., in your generated message text.
426
+
5. **Focus:** The message should *only* contain the commit message itself, starting directly with the type/scope. Do not add introductions like "Here is the enhanced commit message:". Crucially, do not include bracketed tags like '[skip ci]', '[auto-enhanced]', '[skip pages]', etc., in your generated message text.`;
406
427
407
-
**Input Data:**
428
+
constuserPrompt=`Analyze the provided information and generate an improved commit message:
408
429
409
430
* **Original Commit Message:**
410
431
\`\`\`
@@ -418,32 +439,26 @@ ${recentCommitLines}
418
439
${diff}
419
440
\`\`\`
420
441
421
-
**Generate the improved commit message now:**
422
-
`;
442
+
**Generate the improved commit message now:**`;
423
443
424
444
try{
425
-
log('debug','Sending prompt to Gemini API.');
426
-
if(!model){
427
-
thrownewError('Gemini model is not initialized.');
Review the existing PR information (title, original description, code diff) and generate an improved, comprehensive PR description. The goal is to clearly explain the PR's purpose, changes, and potential impact.
562
-
563
573
**Guidelines:**
564
574
565
575
1. **Structure:** Organize the description logically (e.g., Purpose, Changes, How to Test, Considerations). Use Markdown formatting (headings, lists).
566
576
2. **Purpose:** Clearly state the main goal of the PR. What problem does it solve or what feature does it add?
567
-
3. **Key Changes:** Summarize the main modifications using bullet points. Mention affected components or features (e.g., "Updated Twitch integration", "Refactored API error handling", "Improved \`dock.html\` layout").
577
+
3. **Key Changes:** Summarize the main modifications using bullet points. Mention affected components or features (e.g., "Updated publish.py", "Refactored platform support", "Improved installation scripts").
568
578
4. **Context/Why:** Briefly explain the reasoning behind the changes if not obvious.
569
579
5. **Testing:** (Optional but helpful) Suggest how reviewers can test the changes.
570
580
6. **Relate to Diff:** Ensure the description accurately reflects the code changes shown in the diff summary.
571
581
7. **Tone:** Professional and informative.
572
-
8. **Output:** Provide *only* the enhanced PR description text in Markdown format. Do not include introductory phrases like "Here's the updated description:". If the original description is good, you can refine it or even state that no major changes are needed (though usually, adding structure is beneficial).
582
+
8. **Output:** Provide *only* the enhanced PR description text in Markdown format. Do not include introductory phrases like "Here's the updated description:". If the original description is good, you can refine it or even state that no major changes are needed (though usually, adding structure is beneficial).`;
573
583
574
-
**Input Data:**
584
+
constuserPrompt=`Review the existing PR information and generate an improved, comprehensive PR description:
575
585
576
586
* **PR Title:** ${prTitle}
577
587
* **Target Branch:** ${prTargetBranch}
@@ -585,14 +595,12 @@ Review the existing PR information (title, original description, code diff) and
0 commit comments