/** * Sub-Agent Runner — Heuristic execution engines for each sub-agent type. * * Extracted from orchestrator.ts for independent testability and reuse. * Each execute*() method implements a fallback heuristic when AI is unavailable. */ import type { MemoireEngine } from "../engine/core.js"; import type { DesignToken } from "../engine/registry.js"; import type { ComponentSpec, PageSpec, DataVizSpec } from "../specs/types.js"; import type { SubTask, SubAgentType, AgentContext } from "./plan-builder.js"; import type { AnthropicClient } from "../ai/index.js"; export interface DesignMutation { type: "token-created" | "token-updated" | "token-deleted" | "spec-created" | "spec-updated" | "code-generated" | "figma-pushed"; target: string; detail: string; before?: unknown; after?: unknown; } export interface AgentExecutionResult { planId: string; status: "completed" | "partial" | "failed"; completedTasks: number; totalTasks: number; mutations: DesignMutation[]; figmaSynced: boolean; } export declare class SubAgentRunner { private engine; constructor(engine: MemoireEngine); static readonly AI_AGENT_TYPES: SubAgentType[]; executeSubTask(task: SubTask, ctx: AgentContext, ai?: AnthropicClient | null): Promise; private executeTokenEngineer; private executeComponentArchitect; private executeLayoutDesigner; private executeDatavizSpecialist; private executeFigmaAgent; private executeCodeGenerator; private executeDesignAuditor; private executeAccessibilityChecker; private executeThemeBuilder; private executeResponsiveSpecialist; private aiExecuteSubTask; private buildAgentSystemPrompt; private getAgentRoleDescription; private applyAIResult; pushTokenToFigma(token: DesignToken): Promise; syncMutationsToFigma(mutations: DesignMutation[]): Promise; selfHealingLoop(nodeId: string, intent: string, maxRounds?: number): Promise<{ healed: boolean; rounds: number; issues: string[]; }>; scaffoldComponentSpec(name: string, intent: string): ComponentSpec; scaffoldPageSpec(name: string, intent: string, ctx: AgentContext): PageSpec; scaffoldDataVizSpec(name: string, intent: string): DataVizSpec; private inferShadcnBase; private resolveTargetSpecName; private extractNameFromIntent; private toPascalCase; private upsertContextSpec; }