@mastra/server 1.55.0 → 1.56.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.cjs","names":["coreFeatures","HTTPException","RequestContext","isReservedRequestContextKey","createRoute","paginationQuerySchema","listDatasetsResponseSchema","MastraError","handleError","createDatasetBodySchema","datasetResponseSchema","datasetIdPathParams","tenancyQuerySchema","updateDatasetBodySchema","successResponseSchema","listItemsQuerySchema","listItemsResponseSchema","addItemBodySchema","datasetItemResponseSchema","datasetAndItemIdPathParams","updateItemBodySchema","listExperimentsResponseSchema","reviewSummaryResponseSchema","triggerExperimentBodySchema","experimentSummaryResponseSchema","datasetAndExperimentIdPathParams","experimentResponseSchema","listExperimentResultsResponseSchema","experimentResultIdPathParams","updateExperimentResultBodySchema","experimentResultResponseSchema","compareExperimentsBodySchema","comparisonResponseSchema","listDatasetVersionsResponseSchema","listItemVersionsResponseSchema","datasetItemVersionPathParams","batchInsertItemsBodySchema","batchInsertItemsResponseSchema","batchDeleteItemsBodySchema","batchDeleteItemsResponseSchema","generateItemsBodySchema","generateItemsResponseSchema","Agent","z","clusterFailuresBodySchema","clusterFailuresResponseSchema"],"sources":["../../../src/server/handlers/datasets.ts"],"sourcesContent":["import { Agent } from '@mastra/core/agent';\nimport { MastraError } from '@mastra/core/error';\nimport { coreFeatures } from '@mastra/core/features';\nimport { resolveModelConfig } from '@mastra/core/llm';\nimport { RequestContext } from '@mastra/core/request-context';\nimport type { DatasetItemSource, DatasetItemToolMock, TargetType } from '@mastra/core/storage';\nimport { z } from 'zod';\nimport { isReservedRequestContextKey } from '../constants';\nimport { HTTPException } from '../http-exception';\nimport type { StatusCode } from '../http-exception';\nimport { successResponseSchema } from '../schemas/common';\nimport {\n datasetIdPathParams,\n datasetAndExperimentIdPathParams,\n experimentResultIdPathParams,\n datasetAndItemIdPathParams,\n datasetItemVersionPathParams,\n paginationQuerySchema,\n tenancyQuerySchema,\n listItemsQuerySchema,\n createDatasetBodySchema,\n updateDatasetBodySchema,\n addItemBodySchema,\n updateItemBodySchema,\n triggerExperimentBodySchema,\n compareExperimentsBodySchema,\n batchInsertItemsBodySchema,\n batchDeleteItemsBodySchema,\n generateItemsBodySchema,\n generateItemsResponseSchema,\n clusterFailuresBodySchema,\n clusterFailuresResponseSchema,\n datasetResponseSchema,\n datasetItemResponseSchema,\n experimentResponseSchema,\n experimentResultResponseSchema,\n experimentSummaryResponseSchema,\n comparisonResponseSchema,\n listDatasetsResponseSchema,\n listItemsResponseSchema,\n listExperimentsResponseSchema,\n listExperimentResultsResponseSchema,\n listDatasetVersionsResponseSchema,\n listItemVersionsResponseSchema,\n batchInsertItemsResponseSchema,\n batchDeleteItemsResponseSchema,\n updateExperimentResultBodySchema,\n reviewSummaryResponseSchema,\n} from '../schemas/datasets';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { handleError } from './error';\n\n// ============================================================================\n// Feature gate + local type guards\n// ============================================================================\n\nfunction assertDatasetsAvailable(): void {\n if (!coreFeatures.has('datasets')) {\n throw new HTTPException(501, { message: 'Datasets require @mastra/core >= 1.4.0' });\n }\n}\n\n/**\n * Recovers the caller-provided request context for a dataset item.\n *\n * Server adapters overwrite the body's `requestContext` field with the live\n * server `RequestContext` instance (so bodies cannot spoof auth context), after\n * merging the body's entries into it. Persisting that live instance as item\n * data stores internal server state and fails JSON/BSON serialization, so\n * convert it back to the plain caller-provided entries (reserved `mastra__*`\n * keys excluded) before it reaches storage.\n */\nfunction toItemRequestContext(\n requestContext: Record<string, unknown> | RequestContext | undefined,\n): Record<string, unknown> | undefined {\n if (!(requestContext instanceof RequestContext)) return requestContext;\n const entries = Object.entries(requestContext.toJSON()).filter(([key]) => !isReservedRequestContextKey(key));\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\ninterface SchemaValidationLike extends Error {\n field: 'input' | 'groundTruth';\n errors: Array<{ path: string; code: string; message: string }>;\n}\n\ninterface SchemaUpdateValidationLike extends Error {\n failingItems: Array<{\n index: number;\n data: unknown;\n field: 'input' | 'groundTruth';\n errors: Array<{ path: string; code: string; message: string }>;\n }>;\n}\n\nfunction isSchemaValidationError(error: unknown): error is SchemaValidationLike {\n return error instanceof Error && error.name === 'SchemaValidationError';\n}\n\nfunction isSchemaUpdateValidationError(error: unknown): error is SchemaUpdateValidationLike {\n return error instanceof Error && error.name === 'SchemaUpdateValidationError';\n}\n\n// ============================================================================\n// Helper: Map MastraError IDs to HTTP status codes\n// ============================================================================\n\nfunction getHttpStatusForMastraError(errorId: string): number {\n switch (errorId) {\n case 'DATASET_NOT_FOUND':\n case 'EXPERIMENT_NOT_FOUND':\n return 404;\n case 'EXPERIMENT_NO_ITEMS':\n case 'DATASET_ITEM_EXTERNAL_ID_INVALID':\n case 'DATASET_ITEM_PAYLOAD_NOT_SERIALIZABLE':\n return 400;\n case 'DATASET_ITEM_IDENTITY_CONFLICT':\n return 409;\n default:\n return 500;\n }\n}\n\n// ============================================================================\n// Dataset CRUD Routes\n// ============================================================================\n\nexport const LIST_DATASETS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets',\n responseType: 'json',\n queryParamSchema: paginationQuerySchema,\n responseSchema: listDatasetsResponseSchema,\n summary: 'List all datasets',\n description: 'Returns a paginated list of all datasets',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const result = await mastra.datasets.list({ page: page ?? 0, perPage: perPage ?? 10 });\n return {\n datasets: result.datasets as any,\n pagination: result.pagination,\n };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing datasets');\n }\n },\n});\n\nexport const CREATE_DATASET_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets',\n responseType: 'json',\n bodySchema: createDatasetBodySchema,\n responseSchema: datasetResponseSchema,\n summary: 'Create a new dataset',\n description: 'Creates a new dataset with the specified name and optional metadata',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n targetType,\n targetIds,\n scorerIds,\n } = params as {\n name: string;\n description?: string;\n metadata?: Record<string, unknown>;\n inputSchema?: Record<string, unknown> | null;\n groundTruthSchema?: Record<string, unknown> | null;\n requestContextSchema?: Record<string, unknown> | null;\n targetType?: TargetType;\n targetIds?: string[];\n scorerIds?: string[];\n };\n const ds = await mastra.datasets.create({\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n targetType,\n targetIds,\n scorerIds,\n });\n const details = await ds.getDetails();\n return details as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error creating dataset');\n }\n },\n});\n\nexport const GET_DATASET_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: tenancyQuerySchema,\n responseSchema: datasetResponseSchema.nullable(),\n summary: 'Get dataset by ID',\n description: 'Returns details for a specific dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { organizationId, projectId } = params as { organizationId?: string; projectId?: string };\n const ds = await mastra.datasets.get({ id: datasetId, organizationId, projectId });\n return (await ds.getDetails()) as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting dataset');\n }\n },\n});\n\nexport const UPDATE_DATASET_ROUTE = createRoute({\n method: 'PATCH',\n path: '/datasets/:datasetId',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: tenancyQuerySchema,\n bodySchema: updateDatasetBodySchema,\n responseSchema: datasetResponseSchema,\n summary: 'Update dataset',\n description: 'Updates a dataset with the specified fields',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n tags,\n targetType,\n targetIds,\n scorerIds,\n organizationId,\n projectId,\n } = params as {\n name?: string;\n description?: string;\n metadata?: Record<string, unknown>;\n inputSchema?: Record<string, unknown> | null;\n groundTruthSchema?: Record<string, unknown> | null;\n requestContextSchema?: Record<string, unknown> | null;\n tags?: string[];\n targetType?: TargetType;\n targetIds?: string[];\n scorerIds?: string[] | null;\n organizationId?: string;\n projectId?: string;\n };\n const ds = await mastra.datasets.get({ id: datasetId, organizationId, projectId });\n const result = await ds.update({\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n tags,\n targetType,\n targetIds,\n scorerIds,\n });\n return result as any;\n } catch (error) {\n if (isSchemaUpdateValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { failingItems: error.failingItems },\n });\n }\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error updating dataset');\n }\n },\n});\n\nexport const DELETE_DATASET_ROUTE = createRoute({\n method: 'DELETE',\n path: '/datasets/:datasetId',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: tenancyQuerySchema,\n responseSchema: successResponseSchema,\n summary: 'Delete dataset',\n description: 'Deletes a dataset and all its items',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { organizationId, projectId } = params as { organizationId?: string; projectId?: string };\n // For unscoped deletes, preserve the legacy 404-on-missing behavior via a\n // preflight get(). For scoped deletes, skip the preflight: a tenancy\n // mismatch must be a silent no-op (matches \"delete non-existent id is a\n // no-op\") so cross-tenant existence is not leaked via error timing/status.\n if (organizationId === undefined && projectId === undefined) {\n await mastra.datasets.get({ id: datasetId });\n }\n await mastra.datasets.delete({ id: datasetId, organizationId, projectId });\n return { success: true };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error deleting dataset');\n }\n },\n});\n\n// ============================================================================\n// Item CRUD Routes\n// ============================================================================\n\nexport const LIST_ITEMS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: listItemsQuerySchema,\n responseSchema: listItemsResponseSchema,\n summary: 'List dataset items',\n description: 'Returns a paginated list of items in the dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage, version, search } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.listItems({\n page: page ?? 0,\n perPage: perPage ?? 10,\n version,\n search,\n });\n // Handler always passes `page` and `perPage`, so `listItems` always\n // returns the paginated shape; the guard is defensive.\n if (Array.isArray(result)) {\n return { items: result, pagination: { total: result.length, page: 0, perPage: result.length, hasMore: false } };\n }\n return { items: result.items, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing dataset items');\n }\n },\n});\n\nexport const ADD_ITEM_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/items',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: addItemBodySchema,\n responseSchema: datasetItemResponseSchema,\n summary: 'Add item to dataset',\n description: 'Adds a new item to the dataset (auto-increments dataset version)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { externalId, input, groundTruth, requestContext, metadata, source, expectedTrajectory, toolMocks } =\n params as {\n externalId?: string | null;\n input: unknown;\n groundTruth?: unknown;\n requestContext?: Record<string, unknown> | RequestContext;\n metadata?: Record<string, unknown>;\n source?: DatasetItemSource;\n expectedTrajectory?: unknown;\n toolMocks?: DatasetItemToolMock[];\n };\n const ds = await mastra.datasets.get({ id: datasetId });\n return await ds.addItem({\n externalId: externalId ?? undefined,\n input,\n groundTruth,\n requestContext: toItemRequestContext(requestContext),\n metadata,\n source,\n expectedTrajectory,\n toolMocks,\n });\n } catch (error) {\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n if (error.id === 'DATASET_ITEM_IDENTITY_CONFLICT') {\n throw new HTTPException(409, {\n message: error.message,\n cause: { conflicts: 'conflicts' in error ? error.conflicts : [] },\n });\n }\n if (error.id === 'DATASET_ITEM_EXTERNAL_ID_INVALID') {\n throw new HTTPException(400, { message: error.message, cause: { field: 'externalId' } });\n }\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error adding item to dataset');\n }\n },\n});\n\nexport const GET_ITEM_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items/:itemId',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n responseSchema: datasetItemResponseSchema.nullable(),\n summary: 'Get dataset item by ID',\n description: 'Returns details for a specific dataset item',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const item = await ds.getItem({ itemId });\n if (!item || (item as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found: ${itemId}` });\n }\n return item as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting dataset item');\n }\n },\n});\n\nexport const UPDATE_ITEM_ROUTE = createRoute({\n method: 'PATCH',\n path: '/datasets/:datasetId/items/:itemId',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n bodySchema: updateItemBodySchema,\n responseSchema: datasetItemResponseSchema,\n summary: 'Update dataset item',\n description: 'Updates a dataset item (auto-increments dataset version)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { input, groundTruth, requestContext, metadata, expectedTrajectory, toolMocks } = params as {\n input?: unknown;\n groundTruth?: unknown;\n requestContext?: Record<string, unknown> | RequestContext;\n metadata?: Record<string, unknown>;\n expectedTrajectory?: unknown;\n toolMocks?: DatasetItemToolMock[];\n };\n const ds = await mastra.datasets.get({ id: datasetId });\n // Check if item exists and belongs to dataset\n const existing = await ds.getItem({ itemId });\n if (!existing || (existing as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found: ${itemId}` });\n }\n return await ds.updateItem({\n itemId,\n input,\n groundTruth,\n requestContext: toItemRequestContext(requestContext),\n metadata,\n expectedTrajectory,\n toolMocks,\n });\n } catch (error) {\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error updating dataset item');\n }\n },\n});\n\nexport const DELETE_ITEM_ROUTE = createRoute({\n method: 'DELETE',\n path: '/datasets/:datasetId/items/:itemId',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n responseSchema: successResponseSchema,\n summary: 'Delete dataset item',\n description: 'Deletes a dataset item',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const existing = await ds.getItem({ itemId });\n if (!existing || (existing as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found: ${itemId}` });\n }\n await ds.deleteItem({ itemId });\n return { success: true };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error deleting dataset item');\n }\n },\n});\n\n// ============================================================================\n// Experiment Operations Routes\n// ============================================================================\n\nexport const LIST_ALL_EXPERIMENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/experiments',\n responseType: 'json',\n queryParamSchema: paginationQuerySchema,\n responseSchema: listExperimentsResponseSchema,\n summary: 'List all experiments',\n description: 'Returns a paginated list of all experiments across all datasets',\n tags: ['Experiments'],\n requiresAuth: true,\n handler: async ({ mastra, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage not configured' });\n }\n const experimentsStore = await storage.getStore('experiments');\n if (!experimentsStore) {\n throw new HTTPException(500, { message: 'Experiments storage not available' });\n }\n const result = await experimentsStore.listExperiments({\n pagination: { page: page ?? 0, perPage: perPage ?? 20 },\n });\n return { experiments: result.experiments, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing experiments');\n }\n },\n});\n\nexport const EXPERIMENT_REVIEW_SUMMARY_ROUTE = createRoute({\n method: 'GET',\n path: '/experiments/review-summary',\n responseType: 'json',\n responseSchema: reviewSummaryResponseSchema,\n summary: 'Get review summary for all experiments',\n description: 'Returns review status counts (needs-review, reviewed, complete) aggregated per experiment',\n tags: ['Experiments'],\n requiresAuth: true,\n handler: async ({ mastra }) => {\n assertDatasetsAvailable();\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage not configured' });\n }\n const experimentsStore = await storage.getStore('experiments');\n if (!experimentsStore) {\n throw new HTTPException(500, { message: 'Experiments storage not available' });\n }\n const counts = await experimentsStore.getReviewSummary();\n return { counts };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting review summary');\n }\n },\n});\n\nexport const LIST_EXPERIMENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/experiments',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: paginationQuerySchema,\n responseSchema: listExperimentsResponseSchema,\n summary: 'List experiments for dataset',\n description: 'Returns a paginated list of experiments for the dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.listExperiments({ page: page ?? 0, perPage: perPage ?? 10 });\n return { experiments: result.experiments, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing experiments');\n }\n },\n});\n\nexport const TRIGGER_EXPERIMENT_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/experiments',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: triggerExperimentBodySchema,\n responseSchema: experimentSummaryResponseSchema,\n summary: 'Trigger a new experiment',\n description:\n 'Triggers a new experiment on the dataset against the specified target. Returns immediately with pending status; execution happens in background.',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n targetType,\n targetId,\n scorerIds,\n version,\n agentVersion,\n maxConcurrency,\n requestContext: rawRequestContext,\n versions,\n } = params as {\n targetType: 'agent' | 'workflow' | 'scorer';\n targetId: string;\n scorerIds?: string[];\n version?: number;\n agentVersion?: string;\n maxConcurrency?: number;\n requestContext?: Record<string, unknown> | RequestContext;\n versions?: { agents?: Record<string, { versionId: string } | { status: 'draft' | 'published' }> };\n };\n // The adapter middleware merges body + query requestContext into a RequestContext instance.\n // startExperimentAsync expects a plain Record, so convert it.\n const requestContext = rawRequestContext instanceof RequestContext ? rawRequestContext.all : rawRequestContext;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.startExperimentAsync({\n targetType,\n targetId,\n scorers: scorerIds,\n version,\n agentVersion,\n maxConcurrency,\n requestContext,\n versions,\n });\n // Return shape matching experimentSummaryResponseSchema\n return {\n experimentId: result.experimentId,\n status: result.status,\n totalItems: result.totalItems ?? 0,\n succeededCount: 0,\n failedCount: 0,\n startedAt: new Date(),\n completedAt: null,\n results: [],\n };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error triggering experiment');\n }\n },\n});\n\nexport const GET_EXPERIMENT_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/experiments/:experimentId',\n responseType: 'json',\n pathParamSchema: datasetAndExperimentIdPathParams,\n responseSchema: experimentResponseSchema.nullable(),\n summary: 'Get experiment by ID',\n description: 'Returns details for a specific experiment',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, experimentId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const run = await ds.getExperiment({ experimentId });\n if (!run || run.datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Experiment not found: ${experimentId}` });\n }\n return run;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting experiment');\n }\n },\n});\n\nexport const LIST_EXPERIMENT_RESULTS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/experiments/:experimentId/results',\n responseType: 'json',\n pathParamSchema: datasetAndExperimentIdPathParams,\n queryParamSchema: paginationQuerySchema,\n responseSchema: listExperimentResultsResponseSchema,\n summary: 'List experiment results',\n description: 'Returns a paginated list of results for the experiment',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, experimentId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n // Validate experiment belongs to dataset\n const run = await ds.getExperiment({ experimentId });\n if (!run || run.datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Experiment not found: ${experimentId}` });\n }\n const result = await ds.listExperimentResults({ experimentId, page: page ?? 0, perPage: perPage ?? 10 });\n return {\n results: result.results.map(({ experimentId: _eid, ...rest }) => ({ experimentId, ...rest })),\n pagination: result.pagination,\n };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing experiment results');\n }\n },\n});\n\nexport const UPDATE_EXPERIMENT_RESULT_ROUTE = createRoute({\n method: 'PATCH',\n path: '/datasets/:datasetId/experiments/:experimentId/results/:resultId',\n responseType: 'json',\n pathParamSchema: experimentResultIdPathParams,\n bodySchema: updateExperimentResultBodySchema,\n responseSchema: experimentResultResponseSchema,\n summary: 'Update an experiment result',\n description: 'Updates the status and/or tags on an experiment result',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, resultId, experimentId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage not configured' });\n }\n const experimentsStore = await storage.getStore('experiments');\n if (!experimentsStore) {\n throw new HTTPException(500, { message: 'Experiments storage not available' });\n }\n\n const result = await experimentsStore.updateExperimentResult({\n id: resultId,\n experimentId,\n status: params.status,\n tags: params.tags,\n });\n\n return result;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error updating experiment result');\n }\n },\n});\n\n// ============================================================================\n// Analytics Routes (nested under datasets)\n// ============================================================================\n\nexport const COMPARE_EXPERIMENTS_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/compare',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: compareExperimentsBodySchema,\n responseSchema: comparisonResponseSchema,\n summary: 'Compare two experiments',\n description: 'Compares two experiments to detect score regressions',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { experimentIdA, experimentIdB } = params as {\n experimentIdA: string;\n experimentIdB: string;\n };\n // Validate dataset exists\n await mastra.datasets.get({ id: datasetId });\n const result = await mastra.datasets.compareExperiments({\n experimentIds: [experimentIdA, experimentIdB],\n baselineId: experimentIdA,\n });\n return result;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error comparing experiments');\n }\n },\n});\n\n// ============================================================================\n// Version Routes\n// ============================================================================\n\nexport const LIST_DATASET_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/versions',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: paginationQuerySchema,\n responseSchema: listDatasetVersionsResponseSchema,\n summary: 'List dataset versions',\n description: 'Returns a paginated list of all versions for the dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.listVersions({ page: page ?? 0, perPage: perPage ?? 10 });\n return { versions: result.versions, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing dataset versions');\n }\n },\n});\n\nexport const LIST_ITEM_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items/:itemId/history',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n responseSchema: listItemVersionsResponseSchema,\n summary: 'Get item history',\n description: 'Returns the full SCD-2 history of the item across all dataset versions',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const rows = await ds.getItemHistory({ itemId });\n // Check rows belong to this dataset\n if (rows.length > 0 && rows[0]?.datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found in dataset: ${itemId}` });\n }\n return { history: rows };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing item history');\n }\n },\n});\n\nexport const GET_ITEM_VERSION_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items/:itemId/versions/:datasetVersion',\n responseType: 'json',\n pathParamSchema: datasetItemVersionPathParams,\n responseSchema: datasetItemResponseSchema.nullable(),\n summary: 'Get item at specific dataset version',\n description: 'Returns the item as it existed at a specific dataset version',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId, datasetVersion }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const item = await ds.getItem({ itemId, version: datasetVersion });\n if (!item) {\n throw new HTTPException(404, { message: `Item ${itemId} not found at version ${datasetVersion}` });\n }\n if ((item as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found in dataset: ${itemId}` });\n }\n return item as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting item version');\n }\n },\n});\n\n// ============================================================================\n// Batch Operations Routes\n// ============================================================================\n\nexport const BATCH_INSERT_ITEMS_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/items/batch',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: batchInsertItemsBodySchema,\n responseSchema: batchInsertItemsResponseSchema,\n summary: 'Batch insert items to dataset',\n description: 'Adds multiple items to the dataset in a single operation (single version entry)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { items } = params as {\n items: Array<{\n externalId?: string | null;\n input: unknown;\n groundTruth?: unknown;\n expectedTrajectory?: unknown;\n toolMocks?: DatasetItemToolMock[];\n metadata?: Record<string, unknown>;\n source?: DatasetItemSource;\n }>;\n };\n const ds = await mastra.datasets.get({ id: datasetId });\n const addedItems = await ds.addItems({\n items: items.map(item => ({ ...item, externalId: item.externalId ?? undefined })),\n });\n return { items: addedItems, count: addedItems.length };\n } catch (error) {\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n if (error.id === 'DATASET_ITEM_IDENTITY_CONFLICT') {\n throw new HTTPException(409, {\n message: error.message,\n cause: { conflicts: 'conflicts' in error ? error.conflicts : [] },\n });\n }\n if (error.id === 'DATASET_ITEM_EXTERNAL_ID_INVALID') {\n throw new HTTPException(400, { message: error.message, cause: { field: 'externalId' } });\n }\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error batch inserting items');\n }\n },\n});\n\nexport const BATCH_DELETE_ITEMS_ROUTE = createRoute({\n method: 'DELETE',\n path: '/datasets/:datasetId/items/batch',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: batchDeleteItemsBodySchema,\n responseSchema: batchDeleteItemsResponseSchema,\n summary: 'Batch delete items from dataset',\n description: 'Deletes multiple items from the dataset in a single operation (single version entry)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { itemIds } = params as { itemIds: string[] };\n const ds = await mastra.datasets.get({ id: datasetId });\n await ds.deleteItems({ itemIds });\n return { success: true, deletedCount: itemIds.length };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error bulk deleting items');\n }\n },\n});\n\n// ============================================================================\n// AI Generation\n// ============================================================================\n\nconst GENERATE_ITEMS_SYSTEM_PROMPT = `You are a test data generation expert. Your job is to generate realistic, diverse test data items for an AI agent evaluation dataset.\n\nYou will be given context about the agent being tested — its purpose, system prompt, and available tools. Use this to generate inputs that thoroughly exercise the agent's capabilities.\n\nGenerate test items that:\n1. Are realistic and diverse — cover edge cases, different complexities, and various scenarios\n2. Match the provided schemas exactly\n3. Include ground truth values when a ground truth schema is provided\n4. Vary in difficulty (easy, medium, hard cases)\n5. Include potential edge cases and tricky inputs\n6. Test different aspects of the agent's capabilities based on its tools and instructions\n\nReturn the items as a JSON array.`;\n\nexport const GENERATE_ITEMS_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/generate-items',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: generateItemsBodySchema,\n responseSchema: generateItemsResponseSchema,\n summary: 'Generate dataset items using AI',\n description:\n 'Uses an LLM to generate synthetic dataset items based on the dataset schema and a user prompt. Returns generated items for review — they are NOT automatically added to the dataset.',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, modelId, prompt, count, agentContext }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const dataset = await ds.getDetails();\n\n // Resolve the model from the \"provider/model\" string\n const model = await resolveModelConfig(modelId, undefined, mastra);\n\n // Build context about the dataset schema for the generator\n const schemaContext = [\n dataset.inputSchema ? `Input schema:\\n${JSON.stringify(dataset.inputSchema, null, 2)}` : null,\n dataset.groundTruthSchema\n ? `Ground truth schema:\\n${JSON.stringify(dataset.groundTruthSchema, null, 2)}`\n : null,\n ]\n .filter(Boolean)\n .join('\\n\\n');\n\n const generatorAgent = new Agent({\n id: 'dataset-item-generator',\n name: 'dataset-item-generator',\n instructions: GENERATE_ITEMS_SYSTEM_PROMPT,\n model,\n });\n\n // Build the structured output schema dynamically based on count\n // Use z.string() for input/groundTruth since OpenAI structured output requires concrete types.\n // The generator will produce JSON strings that we parse back into objects if needed.\n const itemSchema = z.object({\n input: z\n .string()\n .describe('The input data as a JSON string matching the input schema, or a plain text string if no schema'),\n groundTruth: z\n .string()\n .optional()\n .describe('The expected output as a JSON string matching the ground truth schema'),\n });\n const outputSchema = z.object({\n items: z.array(itemSchema).min(1).max(count),\n });\n\n // Build agent context section\n const agentContextParts = [];\n if (agentContext?.description) {\n agentContextParts.push(`Agent description: ${agentContext.description}`);\n }\n if (agentContext?.instructions) {\n agentContextParts.push(`Agent system prompt:\\n${agentContext.instructions}`);\n }\n if (agentContext?.tools?.length) {\n agentContextParts.push(`Agent tools: ${agentContext.tools.join(', ')}`);\n }\n const agentContextSection = agentContextParts.length > 0 ? agentContextParts.join('\\n\\n') : null;\n\n const userMessage = [\n `Generate exactly ${count} test items for a dataset named \"${dataset.name}\".`,\n dataset.description ? `Dataset description: ${dataset.description}` : null,\n agentContextSection ? `--- AGENT CONTEXT ---\\n${agentContextSection}` : null,\n schemaContext || null,\n `User's request: ${prompt}`,\n `Return exactly ${count} items.`,\n ]\n .filter(Boolean)\n .join('\\n\\n');\n\n const result = await generatorAgent.generate(userMessage, {\n structuredOutput: { schema: outputSchema },\n });\n\n const generated = await result.object;\n\n // Parse JSON strings back to objects where possible\n const items = generated.items.map(item => {\n let input: unknown = item.input;\n try {\n input = JSON.parse(item.input);\n } catch {\n // Keep as string if not valid JSON\n }\n let groundTruth: unknown = item.groundTruth;\n if (item.groundTruth) {\n try {\n groundTruth = JSON.parse(item.groundTruth);\n } catch {\n // Keep as string if not valid JSON\n }\n }\n return { input, groundTruth };\n });\n\n return { items };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error generating dataset items');\n }\n },\n});\n\n// ============================================================================\n// Failure Clustering\n// ============================================================================\n\nconst CLUSTER_FAILURES_SYSTEM_PROMPT = `You are an AI evaluation expert specializing in failure analysis. Given a set of failure items from an AI agent experiment, identify common failure patterns and assign descriptive tags to each item.\n\nFor each cluster you identify, provide:\n- A short, descriptive tag label (2-5 words, lowercase, hyphenated, e.g., \"no-tool-usage\", \"hallucination\")\n- A description explaining the common failure pattern\n- The IDs of items that belong to this cluster\n\nAlso return a \"proposedTags\" array mapping each item ID to the tags you recommend, along with a brief \"reason\" explaining WHY those tags apply to that specific item. The reason should reference concrete evidence from the item's input/output/error.\n\nGuidelines:\n- Create between 1 and 8 clusters depending on the diversity of failures\n- Every item must be assigned to at least one cluster unless there is no clear pattern of failure\n- Focus on the root cause of failures, not surface-level symptoms\n- If items have scores, use low scores as signals for the failure type\n- Be specific about what went wrong\n- IMPORTANT: If existing tags are provided, PREFER reusing them over creating new ones. Only create new tags when no existing tag fits.\n- Items may already have tags — consider those when assigning new ones and avoid duplicating existing tags on an item.\n- The \"reason\" field should be 1-2 sentences explaining the specific evidence for each tag assignment.`;\n\nexport const CLUSTER_FAILURES_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/cluster-failures',\n responseType: 'json',\n bodySchema: clusterFailuresBodySchema,\n responseSchema: clusterFailuresResponseSchema,\n summary: 'Cluster experiment failures using AI',\n description:\n 'Uses an LLM to analyze failure items from an experiment and group them into meaningful failure pattern clusters.',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, modelId, items, availableTags, prompt }) => {\n assertDatasetsAvailable();\n try {\n const model = await resolveModelConfig(modelId, undefined, mastra);\n\n const clusterAgent = new Agent({\n id: 'failure-cluster-analyzer',\n name: 'failure-cluster-analyzer',\n instructions: CLUSTER_FAILURES_SYSTEM_PROMPT,\n model,\n });\n\n const outputSchema = z.object({\n clusters: z.array(\n z.object({\n id: z.string(),\n label: z.string(),\n description: z.string(),\n itemIds: z.array(z.string()),\n }),\n ),\n proposedTags: z.array(\n z.object({\n itemId: z.string(),\n tags: z.array(z.string()),\n reason: z.string().describe('Brief explanation of why these tags were assigned'),\n }),\n ),\n });\n\n const itemSummaries = items.map((item, i) => {\n const parts = [`Item ${i + 1} (id: ${item.id}):`];\n if (item.input !== undefined && item.input !== null) parts.push(` Input: ${JSON.stringify(item.input)}`);\n if (item.output !== undefined && item.output !== null) parts.push(` Output: ${JSON.stringify(item.output)}`);\n if (item.error !== undefined && item.error !== null) {\n parts.push(` Error: ${typeof item.error === 'string' ? item.error : JSON.stringify(item.error)}`);\n }\n if (item.scores !== undefined && item.scores !== null) {\n parts.push(` Scores: ${JSON.stringify(item.scores)}`);\n }\n if (item.existingTags && item.existingTags.length > 0) {\n parts.push(` Existing tags: ${item.existingTags.join(', ')}`);\n }\n return parts.join('\\n');\n });\n\n let userMessage = `Analyze these ${items.length} failure items and group them into clusters of common failure patterns:\\n\\n${itemSummaries.join('\\n\\n')}`;\n\n if (availableTags && availableTags.length > 0) {\n userMessage += `\\n\\nExisting tag vocabulary (prefer reusing these): ${availableTags.join(', ')}`;\n }\n\n if (prompt) {\n userMessage += `\\n\\nAdditional instructions from the reviewer: ${prompt}`;\n }\n\n userMessage += `\\n\\nReturn both \"clusters\" (grouping items by pattern) and \"proposedTags\" (a list mapping each item ID to the tag labels you recommend, with a \"reason\" explaining why). For proposedTags, only include NEW tags to add — do not repeat tags the item already has.`;\n\n const result = await clusterAgent.generate(userMessage, {\n structuredOutput: { schema: outputSchema },\n });\n\n const generated = await result.object;\n return { clusters: generated.clusters, proposedTags: generated.proposedTags ?? [] };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.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EtJ,IAAI,iBAAiB,cAAc,SAAS,GAC1C,eAAe,uDAAuD,cAAc,KAAK,IAAI;GAG/F,IAAI,QACF,eAAe,kDAAkD;GAGnE,eAAe;GAMf,MAAM,YAAY,OAAM,MAJH,aAAa,SAAS,aAAa,EACtD,kBAAkB,EAAE,QAAQ,aAAa,EAC3C,CAAC,EAAA,CAE8B;GAC/B,OAAO;IAAE,UAAU,UAAU;IAAU,cAAc,UAAU,gBAAgB,CAAC;GAAE;EACpF,SAAS,OAAO;GACd,IAAI,iBAAiBpC,mBAAAA,aACnB,MAAM,IAAIN,uBAAAA,cAAc,4BAA4B,MAAM,EAAE,GAAiB,EAAE,SAAS,MAAM,QAAQ,CAAC;GAEzG,OAAOO,8BAAAA,YAAY,OAAO,2BAA2B;EACvD;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"datasets.cjs","names":["coreFeatures","HTTPException","RequestContext","isReservedRequestContextKey","createRoute","paginationQuerySchema","listDatasetsResponseSchema","MastraError","handleError","createDatasetBodySchema","datasetResponseSchema","datasetIdPathParams","tenancyQuerySchema","updateDatasetBodySchema","successResponseSchema","listItemsQuerySchema","listItemsResponseSchema","addItemBodySchema","datasetItemResponseSchema","datasetAndItemIdPathParams","updateItemBodySchema","listExperimentsResponseSchema","reviewSummaryResponseSchema","triggerExperimentBodySchema","experimentSummaryResponseSchema","datasetAndExperimentIdPathParams","experimentResponseSchema","listExperimentResultsResponseSchema","experimentResultIdPathParams","updateExperimentResultBodySchema","experimentResultResponseSchema","compareExperimentsBodySchema","comparisonResponseSchema","listDatasetVersionsResponseSchema","listItemVersionsResponseSchema","datasetItemVersionPathParams","batchInsertItemsBodySchema","batchInsertItemsResponseSchema","batchDeleteItemsBodySchema","batchDeleteItemsResponseSchema","generateItemsBodySchema","generateItemsResponseSchema","Agent","z","clusterFailuresBodySchema","clusterFailuresResponseSchema"],"sources":["../../../src/server/handlers/datasets.ts"],"sourcesContent":["import { Agent } from '@mastra/core/agent';\nimport { MastraError } from '@mastra/core/error';\nimport { coreFeatures } from '@mastra/core/features';\nimport { resolveModelConfig } from '@mastra/core/llm';\nimport { RequestContext } from '@mastra/core/request-context';\nimport type { DatasetItemSource, DatasetItemToolMock, TargetType } from '@mastra/core/storage';\nimport { z } from 'zod';\nimport { isReservedRequestContextKey } from '../constants';\nimport { HTTPException } from '../http-exception';\nimport type { StatusCode } from '../http-exception';\nimport { successResponseSchema } from '../schemas/common';\nimport {\n datasetIdPathParams,\n datasetAndExperimentIdPathParams,\n experimentResultIdPathParams,\n datasetAndItemIdPathParams,\n datasetItemVersionPathParams,\n paginationQuerySchema,\n tenancyQuerySchema,\n listItemsQuerySchema,\n createDatasetBodySchema,\n updateDatasetBodySchema,\n addItemBodySchema,\n updateItemBodySchema,\n triggerExperimentBodySchema,\n compareExperimentsBodySchema,\n batchInsertItemsBodySchema,\n batchDeleteItemsBodySchema,\n generateItemsBodySchema,\n generateItemsResponseSchema,\n clusterFailuresBodySchema,\n clusterFailuresResponseSchema,\n datasetResponseSchema,\n datasetItemResponseSchema,\n experimentResponseSchema,\n experimentResultResponseSchema,\n experimentSummaryResponseSchema,\n comparisonResponseSchema,\n listDatasetsResponseSchema,\n listItemsResponseSchema,\n listExperimentsResponseSchema,\n listExperimentResultsResponseSchema,\n listDatasetVersionsResponseSchema,\n listItemVersionsResponseSchema,\n batchInsertItemsResponseSchema,\n batchDeleteItemsResponseSchema,\n updateExperimentResultBodySchema,\n reviewSummaryResponseSchema,\n} from '../schemas/datasets';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport { handleError } from './error';\n\n// ============================================================================\n// Feature gate + local type guards\n// ============================================================================\n\nfunction assertDatasetsAvailable(): void {\n if (!coreFeatures.has('datasets')) {\n throw new HTTPException(501, { message: 'Datasets require @mastra/core >= 1.4.0' });\n }\n}\n\n/**\n * Recovers the caller-provided request context for a dataset item.\n *\n * Server adapters overwrite the body's `requestContext` field with the live\n * server `RequestContext` instance (so bodies cannot spoof auth context), after\n * merging the body's entries into it. Persisting that live instance as item\n * data stores internal server state and fails JSON/BSON serialization, so\n * convert it back to the plain caller-provided entries (reserved `mastra__*`\n * keys excluded) before it reaches storage.\n */\nfunction toItemRequestContext(\n requestContext: Record<string, unknown> | RequestContext | undefined,\n): Record<string, unknown> | undefined {\n if (!(requestContext instanceof RequestContext)) return requestContext;\n const entries = Object.entries(requestContext.toJSON()).filter(([key]) => !isReservedRequestContextKey(key));\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\ninterface SchemaValidationLike extends Error {\n field: 'input' | 'groundTruth';\n errors: Array<{ path: string; code: string; message: string }>;\n}\n\ninterface SchemaUpdateValidationLike extends Error {\n failingItems: Array<{\n index: number;\n data: unknown;\n field: 'input' | 'groundTruth';\n errors: Array<{ path: string; code: string; message: string }>;\n }>;\n}\n\nfunction isSchemaValidationError(error: unknown): error is SchemaValidationLike {\n return error instanceof Error && error.name === 'SchemaValidationError';\n}\n\nfunction isSchemaUpdateValidationError(error: unknown): error is SchemaUpdateValidationLike {\n return error instanceof Error && error.name === 'SchemaUpdateValidationError';\n}\n\n// ============================================================================\n// Helper: Map MastraError IDs to HTTP status codes\n// ============================================================================\n\nfunction getHttpStatusForMastraError(errorId: string): number {\n switch (errorId) {\n case 'DATASET_NOT_FOUND':\n case 'EXPERIMENT_NOT_FOUND':\n return 404;\n case 'EXPERIMENT_NO_ITEMS':\n case 'DATASET_ITEM_EXTERNAL_ID_INVALID':\n case 'DATASET_ITEM_PAYLOAD_NOT_SERIALIZABLE':\n return 400;\n case 'DATASET_ITEM_IDENTITY_CONFLICT':\n return 409;\n default:\n return 500;\n }\n}\n\n// ============================================================================\n// Dataset CRUD Routes\n// ============================================================================\n\nexport const LIST_DATASETS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets',\n responseType: 'json',\n queryParamSchema: paginationQuerySchema,\n responseSchema: listDatasetsResponseSchema,\n summary: 'List all datasets',\n description: 'Returns a paginated list of all datasets',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const result = await mastra.datasets.list({ page: page ?? 0, perPage: perPage ?? 10 });\n return {\n datasets: result.datasets as any,\n pagination: result.pagination,\n };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing datasets');\n }\n },\n});\n\nexport const CREATE_DATASET_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets',\n responseType: 'json',\n bodySchema: createDatasetBodySchema,\n responseSchema: datasetResponseSchema,\n summary: 'Create a new dataset',\n description: 'Creates a new dataset with the specified name and optional metadata',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n targetType,\n targetIds,\n scorerIds,\n } = params as {\n name: string;\n description?: string;\n metadata?: Record<string, unknown>;\n inputSchema?: Record<string, unknown> | null;\n groundTruthSchema?: Record<string, unknown> | null;\n requestContextSchema?: Record<string, unknown> | null;\n targetType?: TargetType;\n targetIds?: string[];\n scorerIds?: string[];\n };\n const ds = await mastra.datasets.create({\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n targetType,\n targetIds,\n scorerIds,\n });\n const details = await ds.getDetails();\n return details as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error creating dataset');\n }\n },\n});\n\nexport const GET_DATASET_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: tenancyQuerySchema,\n responseSchema: datasetResponseSchema.nullable(),\n summary: 'Get dataset by ID',\n description: 'Returns details for a specific dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { organizationId, projectId } = params as { organizationId?: string; projectId?: string };\n const ds = await mastra.datasets.get({ id: datasetId, organizationId, projectId });\n return (await ds.getDetails()) as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting dataset');\n }\n },\n});\n\nexport const UPDATE_DATASET_ROUTE = createRoute({\n method: 'PATCH',\n path: '/datasets/:datasetId',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: tenancyQuerySchema,\n bodySchema: updateDatasetBodySchema,\n responseSchema: datasetResponseSchema,\n summary: 'Update dataset',\n description: 'Updates a dataset with the specified fields',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n tags,\n targetType,\n targetIds,\n scorerIds,\n organizationId,\n projectId,\n } = params as {\n name?: string;\n description?: string;\n metadata?: Record<string, unknown>;\n inputSchema?: Record<string, unknown> | null;\n groundTruthSchema?: Record<string, unknown> | null;\n requestContextSchema?: Record<string, unknown> | null;\n tags?: string[];\n targetType?: TargetType;\n targetIds?: string[];\n scorerIds?: string[] | null;\n organizationId?: string;\n projectId?: string;\n };\n const ds = await mastra.datasets.get({ id: datasetId, organizationId, projectId });\n const result = await ds.update({\n name,\n description,\n metadata,\n inputSchema,\n groundTruthSchema,\n requestContextSchema,\n tags,\n targetType,\n targetIds,\n scorerIds,\n });\n return result as any;\n } catch (error) {\n if (isSchemaUpdateValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { failingItems: error.failingItems },\n });\n }\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error updating dataset');\n }\n },\n});\n\nexport const DELETE_DATASET_ROUTE = createRoute({\n method: 'DELETE',\n path: '/datasets/:datasetId',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: tenancyQuerySchema,\n responseSchema: successResponseSchema,\n summary: 'Delete dataset',\n description: 'Deletes a dataset and all its items',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { organizationId, projectId } = params as { organizationId?: string; projectId?: string };\n // For unscoped deletes, preserve the legacy 404-on-missing behavior via a\n // preflight get(). For scoped deletes, skip the preflight: a tenancy\n // mismatch must be a silent no-op (matches \"delete non-existent id is a\n // no-op\") so cross-tenant existence is not leaked via error timing/status.\n if (organizationId === undefined && projectId === undefined) {\n await mastra.datasets.get({ id: datasetId });\n }\n await mastra.datasets.delete({ id: datasetId, organizationId, projectId });\n return { success: true };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error deleting dataset');\n }\n },\n});\n\n// ============================================================================\n// Item CRUD Routes\n// ============================================================================\n\nexport const LIST_ITEMS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: listItemsQuerySchema,\n responseSchema: listItemsResponseSchema,\n summary: 'List dataset items',\n description: 'Returns a paginated list of items in the dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage, version, search } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.listItems({\n page: page ?? 0,\n perPage: perPage ?? 10,\n version,\n search,\n });\n // Handler always passes `page` and `perPage`, so `listItems` always\n // returns the paginated shape; the guard is defensive.\n if (Array.isArray(result)) {\n return { items: result, pagination: { total: result.length, page: 0, perPage: result.length, hasMore: false } };\n }\n return { items: result.items, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing dataset items');\n }\n },\n});\n\nexport const ADD_ITEM_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/items',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: addItemBodySchema,\n responseSchema: datasetItemResponseSchema,\n summary: 'Add item to dataset',\n description: 'Adds a new item to the dataset (auto-increments dataset version)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n externalId,\n input,\n groundTruth,\n requestContext,\n metadata,\n source,\n expectedTrajectory,\n toolMocks,\n unmockedToolPolicy,\n } = params as {\n externalId?: string | null;\n input: unknown;\n groundTruth?: unknown;\n requestContext?: Record<string, unknown> | RequestContext;\n metadata?: Record<string, unknown>;\n source?: DatasetItemSource;\n expectedTrajectory?: unknown;\n toolMocks?: DatasetItemToolMock[];\n unmockedToolPolicy?: 'allow' | 'deny';\n };\n const ds = await mastra.datasets.get({ id: datasetId });\n return await ds.addItem({\n externalId: externalId ?? undefined,\n input,\n groundTruth,\n requestContext: toItemRequestContext(requestContext),\n metadata,\n source,\n expectedTrajectory,\n toolMocks,\n unmockedToolPolicy,\n });\n } catch (error) {\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n if (error.id === 'DATASET_ITEM_IDENTITY_CONFLICT') {\n throw new HTTPException(409, {\n message: error.message,\n cause: { conflicts: 'conflicts' in error ? error.conflicts : [] },\n });\n }\n if (error.id === 'DATASET_ITEM_EXTERNAL_ID_INVALID') {\n throw new HTTPException(400, { message: error.message, cause: { field: 'externalId' } });\n }\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error adding item to dataset');\n }\n },\n});\n\nexport const GET_ITEM_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items/:itemId',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n responseSchema: datasetItemResponseSchema.nullable(),\n summary: 'Get dataset item by ID',\n description: 'Returns details for a specific dataset item',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const item = await ds.getItem({ itemId });\n if (!item || (item as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found: ${itemId}` });\n }\n return item as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting dataset item');\n }\n },\n});\n\nexport const UPDATE_ITEM_ROUTE = createRoute({\n method: 'PATCH',\n path: '/datasets/:datasetId/items/:itemId',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n bodySchema: updateItemBodySchema,\n responseSchema: datasetItemResponseSchema,\n summary: 'Update dataset item',\n description: 'Updates a dataset item (auto-increments dataset version)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { input, groundTruth, requestContext, metadata, expectedTrajectory, toolMocks, unmockedToolPolicy } =\n params as {\n input?: unknown;\n groundTruth?: unknown;\n requestContext?: Record<string, unknown> | RequestContext;\n metadata?: Record<string, unknown>;\n expectedTrajectory?: unknown;\n toolMocks?: DatasetItemToolMock[];\n unmockedToolPolicy?: 'allow' | 'deny';\n };\n const ds = await mastra.datasets.get({ id: datasetId });\n // Check if item exists and belongs to dataset\n const existing = await ds.getItem({ itemId });\n if (!existing || (existing as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found: ${itemId}` });\n }\n return await ds.updateItem({\n itemId,\n input,\n groundTruth,\n requestContext: toItemRequestContext(requestContext),\n metadata,\n expectedTrajectory,\n toolMocks,\n unmockedToolPolicy,\n });\n } catch (error) {\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error updating dataset item');\n }\n },\n});\n\nexport const DELETE_ITEM_ROUTE = createRoute({\n method: 'DELETE',\n path: '/datasets/:datasetId/items/:itemId',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n responseSchema: successResponseSchema,\n summary: 'Delete dataset item',\n description: 'Deletes a dataset item',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const existing = await ds.getItem({ itemId });\n if (!existing || (existing as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found: ${itemId}` });\n }\n await ds.deleteItem({ itemId });\n return { success: true };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error deleting dataset item');\n }\n },\n});\n\n// ============================================================================\n// Experiment Operations Routes\n// ============================================================================\n\nexport const LIST_ALL_EXPERIMENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/experiments',\n responseType: 'json',\n queryParamSchema: paginationQuerySchema,\n responseSchema: listExperimentsResponseSchema,\n summary: 'List all experiments',\n description: 'Returns a paginated list of all experiments across all datasets',\n tags: ['Experiments'],\n requiresAuth: true,\n handler: async ({ mastra, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage not configured' });\n }\n const experimentsStore = await storage.getStore('experiments');\n if (!experimentsStore) {\n throw new HTTPException(500, { message: 'Experiments storage not available' });\n }\n const result = await experimentsStore.listExperiments({\n pagination: { page: page ?? 0, perPage: perPage ?? 20 },\n });\n return { experiments: result.experiments, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing experiments');\n }\n },\n});\n\nexport const EXPERIMENT_REVIEW_SUMMARY_ROUTE = createRoute({\n method: 'GET',\n path: '/experiments/review-summary',\n responseType: 'json',\n responseSchema: reviewSummaryResponseSchema,\n summary: 'Get review summary for all experiments',\n description: 'Returns review status counts (needs-review, reviewed, complete) aggregated per experiment',\n tags: ['Experiments'],\n requiresAuth: true,\n handler: async ({ mastra }) => {\n assertDatasetsAvailable();\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage not configured' });\n }\n const experimentsStore = await storage.getStore('experiments');\n if (!experimentsStore) {\n throw new HTTPException(500, { message: 'Experiments storage not available' });\n }\n const counts = await experimentsStore.getReviewSummary();\n return { counts };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting review summary');\n }\n },\n});\n\nexport const LIST_EXPERIMENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/experiments',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: paginationQuerySchema,\n responseSchema: listExperimentsResponseSchema,\n summary: 'List experiments for dataset',\n description: 'Returns a paginated list of experiments for the dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.listExperiments({ page: page ?? 0, perPage: perPage ?? 10 });\n return { experiments: result.experiments, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing experiments');\n }\n },\n});\n\nexport const TRIGGER_EXPERIMENT_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/experiments',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: triggerExperimentBodySchema,\n responseSchema: experimentSummaryResponseSchema,\n summary: 'Trigger a new experiment',\n description:\n 'Triggers a new experiment on the dataset against the specified target. Returns immediately with pending status; execution happens in background.',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const {\n targetType,\n targetId,\n scorerIds,\n version,\n agentVersion,\n maxConcurrency,\n requestContext: rawRequestContext,\n versions,\n } = params as {\n targetType: 'agent' | 'workflow' | 'scorer';\n targetId: string;\n scorerIds?: string[];\n version?: number;\n agentVersion?: string;\n maxConcurrency?: number;\n requestContext?: Record<string, unknown> | RequestContext;\n versions?: { agents?: Record<string, { versionId: string } | { status: 'draft' | 'published' }> };\n };\n // The adapter middleware merges body + query requestContext into a RequestContext instance.\n // startExperimentAsync expects a plain Record, so convert it.\n const requestContext = rawRequestContext instanceof RequestContext ? rawRequestContext.all : rawRequestContext;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.startExperimentAsync({\n targetType,\n targetId,\n scorers: scorerIds,\n version,\n agentVersion,\n maxConcurrency,\n requestContext,\n versions,\n });\n // Return shape matching experimentSummaryResponseSchema\n return {\n experimentId: result.experimentId,\n status: result.status,\n totalItems: result.totalItems ?? 0,\n succeededCount: 0,\n failedCount: 0,\n startedAt: new Date(),\n completedAt: null,\n results: [],\n };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error triggering experiment');\n }\n },\n});\n\nexport const GET_EXPERIMENT_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/experiments/:experimentId',\n responseType: 'json',\n pathParamSchema: datasetAndExperimentIdPathParams,\n responseSchema: experimentResponseSchema.nullable(),\n summary: 'Get experiment by ID',\n description: 'Returns details for a specific experiment',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, experimentId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const run = await ds.getExperiment({ experimentId });\n if (!run || run.datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Experiment not found: ${experimentId}` });\n }\n return run;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting experiment');\n }\n },\n});\n\nexport const LIST_EXPERIMENT_RESULTS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/experiments/:experimentId/results',\n responseType: 'json',\n pathParamSchema: datasetAndExperimentIdPathParams,\n queryParamSchema: paginationQuerySchema,\n responseSchema: listExperimentResultsResponseSchema,\n summary: 'List experiment results',\n description: 'Returns a paginated list of results for the experiment',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, experimentId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n // Validate experiment belongs to dataset\n const run = await ds.getExperiment({ experimentId });\n if (!run || run.datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Experiment not found: ${experimentId}` });\n }\n const result = await ds.listExperimentResults({ experimentId, page: page ?? 0, perPage: perPage ?? 10 });\n return {\n results: result.results.map(({ experimentId: _eid, ...rest }) => ({ experimentId, ...rest })),\n pagination: result.pagination,\n };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing experiment results');\n }\n },\n});\n\nexport const UPDATE_EXPERIMENT_RESULT_ROUTE = createRoute({\n method: 'PATCH',\n path: '/datasets/:datasetId/experiments/:experimentId/results/:resultId',\n responseType: 'json',\n pathParamSchema: experimentResultIdPathParams,\n bodySchema: updateExperimentResultBodySchema,\n responseSchema: experimentResultResponseSchema,\n summary: 'Update an experiment result',\n description: 'Updates the status and/or tags on an experiment result',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, resultId, experimentId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage not configured' });\n }\n const experimentsStore = await storage.getStore('experiments');\n if (!experimentsStore) {\n throw new HTTPException(500, { message: 'Experiments storage not available' });\n }\n\n const result = await experimentsStore.updateExperimentResult({\n id: resultId,\n experimentId,\n status: params.status,\n tags: params.tags,\n });\n\n return result;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error updating experiment result');\n }\n },\n});\n\n// ============================================================================\n// Analytics Routes (nested under datasets)\n// ============================================================================\n\nexport const COMPARE_EXPERIMENTS_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/compare',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: compareExperimentsBodySchema,\n responseSchema: comparisonResponseSchema,\n summary: 'Compare two experiments',\n description: 'Compares two experiments to detect score regressions',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { experimentIdA, experimentIdB } = params as {\n experimentIdA: string;\n experimentIdB: string;\n };\n // Validate dataset exists\n await mastra.datasets.get({ id: datasetId });\n const result = await mastra.datasets.compareExperiments({\n experimentIds: [experimentIdA, experimentIdB],\n baselineId: experimentIdA,\n });\n return result;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error comparing experiments');\n }\n },\n});\n\n// ============================================================================\n// Version Routes\n// ============================================================================\n\nexport const LIST_DATASET_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/versions',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n queryParamSchema: paginationQuerySchema,\n responseSchema: listDatasetVersionsResponseSchema,\n summary: 'List dataset versions',\n description: 'Returns a paginated list of all versions for the dataset',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { page, perPage } = params;\n const ds = await mastra.datasets.get({ id: datasetId });\n const result = await ds.listVersions({ page: page ?? 0, perPage: perPage ?? 10 });\n return { versions: result.versions, pagination: result.pagination };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing dataset versions');\n }\n },\n});\n\nexport const LIST_ITEM_VERSIONS_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items/:itemId/history',\n responseType: 'json',\n pathParamSchema: datasetAndItemIdPathParams,\n responseSchema: listItemVersionsResponseSchema,\n summary: 'Get item history',\n description: 'Returns the full SCD-2 history of the item across all dataset versions',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const rows = await ds.getItemHistory({ itemId });\n // Check rows belong to this dataset\n if (rows.length > 0 && rows[0]?.datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found in dataset: ${itemId}` });\n }\n return { history: rows };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error listing item history');\n }\n },\n});\n\nexport const GET_ITEM_VERSION_ROUTE = createRoute({\n method: 'GET',\n path: '/datasets/:datasetId/items/:itemId/versions/:datasetVersion',\n responseType: 'json',\n pathParamSchema: datasetItemVersionPathParams,\n responseSchema: datasetItemResponseSchema.nullable(),\n summary: 'Get item at specific dataset version',\n description: 'Returns the item as it existed at a specific dataset version',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, itemId, datasetVersion }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const item = await ds.getItem({ itemId, version: datasetVersion });\n if (!item) {\n throw new HTTPException(404, { message: `Item ${itemId} not found at version ${datasetVersion}` });\n }\n if ((item as any).datasetId !== datasetId) {\n throw new HTTPException(404, { message: `Item not found in dataset: ${itemId}` });\n }\n return item as any;\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error getting item version');\n }\n },\n});\n\n// ============================================================================\n// Batch Operations Routes\n// ============================================================================\n\nexport const BATCH_INSERT_ITEMS_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/items/batch',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: batchInsertItemsBodySchema,\n responseSchema: batchInsertItemsResponseSchema,\n summary: 'Batch insert items to dataset',\n description: 'Adds multiple items to the dataset in a single operation (single version entry)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { items } = params as {\n items: Array<{\n externalId?: string | null;\n input: unknown;\n groundTruth?: unknown;\n expectedTrajectory?: unknown;\n toolMocks?: DatasetItemToolMock[];\n unmockedToolPolicy?: 'allow' | 'deny';\n metadata?: Record<string, unknown>;\n source?: DatasetItemSource;\n }>;\n };\n const ds = await mastra.datasets.get({ id: datasetId });\n const addedItems = await ds.addItems({\n items: items.map(item => ({ ...item, externalId: item.externalId ?? undefined })),\n });\n return { items: addedItems, count: addedItems.length };\n } catch (error) {\n if (isSchemaValidationError(error)) {\n throw new HTTPException(400, {\n message: error.message,\n cause: { field: error.field, errors: error.errors },\n });\n }\n if (error instanceof MastraError) {\n if (error.id === 'DATASET_ITEM_IDENTITY_CONFLICT') {\n throw new HTTPException(409, {\n message: error.message,\n cause: { conflicts: 'conflicts' in error ? error.conflicts : [] },\n });\n }\n if (error.id === 'DATASET_ITEM_EXTERNAL_ID_INVALID') {\n throw new HTTPException(400, { message: error.message, cause: { field: 'externalId' } });\n }\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error batch inserting items');\n }\n },\n});\n\nexport const BATCH_DELETE_ITEMS_ROUTE = createRoute({\n method: 'DELETE',\n path: '/datasets/:datasetId/items/batch',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: batchDeleteItemsBodySchema,\n responseSchema: batchDeleteItemsResponseSchema,\n summary: 'Batch delete items from dataset',\n description: 'Deletes multiple items from the dataset in a single operation (single version entry)',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, ...params }) => {\n assertDatasetsAvailable();\n try {\n const { itemIds } = params as { itemIds: string[] };\n const ds = await mastra.datasets.get({ id: datasetId });\n await ds.deleteItems({ itemIds });\n return { success: true, deletedCount: itemIds.length };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error bulk deleting items');\n }\n },\n});\n\n// ============================================================================\n// AI Generation\n// ============================================================================\n\nconst GENERATE_ITEMS_SYSTEM_PROMPT = `You are a test data generation expert. Your job is to generate realistic, diverse test data items for an AI agent evaluation dataset.\n\nYou will be given context about the agent being tested — its purpose, system prompt, and available tools. Use this to generate inputs that thoroughly exercise the agent's capabilities.\n\nGenerate test items that:\n1. Are realistic and diverse — cover edge cases, different complexities, and various scenarios\n2. Match the provided schemas exactly\n3. Include ground truth values when a ground truth schema is provided\n4. Vary in difficulty (easy, medium, hard cases)\n5. Include potential edge cases and tricky inputs\n6. Test different aspects of the agent's capabilities based on its tools and instructions\n\nReturn the items as a JSON array.`;\n\nexport const GENERATE_ITEMS_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/:datasetId/generate-items',\n responseType: 'json',\n pathParamSchema: datasetIdPathParams,\n bodySchema: generateItemsBodySchema,\n responseSchema: generateItemsResponseSchema,\n summary: 'Generate dataset items using AI',\n description:\n 'Uses an LLM to generate synthetic dataset items based on the dataset schema and a user prompt. Returns generated items for review — they are NOT automatically added to the dataset.',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, datasetId, modelId, prompt, count, agentContext }) => {\n assertDatasetsAvailable();\n try {\n const ds = await mastra.datasets.get({ id: datasetId });\n const dataset = await ds.getDetails();\n\n // Resolve the model from the \"provider/model\" string\n const model = await resolveModelConfig(modelId, undefined, mastra);\n\n // Build context about the dataset schema for the generator\n const schemaContext = [\n dataset.inputSchema ? `Input schema:\\n${JSON.stringify(dataset.inputSchema, null, 2)}` : null,\n dataset.groundTruthSchema\n ? `Ground truth schema:\\n${JSON.stringify(dataset.groundTruthSchema, null, 2)}`\n : null,\n ]\n .filter(Boolean)\n .join('\\n\\n');\n\n const generatorAgent = new Agent({\n id: 'dataset-item-generator',\n name: 'dataset-item-generator',\n instructions: GENERATE_ITEMS_SYSTEM_PROMPT,\n model,\n });\n\n // Build the structured output schema dynamically based on count\n // Use z.string() for input/groundTruth since OpenAI structured output requires concrete types.\n // The generator will produce JSON strings that we parse back into objects if needed.\n const itemSchema = z.object({\n input: z\n .string()\n .describe('The input data as a JSON string matching the input schema, or a plain text string if no schema'),\n groundTruth: z\n .string()\n .optional()\n .describe('The expected output as a JSON string matching the ground truth schema'),\n });\n const outputSchema = z.object({\n items: z.array(itemSchema).min(1).max(count),\n });\n\n // Build agent context section\n const agentContextParts = [];\n if (agentContext?.description) {\n agentContextParts.push(`Agent description: ${agentContext.description}`);\n }\n if (agentContext?.instructions) {\n agentContextParts.push(`Agent system prompt:\\n${agentContext.instructions}`);\n }\n if (agentContext?.tools?.length) {\n agentContextParts.push(`Agent tools: ${agentContext.tools.join(', ')}`);\n }\n const agentContextSection = agentContextParts.length > 0 ? agentContextParts.join('\\n\\n') : null;\n\n const userMessage = [\n `Generate exactly ${count} test items for a dataset named \"${dataset.name}\".`,\n dataset.description ? `Dataset description: ${dataset.description}` : null,\n agentContextSection ? `--- AGENT CONTEXT ---\\n${agentContextSection}` : null,\n schemaContext || null,\n `User's request: ${prompt}`,\n `Return exactly ${count} items.`,\n ]\n .filter(Boolean)\n .join('\\n\\n');\n\n const result = await generatorAgent.generate(userMessage, {\n structuredOutput: { schema: outputSchema },\n });\n\n const generated = await result.object;\n\n // Parse JSON strings back to objects where possible\n const items = generated.items.map(item => {\n let input: unknown = item.input;\n try {\n input = JSON.parse(item.input);\n } catch {\n // Keep as string if not valid JSON\n }\n let groundTruth: unknown = item.groundTruth;\n if (item.groundTruth) {\n try {\n groundTruth = JSON.parse(item.groundTruth);\n } catch {\n // Keep as string if not valid JSON\n }\n }\n return { input, groundTruth };\n });\n\n return { items };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error generating dataset items');\n }\n },\n});\n\n// ============================================================================\n// Failure Clustering\n// ============================================================================\n\nconst CLUSTER_FAILURES_SYSTEM_PROMPT = `You are an AI evaluation expert specializing in failure analysis. Given a set of failure items from an AI agent experiment, identify common failure patterns and assign descriptive tags to each item.\n\nFor each cluster you identify, provide:\n- A short, descriptive tag label (2-5 words, lowercase, hyphenated, e.g., \"no-tool-usage\", \"hallucination\")\n- A description explaining the common failure pattern\n- The IDs of items that belong to this cluster\n\nAlso return a \"proposedTags\" array mapping each item ID to the tags you recommend, along with a brief \"reason\" explaining WHY those tags apply to that specific item. The reason should reference concrete evidence from the item's input/output/error.\n\nGuidelines:\n- Create between 1 and 8 clusters depending on the diversity of failures\n- Every item must be assigned to at least one cluster unless there is no clear pattern of failure\n- Focus on the root cause of failures, not surface-level symptoms\n- If items have scores, use low scores as signals for the failure type\n- Be specific about what went wrong\n- IMPORTANT: If existing tags are provided, PREFER reusing them over creating new ones. Only create new tags when no existing tag fits.\n- Items may already have tags — consider those when assigning new ones and avoid duplicating existing tags on an item.\n- The \"reason\" field should be 1-2 sentences explaining the specific evidence for each tag assignment.`;\n\nexport const CLUSTER_FAILURES_ROUTE = createRoute({\n method: 'POST',\n path: '/datasets/cluster-failures',\n responseType: 'json',\n bodySchema: clusterFailuresBodySchema,\n responseSchema: clusterFailuresResponseSchema,\n summary: 'Cluster experiment failures using AI',\n description:\n 'Uses an LLM to analyze failure items from an experiment and group them into meaningful failure pattern clusters.',\n tags: ['Datasets'],\n requiresAuth: true,\n handler: async ({ mastra, modelId, items, availableTags, prompt }) => {\n assertDatasetsAvailable();\n try {\n const model = await resolveModelConfig(modelId, undefined, mastra);\n\n const clusterAgent = new Agent({\n id: 'failure-cluster-analyzer',\n name: 'failure-cluster-analyzer',\n instructions: CLUSTER_FAILURES_SYSTEM_PROMPT,\n model,\n });\n\n const outputSchema = z.object({\n clusters: z.array(\n z.object({\n id: z.string(),\n label: z.string(),\n description: z.string(),\n itemIds: z.array(z.string()),\n }),\n ),\n proposedTags: z.array(\n z.object({\n itemId: z.string(),\n tags: z.array(z.string()),\n reason: z.string().describe('Brief explanation of why these tags were assigned'),\n }),\n ),\n });\n\n const itemSummaries = items.map((item, i) => {\n const parts = [`Item ${i + 1} (id: ${item.id}):`];\n if (item.input !== undefined && item.input !== null) parts.push(` Input: ${JSON.stringify(item.input)}`);\n if (item.output !== undefined && item.output !== null) parts.push(` Output: ${JSON.stringify(item.output)}`);\n if (item.error !== undefined && item.error !== null) {\n parts.push(` Error: ${typeof item.error === 'string' ? item.error : JSON.stringify(item.error)}`);\n }\n if (item.scores !== undefined && item.scores !== null) {\n parts.push(` Scores: ${JSON.stringify(item.scores)}`);\n }\n if (item.existingTags && item.existingTags.length > 0) {\n parts.push(` Existing tags: ${item.existingTags.join(', ')}`);\n }\n return parts.join('\\n');\n });\n\n let userMessage = `Analyze these ${items.length} failure items and group them into clusters of common failure patterns:\\n\\n${itemSummaries.join('\\n\\n')}`;\n\n if (availableTags && availableTags.length > 0) {\n userMessage += `\\n\\nExisting tag vocabulary (prefer reusing these): ${availableTags.join(', ')}`;\n }\n\n if (prompt) {\n userMessage += `\\n\\nAdditional instructions from the reviewer: ${prompt}`;\n }\n\n userMessage += `\\n\\nReturn both \"clusters\" (grouping items by pattern) and \"proposedTags\" (a list mapping each item ID to the tag labels you recommend, with a \"reason\" explaining why). For proposedTags, only include NEW tags to add — do not repeat tags the item already has.`;\n\n const result = await clusterAgent.generate(userMessage, {\n structuredOutput: { schema: outputSchema },\n });\n\n const generated = await result.object;\n return { clusters: generated.clusters, proposedTags: generated.proposedTags ?? [] };\n } catch (error) {\n if (error instanceof MastraError) {\n throw new HTTPException(getHttpStatusForMastraError(error.id) as StatusCode, { message: error.message });\n }\n return handleError(error, 'Error clustering failures');\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;AAwDA,SAAS,0BAAgC;CACvC,IAAI,CAACA,sBAAAA,aAAa,IAAI,UAAU,GAC9B,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,yCAAyC,CAAC;AAEtF;;;;;;;;;;;AAYA,SAAS,qBACP,gBACqC;CACrC,IAAI,EAAE,0BAA0BC,6BAAAA,iBAAiB,OAAO;CACxD,MAAM,UAAU,OAAO,QAAQ,eAAe,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAACC,kBAAAA,4BAA4B,GAAG,CAAC;CAC3G,OAAO,QAAQ,SAAS,IAAI,OAAO,YAAY,OAAO,IAAI,KAAA;AAC5D;AAgBA,SAAS,wBAAwB,OAA+C;CAC9E,OAAO,iBAAiB,SAAS,MAAM,SAAS;AAClD;AAEA,SAAS,8BAA8B,OAAqD;CAC1F,OAAO,iBAAiB,SAAS,MAAM,SAAS;AAClD;AAMA,SAAS,4BAA4B,SAAyB;CAC5D,QAAQ,SAAR;EACE,K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IAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,MAAM,MAAM,KAAK,aAAa,KAAK,UAAU,KAAK,MAAM,GAAG;IAC5G,IAAI,KAAK,UAAU,KAAA,KAAa,KAAK,UAAU,MAC7C,MAAM,KAAK,YAAY,OAAO,KAAK,UAAU,WAAW,KAAK,QAAQ,KAAK,UAAU,KAAK,KAAK,GAAG;IAEnG,IAAI,KAAK,WAAW,KAAA,KAAa,KAAK,WAAW,MAC/C,MAAM,KAAK,aAAa,KAAK,UAAU,KAAK,MAAM,GAAG;IAEvD,IAAI,KAAK,gBAAgB,KAAK,aAAa,SAAS,GAClD,MAAM,KAAK,oBAAoB,KAAK,aAAa,KAAK,IAAI,GAAG;IAE/D,OAAO,MAAM,KAAK,IAAI;GACxB,CAAC;GAED,IAAI,cAAc,iBAAiB,MAAM,OAAO,6EAA6E,cAAc,KAAK,MAAM;GAEtJ,IAAI,iBAAiB,cAAc,SAAS,GAC1C,eAAe,uDAAuD,cAAc,KAAK,IAAI;GAG/F,IAAI,QACF,eAAe,kDAAkD;GAGnE,eAAe;GAMf,MAAM,YAAY,OAAM,MAJH,aAAa,SAAS,aAAa,EACtD,kBAAkB,EAAE,QAAQ,aAAa,EAC3C,CAAC,EAAA,CAE8B;GAC/B,OAAO;IAAE,UAAU,UAAU;IAAU,cAAc,UAAU,gBAAgB,CAAC;GAAE;EACpF,SAAS,OAAO;GACd,IAAI,iBAAiBpC,mBAAAA,aACnB,MAAM,IAAIN,uBAAAA,cAAc,4BAA4B,MAAM,EAAE,GAAiB,EAAE,SAAS,MAAM,QAAQ,CAAC;GAEzG,OAAOO,8BAAAA,YAAY,OAAO,2BAA2B;EACvD;CACF;AACF,CAAC"}
@@ -246,6 +246,7 @@ export declare const LIST_ITEMS_ROUTE: import("../server-adapter").ServerRoute<i
246
246
  output: unknown;
