/** * Pipeline Types — Artifacts, agent configuration, and pipeline state * * These types define the contract between the 8 agents in the component * generation pipeline. Each agent consumes input artifacts and produces * output artifacts, mediated by the orchestrator. */ import type { HealthIssue, LearningEntry } from '../types.js'; /** Names of structured artifacts that flow between agents */ export type ArtifactName = 'brief.md' | 'component-rules.md' | 'architecture.md' | 'component.ts' | 'component.scss' | 'component.stories.ts'; /** A single pipeline artifact */ export interface PipelineArtifact { name: ArtifactName | string; content: string; /** Which agent produced this */ producedBy: AgentId; /** When it was produced */ timestamp: string; /** Version (incremented on each agent revision) */ version: number; } /** Agent identifiers matching the 8 pipeline agents */ export type AgentId = 'spec-analyst' | 'library-researcher' | 'component-architect' | 'code-writer' | 'accessibility-auditor' | 'story-author' | 'code-reviewer' | 'quality-gate'; /** Pipeline phase */ export type PipelinePhase = 'understand' | 'build' | 'verify'; /** Which eddie-brain tools an agent is allowed to call */ export type EddieTool = 'eddie_get_component' | 'eddie_get_token' | 'eddie_validate_file' | 'eddie_check_health' | 'eddie_compose_recipe' | 'eddie_get_relationships' | 'eddie_search' | 'eddie_suggest_fix' | 'eddie_read_file' | 'ds_search_design_knowledge' | 'ds_search_chunks' | 'ds_browse_by_category'; /** Static configuration for a single agent */ export interface AgentConfig { id: AgentId; name: string; phase: PipelinePhase; /** System prompt template. Uses {{artifactName}} for substitution. */ systemPrompt: string; /** Which artifacts this agent reads */ inputArtifacts: Array; /** Which artifacts this agent produces */ outputArtifacts: Array; /** Which Eddie MCP tools this agent may call */ tools: EddieTool[]; /** Maximum iterations for this agent's fix loop */ maxIterations: number; /** If true, pipeline pauses for human review after this agent */ hasConversationalGate: boolean; } /** Push-back severity from Agent 3's conversational gate */ export type PushBackLevel = 'BLOCKING' | 'OVERRIDE' | 'SUGGESTION'; /** A push-back item from the component architect */ export interface PushBackItem { level: PushBackLevel; category: string; message: string; /** What the architect recommends instead */ recommendation: string; } /** Record of a single iteration within an agent's fix loop */ export interface IterationRecord { iteration: number; timestamp: string; /** Health score or issue count at this iteration */ score: number; /** Delta from previous iteration */ delta: number; /** Issues found at this iteration */ issues: HealthIssue[]; /** Whether the agent stopped due to diminishing returns */ stoppedEarly: boolean; } /** Summary of an agent's iteration history */ export interface IterationSummary { agentId: AgentId; totalIterations: number; maxIterations: number; startScore: number; endScore: number; totalImprovement: number; stoppedEarly: boolean; records: IterationRecord[]; } /** Status of a single agent run */ export type AgentStatus = 'pending' | 'running' | 'gated' | 'completed' | 'failed' | 'skipped'; /** Runtime state for one agent in the pipeline */ export interface AgentState { agentId: AgentId; status: AgentStatus; startedAt: string | null; completedAt: string | null; iterations: IterationSummary | null; pushBacks: PushBackItem[]; /** Any error that caused failure */ error: string | null; } /** Overall pipeline status */ export type PipelineStatus = 'idle' | 'running' | 'gated' | 'completed' | 'failed'; /** Full pipeline state, serializable to disk */ export interface PipelineState { id: string; status: PipelineStatus; /** The original brief text */ brief: string; /** Target component name (e.g., "ed-progress-bar") */ componentName: string; /** Current phase */ currentPhase: PipelinePhase; /** Current agent */ currentAgent: AgentId | null; /** State per agent */ agents: Record; /** All artifacts produced so far */ artifacts: Record; /** Timestamps */ startedAt: string; completedAt: string | null; /** Learning entries to record at the end */ learnings: LearningEntry[]; } /** Configuration for running a pipeline */ export interface PipelineConfig { /** Anthropic API key */ apiKey: string; /** Model to use */ model: string; /** Path to Eddie monorepo root */ rootDir: string; /** Where to write output files */ outputDir: string; /** Whether to pause at conversational gates */ interactive: boolean; /** Override iteration budgets per agent */ iterationBudgets?: Partial>; /** Minimum improvement percentage to continue iterating (default: 2) */ diminishingReturnsThreshold: number; } /** Default pipeline config (API key must be provided) */ export declare const DEFAULT_PIPELINE_CONFIG: Omit; /** Result of running a single agent */ export interface AgentRunResult { artifacts: PipelineArtifact[]; iterations: IterationRecord[]; toolCallCount: number; pushBacks: PushBackItem[]; error: string | null; } /** The ordered sequence of agents in the pipeline */ export declare const PIPELINE_AGENT_ORDER: AgentId[]; //# sourceMappingURL=types.d.ts.map