/** * Structured-adaptive agent loop for Catui. * Keeps the public AgentMessage/EventStream contract while using a query-loop * state machine with ordered tool-result pairing and safe tool batching. */ /** * [WHO]: structuredAdaptiveAgentLoop, structuredAdaptiveAgentLoopContinue * [FROM]: Depends on @catui/ai, ./types, ./errors, structured-adaptive tool executors, and shared loop helpers. * [TO]: Consumed by core/lib/agent-core/src/agent.ts and index.ts * [HERE]: core/lib/agent-core/src/structured-adaptive-agent-loop.ts - selectable structured-adaptive query loop framework with recovered-error tombstoning */ import { EventStream } from "@catui/ai/events"; import type { AgentContext, AgentEvent, AgentLoopConfig, AgentMessage, StreamFn } from "./types.js"; export declare function structuredAdaptiveAgentLoop(prompts: AgentMessage[], context: AgentContext, config: AgentLoopConfig, signal?: AbortSignal, streamFn?: StreamFn): EventStream; export declare function structuredAdaptiveAgentLoopContinue(context: AgentContext, config: AgentLoopConfig, signal?: AbortSignal, streamFn?: StreamFn): EventStream;