/** * AgentRunner — Runs a single agent via the Anthropic API * * Core agentic loop: * 1. Build system prompt by injecting artifact content into {{placeholders}} * 2. Build tool definitions from AgentConfig * 3. Call Anthropic API with tools * 4. Handle tool_use → executeToolCall → tool_result loop * 5. Extract output artifacts from fenced code blocks * 6. If code agents produce no artifacts, retry with explicit output request * 7. Return AgentRunResult */ import type { KnowledgeGraph } from '../knowledge-graph/index.js'; import type { AgentConfig, AgentRunResult, PipelineArtifact, PipelineConfig } from './types.js'; import { ArtifactStore } from './artifact-store.js'; /** * Build the system prompt by substituting artifact content into {{placeholders}}. */ export declare function buildSystemPrompt(config: AgentConfig, store: ArtifactStore): string; /** * Extract output artifacts from fenced code blocks in the agent's response. * * Supports multiple patterns: * Pattern 1: ```typescript:component.ts\n...\n``` (tagged) * Pattern 2: ## component.ts\n```typescript\n...\n``` (section header) * Pattern 3: ```typescript\n...\n``` (untagged, matched by order to expected artifacts) * Pattern 4: For single .md artifact, treat entire response as content */ export declare function extractArtifacts(responseText: string, agentId: AgentConfig['id'], expectedArtifacts: string[]): PipelineArtifact[]; /** * Run a single agent to completion. */ export declare function runAgent(config: AgentConfig, store: ArtifactStore, knowledgeGraph: KnowledgeGraph, pipelineConfig: PipelineConfig, userMessage: string): Promise; //# sourceMappingURL=agent-runner.d.ts.map