/** * Agent Orchestrator — Claude-powered design intelligence system. * * Decomposes high-level design intents into structured sub-agent tasks, * each with rich prompts that maximize Claude's design reasoning. * * Architecture: * User Intent (natural language) * → Intent Classifier (categorize the request) * → Plan Builder (decompose into sub-tasks) * → Sub-Agent Router (dispatch to specialized handlers) * → Figma Executor (push changes via bridge) * → Result Aggregator (combine and report) * * This coordinator delegates to three focused modules: * - intent-classifier.ts — classifyIntent(), IntentCategory, INTENT_PATTERNS * - plan-builder.ts — PlanBuilder class with all decompose*() methods * - sub-agents.ts — SubAgentRunner class with all execute*() heuristics */ import type { MemoireEngine } from "../engine/core.js"; import { type ResolvedSkill } from "../notes/index.js"; import { type AgentBoxUpdate } from "./agent-box.js"; export { classifyIntent, INTENT_PATTERNS } from "./intent-classifier.js"; export type { IntentCategory } from "./intent-classifier.js"; export type { AgentPlan, SubTask, SubAgentType, AgentContext } from "./plan-builder.js"; export type { AgentExecutionResult, DesignMutation } from "./sub-agents.js"; import type { IntentCategory } from "./intent-classifier.js"; import type { AgentPlan, AgentContext } from "./plan-builder.js"; export declare class AgentOrchestrator { private engine; private planCounter; private planBuilder; private subAgentRunner; private onUpdate?; constructor(engine: MemoireEngine, onUpdate?: (plan: AgentPlan) => void); /** * Main entry point — take a natural language intent, classify it, * build a plan of sub-agent tasks, and execute them. */ executeBatch(intents: string[], options?: { dryRun?: boolean; }): Promise; execute(intent: string, options?: { autoSync?: boolean; dryRun?: boolean; context?: AgentContext; }): Promise; private buildContext; buildPlan(intent: string, category: IntentCategory, context: AgentContext, resolvedNotes?: ResolvedSkill[]): AgentPlan; private executePlan; private static readonly MAX_RETRIES; private static readonly RETRY_BASE_MS; /** * Try to dispatch a task to an external agent first; fall back to internal execution. * External agents are matched by role via the AgentRegistry. */ private tryExternalOrInternal; private executeWithRetry; selfHealingLoop(nodeId: string, intent: string, maxRounds?: number): Promise<{ healed: boolean; rounds: number; issues: string[]; }>; createAgentBox(update: AgentBoxUpdate): Promise; updateAgentBox(update: AgentBoxUpdate): Promise; private makeAgentBoxUpdate; private summarizeTaskResult; private publishAgentStatus; private toAgentStatus; }