import { z } from "@hono/zod-openapi";
import { AgentsRunDatabaseClient, EventSelect, FeedbackSelect, ResolvedRef, WebhookDestinationEventTypeEnum, WebhookEventEnvelopeSchema } from "@inkeep/agents-core";
import { EvaluationStatus } from "@inkeep/agents-core/evaluation";

//#region src/domains/run/services/WebhookDeliveryService.d.ts
type WebhookEventType = z.infer<typeof WebhookDestinationEventTypeEnum>;
type WebhookEventEnvelope = z.infer<typeof WebhookEventEnvelopeSchema>;
interface WebhookSlackMeta {
  evaluationRunConfigId?: string | null;
  evaluationJobConfigId?: string | null;
}
interface EmitWebhookEventParams {
  tenantId: string;
  projectId: string;
  agentId: string;
  resolvedRef: ResolvedRef;
  eventType: WebhookEventType;
  data: Record<string, unknown>;
  slackMeta?: WebhookSlackMeta;
}
interface EmitConversationWebhookParams {
  runDbClient: AgentsRunDatabaseClient;
  tenantId: string;
  projectId: string;
  agentId: string;
  conversationId: string;
  resolvedRef: ResolvedRef;
  eventType: WebhookEventType;
}
declare function emitConversationWebhook(params: EmitConversationWebhookParams): Promise<void>;
declare function emitWebhookEvent(params: EmitWebhookEventParams): Promise<void>;
declare function emitWebhookEventFireAndForget(params: EmitWebhookEventParams, context: string): void;
interface EmitFeedbackWebhookParams {
  runDbClient: AgentsRunDatabaseClient;
  tenantId: string;
  projectId: string;
  agentId?: string;
  feedback: FeedbackSelect;
}
declare function emitFeedbackWebhook(params: EmitFeedbackWebhookParams): Promise<void>;
interface EmitEventWebhookParams {
  tenantId: string;
  projectId: string;
  agentId: string;
  resolvedRef: ResolvedRef;
  event: EventSelect;
}
declare function emitEventWebhook(params: EmitEventWebhookParams): Promise<void>;
interface EmitEvaluationFailedWebhookParams {
  runDbClient: AgentsRunDatabaseClient;
  tenantId: string;
  projectId: string;
  verdict: EvaluationStatus;
  failedConditions: Array<{
    field: string;
    operator: string;
    value: number;
    actual: number;
  }>;
  evaluationResult: {
    id: string;
    evaluatorId: string;
    conversationId: string;
    evaluationRunId: string | null;
  };
  evaluator: {
    id: string;
    name: string;
  };
}
declare function emitEvaluationFailedWebhook(params: EmitEvaluationFailedWebhookParams): Promise<void>;
//#endregion
export { EmitConversationWebhookParams, EmitEvaluationFailedWebhookParams, EmitEventWebhookParams, EmitFeedbackWebhookParams, EmitWebhookEventParams, WebhookEventEnvelope, WebhookEventType, WebhookSlackMeta, emitConversationWebhook, emitEvaluationFailedWebhook, emitEventWebhook, emitFeedbackWebhook, emitWebhookEvent, emitWebhookEventFireAndForget };