'use strict';

var chunkZYXDUS6Q_cjs = require('./chunk-ZYXDUS6Q.cjs');
var z = require('zod');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var z__default = /*#__PURE__*/_interopDefault(z);

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

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