import { paginationInfoSchema } from './chunk-USZD5AX2.js';
import z from 'zod';

var jsonSchemaObject = z.lazy(() => z.record(z.string(), z.unknown()));
var jsonSchemaField = z.union([jsonSchemaObject, z.null()]).optional();
var datasetIdPathParams = z.object({
  datasetId: z.string().describe("Unique identifier for the dataset")
});
var experimentIdPathParams = z.object({
  experimentId: z.string().describe("Unique identifier for the experiment")
});
var itemIdPathParams = z.object({
  itemId: z.string().describe("Unique identifier for the dataset item")
});
var datasetAndExperimentIdPathParams = z.object({
  datasetId: z.string().describe("Unique identifier for the dataset"),
  experimentId: z.string().describe("Unique identifier for the experiment")
});
var datasetAndItemIdPathParams = z.object({
  datasetId: z.string().describe("Unique identifier for the dataset"),
  itemId: z.string().describe("Unique identifier for the dataset item")
});
var paginationQuerySchema = z.object({
  page: z.coerce.number().optional().default(0),
  perPage: z.coerce.number().optional().default(10)
});
var listItemsQuerySchema = z.object({
  page: z.coerce.number().optional().default(0),
  perPage: z.coerce.number().optional().default(10),
  version: z.coerce.number().int().optional(),
  // Optional version filter for snapshot semantics
  search: z.string().optional()
});
var createDatasetBodySchema = z.object({
  name: z.string().describe("Name of the dataset"),
  description: z.string().optional().describe("Description of the dataset"),
  metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata"),
  inputSchema: jsonSchemaField.describe("JSON Schema for validating item input"),
  groundTruthSchema: jsonSchemaField.describe("JSON Schema for validating item groundTruth"),
  requestContextSchema: jsonSchemaField.describe("JSON Schema describing expected request context shape")
});
var updateDatasetBodySchema = z.object({
  name: z.string().optional().describe("Name of the dataset"),
  description: z.string().optional().describe("Description of the dataset"),
  metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata"),
  inputSchema: jsonSchemaField.describe("JSON Schema for validating item input"),
  groundTruthSchema: jsonSchemaField.describe("JSON Schema for validating item groundTruth"),
  requestContextSchema: jsonSchemaField.describe("JSON Schema describing expected request context shape")
});
var addItemBodySchema = z.object({
  input: z.unknown().describe("Input data for the dataset item"),
  groundTruth: z.unknown().optional().describe("Expected output for comparison"),
  requestContext: z.record(z.string(), z.unknown()).optional().describe("Request context preset for this item"),
  metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata")
});
var updateItemBodySchema = z.object({
  input: z.unknown().optional().describe("Input data for the dataset item"),
  groundTruth: z.unknown().optional().describe("Expected output for comparison"),
  requestContext: z.record(z.string(), z.unknown()).optional().describe("Request context preset for this item"),
  metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata")
});
var triggerExperimentBodySchema = z.object({
  targetType: z.enum(["agent", "workflow", "scorer"]).describe("Type of target to run against"),
  targetId: z.string().describe("ID of the target"),
  scorerIds: z.array(z.string()).optional().describe("IDs of scorers to apply"),
  version: z.coerce.number().int().optional().describe("Pin to specific dataset version"),
  maxConcurrency: z.number().optional().describe("Maximum concurrent executions"),
  requestContext: z.record(z.string(), z.unknown()).optional().describe("Global request context passed to the target")
});
var compareExperimentsBodySchema = z.object({
  experimentIdA: z.string().describe("ID of baseline experiment"),
  experimentIdB: z.string().describe("ID of candidate experiment")
});
var datasetResponseSchema = z.object({
  id: z.string(),
  name: z.string(),
  description: z.string().optional().nullable(),
  metadata: z.record(z.string(), z.unknown()).optional().nullable(),
  inputSchema: z.record(z.string(), z.unknown()).optional(),
  groundTruthSchema: z.record(z.string(), z.unknown()).optional(),
  requestContextSchema: z.record(z.string(), z.unknown()).optional(),
  version: z.number().int(),
  createdAt: z.coerce.date(),
  updatedAt: z.coerce.date()
});
var datasetItemResponseSchema = z.object({
  id: z.string(),
  datasetId: z.string(),
  datasetVersion: z.number().int(),
  input: z.unknown(),
  groundTruth: z.unknown().optional(),
  requestContext: z.record(z.string(), z.unknown()).optional(),
  metadata: z.record(z.string(), z.unknown()).optional(),
  createdAt: z.coerce.date(),
  updatedAt: z.coerce.date()
});
var experimentResponseSchema = z.object({
  id: z.string(),
  datasetId: z.string().nullable(),
  datasetVersion: z.number().int().nullable(),
  targetType: z.enum(["agent", "workflow", "scorer", "processor"]),
  targetId: z.string(),
  name: z.string().optional(),
  description: z.string().optional(),
  metadata: z.record(z.string(), z.unknown()).optional(),
  status: z.enum(["pending", "running", "completed", "failed"]),
  totalItems: z.number(),
  succeededCount: z.number(),
  failedCount: z.number(),
  skippedCount: z.number(),
  startedAt: z.coerce.date().nullable(),
  completedAt: z.coerce.date().nullable(),
  createdAt: z.coerce.date(),
  updatedAt: z.coerce.date()
});
var scorerResultSchema = z.object({
  scorerId: z.string(),
  scorerName: z.string(),
  score: z.number().nullable(),
  reason: z.string().nullable(),
  error: z.string().nullable()
});
var experimentResultResponseSchema = z.object({
  id: z.string(),
  experimentId: z.string(),
  itemId: z.string(),
  itemDatasetVersion: z.number().int().nullable(),
  input: z.unknown(),
  output: z.unknown().nullable(),
  groundTruth: z.unknown().nullable(),
  error: z.object({
    message: z.string(),
    stack: z.string().optional(),
    code: z.string().optional()
  }).nullable(),
  startedAt: z.coerce.date(),
  completedAt: z.coerce.date(),
  retryCount: z.number(),
  traceId: z.string().nullable(),
  createdAt: z.coerce.date()
});
var comparisonItemSchema = z.object({
  itemId: z.string(),
  input: z.unknown().nullable(),
  groundTruth: z.unknown().nullable(),
  results: z.record(
    z.string(),
    z.object({
      output: z.unknown().nullable(),
      scores: z.record(z.string(), z.number().nullable())
    }).nullable()
  )
});
var comparisonResponseSchema = z.object({
  baselineId: z.string(),
  items: z.array(comparisonItemSchema)
});
var experimentSummaryResponseSchema = z.object({
  experimentId: z.string(),
  status: z.enum(["pending", "running", "completed", "failed"]),
  totalItems: z.number(),
  succeededCount: z.number(),
  failedCount: z.number(),
  startedAt: z.coerce.date(),
  completedAt: z.coerce.date().nullable(),
  results: z.array(
    z.object({
      itemId: z.string(),
      itemDatasetVersion: z.number().int().nullable(),
      input: z.unknown(),
      output: z.unknown().nullable(),
      groundTruth: z.unknown().nullable(),
      error: z.string().nullable(),
      startedAt: z.coerce.date(),
      completedAt: z.coerce.date(),
      retryCount: z.number(),
      scores: z.array(
        z.object({
          scorerId: z.string(),
          scorerName: z.string(),
          score: z.number().nullable(),
          reason: z.string().nullable(),
          error: z.string().nullable()
        })
      )
    })
  )
});
var listDatasetsResponseSchema = z.object({
  datasets: z.array(datasetResponseSchema),
  pagination: paginationInfoSchema
});
var listItemsResponseSchema = z.object({
  items: z.array(datasetItemResponseSchema),
  pagination: paginationInfoSchema
});
var listExperimentsResponseSchema = z.object({
  experiments: z.array(experimentResponseSchema),
  pagination: paginationInfoSchema
});
var listExperimentResultsResponseSchema = z.object({
  results: z.array(experimentResultResponseSchema),
  pagination: paginationInfoSchema
});
var datasetItemVersionPathParams = z.object({
  datasetId: z.string().describe("Unique identifier for the dataset"),
  itemId: z.string().describe("Unique identifier for the dataset item"),
  datasetVersion: z.coerce.number().int().describe("Dataset version number")
});
var itemVersionResponseSchema = z.object({
  id: z.string(),
  datasetId: z.string(),
  datasetVersion: z.number().int(),
  input: z.unknown(),
  groundTruth: z.unknown().optional(),
  metadata: z.record(z.string(), z.unknown()).optional(),
  validTo: z.number().int().nullable(),
  isDeleted: z.boolean(),
  createdAt: z.coerce.date(),
  updatedAt: z.coerce.date()
});
var listItemVersionsResponseSchema = z.object({
  history: z.array(itemVersionResponseSchema)
});
var datasetVersionResponseSchema = z.object({
  id: z.string(),
  datasetId: z.string(),
  version: z.number().int(),
  createdAt: z.coerce.date()
});
var listDatasetVersionsResponseSchema = z.object({
  versions: z.array(datasetVersionResponseSchema),
  pagination: paginationInfoSchema
});
var batchInsertItemsBodySchema = z.object({
  items: z.array(
    z.object({
      input: z.unknown(),
      groundTruth: z.unknown().optional(),
      requestContext: z.record(z.string(), z.unknown()).optional(),
      metadata: z.record(z.string(), z.unknown()).optional()
    })
  )
});
var batchInsertItemsResponseSchema = z.object({
  items: z.array(datasetItemResponseSchema),
  count: z.number()
});
var batchDeleteItemsBodySchema = z.object({
  itemIds: z.array(z.string())
});
var batchDeleteItemsResponseSchema = z.object({
  success: z.boolean(),
  deletedCount: z.number()
});

export { addItemBodySchema, batchDeleteItemsBodySchema, batchDeleteItemsResponseSchema, batchInsertItemsBodySchema, batchInsertItemsResponseSchema, compareExperimentsBodySchema, comparisonResponseSchema, createDatasetBodySchema, datasetAndExperimentIdPathParams, datasetAndItemIdPathParams, datasetIdPathParams, datasetItemResponseSchema, datasetItemVersionPathParams, datasetResponseSchema, datasetVersionResponseSchema, experimentIdPathParams, experimentResponseSchema, experimentResultResponseSchema, experimentSummaryResponseSchema, itemIdPathParams, itemVersionResponseSchema, listDatasetVersionsResponseSchema, listDatasetsResponseSchema, listExperimentResultsResponseSchema, listExperimentsResponseSchema, listItemVersionsResponseSchema, listItemsQuerySchema, listItemsResponseSchema, paginationQuerySchema, scorerResultSchema, triggerExperimentBodySchema, updateDatasetBodySchema, updateItemBodySchema };
//# sourceMappingURL=chunk-5N4O5XJZ.js.map
//# sourceMappingURL=chunk-5N4O5XJZ.js.map