import { P as PredicateResult, I as IterationTranscript, a as Predicate, A as ArgMatcher, T as TranscriptToolCall, b as TranscriptUsage } from '../eval-tool-execution-2L_dcBJI.js';
export { c as ArgMatchMode, C as CasePredicates, d as PREDICATE_PLACEHOLDER_STRINGS, e as PredicatePlaceholder, f as PredicateType, g as ToolErrorKind, h as ToolErrorRecord, i as argMatcherSchema, j as casePredicatesSchema, k as extractToolErrors, p as predicateArraySchema, l as predicateSchema } from '../eval-tool-execution-2L_dcBJI.js';
import { a as EvalTraceInput } from '../MCPClientManager-D9Cqa92W.js';
import 'zod';
import '@modelcontextprotocol/client';
import '../types-mAgSJ57j.js';
import '../mcp-protocol-version-cf74324S.js';
import 'ai';

/**
 * Pure evaluator for the state-based predicate library.
 *
 * `evaluatePredicates(transcript, predicates)` returns one
 * {@link PredicateResult} per predicate; `allPredicatesPassed` reduces them to
 * the case verdict (a case passes iff **all** predicates pass; zero predicates
 * pass vacuously). Every function here is a pure function of its inputs — no
 * I/O, no clocks, no randomness — which is exactly what makes predicates a
 * valid CI gate.
 */

/** Evaluate a single predicate against the iteration transcript. */
declare function evaluatePredicate(transcript: IterationTranscript, predicate: Predicate): PredicateResult;
/** Evaluate every predicate, preserving order. */
declare function evaluatePredicates(transcript: IterationTranscript, predicates: Predicate[] | undefined): PredicateResult[];
/**
 * Case verdict from predicate results: passes iff **all** pass. An empty set
 * passes vacuously (a case with no predicates is not gated by predicates).
 */
declare function allPredicatesPassed(results: PredicateResult[]): boolean;

/**
 * Argument matching for the `toolCalledWith` predicate.
 *
 * Delegates to the same `evaluateToolCalls` engine the tool-call matcher uses,
 * exposing all three `argumentMatching` modes (`exact` | `partial` | `ignore`).
 * Reusing one engine guarantees a predicate's notion of "these args match" is
 * identical to the existing `expectedToolCalls` matcher's.
 */

/**
 * True iff `actualArgs` satisfies `matcher` under its `argumentMatching` mode
 * (default `"partial"`).
 */
declare function argMatch(matcher: ArgMatcher, actualArgs: Record<string, unknown>): boolean;

/**
 * Adapter: build the stable {@link IterationTranscript} the predicate evaluator
 * consumes from the data an eval runner already has per iteration — the trace
 * (messages + spans), the tool calls, and token usage.
 *
 * Tool-error classification (content-error vs protocol-error) is delegated to
 * `extractToolErrors` so it stays in lockstep with the runner's existing
 * `traceIndicatesToolExecutionFailure` gate.
 */

/** Text of the last assistant message in a message list, if any. */
declare function extractFinalAssistantMessage(messages: unknown): string | undefined;
interface BuildTranscriptInput {
    trace?: EvalTraceInput;
    toolCalls: TranscriptToolCall[];
    usage?: TranscriptUsage;
    /** Override the message-derived final assistant text when the runner has it. */
    finalAssistantMessage?: string;
}
/** Assemble an {@link IterationTranscript} from runner per-iteration data. */
declare function buildIterationTranscript(input: BuildTranscriptInput): IterationTranscript;

export { ArgMatcher, type BuildTranscriptInput, IterationTranscript, Predicate, PredicateResult, TranscriptToolCall, TranscriptUsage, allPredicatesPassed, argMatch, buildIterationTranscript, evaluatePredicate, evaluatePredicates, extractFinalAssistantMessage };
