improved a lot of things

This commit is contained in:
SinachPat
2026-04-26 09:09:55 +01:00
parent 2911f22df8
commit 97315846be
70 changed files with 4967 additions and 10 deletions
@@ -0,0 +1,34 @@
import type { AIGateway } from '../gateway.js';
import { buildSystemPrompt } from '../prompts/system.js';
export interface DiffSummaryInput {
/** Serialized component-level changes (JSON) */
changesJson: string;
/** Component name */
componentName: string;
}
export interface DiffSummaryOutput {
summary: string;
}
export async function generateDiffSummary(
gateway: AIGateway,
input: DiffSummaryInput
): Promise<DiffSummaryOutput> {
const system = buildSystemPrompt({ role: 'a technical writer summarizing UI component changes' });
const response = await gateway.complete({
system,
messages: [
{
role: 'user',
content: `Summarize the following component changes for "${input.componentName}" in one concise sentence (max 20 words) suitable for a developer reviewing a pull request. Focus on what changed and its purpose.\n\n<changes>\n${input.changesJson}\n</changes>\n\nRespond with only the summary sentence.`,
},
],
maxTokens: 128,
temperature: 0.3,
});
return { summary: response.text.trim() };
}