/** * Refinement Loop - Interactive process model improvement based on user feedback * * This module implements the feedback loop described in the paper where users can: * 1. View the generated process model * 2. Provide feedback/comments * 3. Get an updated model incorporating their feedback */ import type { PowlModel } from "./index.js"; /** * User feedback entry */ export interface UserFeedback { type: 'text' | 'visual'; content: string; timestamp: Date; } /** * Active refinement session tracking */ export interface RefinementSession { originalDescription: string; currentModel: PowlModel | null; feedbackHistory: UserFeedback[]; conversationHistory: Array<{ role: string; content: string; }>; iterationCount: number; } /** * Result of a refinement operation */ export interface RefinementResult { success: boolean; updatedModel: PowlModel | null; prompt: string; response: string; iteration: number; error?: string; } /** * Refinement loop for iterative process model improvement */ export declare class RefinementLoop { private session; constructor(initialDescription: string); /** * Get the current session state */ getSession(): RefinementSession; /** * Update the current model */ setCurrentModel(model: PowlModel | null): void; /** * Add user feedback to the session */ addFeedback(feedback: UserFeedback): void; /** * Add a conversation message */ addConversationMessage(role: string, content: string): void; /** * Generate prompt incorporating all feedback and conversation history */ generateRefinementPrompt(basePrompt: string): string; /** * Process refinement with LLM */ refineModel(llmCall: (prompt: string) => Promise, basePrompt: string): Promise; /** * Parse model from LLM response * Extracts POWL model code from markdown code blocks */ private parseModelFromResponse; /** * Get session summary */ getSessionSummary(): { feedbackCount: number; hasModel: boolean; conversationTurns: number; iterationCount: number; }; /** * Export session for persistence */ exportSession(): string; /** * Import session from JSON */ static importSession(json: string, initialModel?: PowlModel | null): RefinementLoop; /** * Reset the session (keep original description) */ reset(): void; /** * Create a text summary of the refinement session */ createSummaryReport(): string; } //# sourceMappingURL=refinement-loop.d.ts.map