247
247
  matchArgs?: "strict" | "ignore" | undefined;
248
248
  }[] | undefined;
249
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
249
250
  requestContext?: Record<string, unknown> | undefined;
250
251
  metadata?: Record<string, unknown> | undefined;
251
252
  source?: {
@@ -284,6 +285,10 @@ export declare const LIST_ITEMS_ROUTE: import("../server-adapter").ServerRoute<i
284
285
  ignore: "ignore";
285
286
  }>>;
286
287
  }, z.core.$strip>>>;
288
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
289
+ allow: "allow";
290
+ deny: "deny";
291
+ }>>;
287
292
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
288
293
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
289
294
  source: z.ZodOptional<z.ZodObject<{
@@ -444,6 +449,10 @@ export declare const ADD_ITEM_ROUTE: import("../server-adapter").ServerRoute<imp
444
449
  ignore: "ignore";
445
450
  }>>;
446
451
  }, z.core.$strip>>>;
452
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
453
+ allow: "allow";
454
+ deny: "deny";
455
+ }>>;
447
456
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
448
457
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
449
458
  source: z.ZodOptional<z.ZodObject<{
@@ -473,6 +482,7 @@ export declare const ADD_ITEM_ROUTE: import("../server-adapter").ServerRoute<imp
473
482
  output: unknown;
474
483
  matchArgs?: "strict" | "ignore" | undefined;
475
484
  }[] | undefined;
