import { SpecializedAgent, type TaskAssignmentPayload, type TaskResultPayload } from '../specialized-agent.js'; import type { AgentMessage, ArchitecturePlan, PlanQuestion, PlanAnswer, ReadinessEvaluation, ChatMessage, ChatResponse } from '../types.js'; import type { MessageBus } from '../message-bus.js'; export declare class PlannerAgent extends SpecializedAgent { constructor(messageBus: MessageBus, opts?: { model?: string; }); protected onMessage(_message: AgentMessage): void; executeTask(task: TaskAssignmentPayload): Promise; /** * Analyze the user prompt and current plan to generate structured questions * about ambiguities that significantly affect architecture decisions. */ generateQuestions(userPrompt: string, currentPlan?: ArchitecturePlan, gaps?: string[]): Promise; evaluateReadiness(userPrompt: string, allAnswers: PlanAnswer[]): Promise; converse(userPrompt: string, conversationHistory: readonly ChatMessage[]): Promise; /** * Refine the architecture plan by incorporating user answers to questions. * Returns updated plan and a confidence score (0-1). */ refinePlan(currentPlan: ArchitecturePlan, answers: PlanAnswer[], userPrompt: string): Promise<{ plan: ArchitecturePlan; confidence: number; }>; /** * Try to extract a JSON array from LLM response text. */ private extractJsonArray; private extractJsonObject; private parsePlanResponse; /** * Try multiple strategies to extract JSON from LLM response: * 1. Direct parse * 2. Strip markdown code fences * 3. Find first { ... } balanced block */ private extractJson; }