UNPKG

@mastra/core

Version:
1,806 lines • 69.4 kB
let zod_v4 = require("zod/v4");
// ../_internal-core/dist/storage/index.js
/** Types of entities that can produce observability spans. */
let EntityType = /* @__PURE__ */ function(EntityType) {
	/** Agent/Model execution */
	EntityType["AGENT"] = "agent";
	/** Scorer definition/execution */
	EntityType["SCORER"] = "scorer";
	/** RAG ingestion pipeline execution */
	EntityType["RAG_INGESTION"] = "rag_ingestion";
	/** Trajectory evaluation target */
	EntityType["TRAJECTORY"] = "trajectory";
	/** Input Processor */
	EntityType["INPUT_PROCESSOR"] = "input_processor";
	/** Input Step Processor */
	EntityType["INPUT_STEP_PROCESSOR"] = "input_step_processor";
	/** Output Processor */
	EntityType["OUTPUT_PROCESSOR"] = "output_processor";
	/** Output Step Processor */
	EntityType["OUTPUT_STEP_PROCESSOR"] = "output_step_processor";
	/** Tool Result Processor */
	EntityType["TOOL_RESULT_PROCESSOR"] = "tool_result_processor";
	/** Workflow Step */
	EntityType["WORKFLOW_STEP"] = "workflow_step";
	/** Tool */
	EntityType["TOOL"] = "tool";
	/** MCP server */
	EntityType["MCP_SERVER"] = "mcp_server";
	/** Workflow */
	EntityType["WORKFLOW_RUN"] = "workflow_run";
	/** Memory */
	EntityType["MEMORY"] = "memory";
	/** Classifier */
	EntityType["CLASSIFIER"] = "classifier";
	return EntityType;
}({});
/**
* Common DB fields
*/
const createdAtField = zod_v4.z.date().describe("Database record creation time");
const updatedAtField = zod_v4.z.date().describe("Database record last update time");
const dbTimestamps = {
	createdAt: createdAtField,
	updatedAt: updatedAtField.nullable()
};
/**
* Pagination arguments for list queries (page and perPage only)
* Uses z.coerce to handle string → number conversion from query params
*/
const paginationArgsSchema = zod_v4.z.object({
	page: zod_v4.z.coerce.number().int().min(0).optional().default(0).describe("Zero-indexed page number"),
	perPage: zod_v4.z.coerce.number().int().min(1).max(100).optional().default(10).describe("Number of items per page")
}).describe("Pagination options for list queries");
/**
* Pagination response info
* Used across all paginated endpoints
*/
const paginationInfoSchema = zod_v4.z.object({
	total: zod_v4.z.number().describe("Total number of items available"),
	page: zod_v4.z.number().describe("Current page"),
	perPage: zod_v4.z.union([zod_v4.z.number(), zod_v4.z.literal(false)]).describe("Number of items per page, or false if pagination is disabled"),
	hasMore: zod_v4.z.boolean().describe("True if more pages are available")
});
/** Opaque cursor used to resume incremental polling for observability list endpoints. */
const deltaCursorSchema = zod_v4.z.string().min(1).describe("Opaque cursor value for incremental polling");
/** Explicit list mode selector for observability list endpoints. */
const listModeSchema = zod_v4.z.enum(["page", "delta"]).describe("List mode: 'page' | 'delta', defaults to 'page' when omitted.");
/** Max number of updates returned from a delta poll window. */
const deltaLimitSchema = zod_v4.z.coerce.number().int().min(1).max(100).optional().describe("Maximum number of updates to return in one delta poll");
/** Default page-mode pagination used to preserve legacy list arg behavior. */
const defaultPaginationArgs = {
	page: 0,
	perPage: 10
};
/** Default number of updates returned when delta mode does not specify a limit. */
const defaultDeltaLimit = 10;
/**
* Enforces the shared page-vs-delta parameter rules for observability list endpoints.
* Keeps validation centralized while allowing endpoints to keep their own filters and orderBy schemas.
*/
function refineObservabilityListMode(value, ctx) {
	if (value.mode === "delta") {
		if (value.pagination !== void 0) ctx.addIssue({
			code: "custom",
			path: ["pagination"],
			message: "pagination is not allowed in delta mode"
		});
		if (value.orderBy !== void 0) ctx.addIssue({
			code: "custom",
			path: ["orderBy"],
			message: "orderBy is not allowed in delta mode"
		});
		return;
	}
	if (value.after !== void 0) ctx.addIssue({
		code: "custom",
		path: ["after"],
		message: "after is only allowed in delta mode"
	});
	if (value.limit !== void 0) ctx.addIssue({
		code: "custom",
		path: ["limit"],
		message: "limit is only allowed in delta mode"
	});
}
/**
* Normalizes observability list args into the legacy-friendly shape expected by existing stores.
* Page mode remains the default, and pagination/orderBy/limit are always populated.
*/
function normalizeObservabilityListArgs(value, defaults) {
	return {
		mode: value.mode === "delta" ? "delta" : "page",
		filters: value.filters,
		pagination: value.pagination ?? defaults.pagination ?? defaultPaginationArgs,
		orderBy: value.orderBy ?? defaults.orderBy,
		after: value.after,
		limit: value.limit ?? defaults.limit ?? 10
	};
}
/** Metadata returned for a delta poll window. */
const deltaInfoSchema = zod_v4.z.object({
	limit: zod_v4.z.number().describe("Maximum number of updates requested for this delta poll"),
	hasMore: zod_v4.z.boolean().describe("True when more matching updates remain after this response")
}).describe("Incremental polling metadata");
/**
* Date range for filtering by time
* Uses z.coerce to handle ISO string → Date conversion from query params
*/
const dateRangeSchema = zod_v4.z.object({
	start: zod_v4.z.coerce.date().optional().describe("Start of date range (inclusive by default)"),
	end: zod_v4.z.coerce.date().optional().describe("End of date range (inclusive by default)"),
	startExclusive: zod_v4.z.boolean().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),
	endExclusive: zod_v4.z.boolean().optional().describe("When true, excludes the end date from results (uses < instead of <=)")
}).describe("Date range filter for timestamps");
const sortDirectionSchema = zod_v4.z.enum(["ASC", "DESC"]).describe("Sort direction: 'ASC' | 'DESC'");
/** Aggregation type schema shared across OLAP-style observability queries. */
const aggregationTypeSchema = zod_v4.z.enum([
	"sum",
	"avg",
	"min",
	"max",
	"count",
	"count_distinct",
	"last"
]).describe("Aggregation function");
/** Aggregation interval schema shared across OLAP-style observability queries. */
const aggregationIntervalSchema = zod_v4.z.enum([
	"1m",
	"5m",
	"15m",
	"1h",
	"1d"
]).describe("Time bucket interval");
/** Compare period for aggregate queries with period-over-period comparison. */
const comparePeriodSchema = zod_v4.z.enum([
	"previous_period",
	"previous_day",
	"previous_week"
]).describe("Comparison period for aggregate queries");
/** Shared groupBy schema for OLAP-style breakdown and time-series queries. */
const groupBySchema = zod_v4.z.array(zod_v4.z.string()).min(1).describe("Fields to group by");
/** Shared percentiles schema for percentile queries. */
const percentilesSchema = zod_v4.z.array(zod_v4.z.number().min(0).max(1)).min(1).describe("Percentile values (0-1)");
/** Shared fields for aggregate OLAP responses across observability signals. */
const aggregateResponseFields = {
	value: zod_v4.z.number().nullable().describe("Aggregated value"),
	previousValue: zod_v4.z.number().nullable().optional().describe("Value from comparison period"),
	changePercent: zod_v4.z.number().nullable().optional().describe("Percentage change from comparison period")
};
/** Shared field for OLAP breakdown dimension values. */
const dimensionsField = zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string().nullable()).describe("Dimension values for this group");
/** Shared field for non-null OLAP aggregated values. */
const aggregatedValueField = zod_v4.z.number().describe("Aggregated value");
/** Shared field for OLAP bucket timestamps. */
const bucketTimestampField = zod_v4.z.date().describe("Bucket timestamp");
/** Shared field for percentile identifiers in OLAP responses. */
const percentileField = zod_v4.z.number().describe("Percentile value");
/** Shared field for percentile values within a time bucket. */
const percentileBucketValueField = zod_v4.z.number().describe("Percentile value at this bucket");
const entityTypeField = zod_v4.z.nativeEnum(EntityType).describe(`Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')`);
const entityIdField = zod_v4.z.string().describe("ID of the entity (e.g., \"weatherAgent\", \"orderWorkflow\")");
const entityNameField = zod_v4.z.string().describe("Name of the entity");
const userIdField = zod_v4.z.string().describe("Human end-user who triggered execution");
const organizationIdField = zod_v4.z.string().describe("Multi-tenant organization/account");
const resourceIdField = zod_v4.z.string().describe("Broader resource context (Mastra memory compatibility)");
const runIdField = zod_v4.z.string().describe("Unique execution run identifier");
const sessionIdField = zod_v4.z.string().describe("Session identifier for grouping traces");
const threadIdField = zod_v4.z.string().describe("Conversation thread identifier");
const requestIdField = zod_v4.z.string().describe("HTTP request ID for log correlation");
const environmentField = zod_v4.z.string().describe(`Environment (e.g., "production" | "staging" | "development")`);
const sourceField = zod_v4.z.string().describe(`Source of execution (e.g., "local" | "cloud" | "ci")`);
const executionSourceField = zod_v4.z.string().describe(`Source of execution (e.g., "local" | "cloud" | "ci")`);
const serviceNameField = zod_v4.z.string().describe("Name of the service");
const parentEntityTypeField = zod_v4.z.nativeEnum(EntityType).describe("Entity type of the parent entity");
const parentEntityIdField = zod_v4.z.string().describe("ID of the parent entity");
const parentEntityNameField = zod_v4.z.string().describe("Name of the parent entity");
const rootEntityTypeField = zod_v4.z.nativeEnum(EntityType).describe("Entity type of the root entity");
const rootEntityIdField = zod_v4.z.string().describe("ID of the root entity");
const rootEntityNameField = zod_v4.z.string().describe("Name of the root entity");
const entityVersionIdField = zod_v4.z.string().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)");
const parentEntityVersionIdField = zod_v4.z.string().describe("Version ID of the parent entity that produced this signal");
const rootEntityVersionIdField = zod_v4.z.string().describe("Version ID of the root entity that produced this signal");
const experimentIdField = zod_v4.z.string().describe("Experiment or eval run identifier");
const scopeField = zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).describe("Arbitrary package/app version info (e.g., {\"core\": \"1.0.0\", \"memory\": \"1.0.0\", \"gitSha\": \"abcd1234\"})");
const metadataField = zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).describe("User-defined metadata for custom filtering");
const tagsField = zod_v4.z.array(zod_v4.z.string()).describe("Labels for filtering");
/**
* Base context fields shared across tracing and non-tracing observability records.
* Source/provenance is intentionally excluded because tracing uses `source`
* while signals use `executionSource`.
*/
const contextFieldsBase = {
	entityType: entityTypeField.nullish(),
	entityId: entityIdField.nullish(),
	entityName: entityNameField.nullish(),
	parentEntityType: parentEntityTypeField.nullish(),
	parentEntityId: parentEntityIdField.nullish(),
	parentEntityName: parentEntityNameField.nullish(),
	rootEntityType: rootEntityTypeField.nullish(),
	rootEntityId: rootEntityIdField.nullish(),
	rootEntityName: rootEntityNameField.nullish(),
	userId: userIdField.nullish(),
	organizationId: organizationIdField.nullish(),
	resourceId: resourceIdField.nullish(),
	runId: runIdField.nullish(),
	sessionId: sessionIdField.nullish(),
	threadId: threadIdField.nullish(),
	requestId: requestIdField.nullish(),
	environment: environmentField.nullish(),
	serviceName: serviceNameField.nullish(),
	scope: scopeField.nullish(),
	entityVersionId: entityVersionIdField.nullish(),
	parentEntityVersionId: parentEntityVersionIdField.nullish(),
	rootEntityVersionId: rootEntityVersionIdField.nullish(),
	experimentId: experimentIdField.nullish()
};
/**
* Context fields shared across observability signals other than spans (metrics, logs, scores, feedback).
* These use `executionSource` to avoid colliding with signal-specific provenance fields.
*/
const contextFields = {
	...contextFieldsBase,
	executionSource: executionSourceField.nullish(),
	tags: tagsField.nullish()
};
/**
* Context fields used by tracing/span records.
* Tracing continues to expose execution provenance as `source`.
*/
const spanContextFields = {
	...contextFieldsBase,
	source: sourceField.nullish()
};
/**
* Common filter fields shared across observability signal filters (metrics, logs, scores, feedback).
* All fields are optional — each signal extends this with signal-specific filters.
*/
const commonFilterFields = {
	timestamp: dateRangeSchema.optional().describe("Filter by timestamp range"),
	traceId: zod_v4.z.string().optional().describe("Filter by trace ID"),
	spanId: zod_v4.z.string().optional().describe("Filter by span ID"),
	entityType: entityTypeField.optional(),
	entityName: entityNameField.optional(),
	entityVersionId: entityVersionIdField.optional(),
	parentEntityVersionId: parentEntityVersionIdField.optional(),
	rootEntityVersionId: rootEntityVersionIdField.optional(),
	userId: userIdField.optional(),
	organizationId: organizationIdField.optional(),
	experimentId: experimentIdField.optional(),
	serviceName: serviceNameField.optional(),
	environment: environmentField.optional(),
	parentEntityType: parentEntityTypeField.optional(),
	parentEntityName: parentEntityNameField.optional(),
	rootEntityType: rootEntityTypeField.optional(),
	rootEntityName: rootEntityNameField.optional(),
	resourceId: resourceIdField.optional(),
	runId: runIdField.optional(),
	sessionId: sessionIdField.optional(),
	threadId: threadIdField.optional(),
	requestId: requestIdField.optional(),
	executionSource: executionSourceField.optional(),
	tags: zod_v4.z.array(zod_v4.z.string()).optional().describe("Filter by tags (must have all specified tags)")
};
/** Zod schema for trace ID field */
const traceIdField = zod_v4.z.string().describe("Unique trace identifier");
/** Zod schema for span ID field */
const spanIdField = zod_v4.z.string().describe("Unique span identifier within a trace");
/** Log level schema for validation */
const logLevelSchema = zod_v4.z.enum([
	"debug",
	"info",
	"warn",
	"error",
	"fatal"
]);
const messageField = zod_v4.z.string().describe("Log message");
const logDataField = zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).describe("Structured data attached to the log");
/**
* Schema for logs as stored in the database.
* Includes all fields from ExportedLog plus storage-specific fields.
*/
const logRecordSchema = zod_v4.z.object({
	logId: zod_v4.z.string().nullish().describe("Unique id for this log event"),
	timestamp: zod_v4.z.date().describe("When the log was created"),
	level: logLevelSchema.describe("Log severity level"),
	message: messageField,
	data: logDataField.nullish(),
	traceId: traceIdField.nullish(),
	spanId: spanIdField.nullish(),
	...contextFields,
	/**
	* @deprecated Use `executionSource` instead.
	*/
	source: zod_v4.z.string().nullish().describe("Execution source"),
	metadata: metadataField.nullish()
}).describe("Log record as stored in the database");
/**
* Schema for user-provided log input (minimal required fields).
* The logger enriches this with context before emitting ExportedLog.
*/
const logRecordInputSchema = zod_v4.z.object({
	level: logLevelSchema,
	message: messageField,
	data: logDataField.optional(),
	tags: tagsField.optional()
}).describe("User-provided log input");
/** Schema for creating a log record */
const createLogRecordSchema = logRecordSchema;
/** Schema for batchCreateLogs operation arguments */
const batchCreateLogsArgsSchema = zod_v4.z.object({ logs: zod_v4.z.array(createLogRecordSchema) }).describe("Arguments for batch creating logs");
/** Schema for filtering logs in list queries */
const logsFilterSchema = zod_v4.z.object({
	...commonFilterFields,
	/**
	* @deprecated Use `executionSource` instead.
	*/
	source: zod_v4.z.string().optional().describe("Filter by execution source"),
	level: zod_v4.z.union([logLevelSchema, zod_v4.z.array(logLevelSchema)]).optional().describe("Filter by log level(s)")
}).describe("Filters for querying logs");
/** Fields available for ordering log results */
const logsOrderByFieldSchema = zod_v4.z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
/** Order by configuration for log queries */
const logsOrderBySchema = zod_v4.z.object({
	field: logsOrderByFieldSchema.default("timestamp").describe("Field to order by"),
	direction: sortDirectionSchema.default("DESC").describe("Sort direction")
}).describe("Order by configuration");
/** Schema for listLogs operation arguments */
const listLogsArgsSchema = zod_v4.z.object({
	mode: listModeSchema.optional(),
	filters: logsFilterSchema.optional().describe("Optional filters to apply"),
	pagination: paginationArgsSchema.optional(),
	orderBy: logsOrderBySchema.optional(),
	after: deltaCursorSchema.optional(),
	limit: deltaLimitSchema
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
	field: "timestamp",
	direction: "DESC"
} })).describe("Arguments for listing logs");
/** Schema for listLogs operation response */
const listLogsResponseSchema = zod_v4.z.object({
	pagination: paginationInfoSchema.optional(),
	delta: deltaInfoSchema.optional(),
	deltaCursor: deltaCursorSchema.optional(),
	logs: zod_v4.z.array(logRecordSchema)
}).describe("Response from listing logs");
const scorerIdField = zod_v4.z.string().describe("Identifier of the scorer (e.g., relevance, accuracy)");
const scorerNameField = zod_v4.z.string().describe("Display name of the scorer");
const scorerVersionField = zod_v4.z.string().describe("Version of the scorer");
const scoreSourceField = zod_v4.z.string().describe("How the score was produced (e.g., manual, automated, experiment)");
const scoreValueField = zod_v4.z.number().describe("Score value (range defined by scorer)");
const scoreReasonField = zod_v4.z.string().describe("Explanation for the score");
/**
* Schema for scores as stored in the database.
* Includes all fields from ExportedScore plus storage-specific fields.
*/
const scoreRecordSchema = zod_v4.z.object({
	scoreId: zod_v4.z.string().nullish().describe("Unique id for this score event"),
	timestamp: zod_v4.z.date().describe("When the score was recorded"),
	traceId: traceIdField.nullish().describe("Trace that anchors the scored target when available"),
	spanId: spanIdField.nullish().describe("Span ID this score applies to"),
	scorerId: scorerIdField,
	scorerName: scorerNameField.nullish(),
	scorerVersion: scorerVersionField.nullish(),
	scoreSource: scoreSourceField.nullish(),
	/**
	* @deprecated Use `scoreSource` instead.
	*/
	source: scoreSourceField.nullish(),
	score: scoreValueField,
	reason: scoreReasonField.nullish(),
	...contextFields,
	/** Trace ID of the scoring run (links to trace that generated this score) */
	scoreTraceId: zod_v4.z.string().nullish().describe("Trace ID of the scoring run for debugging score generation"),
	metadata: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).nullish().describe("User-defined metadata")
}).describe("Score record as stored in the database");
/**
* Schema for user-provided score input (minimal required fields).
* The span/trace context adds traceId/spanId before emitting ExportedScore.
*/
const scoreInputSchema = zod_v4.z.object({
	scorerId: scorerIdField,
	scorerName: scorerNameField.optional(),
	scorerVersion: scorerVersionField.optional(),
	scoreSource: scoreSourceField.optional(),
	/**
	* @deprecated Use `scoreSource` instead.
	*/
	source: scoreSourceField.optional(),
	score: scoreValueField,
	reason: scoreReasonField.optional(),
	metadata: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).optional().describe("Additional scorer-specific metadata"),
	experimentId: experimentIdField.optional(),
	scoreTraceId: zod_v4.z.string().optional().describe("Trace ID of the scoring run for debugging score generation"),
	targetEntityType: entityTypeField.optional().describe("Entity type the scorer evaluated when known")
}).describe("User-provided score input");
/** Schema for creating a score record */
const createScoreRecordSchema = scoreRecordSchema;
/** Schema for createScore operation arguments */
const createScoreArgsSchema = zod_v4.z.object({ score: createScoreRecordSchema }).describe("Arguments for creating a score");
/** Schema for createScore operation body in client/server */
const createScoreBodySchema = zod_v4.z.object({
	contextMode: zod_v4.z.enum(["resolve", "provided"]).optional().describe("Context handling; defaults to provided on OSS and resolve on Platform"),
	score: createScoreRecordSchema.omit({ timestamp: true }).extend({
		timestamp: zod_v4.z.iso.datetime({ offset: true }).optional().describe("Original record timestamp; preserve across retries and replacements"),
		traceId: traceIdField.regex(/\S/, "traceId must not be empty or whitespace-only")
	})
}).describe("Arguments for creating a score");
/** Schema for createScore operation response */
const createScoreResponseSchema = zod_v4.z.object({
	success: zod_v4.z.boolean(),
	data: zod_v4.z.object({
		scoreId: zod_v4.z.string(),
		traceId: zod_v4.z.string(),
		spanId: zod_v4.z.string().nullable(),
		timestamp: zod_v4.z.iso.datetime()
	}).optional()
}).describe("Response from creating a score");
/** Schema for batchCreateScores operation arguments */
const batchCreateScoresArgsSchema = zod_v4.z.object({ scores: zod_v4.z.array(createScoreRecordSchema) }).describe("Arguments for batch recording scores");
const DELETE_SCORES_MAX_IDS = 1e3;
/** Schema for deleteScores operation arguments */
const deleteScoresArgsSchema = zod_v4.z.object({
	scoreIds: zod_v4.z.array(zod_v4.z.string()).max(DELETE_SCORES_MAX_IDS).describe(`IDs of the score events to delete (maximum ${DELETE_SCORES_MAX_IDS})`),
	organizationId: organizationIdField.optional().describe("Restrict deletion to scores in this organization"),
	resourceId: resourceIdField.optional().describe("Restrict deletion to scores for this resource")
}).describe("Arguments for deleting scores by id");
/** Schema for deleteScores operation response */
const deleteScoresResponseSchema = zod_v4.z.object({ success: zod_v4.z.boolean() }).describe("Response from deleting scores");
/** Schema for filtering scores in list queries */
const scoresFilterSchema = zod_v4.z.object({
	...commonFilterFields,
	scorerId: zod_v4.z.union([zod_v4.z.string(), zod_v4.z.array(zod_v4.z.string())]).optional().describe("Filter by scorer ID(s)"),
	scoreSource: scoreSourceField.optional().describe("Filter by how the score was produced"),
	metadata: metadataField.nullish().describe("Filter by metadata key-value pairs (exact match per key)"),
	/**
	* @deprecated Use `scoreSource` instead.
	*/
	source: scoreSourceField.optional().describe("Filter by how the score was produced")
}).describe("Filters for querying scores");
/** Fields available for ordering score results */
const scoresOrderByFieldSchema = zod_v4.z.enum(["timestamp", "score"]).describe("Field to order by: 'timestamp' | 'score'");
/** Order by configuration for score queries */
const scoresOrderBySchema = zod_v4.z.object({
	field: scoresOrderByFieldSchema.default("timestamp").describe("Field to order by"),
	direction: sortDirectionSchema.default("DESC").describe("Sort direction")
}).describe("Order by configuration");
const listScoresArgsSchema = zod_v4.z.object({
	mode: listModeSchema.optional(),
	filters: scoresFilterSchema.optional(),
	pagination: paginationArgsSchema.optional(),
	orderBy: scoresOrderBySchema.optional(),
	after: deltaCursorSchema.optional(),
	limit: deltaLimitSchema
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
	field: "timestamp",
	direction: "DESC"
} })).describe("Arguments for listing scores");
/** Schema for listScores operation response */
const listScoresResponseSchema = zod_v4.z.object({
	pagination: paginationInfoSchema.optional(),
	delta: deltaInfoSchema.optional(),
	deltaCursor: deltaCursorSchema.optional(),
	scores: zod_v4.z.array(scoreRecordSchema)
}).describe("Response from listing scores");
const getScoreAggregateArgsSchema = zod_v4.z.object({
	scorerId: scorerIdField,
	scoreSource: scoreSourceField.optional(),
	aggregation: aggregationTypeSchema,
	filters: scoresFilterSchema.optional(),
	comparePeriod: comparePeriodSchema.optional()
}).describe("Arguments for getting a score aggregate");
const getScoreAggregateResponseSchema = zod_v4.z.object(aggregateResponseFields);
const getScoreBreakdownArgsSchema = zod_v4.z.object({
	scorerId: scorerIdField,
	scoreSource: scoreSourceField.optional(),
	groupBy: groupBySchema,
	aggregation: aggregationTypeSchema,
	filters: scoresFilterSchema.optional()
}).describe("Arguments for getting a score breakdown");
const getScoreBreakdownResponseSchema = zod_v4.z.object({ groups: zod_v4.z.array(zod_v4.z.object({
	dimensions: dimensionsField,
	value: aggregatedValueField
})) });
const getScoreTimeSeriesArgsSchema = zod_v4.z.object({
	scorerId: scorerIdField,
	scoreSource: scoreSourceField.optional(),
	interval: aggregationIntervalSchema,
	aggregation: aggregationTypeSchema,
	filters: scoresFilterSchema.optional(),
	groupBy: groupBySchema.optional()
}).describe("Arguments for getting score time series");
const getScoreTimeSeriesResponseSchema = zod_v4.z.object({ series: zod_v4.z.array(zod_v4.z.object({
	name: zod_v4.z.string().describe("Series name (scorer ID or group key)"),
	points: zod_v4.z.array(zod_v4.z.object({
		timestamp: bucketTimestampField,
		value: aggregatedValueField
	}))
})) });
const getScorePercentilesArgsSchema = zod_v4.z.object({
	scorerId: scorerIdField,
	scoreSource: scoreSourceField.optional(),
	percentiles: percentilesSchema,
	interval: aggregationIntervalSchema,
	filters: scoresFilterSchema.optional()
}).describe("Arguments for getting score percentiles");
const getScorePercentilesResponseSchema = zod_v4.z.object({ series: zod_v4.z.array(zod_v4.z.object({
	percentile: percentileField,
	points: zod_v4.z.array(zod_v4.z.object({
		timestamp: bucketTimestampField,
		value: percentileBucketValueField
	}))
})) });
const feedbackSourceField = zod_v4.z.string().describe("Source of feedback (e.g., 'user', 'system', 'manual')");
const feedbackTypeField = zod_v4.z.string().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')");
const feedbackValueField = zod_v4.z.union([zod_v4.z.number(), zod_v4.z.string()]).describe("Feedback value (rating number or correction text)");
const feedbackCommentField = zod_v4.z.string().describe("Additional comment or context");
const feedbackUserIdField = zod_v4.z.string().describe("User who provided the feedback");
const feedbackReviewStatusSchema = zod_v4.z.enum(["needs-review", "reviewed"]);
function normalizeLegacyFeedbackActor(input) {
	if (!input || typeof input !== "object" || Array.isArray(input)) return input;
	const record = { ...input };
	if (typeof record.userId === "string" && record.feedbackUserId === void 0) {
		record.feedbackUserId = record.userId;
		delete record.userId;
	}
	return record;
}
/**
* Schema for feedback as stored in the database.
* Includes all fields from ExportedFeedback plus storage-specific fields.
*/
const feedbackRecordObjectSchema = zod_v4.z.object({
	feedbackId: zod_v4.z.string().nullish().describe("Unique id for this feedback event"),
	timestamp: zod_v4.z.date().describe("When the feedback was recorded"),
	traceId: traceIdField.nullish().describe("Trace that anchors the feedback target when available"),
	spanId: spanIdField.nullish().describe("Span ID this feedback applies to"),
	feedbackSource: feedbackSourceField.nullish(),
	/**
	* @deprecated Use `feedbackSource` instead.
	*/
	source: feedbackSourceField.nullish(),
	feedbackType: feedbackTypeField,
	value: feedbackValueField,
	comment: feedbackCommentField.nullish(),
	feedbackUserId: feedbackUserIdField.nullish(),
	...contextFields,
	sourceId: zod_v4.z.string().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),
	metadata: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).nullish().describe("User-defined metadata"),
	reviewStatus: feedbackReviewStatusSchema.describe("Feedback review workflow status")
});
/** Feedback record fields accepted on creation: `reviewStatus` is optional and defaults to `needs-review` in storage */
const createFeedbackRecordObjectSchema = feedbackRecordObjectSchema.extend({ reviewStatus: feedbackReviewStatusSchema.optional().describe("Feedback review workflow status") });
const feedbackRecordSchema = zod_v4.z.object(feedbackRecordObjectSchema.shape).describe("Feedback record as stored in the database");
/**
* Schema for user-provided feedback input (minimal required fields).
* The span/trace context adds traceId/spanId before emitting ExportedFeedback.
*/
const feedbackInputObjectSchema = zod_v4.z.object({
	feedbackSource: feedbackSourceField.optional(),
	/**
	* @deprecated Use `feedbackSource` instead.
	*/
	source: feedbackSourceField.optional(),
	feedbackType: feedbackTypeField,
	value: feedbackValueField,
	comment: feedbackCommentField.optional(),
	feedbackUserId: feedbackUserIdField.optional(),
	/**
	* @deprecated Use `feedbackUserId` instead.
	*/
	userId: feedbackUserIdField.optional(),
	metadata: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).optional().describe("Additional feedback-specific metadata"),
	experimentId: experimentIdField.optional(),
	sourceId: zod_v4.z.string().optional().describe("ID of the source record this feedback is linked to")
});
const feedbackInputSchema = zod_v4.z.object(feedbackInputObjectSchema.shape).describe("User-provided feedback input");
/** Schema for creating a feedback record */
const createFeedbackRecordSchema = zod_v4.z.object(createFeedbackRecordObjectSchema.shape).describe("Feedback record accepted on creation");
/** Schema for createFeedback operation arguments */
const createFeedbackArgsSchema = zod_v4.z.object({
	feedback: zod_v4.z.preprocess(normalizeLegacyFeedbackActor, createFeedbackRecordObjectSchema),
	onConflict: zod_v4.z.enum(["ignore", "replace"]).optional()
}).describe("Arguments for creating feedback");
/** Schema for createFeedback operation body in client/server */
const createFeedbackBodySchema = zod_v4.z.object({
	contextMode: zod_v4.z.enum(["resolve", "provided"]).optional().describe("Context handling; defaults to provided on OSS and resolve on Platform"),
	feedback: createFeedbackRecordObjectSchema.omit({ timestamp: true }).extend({
		timestamp: zod_v4.z.iso.datetime({ offset: true }).optional().describe("Original record timestamp; preserve across retries and replacements"),
		traceId: traceIdField.regex(/\S/, "traceId must not be empty or whitespace-only")
	})
}).describe("Arguments for creating feedback");
/** Full replacement retains the original feedback identity and creation timestamp. */
const replaceFeedbackBodySchema = createFeedbackBodySchema.extend({ feedback: createFeedbackBodySchema.shape.feedback.extend({
	feedbackId: zod_v4.z.string().regex(/\S/, "feedbackId must not be empty"),
	timestamp: zod_v4.z.iso.datetime({ offset: true })
}) });
/** Schema for createFeedback operation response */
const createFeedbackResponseSchema = zod_v4.z.object({
	success: zod_v4.z.boolean(),
	data: zod_v4.z.object({
		feedbackId: zod_v4.z.string(),
		traceId: zod_v4.z.string(),
		spanId: zod_v4.z.string().nullable(),
		timestamp: zod_v4.z.iso.datetime()
	}).optional()
}).describe("Response from creating feedback");
/** Schema for batchCreateFeedback operation arguments */
const batchCreateFeedbackArgsSchema = zod_v4.z.object({
	feedbacks: zod_v4.z.array(zod_v4.z.preprocess(normalizeLegacyFeedbackActor, createFeedbackRecordObjectSchema)),
	onConflict: zod_v4.z.enum(["ignore", "replace"]).optional()
}).describe("Arguments for batch recording feedback");
/** Schema for updating a feedback record's review status */
const updateFeedbackReviewStatusArgsSchema = zod_v4.z.object({
	feedbackId: zod_v4.z.string(),
	reviewStatus: feedbackReviewStatusSchema
}).describe("Arguments for updating a feedback record's review status");
const DELETE_FEEDBACK_MAX_IDS = 1e3;
/** Schema for deleteFeedback operation arguments */
const deleteFeedbackArgsSchema = zod_v4.z.object({
	feedbackIds: zod_v4.z.array(zod_v4.z.string()).max(DELETE_FEEDBACK_MAX_IDS).describe(`IDs of the feedback events to delete (maximum ${DELETE_FEEDBACK_MAX_IDS})`),
	organizationId: organizationIdField.optional().describe("Restrict deletion to feedback in this organization"),
	resourceId: resourceIdField.optional().describe("Restrict deletion to feedback for this resource")
}).describe("Arguments for deleting feedback by id");
/** Schema for deleteFeedback operation response */
const deleteFeedbackResponseSchema = zod_v4.z.object({ success: zod_v4.z.boolean() }).describe("Response from deleting feedback");
/** Schema for filtering feedback in list queries */
const feedbackFilterObjectSchema = zod_v4.z.object({
	...commonFilterFields,
	feedbackType: zod_v4.z.union([zod_v4.z.string(), zod_v4.z.array(zod_v4.z.string())]).optional().describe("Filter by feedback type(s)"),
	feedbackSource: feedbackSourceField.optional(),
	/**
	* @deprecated Use `feedbackSource` instead.
	*/
	source: feedbackSourceField.optional(),
	feedbackUserId: feedbackUserIdField.optional(),
	reviewStatus: feedbackReviewStatusSchema.optional()
});
const feedbackFilterSchema = zod_v4.z.object(feedbackFilterObjectSchema.shape).describe("Filters for querying feedback");
/** Fields available for ordering feedback results */
const feedbackOrderByFieldSchema = zod_v4.z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
/** Order by configuration for feedback queries */
const feedbackOrderBySchema = zod_v4.z.object({
	field: feedbackOrderByFieldSchema.default("timestamp").describe("Field to order by"),
	direction: sortDirectionSchema.default("DESC").describe("Sort direction")
}).describe("Order by configuration");
const listFeedbackArgsSchema = zod_v4.z.object({
	mode: listModeSchema.optional(),
	filters: zod_v4.z.preprocess(normalizeLegacyFeedbackActor, feedbackFilterObjectSchema).optional(),
	pagination: paginationArgsSchema.optional(),
	orderBy: feedbackOrderBySchema.optional(),
	after: deltaCursorSchema.optional(),
	limit: deltaLimitSchema
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
	field: "timestamp",
	direction: "DESC"
} })).describe("Arguments for listing feedback");
/** Schema for listFeedback operation response */
const listFeedbackResponseSchema = zod_v4.z.object({
	pagination: paginationInfoSchema.optional(),
	delta: deltaInfoSchema.optional(),
	deltaCursor: deltaCursorSchema.optional(),
	feedback: zod_v4.z.array(feedbackRecordSchema)
}).describe("Response from listing feedback");
const getFeedbackAggregateArgsSchema = zod_v4.z.object({
	feedbackType: feedbackTypeField,
	feedbackSource: feedbackSourceField.optional(),
	aggregation: aggregationTypeSchema,
	filters: feedbackFilterSchema.optional(),
	comparePeriod: comparePeriodSchema.optional()
}).describe("Arguments for getting a feedback aggregate over numeric values");
const getFeedbackAggregateResponseSchema = zod_v4.z.object(aggregateResponseFields);
const getFeedbackBreakdownArgsSchema = zod_v4.z.object({
	feedbackType: feedbackTypeField,
	feedbackSource: feedbackSourceField.optional(),
	groupBy: groupBySchema,
	aggregation: aggregationTypeSchema,
	filters: feedbackFilterSchema.optional()
}).describe("Arguments for getting a feedback breakdown over numeric values");
const getFeedbackBreakdownResponseSchema = zod_v4.z.object({ groups: zod_v4.z.array(zod_v4.z.object({
	dimensions: dimensionsField,
	value: aggregatedValueField
})) });
const getFeedbackTimeSeriesArgsSchema = zod_v4.z.object({
	feedbackType: feedbackTypeField,
	feedbackSource: feedbackSourceField.optional(),
	interval: aggregationIntervalSchema,
	aggregation: aggregationTypeSchema,
	filters: feedbackFilterSchema.optional(),
	groupBy: groupBySchema.optional()
}).describe("Arguments for getting feedback time series over numeric values");
const getFeedbackTimeSeriesResponseSchema = zod_v4.z.object({ series: zod_v4.z.array(zod_v4.z.object({
	name: zod_v4.z.string().describe("Series name (feedback type or group key)"),
	points: zod_v4.z.array(zod_v4.z.object({
		timestamp: bucketTimestampField,
		value: aggregatedValueField
	}))
})) });
const getFeedbackPercentilesArgsSchema = zod_v4.z.object({
	feedbackType: feedbackTypeField,
	feedbackSource: feedbackSourceField.optional(),
	percentiles: percentilesSchema,
	interval: aggregationIntervalSchema,
	filters: feedbackFilterSchema.optional()
}).describe("Arguments for getting feedback percentiles over numeric values");
const getFeedbackPercentilesResponseSchema = zod_v4.z.object({ series: zod_v4.z.array(zod_v4.z.object({
	percentile: percentileField,
	points: zod_v4.z.array(zod_v4.z.object({
		timestamp: bucketTimestampField,
		value: percentileBucketValueField
	}))
})) });
/**
* @deprecated MetricType is no longer stored. All metrics are raw events
* with aggregation determined at query time.
*/
const metricTypeSchema = zod_v4.z.enum([
	"counter",
	"gauge",
	"histogram"
]);
const metricNameField = zod_v4.z.string().describe("Metric name (e.g., mastra_agent_duration_ms)");
const metricValueField = zod_v4.z.number().describe("Metric value");
const labelsField = zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).describe("Metric labels for dimensional filtering");
const providerField = zod_v4.z.string().describe("Model provider");
const modelField = zod_v4.z.string().describe("Model");
const estimatedCostField = zod_v4.z.number().describe("Estimated cost");
const costUnitField = zod_v4.z.string().describe("Unit for the estimated cost (e.g., usd)");
const costMetadField = zod_v4.z.record(zod_v4.z.string(), zod_v4.z.unknown()).nullish().describe("Structured costing metadata");
/**
* Schema for metrics as stored in the database.
* Each record is a single metric observation.
*/
const metricRecordSchema = zod_v4.z.object({
	metricId: zod_v4.z.string().nullish().describe("Unique id for this metric event"),
	timestamp: zod_v4.z.date().describe("When the metric was recorded"),
	name: metricNameField,
	value: metricValueField,
	traceId: traceIdField.nullish(),
	spanId: spanIdField.nullish(),
	...contextFields,
	/**
	* @deprecated Use `executionSource` instead.
	*/
	source: zod_v4.z.string().nullish().describe("Execution source"),
	provider: providerField.nullish(),
	model: modelField.nullish(),
	estimatedCost: estimatedCostField.nullish(),
	costUnit: costUnitField.nullish(),
	costMetadata: costMetadField.nullish(),
	labels: labelsField.default({}),
	metadata: metadataField.nullish()
}).describe("Metric record as stored in the database");
/**
* Schema for user-provided metric input (minimal required fields).
* The metrics context enriches this with environment before emitting ExportedMetric.
*/
const metricInputSchema = zod_v4.z.object({
	name: metricNameField,
	value: metricValueField,
	labels: labelsField.optional()
}).describe("User-provided metric input");
/** Schema for creating a metric record (without db timestamps) */
const createMetricRecordSchema = metricRecordSchema;
/** Schema for batchCreateMetrics operation arguments */
const batchCreateMetricsArgsSchema = zod_v4.z.object({ metrics: zod_v4.z.array(createMetricRecordSchema) }).describe("Arguments for batch recording metrics");
/** Schema for metric aggregation configuration */
const metricsAggregationSchema = zod_v4.z.object({
	type: aggregationTypeSchema,
	interval: aggregationIntervalSchema.optional(),
	groupBy: groupBySchema.optional()
}).describe("Metrics aggregation configuration");
/** Schema for filtering metrics in queries */
const metricsFilterSchema = zod_v4.z.object({
	...commonFilterFields,
	traceIds: zod_v4.z.array(traceIdField).nonempty().max(1e3).optional().describe("Filter by one or more trace IDs"),
	experimentIds: zod_v4.z.array(experimentIdField).nonempty().max(1e3).optional().describe("Filter by one or more experiment IDs"),
	name: zod_v4.z.array(zod_v4.z.string()).nonempty().optional().describe("Filter by metric name(s)"),
	/**
	* @deprecated Use `executionSource` instead.
	*/
	source: zod_v4.z.string().optional().describe("Filter by execution source"),
	provider: providerField.optional(),
	model: modelField.optional(),
	costUnit: costUnitField.optional(),
	labels: zod_v4.z.record(zod_v4.z.string(), zod_v4.z.string()).optional().describe("Exact match on label key-value pairs")
}).describe("Filters for querying metrics");
/** Fields available for ordering metric list results */
const metricsOrderByFieldSchema = zod_v4.z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
/** Order by configuration for metric list queries */
const metricsOrderBySchema = zod_v4.z.object({
	field: metricsOrderByFieldSchema.default("timestamp").describe("Field to order by"),
	direction: sortDirectionSchema.default("DESC").describe("Sort direction")
}).describe("Order by configuration");
const listMetricsArgsSchema = zod_v4.z.object({
	mode: listModeSchema.optional(),
	filters: metricsFilterSchema.optional(),
	pagination: paginationArgsSchema.optional(),
	orderBy: metricsOrderBySchema.optional(),
	after: deltaCursorSchema.optional(),
	limit: deltaLimitSchema
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
	field: "timestamp",
	direction: "DESC"
} })).describe("Arguments for listing metrics");
/** Schema for listMetrics operation response */
const listMetricsResponseSchema = zod_v4.z.object({
	pagination: paginationInfoSchema.optional(),
	delta: deltaInfoSchema.optional(),
	deltaCursor: deltaCursorSchema.optional(),
	metrics: zod_v4.z.array(metricRecordSchema)
}).describe("Response from listing metrics");
/**
* Columns eligible for `count_distinct`.
*
* Restricted to low/medium-cardinality categorical attributes. ID columns are
* intentionally excluded — approximate distinct count over near-unique values
* converges to the row count and is rarely a useful KPI.
*/
const METRIC_DISTINCT_COLUMNS = [
	"entityType",
	"entityName",
	"parentEntityType",
	"parentEntityName",
	"rootEntityType",
	"rootEntityName",
	"name",
	"provider",
	"model",
	"environment",
	"executionSource",
	"serviceName",
	"threadId",
	"resourceId"
];
const distinctColumnSchema = zod_v4.z.enum(METRIC_DISTINCT_COLUMNS).optional().describe("Column to apply count_distinct over (required when aggregation is 'count_distinct'). Restricted to allowlisted metric dimensions.");
/** Shared by the metric args schemas and dashboard metric queries, which rebuild those objects. */
const requireDistinctColumnRefinement = {
	check: (data) => data.aggregation !== "count_distinct" || data.distinctColumn !== void 0,
	options: {
		message: "distinctColumn is required when aggregation is 'count_distinct'",
		path: ["distinctColumn"]
	}
};
const getMetricAggregateArgsSchema = zod_v4.z.object({
	name: zod_v4.z.array(zod_v4.z.string()).nonempty().describe("Metric name(s) to aggregate"),
	aggregation: aggregationTypeSchema,
	distinctColumn: distinctColumnSchema,
	filters: metricsFilterSchema.optional(),
	comparePeriod: comparePeriodSchema.optional()
}).refine(requireDistinctColumnRefinement.check, requireDistinctColumnRefinement.options).describe("Arguments for getting a metric aggregate");
const getMetricAggregateResponseSchema = zod_v4.z.object({
	...aggregateResponseFields,
	estimatedCost: zod_v4.z.number().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),
	costUnit: zod_v4.z.string().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),
	previousEstimatedCost: zod_v4.z.number().nullable().optional().describe("Aggregated estimated cost from the comparison period"),
	costChangePercent: zod_v4.z.number().nullable().optional().describe("Percentage change in estimated cost from comparison period")
});
const getMetricBreakdownArgsSchema = zod_v4.z.object({
	name: zod_v4.z.array(zod_v4.z.string()).nonempty().describe("Metric name(s) to break down"),
	groupBy: groupBySchema,
	aggregation: aggregationTypeSchema,
	distinctColumn: distinctColumnSchema,
	filters: metricsFilterSchema.optional(),
	limit: zod_v4.z.number().int().positive().max(1e3).optional().describe("Maximum number of groups to return (server-side TopK). Required for high-cardinality groupBy."),
	orderDirection: sortDirectionSchema.optional().describe("Sort direction for the aggregated value (defaults to 'DESC' at the storage layer; pairs with limit for top/bottom-N).")
}).refine(requireDistinctColumnRefinement.check, requireDistinctColumnRefinement.options).describe("Arguments for getting a metric breakdown");
const getMetricBreakdownResponseSchema = zod_v4.z.object({ groups: zod_v4.z.array(zod_v4.z.object({
	dimensions: dimensionsField,
	value: aggregatedValueField,
	estimatedCost: zod_v4.z.number().nullable().optional().describe("Summed estimated cost for this group"),
	costUnit: zod_v4.z.string().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")
})) });
const getMetricTimeSeriesArgsSchema = zod_v4.z.object({
	name: zod_v4.z.array(zod_v4.z.string()).nonempty().describe("Metric name(s)"),
	interval: aggregationIntervalSchema,
	aggregation: aggregationTypeSchema,
	distinctColumn: distinctColumnSchema,
	filters: metricsFilterSchema.optional(),
	groupBy: groupBySchema.optional()
}).refine(requireDistinctColumnRefinement.check, requireDistinctColumnRefinement.options).describe("Arguments for getting metric time series");
const getMetricTimeSeriesResponseSchema = zod_v4.z.object({ series: zod_v4.z.array(zod_v4.z.object({
	name: zod_v4.z.string().describe("Series name (metric name or group key)"),
	costUnit: zod_v4.z.string().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),
	points: zod_v4.z.array(zod_v4.z.object({
		timestamp: bucketTimestampField,
		value: aggregatedValueField,
		estimatedCost: zod_v4.z.number().nullable().optional().describe("Summed estimated cost in this bucket")
	}))
})) });
const getMetricPercentilesArgsSchema = zod_v4.z.object({
	name: zod_v4.z.string().describe("Metric name"),
	percentiles: percentilesSchema,
	interval: aggregationIntervalSchema,
	filters: metricsFilterSchema.optional()
}).describe("Arguments for getting metric percentiles");
const getMetricPercentilesResponseSchema = zod_v4.z.object({ series: zod_v4.z.array(zod_v4.z.object({
	percentile: percentileField,
	points: zod_v4.z.array(zod_v4.z.object({
		timestamp: bucketTimestampField,
		value: percentileBucketValueField
	}))
})) });
const getMetricNamesArgsSchema = zod_v4.z.object({
	prefix: zod_v4.z.string().optional().describe("Filter metric names by prefix"),
	limit: zod_v4.z.coerce.number().int().min(1).optional().describe("Maximum number of names to return")
}).describe("Arguments for getting metric names");
const getMetricNamesResponseSchema = zod_v4.z.object({ names: zod_v4.z.array(zod_v4.z.string()).describe("Distinct metric names") });
const getMetricLabelKeysArgsSchema = zod_v4.z.object({ metricName: zod_v4.z.string().describe("Metric name to get label keys for") }).describe("Arguments for getting metric label keys");
const getMetricLabelKeysResponseSchema = zod_v4.z.object({ keys: zod_v4.z.array(zod_v4.z.string()).describe("Distinct label keys for the metric") });
const getMetricLabelValuesArgsSchema = zod_v4.z.object({
	metricName: zod_v4.z.string().describe("Metric name"),
	labelKey: zod_v4.z.string().describe("Label key to get values for"),
	prefix: zod_v4.z.string().optional().describe("Filter values by prefix"),
	limit: zod_v4.z.coerce.number().int().min(1).optional().describe("Maximum number of values to return")
}).describe("Arguments for getting label values");
const getMetricLabelValuesResponseSchema = zod_v4.z.object({ values: zod_v4.z.array(zod_v4.z.string()).describe("Distinct label values") });
const getEntityTypesArgsSchema = zod_v4.z.object({}).describe("Arguments for getting entity types");
const getEntityTypesResponseSchema = zod_v4.z.object({ entityTypes: zod_v4.z.array(entityTypeField).describe("Distinct entity types") });
const getEntityNamesArgsSchema = zod_v4.z.object({ entityType: entityTypeField.optional().describe("Optional entity type filter") }).describe("Arguments for getting entity names");
const getEntityNamesResponseSchema = zod_v4.z.object({ names: zod_v4.z.array(zod_v4.z.string()).describe("Distinct entity names") });
const getServiceNamesArgsSchema = zod_v4.z.object({}).describe("Arguments for getting service names");
const getServiceNamesResponseSchema = zod_v4.z.object({ serviceNames: zod_v4.z.array(zod_v4.z.string()).describe("Distinct service names") });
const getEnvironmentsArgsSchema = zod_v4.z.object({}).describe("Arguments for getting environments");
const getEnvironmentsResponseSchema = zod_v4.z.object({ environments: zod_v4.z.array(zod_v4.z.string()).describe("Distinct environments") });
const getTagsArgsSchema = zod_v4.z.object({ entityType: entityTypeField.optional().describe("Optional entity type filter") }).describe("Arguments for getting tags");
const getTagsResponseSchema = zod_v4.z.object({ tags: zod_v4.z.array(zod_v4.z.string()).describe("Distinct tags") });
Object.defineProperty(exports, "EntityType", {
	enumerable: true,
	get: function() {
		return EntityType;
	}
});
Object.defineProperty(exports, "METRIC_DISTINCT_COLUMNS", {
	enumerable: true,
	get: function() {
		return METRIC_DISTINCT_COLUMNS;
	}
});
Object.defineProperty(exports, "aggregationIntervalSchema", {
	enumerable: true,
	get: function() {
		return aggregationIntervalSchema;
	}
});
Object.defineProperty(exports, "aggregationTypeSchema", {
	enumerable: true,
	get: function() {
		return aggregationTypeSchema;
	}
});
Object.defineProperty(exports, "batchCreateFeedbackArgsSchema", {
	enumerable: true,
	get: function() {
		return batchCreateFeedbackArgsSchema;
	}
});
Object.defineProperty(exports, "batchCreateLogsArgsSchema", {
	enumerable: true,
	get: function() {
		return batchCreateLogsArgsSchema;
	}
});
Object.defineProperty(exports, "batchCreateMetricsArgsSchema", {
	enumerable: true,
	get: function() {
		return batchCreateMetricsArgsSchema;
	}
});
Object.defineProperty(exports, "batchCreateScoresArgsSchema", {
	enumerable: true,
	get: function() {
		return batchCreateScoresArgsSchema;
	}
});
Object.defineProperty(exports, "commonFilterFields", {
	enumerable: true,
	get: function() {
		return commonFilterFields;
	}
});
Object.defineProperty(exports, "comparePeriodSchema", {
	enumerable: true,
	get: function() {
		return comparePeriodSchema;
	}
});
Object.defineProperty(exports, "contextFields", {
	enumerable: true,
	get: function() {
		return contextFields;
	}
});
Object.defineProperty(exports, "createFeedbackArgsSchema", {
	enumerable: true,
	get: function() {
		return createFeedbackArgsSchema;
	}
});
Object.defineProperty(exports, "createFeedbackBodySchema", {
	enumerable: true,
	get: function() {
		return createFeedbackBodySchema;
	}
});
Object.defineProperty(exports, "createFeedbackRecordSchema", {
	enumerable: true,
	get: function() {
		return createFeedbackRecordSchema;
	}
});
Object.defineProperty(exports, "createFeedbackResponseSchema", {
	enumerable: true,
	get: function() {
		return createFeedbackResponseSchema;
	}
});
Object.defineProperty(exports, "createLogRecordSchema", {
	enumerable: true,
	get: function() {
		return createLogRecordSchema;
	}
});
Object.defineProperty(exports, "createMetricRecordSchema", {
	enumerable: true,
	get: function() {
		return createMetricRecordSchema;
	}
});
Object.defineProperty(exports, "createScoreArgsSchema", {
	enumerable: true,
	get: function() {
		return createScoreArgsSchema;
	}
});
Object.defineProperty(exports, "createScoreBodySchema", {
	enumerable: true,
	get: function() {
		return createScoreBodySchema;
	}
});
Object.defineProperty(exports, "createScoreRecordSchema", {
	enumerable: true,
	get: function() {
		return createScoreRecordSchema;
	}
});
Object.defineProperty(exports, "createScoreResponseSchema", {
	enumerable: true,
	get: function() {
		return createScoreResponseSchema;
	}
});
Object.defineProperty(exports, "createdAtField", {
	enumerable: true,
	get: function() {
		return createdAtField;
	}
});
Object.defineProperty(exports, "dateRangeSchema", {
	enumerable: true,
	get: function() {
		return dateRangeSchema;
	}
});
Object.defineProperty(exports, "dbTimestamps", {
	enumerable: true,
	get: function() {
		return dbTimestamps;
	}
});
Object.defineProperty(exports, "defaultDeltaLimit", {
	enumerable: true,
	get: function() {
		return defaultDeltaLimit;
	}
});
Object.defineProperty(exports, "defaultPaginationArgs", {
	enumerable: true,
	get: function() {
		return defaultPaginationArgs;
	}
});
Object.defineProperty(exports, "deleteFeedbackArgsSchema", {
	enumerable: true,
	get: function() {
		return deleteFeedbackArgsSchema;
	}
});
Object.defineProperty(exports, "deleteFeedbackResponseSchema", {
	enumerable: true,
	get: function() {
		return deleteFeedbackResponseSchema;
	}
});
Object.defineProperty(exports, "deleteScoresArgsSchema", {
	enumerable: true,
	get: function() {
		return deleteScoresArgsSchema;
	}
});
Object.defineProperty(exports, "deleteScoresResponseSchema", {
	enumerable: true,
	get: function() {
		return deleteScoresResponseSchema;
	}
});
Object.defineProperty(exports, "deltaCursorSchema", {
	enumerable: true,
	get: function() {
		return deltaCursorSchema;
	}
});
Object.defineProperty(exports, "deltaInfoSchema", {
	enumerable: true,
	get: function() {
		return deltaInfoSchema;
	}
});
Object.defineProperty(exports, "deltaLimitSchema", {
	enumerable: true,
	get: function() {
		return deltaLimitSchema;
	}
});
Object.defineProperty(exports, "distinctColumnSchema", {
	enumerable: true,
	get: function() {
		return distinctColumnSchema;
	}
});
Object.defineProperty(exports, "entityIdField", {
	enumerable: true,
	get: function() {
		return entityIdField;
	}
});
Object.defineProperty(exports, "entityNameField", {
	enumerable: true,
	get: function() {
		return entityNameField;
	}
});
Object.defineProperty(exports, "entityTypeField", {
	enumerable: true,
	get: function() {
		return entityTypeField;
	}
});
Object.defineProperty(exports, "environmentField", {
	enumerable: true,
	get: function() {
		return environmentField;
	}
});
Object.defineProperty(exports, "executionSourceField", {
	enumerable: true,
	get: function() {
		return executionSourceField;
	}
});
Object.defineProperty(exports, "experimentIdField", {
	enumerable: true,
	get: function() {
		return experimentIdField;
	}
});
Object.defineProperty(exports, "feedbackFilterSchema", {
	enumerable: true,
	get: function() {
		return feedbackFilterSchema;
	}
});
Object.defineProperty(exports, "feedbackInputSchema", {
	enumerable: true,
	get: function() {
		return feedbackInputSchema;
	}
});
Object.defineProperty(exports, "feedbackOrderByFieldSchema", {
	enumerable: true,
	get: function() {
		return feedbackOrderByFieldSchema;
	}
});
Object.defineProperty(exports, "feedbackOrderBySchema", {
	enumerable: true,
	get: function() {
		return feedbackOrderBySchema;
	}
});
Object.defineProperty(exports, "feedbackRecordSchema", {
	enumerable: true,
	get: function() {
		return feedbackRecordSchema;
	}
});
Object.defineProperty(exports, "feedbackReviewStatusSchema", {
	enumerable: true,
	get: function() {
		return feedbackReviewStatusSchema;
	}
});
Object.defineProperty(exports, "getEntityNamesArgsSchema", {
	enumerable: true,
	get: function() {
		return getEntityNamesArgsSchema;
	}
});
Object.defineProperty(exports, "getEntityNamesResponseSchema", {
	enumerable: true,
	get: function() {
		return getEntityNamesResponseSchema;
	}
});
Object.defineProperty(exports, "getEntityTypesArgsSchema", {
	enumerable: true,
	get: function() {
		return getEntityTypesArgsSchema;
	}
});
Object.defineProperty(exports, "getEntityTypesResponseSchema", {
	enumerable: true,
	get: function() {
		return getEntityTypesResponseSchema;
	}
});
Object.defineProperty(exports, "getEnvironmentsArgsSchema", {
	enumerable: true,
	get: function() {
		return getEnvironmentsArgsSchema;
	}
});
Object.defineProperty(exports, "getEnvironmentsResponseSchema", {
	enumerable: true,
	get: function() {
		return getEnvironmentsResponseSchema;
	}
});
Object.defineProperty(exports, "getFeedbackAggregateArgsSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackAggregateArgsSchema;
	}
});
Object.defineProperty(exports, "getFeedbackAggregateResponseSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackAggregateResponseSchema;
	}
});
Object.defineProperty(exports, "getFeedbackBreakdownArgsSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackBreakdownArgsSchema;
	}
});
Object.defineProperty(exports, "getFeedbackBreakdownResponseSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackBreakdownResponseSchema;
	}
});
Object.defineProperty(exports, "getFeedbackPercentilesArgsSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackPercentilesArgsSchema;
	}
});
Object.defineProperty(exports, "getFeedbackPercentilesResponseSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackPercentilesResponseSchema;
	}
});
Object.defineProperty(exports, "getFeedbackTimeSeriesArgsSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackTimeSeriesArgsSchema;
	}
});
Object.defineProperty(exports, "getFeedbackTimeSeriesResponseSchema", {
	enumerable: true,
	get: function() {
		return getFeedbackTimeSeriesResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricAggregateArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricAggregateArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricAggregateResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricAggregateResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricBreakdownArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricBreakdownArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricBreakdownResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricBreakdownResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricLabelKeysArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricLabelKeysArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricLabelKeysResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricLabelKeysResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricLabelValuesArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricLabelValuesArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricLabelValuesResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricLabelValuesResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricNamesArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricNamesArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricNamesResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricNamesResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricPercentilesArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricPercentilesArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricPercentilesResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricPercentilesResponseSchema;
	}
});
Object.defineProperty(exports, "getMetricTimeSeriesArgsSchema", {
	enumerable: true,
	get: function() {
		return getMetricTimeSeriesArgsSchema;
	}
});
Object.defineProperty(exports, "getMetricTimeSeriesResponseSchema", {
	enumerable: true,
	get: function() {
		return getMetricTimeSeriesResponseSchema;
	}
});
Object.defineProperty(exports, "getScoreAggregateArgsSchema", {
	enumerable: true,
	get: function() {
		return getScoreAggregateArgsSchema;
	}
});
Object.defineProperty(exports, "getScoreAggregateResponseSchema", {
	enumerable: true,
	get: function() {
		return getScoreAggregateResponseSchema;
	}
});
Object.defineProperty(exports, "getScoreBreakdownArgsSchema", {
	enumerable: true,
	get: function() {
		return getScoreBreakdownArgsSchema;
	}
});
Object.defineProperty(exports, "getScoreBreakdownResponseSchema", {
	enumerable: true,
	get: function() {
		return getScoreBreakdownResponseSchema;
	}
});
Object.defineProperty(exports, "getScorePercentilesArgsSchema", {
	enumerable: true,
	get: function() {
		return getScorePercentilesArgsSchema;
	}
});
Object.defineProperty(exports, "getScorePercentilesResponseSchema", {
	enumerable: true,
	get: function() {
		return getScorePercentilesResponseSchema;
	}
});
Object.defineProperty(exports, "getScoreTimeSeriesArgsSchema", {
	enumerable: true,
	get: function() {
		return getScoreTimeSeriesArgsSchema;
	}
});
Object.defineProperty(exports, "getScoreTimeSeriesResponseSchema", {
	enumerable: true,
	get: function() {
		return getScoreTimeSeriesResponseSchema;
	}
});
Object.defineProperty(exports, "getServiceNamesArgsSchema", {
	enumerable: true,
	get: function() {
		return getServiceNamesArgsSchema;
	}
});
Object.defineProperty(exports, "getServiceNamesResponseSchema", {
	enumerable: true,
	get: function() {
		return getServiceNamesResponseSchema;
	}
});
Object.defineProperty(exports, "getTagsArgsSchema", {
	enumerable: true,
	get: function() {
		return getTagsArgsSchema;
	}
});
Object.defineProperty(exports, "getTagsResponseSchema", {
	enumerable: true,
	get: function() {
		return getTagsResponseSchema;
	}
});
Object.defineProperty(exports, "listFeedbackArgsSchema", {
	enumerable: true,
	get: function() {
		return listFeedbackArgsSchema;
	}
});
Object.defineProperty(exports, "listFeedbackResponseSchema", {
	enumerable: true,
	get: function() {
		return listFeedbackResponseSchema;
	}
});
Object.defineProperty(exports, "listLogsArgsSchema", {
	enumerable: true,
	get: function() {
		return listLogsArgsSchema;
	}
});
Object.defineProperty(exports, "listLogsResponseSchema", {
	enumerable: true,
	get: function() {
		return listLogsResponseSchema;
	}
});
Object.defineProperty(exports, "listMetricsArgsSchema", {
	enumerable: true,
	get: function() {
		return listMetricsArgsSchema;
	}
});
Object.defineProperty(exports, "listMetricsResponseSchema", {
	enumerable: true,
	get: function() {
		return listMetricsResponseSchema;
	}
});
Object.defineProperty(exports, "listModeSchema", {
	enumerable: true,
	get: function() {
		return listModeSchema;
	}
});
Object.defineProperty(exports, "listScoresArgsSchema", {
	enumerable: true,
	get: function() {
		return listScoresArgsSchema;
	}
});
Object.defineProperty(exports, "listScoresResponseSchema", {
	enumerable: true,
	get: function() {
		return listScoresResponseSchema;
	}
});
Object.defineProperty(exports, "logLevelSchema", {
	enumerable: true,
	get: function() {
		return logLevelSchema;
	}
});
Object.defineProperty(exports, "logRecordInputSchema", {
	enumerable: true,
	get: function() {
		return logRecordInputSchema;
	}
});
Object.defineProperty(exports, "logRecordSchema", {
	enumerable: true,
	get: function() {
		return logRecordSchema;
	}
});
Object.defineProperty(exports, "logsFilterSchema", {
	enumerable: true,
	get: function() {
		return logsFilterSchema;
	}
});
Object.defineProperty(exports, "logsOrderByFieldSchema", {
	enumerable: true,
	get: function() {
		return logsOrderByFieldSchema;
	}
});
Object.defineProperty(exports, "logsOrderBySchema", {
	enumerable: true,
	get: function() {
		return logsOrderBySchema;
	}
});
Object.defineProperty(exports, "metadataField", {
	enumerable: true,
	get: function() {
		return metadataField;
	}
});
Object.defineProperty(exports, "metricInputSchema", {
	enumerable: true,
	get: function() {
		return metricInputSchema;
	}
});
Object.defineProperty(exports, "metricRecordSchema", {
	enumerable: true,
	get: function() {
		return metricRecordSchema;
	}
});
Object.defineProperty(exports, "metricTypeSchema", {
	enumerable: true,
	get: function() {
		return metricTypeSchema;
	}
});
Object.defineProperty(exports, "metricsAggregationSchema", {
	enumerable: true,
	get: function() {
		return metricsAggregationSchema;
	}
});
Object.defineProperty(exports, "metricsFilterSchema", {
	enumerable: true,
	get: function() {
		return metricsFilterSchema;
	}
});
Object.defineProperty(exports, "metricsOrderByFieldSchema", {
	enumerable: true,
	get: function() {
		return metricsOrderByFieldSchema;
	}
});
Object.defineProperty(exports, "metricsOrderBySchema", {
	enumerable: true,
	get: function() {
		return metricsOrderBySchema;
	}
});
Object.defineProperty(exports, "normalizeObservabilityListArgs", {
	enumerable: true,
	get: function() {
		return normalizeObservabilityListArgs;
	}
});
Object.defineProperty(exports, "organizationIdField", {
	enumerable: true,
	get: function() {
		return organizationIdField;
	}
});
Object.defineProperty(exports, "paginationArgsSchema", {
	enumerable: true,
	get: function() {
		return paginationArgsSchema;
	}
});
Object.defineProperty(exports, "paginationInfoSchema", {
	enumerable: true,
	get: function() {
		return paginationInfoSchema;
	}
});
Object.defineProperty(exports, "parentEntityIdField", {
	enumerable: true,
	get: function() {
		return parentEntityIdField;
	}
});
Object.defineProperty(exports, "parentEntityNameField", {
	enumerable: true,
	get: function() {
		return parentEntityNameField;
	}
});
Object.defineProperty(exports, "parentEntityTypeField", {
	enumerable: true,
	get: function() {
		return parentEntityTypeField;
	}
});
Object.defineProperty(exports, "refineObservabilityListMode", {
	enumerable: true,
	get: function() {
		return refineObservabilityListMode;
	}
});
Object.defineProperty(exports, "replaceFeedbackBodySchema", {
	enumerable: true,
	get: function() {
		return replaceFeedbackBodySchema;
	}
});
Object.defineProperty(exports, "requestIdField", {
	enumerable: true,
	get: function() {
		return requestIdField;
	}
});
Object.defineProperty(exports, "requireDistinctColumnRefinement", {
	enumerable: true,
	get: function() {
		return requireDistinctColumnRefinement;
	}
});
Object.defineProperty(exports, "resourceIdField", {
	enumerable: true,
	get: function() {
		return resourceIdField;
	}
});
Object.defineProperty(exports, "rootEntityIdField", {
	enumerable: true,
	get: function() {
		return rootEntityIdField;
	}
});
Object.defineProperty(exports, "rootEntityNameField", {
	enumerable: true,
	get: function() {
		return rootEntityNameField;
	}
});
Object.defineProperty(exports, "rootEntityTypeField", {
	enumerable: true,
	get: function() {
		return rootEntityTypeField;
	}
});
Object.defineProperty(exports, "runIdField", {
	enumerable: true,
	get: function() {
		return runIdField;
	}
});
Object.defineProperty(exports, "scopeField", {
	enumerable: true,
	get: function() {
		return scopeField;
	}
});
Object.defineProperty(exports, "scoreInputSchema", {
	enumerable: true,
	get: function() {
		return scoreInputSchema;
	}
});
Object.defineProperty(exports, "scoreRecordSchema", {
	enumerable: true,
	get: function() {
		return scoreRecordSchema;
	}
});
Object.defineProperty(exports, "scoresFilterSchema", {
	enumerable: true,
	get: function() {
		return scoresFilterSchema;
	}
});
Object.defineProperty(exports, "scoresOrderByFieldSchema", {
	enumerable: true,
	get: function() {
		return scoresOrderByFieldSchema;
	}
});
Object.defineProperty(exports, "scoresOrderBySchema", {
	enumerable: true,
	get: function() {
		return scoresOrderBySchema;
	}
});
Object.defineProperty(exports, "serviceNameField", {
	enumerable: true,
	get: function() {
		return serviceNameField;
	}
});
Object.defineProperty(exports, "sessionIdField", {
	enumerable: true,
	get: function() {
		return sessionIdField;
	}
});
Object.defineProperty(exports, "sortDirectionSchema", {
	enumerable: true,
	get: function() {
		return sortDirectionSchema;
	}
});
Object.defineProperty(exports, "sourceField", {
	enumerable: true,
	get: function() {
		return sourceField;
	}
});
Object.defineProperty(exports, "spanContextFields", {
	enumerable: true,
	get: function() {
		return spanContextFields;
	}
});
Object.defineProperty(exports, "spanIdField", {
	enumerable: true,
	get: function() {
		return spanIdField;
	}
});
Object.defineProperty(exports, "tagsField", {
	enumerable: true,
	get: function() {
		return tagsField;
	}
});
Object.defineProperty(exports, "threadIdField", {
	enumerable: true,
	get: function() {
		return threadIdField;
	}
});
Object.defineProperty(exports, "traceIdField", {
	enumerable: true,
	get: function() {
		return traceIdField;
	}
});
Object.defineProperty(exports, "updateFeedbackReviewStatusArgsSchema", {
	enumerable: true,
	get: function() {
		return updateFeedbackReviewStatusArgsSchema;
	}
});
Object.defineProperty(exports, "updatedAtField", {
	enumerable: true,
	get: function() {
		return updatedAtField;
	}
});
Object.defineProperty(exports, "userIdField", {
	enumerable: true,
	get: function() {
		return userIdField;
	}
});

//# sourceMappingURL=storage-CfG0I2aF.cjs.map