485
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
476
486
  requestContext?: Record<string, unknown> | undefined;
477
487
  metadata?: Record<string, unknown> | undefined;
478
488
  source?: {
@@ -616,6 +626,10 @@ export declare const ADD_ITEM_ROUTE: import("../server-adapter").ServerRoute<imp
616
626
  ignore: "ignore";
617
627
  }>>;
618
628
  }, z.core.$strip>>>;
629
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
630
+ allow: "allow";
631
+ deny: "deny";
632
+ }>>;
619
633
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
620
634
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
621
635
  source: z.ZodOptional<z.ZodObject<{
@@ -646,6 +660,10 @@ export declare const ADD_ITEM_ROUTE: import("../server-adapter").ServerRoute<imp
646
660
  ignore: "ignore";
647
661
  }>>;
648
662
  }, z.core.$strip>>>;
663
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
664
+ allow: "allow";
665
+ deny: "deny";
666
+ }>>;
649
667
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
650
668
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
651
669
  source: z.ZodOptional<z.ZodObject<{
@@ -681,6 +699,7 @@ export declare const GET_ITEM_ROUTE: import("../server-adapter").ServerRoute<{
681
699
  output: unknown;
682
700
  matchArgs?: "strict" | "ignore" | undefined;
683
701
  }[] | undefined;
702
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
684
703
  requestContext?: Record<string, unknown> | undefined;
685
704
  metadata?: Record<string, unknown> | undefined;
686
705
  source?: {
@@ -707,6 +726,10 @@ export declare const GET_ITEM_ROUTE: import("../server-adapter").ServerRoute<{
707
726
  ignore: "ignore";
708
727
  }>>;
709
728
  }, z.core.$strip>>>;
729
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
730
+ allow: "allow";
731
+ deny: "deny";
732
+ }>>;
710
733
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
711
734
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
712
735
  source: z.ZodOptional<z.ZodObject<{
@@ -860,6 +883,10 @@ export declare const UPDATE_ITEM_ROUTE: import("../server-adapter").ServerRoute<
860
883
  ignore: "ignore";
861
884
  }>>;
