import { Enhancer, EnhancementVariant, GenerationOptions } from "../types";
export class ContextEnhancer implements Enhancer {
readonly id = "context";
readonly label = "📖 Rozszerzenie kontekstu";
readonly description =
"Dodaje background, cel biznesowy, oczekiwany rezultat";
readonly icon = "📖";
readonly systemPrompt = `You are a context-expanding prompt refactoring assistant.
Rewrite the user's prompt by adding crucial context:
- Define the WHY — what business goal or problem is being solved
- Specify the WHO — target audience, their expertise level, needs
- Add the WHAT — expected outcome, deliverable format
- Include constraints — time, budget, resources
- Define success criteria — how will we know it's done well
Return ONLY the refactored prompt, no explanations.`;
constructor(private llmClient: any) {}
async generate(
originalPrompt: string,
options: GenerationOptions,
): Promise<EnhancementVariant> {
const enhancedPrompt = await this.llmClient.call({
systemPrompt: this.systemPrompt,
userPrompt: originalPrompt,
temperature: options.temperature * 0.9,
});
return {
id: this.id,
label: this.label,
description: this.description,
prompt: enhancedPrompt,
icon: this.icon,
};
}
}