import type { CheckResult, MermaidView } from "./validate.js"; export type DiagramGrade = "presentation" | "specification"; export type RequestedGrade = DiagramGrade | "both"; export declare const GRADE_SYSTEM_PROMPT = "You are a meticulous Mermaid v11 diagram editor. You output only valid Mermaid source, never wrapped in code fences, and you keep all facts and decision logic accurate. Never invent or drop a rule, threshold, or outcome."; export declare const GRADE_PROMPTS: Record; /** * Map free-form user/tool wording onto a supported grade. Returns undefined when * nothing matches so the caller can apply its default. */ export declare function resolveGrade(text: string): RequestedGrade | undefined; export declare function stripFences(raw: string): string; export interface CompleteOptions { systemPrompt: string; prompt: string; maxTokens: number; signal?: AbortSignal; } export interface PolishOptions { grade: DiagramGrade; view: MermaidView; source: string; seed: string; maxTokens: number; maxRounds?: number; signal?: AbortSignal; complete: (options: CompleteOptions) => Promise<{ text: string; }>; validate: (code: string) => Promise; onProgress?: (message: string) => void; } export interface PolishResult { code: string; rounds: number; } /** * Ask the active pi model to rewrite the deterministic seed in the requested * grade, validating each attempt and feeding failures back until it parses or * the round budget is exhausted. */ export declare function polishDiagram(options: PolishOptions): Promise;