862
885
  }, z.core.$strip>>>;
886
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
887
+ allow: "allow";
888
+ deny: "deny";
889
+ }>>;
863
890
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
864
891
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
865
892
  source: z.ZodOptional<z.ZodObject<{
@@ -889,6 +916,7 @@ export declare const UPDATE_ITEM_ROUTE: import("../server-adapter").ServerRoute<
889
916
  output: unknown;
890
917
  matchArgs?: "strict" | "ignore" | undefined;
891
918
  }[] | undefined;
919
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
892
920
  requestContext?: Record<string, unknown> | undefined;
893
921
  metadata?: Record<string, unknown> | undefined;
894
922
  source?: {
@@ -1032,6 +1060,10 @@ export declare const UPDATE_ITEM_ROUTE: import("../server-adapter").ServerRoute<
1032
1060
  ignore: "ignore";
1033
1061
  }>>;
1034
1062
  }, z.core.$strip>>>;
1063
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
1064
+ allow: "allow";
1065
+ deny: "deny";
1066
+ }>>;
1035
1067
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1036
1068
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1037
1069
  source: z.ZodOptional<z.ZodObject<{
@@ -1062,6 +1094,10 @@ export declare const UPDATE_ITEM_ROUTE: import("../server-adapter").ServerRoute<
1062
1094
  ignore: "ignore";
1063
1095
  }>>;
