import { AgentRunContext, ResolvedGenerationResponse } from "./agent-types.js";
import { OutputContract } from "@inkeep/agents-core";
import { Span } from "@opentelemetry/api";

//#region src/domains/run/agents/output-contract.d.ts
declare function resolveAllowText(outputContract: OutputContract | undefined): boolean;
declare function deriveContractEnforcement(params: {
  outputContract: OutputContract | undefined;
  resolvedAllowText: boolean;
  hasStructuredOutput: boolean;
}): boolean;
declare function resolveContractToolChoice(params: {
  resolvedAllowText: boolean;
  hasStructuredOutput: boolean;
  hasArtifactComponents: boolean;
}): 'auto' | 'required';
/**
 * Returns a human-readable description of the first contract rule the response
 * violates, or null when the contract is satisfied. The description names the
 * offending rule and what was expected vs. emitted, so the failure is
 * diagnosable from the error/trace alone.
 */
declare function getContractViolation(params: {
  ctx: AgentRunContext;
  response: ResolvedGenerationResponse;
  hasStructuredOutput: boolean;
}): string | null;
/** Boolean form of {@link getContractViolation}. */
declare function isContractViolation(params: {
  ctx: AgentRunContext;
  response: ResolvedGenerationResponse;
  hasStructuredOutput: boolean;
}): boolean;
declare function enforceOutputContract(params: {
  ctx: AgentRunContext;
  response: ResolvedGenerationResponse;
  hasStructuredOutput: boolean;
  hasContractEnforcement: boolean;
  textResponse: string;
  span: Span;
  logger: {
    warn: (obj: Record<string, unknown>, msg: string) => void;
  };
}): void;
//#endregion
export { deriveContractEnforcement, enforceOutputContract, getContractViolation, isContractViolation, resolveAllowText, resolveContractToolChoice };