UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

25 lines (24 loc) 1.15 kB
import { type ModelMessage } from "ai"; import { type HarnessStepResult } from "#harness/step-hooks.js"; import { type StepFn, type ToolLoopHarnessConfig } from "#harness/types.js"; export declare function createToolLoopHarness(config: ToolLoopHarnessConfig): StepFn; type ToolResponsePart = Extract<ModelMessage, { role: "tool"; }>["content"][number]; type ToolResultPart = Extract<ToolResponsePart, { type: "tool-result"; }>; type StepResponseMessage = HarnessStepResult["response"]["messages"][number]; /** * Appends synthesized tool results for calls that have no result anywhere in * the step's response messages. Exported for its dedupe contract: a call * already answered — including provider-executed results the SDK keeps * inline in the assistant message — must never receive a second * `tool-result`, or the next Anthropic call rejects the history with * "each tool_use must have a single result". */ export declare function appendMissingToolResultMessages(input: { readonly append: readonly ToolResultPart[]; readonly responseMessages: readonly StepResponseMessage[]; }): StepResponseMessage[]; export {};