1064
1096
  }, z.core.$strip>>>;
1097
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
1098
+ allow: "allow";
1099
+ deny: "deny";
1100
+ }>>;
1065
1101
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1066
1102
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1067
1103
  source: z.ZodOptional<z.ZodObject<{
@@ -1321,7 +1357,7 @@ export declare const TRIGGER_EXPERIMENT_ROUTE: import("../server-adapter").Serve
1321
1357
  args: unknown;
1322
1358
  }[];
1323
1359
  failure?: {
1324
- code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED";
1360
+ code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED" | "TOOL_MOCK_NOT_DECLARED";
1325
1361
  toolName: string;
1326
1362
  args: unknown;
1327
1363
  } | undefined;
@@ -1397,6 +1433,7 @@ export declare const TRIGGER_EXPERIMENT_ROUTE: import("../server-adapter").Serve
1397
1433
  code: z.ZodEnum<{
1398
1434
  TOOL_MOCK_MISMATCH: "TOOL_MOCK_MISMATCH";
1399
1435
  TOOL_MOCK_EXHAUSTED: "TOOL_MOCK_EXHAUSTED";
1436
+ TOOL_MOCK_NOT_DECLARED: "TOOL_MOCK_NOT_DECLARED";
1400
1437
  }>;
1401
1438
  toolName: z.ZodString;
