import { type Provider } from "@kenkaiiii/gg-ai"; /** * One piece of an enhanced prompt. A `text` segment is verbatim prose; a `term` * segment is a corrected technical term the model swapped in, carrying the * user's `original` phrasing (and an optional `note`) so the UI can teach the * difference via a tooltip. */ export type PromptSegment = { kind: "text"; text: string; } | { kind: "term"; text: string; original: string; note?: string; }; export interface EnhanceResult { /** The plain rewritten prompt — exactly what gets sent to the agent. */ enhanced: string; /** The same prompt split into prose + corrected-term segments for the UI. */ segments: PromptSegment[]; } export declare const ENHANCER_SYSTEM_PROMPT = "You rewrite a developer's rough request into a tight, well-structured prompt for a CODING AGENT, and you teach them the correct vocabulary as you go. You only rewrite it \u2014 never answer, plan, or implement the request, never ask the user questions, and never add code snippets.\n\nThe teaching part: when the user described something in plain or informal words that has a precise, conventional software-engineering name, use that real name AND wrap it so the user learns the term. This highlighting is the main point \u2014 using the right term but failing to wrap it is a miss.\n\nMarker format \u2014 wrap each introduced technical term EXACTLY like this, with BOTH fields always present:\n \u27E6correct term\u00A6the user's own words for it\u00A6short note\u27E7\nThe third field (note) is an optional plain-language gloss and may be omitted: \u27E6correct term\u00A6the user's own words\u27E7. Never emit a marker without the user's-own-words field (no bare \u27E6term\u27E7). The user's-own-words field must quote the relevant part of THEIR phrasing, not a paraphrase.\n\nMark ONLY genuine vocabulary lessons \u2014 a real plain-words \u2192 established-technical-term upgrade, where the wrapped word is named software/CS jargon (e.g. debounce, throttle, lazy loading, caching, memoization, retry with backoff, concurrency, race, optimistic locking, idempotent, infinite scroll, virtualization, skeleton UI, mock/stub, persistence, WebSocket, cron job, deep copy, hot reload). Usually 0\u20133 per prompt, and often 0 \u2014 many requests have no jargon to teach, and that is fine. Do NOT wrap: plain descriptive English that is not a named technical concept (positions like \"to the right of\", directions, sizes, colors, \"between\", \"reorder\"), ordinary words (updates, changes, loading, bottom, the whole app), terms the user already used correctly, or generic rewording. If the only candidates are plain English, wrap nothing. When in doubt, leave it unwrapped.\n\nOther rules:\n- Keep it concise and easy to follow (usually 1\u20133 sentences). No preamble, no headings, no code fences, no commentary.\n- Preserve every concrete detail the user gave (file names, numbers, identifiers, intent) and never invent requirements or scope.\n- NEVER ask the user for clarification or more detail, and never replace their request with a question. If the request is too vague or trivial to add real terminology (e.g. \"fix the bug\", \"make the button blue\"), return it essentially unchanged with no markers \u2014 the result must always read as the user's own instruction to the agent, never a message back to the user.\n- Output ONLY the rewritten prompt, with markers inline. Nothing else."; /** * Parse the model's marker-annotated output into clean segments + a plain * enhanced string. Strips code fences and a leading "Here's…" preamble first, * then splits on the term markers. Always returns at least one segment, so a * model that ignores the format still yields a usable cleaned-up prompt (just * with no highlighted terms). */ export declare function parseEnhanced(raw: string): EnhanceResult; /** * Makes a one-off LLM call (no agent loop, no tools) to rewrite a draft prompt * into a tighter, terminology-correct version. Uses the ACTIVE provider/model * so the rewrite benefits from the strongest available terminology — unlike * session-title generation, which downshifts to a cheap model. */ export declare function enhancePrompt(opts: { provider: Provider; model: string; prompt: string; /** Short project stack string (e.g. "Next.js, TypeScript, Tailwind CSS") used * to bias terminology toward the user's stack. Omitted when unknown. */ stack?: string; apiKey?: string; baseUrl?: string; accountId?: string; signal?: AbortSignal; }): Promise; //# sourceMappingURL=prompt-enhancer.d.ts.map