import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
import { EvaluationJobFilterCriteria, Filter, MessageContent } from "../../types/utility.js";
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
import { ConversationSelect, DatasetRunConversationRelationInsert, DatasetRunConversationRelationSelect, DatasetRunInsert, DatasetRunSelect, EvaluationResultInsert, EvaluationResultSelect, EvaluationResultUpdate, EvaluationRunInsert, EvaluationRunSelect, EvaluationRunUpdate } from "../../types/entities.js";

//#region src/data-access/runtime/evalRuns.d.ts
declare const getDatasetRunById: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    datasetRunId: string;
  };
}) => Promise<DatasetRunSelect | null>;
declare const listDatasetRuns: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
}) => Promise<DatasetRunSelect[]>;
declare const getDatasetRunsByIds: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  datasetRunIds: string[];
}) => Promise<DatasetRunSelect[]>;
declare const listDatasetRunsByConfig: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    datasetRunConfigId: string;
  };
}) => Promise<DatasetRunSelect[]>;
declare const createDatasetRun: (db: AgentsRunDatabaseClient) => (data: DatasetRunInsert) => Promise<DatasetRunSelect>;
declare const deleteDatasetRun: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    datasetRunId: string;
  };
}) => Promise<boolean>;
declare const getDatasetRunConversationRelations: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    datasetRunId: string;
  };
}) => Promise<DatasetRunConversationRelationSelect[]>;
declare const createDatasetRunConversationRelation: (db: AgentsRunDatabaseClient) => (data: DatasetRunConversationRelationInsert) => Promise<DatasetRunConversationRelationSelect>;
declare const createDatasetRunConversationRelations: (db: AgentsRunDatabaseClient) => (data: DatasetRunConversationRelationInsert[]) => Promise<DatasetRunConversationRelationSelect[]>;
declare const deleteDatasetRunConversationRelation: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    datasetRunId: string;
    conversationId: string;
  };
}) => Promise<boolean>;
declare const deleteDatasetRunConversationRelationsByRun: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    datasetRunId: string;
  };
}) => Promise<number>;
declare const getDatasetRunConversationRelationByConversation: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    conversationId: string;
  };
}) => Promise<DatasetRunConversationRelationSelect | null>;
declare const getEvaluationRunById: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationRunId: string;
  };
}) => Promise<EvaluationRunSelect | null>;
declare const listEvaluationRuns: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
}) => Promise<EvaluationRunSelect[]>;
declare const listEvaluationRunsByJobConfigId: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  evaluationJobConfigId: string;
}) => Promise<EvaluationRunSelect[]>;
declare const getEvaluationRunByJobConfigId: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  evaluationJobConfigId: string;
}) => Promise<EvaluationRunSelect | null>;
declare const createEvaluationRun: (db: AgentsRunDatabaseClient) => (data: EvaluationRunInsert) => Promise<EvaluationRunSelect>;
declare const updateEvaluationRun: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationRunId: string;
  };
  data: EvaluationRunUpdate;
}) => Promise<EvaluationRunSelect | null>;
declare const deleteEvaluationRun: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationRunId: string;
  };
}) => Promise<boolean>;
declare const getEvaluationResultById: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationResultId: string;
  };
}) => Promise<EvaluationResultSelect | null>;
declare const listEvaluationResults: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
}) => Promise<EvaluationResultSelect[]>;
declare const listEvaluationResultsByRun: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationRunId: string;
  };
}) => Promise<EvaluationResultSelect[]>;
interface EvalResultsFilter {
  evaluatorId?: string;
  agentId?: string;
  conversationId?: string;
  /** ISO timestamp — only include results whose conversation was created on or after this instant. */
  startDate?: string;
  /** ISO timestamp — only include results whose conversation was created on or before this instant. */
  endDate?: string;
}
interface EvalResultsPagination {
  page: number;
  limit: number;
}
interface EnrichedEvaluationResult {
  id: string;
  tenantId: string;
  projectId: string;
  conversationId: string;
  evaluatorId: string;
  evaluationRunId: string | null;
  output: MessageContent | null;
  createdAt: string;
  updatedAt: string;
  input: string | null;
  agentId: string | null;
  conversationCreatedAt: string | null;
}
interface PaginatedEvalResults {
  data: EnrichedEvaluationResult[];
  pagination: {
    page: number;
    limit: number;
    total: number;
    pages: number;
    completedCount: number;
  };
  distinctAgentIds: string[];
  distinctOutputKeys: string[];
}
declare const listEvaluationResultsPaginated: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  evaluationRunConfigId?: string;
  evaluationJobConfigId?: string;
  filters?: EvalResultsFilter;
  pagination?: EvalResultsPagination;
}) => Promise<PaginatedEvalResults>;
declare const listEvaluationResultsByConversation: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    conversationId: string;
  };
}) => Promise<EvaluationResultSelect[]>;
declare const createEvaluationResult: (db: AgentsRunDatabaseClient) => (data: EvaluationResultInsert) => Promise<EvaluationResultSelect>;
declare const createEvaluationResults: (db: AgentsRunDatabaseClient) => (data: EvaluationResultInsert[]) => Promise<EvaluationResultSelect[]>;
declare const updateEvaluationResult: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationResultId: string;
  };
  data: EvaluationResultUpdate;
}) => Promise<EvaluationResultSelect | null>;
declare const deleteEvaluationResult: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationResultId: string;
  };
}) => Promise<boolean>;
declare const deleteEvaluationResultsByRun: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig & {
    evaluationRunId: string;
  };
}) => Promise<number>;
/**
 * Filter conversations based on evaluation job filter criteria
 */
declare const filterConversationsForJob: (db: AgentsRunDatabaseClient) => (params: {
  scopes: ProjectScopeConfig;
  jobFilters: Filter<EvaluationJobFilterCriteria> | null | undefined;
}) => Promise<ConversationSelect[]>;
//#endregion
export { EnrichedEvaluationResult, EvalResultsFilter, EvalResultsPagination, PaginatedEvalResults, createDatasetRun, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationResult, createEvaluationResults, createEvaluationRun, deleteDatasetRun, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, filterConversationsForJob, getDatasetRunById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getDatasetRunsByIds, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, listDatasetRuns, listDatasetRunsByConfig, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationResultsPaginated, listEvaluationRuns, listEvaluationRunsByJobConfigId, updateEvaluationResult, updateEvaluationRun };