1402
1439
  args: z.ZodUnknown;
@@ -1510,7 +1547,7 @@ export declare const LIST_EXPERIMENT_RESULTS_ROUTE: import("../server-adapter").
1510
1547
  args: unknown;
1511
1548
  }[];
1512
1549
  failure?: {
1513
- code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED";
1550
+ code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED" | "TOOL_MOCK_NOT_DECLARED";
1514
1551
  toolName: string;
1515
1552
  args: unknown;
1516
1553
  } | undefined;
@@ -1572,6 +1609,7 @@ export declare const LIST_EXPERIMENT_RESULTS_ROUTE: import("../server-adapter").
1572
1609
  code: z.ZodEnum<{
1573
1610
  TOOL_MOCK_MISMATCH: "TOOL_MOCK_MISMATCH";
1574
1611
  TOOL_MOCK_EXHAUSTED: "TOOL_MOCK_EXHAUSTED";
1612
+ TOOL_MOCK_NOT_DECLARED: "TOOL_MOCK_NOT_DECLARED";
1575
1613
  }>;
1576
1614
  toolName: z.ZodString;
1577
1615
  args: z.ZodUnknown;
@@ -1634,7 +1672,7 @@ export declare const UPDATE_EXPERIMENT_RESULT_ROUTE: import("../server-adapter")
1634
1672
  args: unknown;
1635
1673
  }[];
1636
1674
  failure?: {
1637
- code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED";
1675
+ code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED" | "TOOL_MOCK_NOT_DECLARED";
1638
1676
  toolName: string;
1639
1677
  args: unknown;
1640
1678
  } | undefined;
@@ -1693,6 +1731,7 @@ export declare const UPDATE_EXPERIMENT_RESULT_ROUTE: import("../server-adapter")
1693
1731
  code: z.ZodEnum<{
1694
1732
  TOOL_MOCK_MISMATCH: "TOOL_MOCK_MISMATCH";
1695
1733
  TOOL_MOCK_EXHAUSTED: "TOOL_MOCK_EXHAUSTED";
1734
+ TOOL_MOCK_NOT_DECLARED: "TOOL_MOCK_NOT_DECLARED";
1696
1735
  }>;
1697
1736
  toolName: z.ZodString;
1698
1737
  args: z.ZodUnknown;
@@ -1791,6 +1830,7 @@ export declare const LIST_ITEM_VERSIONS_ROUTE: import("../server-adapter").Serve
1791
1830
  output: unknown;
1792
1831
  matchArgs?: "strict" | "ignore" | undefined;
1793
1832
  }[] | undefined;
1833
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
1794
1834
  metadata?: Record<string, unknown> | undefined;
1795
1835
  }[];
1796
1836
  }, "json", import("../server-adapter").RouteSchemas<z.ZodObject<{
@@ -1813,6 +1853,10 @@ export declare const LIST_ITEM_VERSIONS_ROUTE: import("../server-adapter").Serve
1813
1853
  ignore: "ignore";
1814
1854
  }>>;
1815
1855
  }, z.core.$strip>>>;
1856
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
1857
+ allow: "allow";
1858
+ deny: "deny";
1859
+ }>>;
1816
1860
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1817
1861
  validTo: z.ZodNullable<z.ZodNumber>;
1818
1862
  isDeleted: z.ZodBoolean;
@@ -1840,6 +1884,7 @@ export declare const GET_ITEM_VERSION_ROUTE: import("../server-adapter").ServerR
1840
1884
  output: unknown;
1841
1885
  matchArgs?: "strict" | "ignore" | undefined;
1842
1886
  }[] | undefined;
1887
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
1843
1888
  requestContext?: Record<string, unknown> | undefined;
1844
1889
  metadata?: Record<string, unknown> | undefined;
1845
1890
  source?: {
@@ -1867,6 +1912,10 @@ export declare const GET_ITEM_VERSION_ROUTE: import("../server-adapter").ServerR
1867
1912
  ignore: "ignore";
1868
1913
  }>>;
1869
1914
  }, z.core.$strip>>>;
1915
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
1916
+ allow: "allow";
1917
+ deny: "deny";
1918
+ }>>;
1870
1919
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1871
1920
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1872
1921
  source: z.ZodOptional<z.ZodObject<{
@@ -2021,6 +2070,10 @@ export declare const BATCH_INSERT_ITEMS_ROUTE: import("../server-adapter").Serve
2021
2070
  ignore: "ignore";
2022
2071
  }>>;
2023
2072
  }, z.core.$strip>>>;
2073
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
2074
+ allow: "allow";
2075
+ deny: "deny";
2076
+ }>>;
2024
2077
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2025
2078
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2026
2079
  source: z.ZodOptional<z.ZodObject<{
@@ -2052,6 +2105,7 @@ export declare const BATCH_INSERT_ITEMS_ROUTE: import("../server-adapter").Serve
2052
2105
  output: unknown;
2053
2106
  matchArgs?: "strict" | "ignore" | undefined;
2054
2107
  }[] | undefined;
2108
+ unmockedToolPolicy?: "allow" | "deny" | undefined;
2055
2109
  requestContext?: Record<string, unknown> | undefined;
2056
2110
  metadata?: Record<string, unknown> | undefined;
2057
2111
  source?: {
@@ -2198,6 +2252,10 @@ export declare const BATCH_INSERT_ITEMS_ROUTE: import("../server-adapter").Serve
2198
2252
  ignore: "ignore";
2199
2253
  }>>;
2200
2254
  }, z.core.$strip>>>;
2255
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
2256
+ allow: "allow";
2257
+ deny: "deny";
2258
+ }>>;
2201
2259
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2202
2260
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2203
2261
  source: z.ZodOptional<z.ZodObject<{
@@ -2230,6 +2288,10 @@ export declare const BATCH_INSERT_ITEMS_ROUTE: import("../server-adapter").Serve
2230
2288
  ignore: "ignore";
2231
2289
  }>>;
2232
2290
  }, z.core.$strip>>>;
2291
+ unmockedToolPolicy: z.ZodOptional<z.ZodEnum<{
2292
+ allow: "allow";
2293
+ deny: "deny";
2294
+ }>>;
2233
2295
  requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2234
2296
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2235
2297
  source: z.ZodOptional<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/datasets.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwHxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA0B9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAsD/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDAwB5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA2E/B,CAAC;AAEH,eAAO,MAAM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