@mastra/server 1.18.0-alpha.3 → 1.18.0-alpha.5
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.
- package/CHANGELOG.md +31 -0
- package/dist/_types/@internal_core/dist/index.d.ts +1078 -256
- package/dist/{chunk-Z36FXNDQ.cjs → chunk-2QCTUEHS.cjs} +71 -67
- package/dist/chunk-2QCTUEHS.cjs.map +1 -0
- package/dist/{chunk-JL6JURL5.js → chunk-4WCXXTKX.js} +3 -3
- package/dist/{chunk-JL6JURL5.js.map → chunk-4WCXXTKX.js.map} +1 -1
- package/dist/{chunk-RSIZIEPW.js → chunk-53YFG5AY.js} +58 -2
- package/dist/chunk-53YFG5AY.js.map +1 -0
- package/dist/{chunk-6MYRF6QR.js → chunk-5YMAXL54.js} +11 -7
- package/dist/chunk-5YMAXL54.js.map +1 -0
- package/dist/{chunk-WIQDQTKG.cjs → chunk-6FF7Q5D7.cjs} +6 -6
- package/dist/{chunk-WIQDQTKG.cjs.map → chunk-6FF7Q5D7.cjs.map} +1 -1
- package/dist/{chunk-YKS5HCGB.js → chunk-B32EWUTE.js} +81 -25
- package/dist/chunk-B32EWUTE.js.map +1 -0
- package/dist/{chunk-ATZ7V3XS.js → chunk-B5FSBQV5.js} +3 -3
- package/dist/{chunk-ATZ7V3XS.js.map → chunk-B5FSBQV5.js.map} +1 -1
- package/dist/{chunk-6H7FQ4CY.cjs → chunk-CHQVMEZ3.cjs} +7 -4
- package/dist/chunk-CHQVMEZ3.cjs.map +1 -0
- package/dist/{chunk-4Q2QV27C.js → chunk-CMTOQQZD.js} +7 -4
- package/dist/chunk-CMTOQQZD.js.map +1 -0
- package/dist/{chunk-ZKXIAID6.js → chunk-FWNRIUEW.js} +3 -3
- package/dist/{chunk-ZKXIAID6.js.map → chunk-FWNRIUEW.js.map} +1 -1
- package/dist/{chunk-SCHPGBMK.js → chunk-GCHFLKRG.js} +22 -16
- package/dist/chunk-GCHFLKRG.js.map +1 -0
- package/dist/{chunk-4G5KVXN6.cjs → chunk-HSCQPKAF.cjs} +23 -17
- package/dist/chunk-HSCQPKAF.cjs.map +1 -0
- package/dist/{chunk-3BRCE7JC.cjs → chunk-KOKKZIYI.cjs} +4 -4
- package/dist/{chunk-3BRCE7JC.cjs.map → chunk-KOKKZIYI.cjs.map} +1 -1
- package/dist/{chunk-FPEX6KOJ.cjs → chunk-MUNMS4IN.cjs} +81 -24
- package/dist/chunk-MUNMS4IN.cjs.map +1 -0
- package/dist/{chunk-K7S4XDX6.js → chunk-MYFV2L3T.js} +12 -4
- package/dist/{chunk-K7S4XDX6.js.map → chunk-MYFV2L3T.js.map} +1 -1
- package/dist/{chunk-PTTPRMT3.cjs → chunk-OSMI5XLT.cjs} +393 -105
- package/dist/chunk-OSMI5XLT.cjs.map +1 -0
- package/dist/{chunk-2UVJD67W.cjs → chunk-TU7U5XUE.cjs} +58 -2
- package/dist/chunk-TU7U5XUE.cjs.map +1 -0
- package/dist/{chunk-YEYWCSMW.cjs → chunk-U6YSBD3M.cjs} +6 -6
- package/dist/{chunk-YEYWCSMW.cjs.map → chunk-U6YSBD3M.cjs.map} +1 -1
- package/dist/{chunk-CL24HN6K.cjs → chunk-XINNAPVH.cjs} +34 -26
- package/dist/chunk-XINNAPVH.cjs.map +1 -0
- package/dist/{chunk-AHOZXQZ5.js → chunk-YFQ5JIUD.js} +352 -72
- package/dist/chunk-YFQ5JIUD.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/handlers/a2a.cjs +9 -9
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agents.cjs +37 -33
- package/dist/server/handlers/agents.d.ts +3 -0
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/datasets.cjs +26 -26
- package/dist/server/handlers/datasets.d.ts +12 -0
- package/dist/server/handlers/datasets.d.ts.map +1 -1
- package/dist/server/handlers/datasets.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +51 -19
- package/dist/server/handlers/observability-new-endpoints.d.ts +2446 -534
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.js +1 -1
- package/dist/server/handlers/observability-shared.cjs +5 -5
- package/dist/server/handlers/observability-shared.d.ts +56 -0
- package/dist/server/handlers/observability-shared.d.ts.map +1 -1
- package/dist/server/handlers/observability-shared.js +1 -1
- package/dist/server/handlers/observability.cjs +56 -24
- package/dist/server/handlers/observability.d.ts +4 -4
- package/dist/server/handlers/observability.js +2 -2
- package/dist/server/handlers/scores.cjs +7 -7
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.d.ts.map +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -8
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers.cjs +12 -12
- package/dist/server/handlers.js +6 -6
- package/dist/server/schemas/datasets.d.ts +4 -0
- package/dist/server/schemas/datasets.d.ts.map +1 -1
- package/dist/server/schemas/index.cjs +42 -42
- package/dist/server/schemas/index.js +1 -1
- package/dist/server/server-adapter/index.cjs +97 -97
- package/dist/server/server-adapter/index.js +8 -8
- package/dist/server/server-adapter/routes/datasets.d.ts +12 -0
- package/dist/server/server-adapter/routes/datasets.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/observability.d.ts +307 -121
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-2UVJD67W.cjs.map +0 -1
- package/dist/chunk-4G5KVXN6.cjs.map +0 -1
- package/dist/chunk-4Q2QV27C.js.map +0 -1
- package/dist/chunk-6H7FQ4CY.cjs.map +0 -1
- package/dist/chunk-6MYRF6QR.js.map +0 -1
- package/dist/chunk-AHOZXQZ5.js.map +0 -1
- package/dist/chunk-CL24HN6K.cjs.map +0 -1
- package/dist/chunk-FPEX6KOJ.cjs.map +0 -1
- package/dist/chunk-PTTPRMT3.cjs.map +0 -1
- package/dist/chunk-RSIZIEPW.js.map +0 -1
- package/dist/chunk-SCHPGBMK.js.map +0 -1
- package/dist/chunk-YKS5HCGB.js.map +0 -1
- package/dist/chunk-Z36FXNDQ.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NEW_ROUTE_DEFS, getObservabilityStore } from './chunk-
|
|
1
|
+
import { NEW_ROUTE_DEFS, getObservabilityStore } from './chunk-53YFG5AY.js';
|
|
2
2
|
import { handleError } from './chunk-P23KBWKB.js';
|
|
3
3
|
import { wrapSchemaForQueryParams, createRoute, pickParams } from './chunk-NMS2SC2B.js';
|
|
4
4
|
import { HTTPException } from './chunk-6QWQZI4Q.js';
|
|
@@ -39,6 +39,21 @@ var dateRangeSchema = z.object({
|
|
|
39
39
|
endExclusive: z.boolean().optional().describe("When true, excludes the end date from results (uses < instead of <=)")
|
|
40
40
|
}).describe("Date range filter for timestamps");
|
|
41
41
|
var sortDirectionSchema = z.enum(["ASC", "DESC"]).describe("Sort direction: 'ASC' | 'DESC'");
|
|
42
|
+
var aggregationTypeSchema = z.enum(["sum", "avg", "min", "max", "count", "last"]).describe("Aggregation function");
|
|
43
|
+
var aggregationIntervalSchema = z.enum(["1m", "5m", "15m", "1h", "1d"]).describe("Time bucket interval");
|
|
44
|
+
var comparePeriodSchema = z.enum(["previous_period", "previous_day", "previous_week"]).describe("Comparison period for aggregate queries");
|
|
45
|
+
var groupBySchema = z.array(z.string()).min(1).describe("Fields to group by");
|
|
46
|
+
var percentilesSchema = z.array(z.number().min(0).max(1)).min(1).describe("Percentile values (0-1)");
|
|
47
|
+
var aggregateResponseFields = {
|
|
48
|
+
value: z.number().nullable().describe("Aggregated value"),
|
|
49
|
+
previousValue: z.number().nullable().optional().describe("Value from comparison period"),
|
|
50
|
+
changePercent: z.number().nullable().optional().describe("Percentage change from comparison period")
|
|
51
|
+
};
|
|
52
|
+
var dimensionsField = z.record(z.string(), z.string().nullable()).describe("Dimension values for this group");
|
|
53
|
+
var aggregatedValueField = z.number().describe("Aggregated value");
|
|
54
|
+
var bucketTimestampField = z.date().describe("Bucket timestamp");
|
|
55
|
+
var percentileField = z.number().describe("Percentile value");
|
|
56
|
+
var percentileBucketValueField = z.number().describe("Percentile value at this bucket");
|
|
42
57
|
var entityTypeField = z.nativeEnum(EntityType).describe(`Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')`);
|
|
43
58
|
var entityIdField = z.string().describe('ID of the entity (e.g., "weatherAgent", "orderWorkflow")');
|
|
44
59
|
var entityNameField = z.string().describe("Name of the entity");
|
|
@@ -51,6 +66,7 @@ var threadIdField = z.string().describe("Conversation thread identifier");
|
|
|
51
66
|
var requestIdField = z.string().describe("HTTP request ID for log correlation");
|
|
52
67
|
var environmentField = z.string().describe(`Environment (e.g., "production" | "staging" | "development")`);
|
|
53
68
|
var sourceField = z.string().describe(`Source of execution (e.g., "local" | "cloud" | "ci")`);
|
|
69
|
+
var executionSourceField = z.string().describe(`Source of execution (e.g., "local" | "cloud" | "ci")`);
|
|
54
70
|
var serviceNameField = z.string().describe("Name of the service");
|
|
55
71
|
var parentEntityTypeField = z.nativeEnum(EntityType).describe("Entity type of the parent entity");
|
|
56
72
|
var parentEntityIdField = z.string().describe("ID of the parent entity");
|
|
@@ -62,7 +78,7 @@ var experimentIdField = z.string().describe("Experiment or eval run identifier")
|
|
|
62
78
|
var scopeField = z.record(z.string(), z.unknown()).describe('Arbitrary package/app version info (e.g., {"core": "1.0.0", "memory": "1.0.0", "gitSha": "abcd1234"})');
|
|
63
79
|
var metadataField = z.record(z.string(), z.unknown()).describe("User-defined metadata for custom filtering");
|
|
64
80
|
var tagsField = z.array(z.string()).describe("Labels for filtering");
|
|
65
|
-
var
|
|
81
|
+
var contextFieldsBase = {
|
|
66
82
|
// Entity identification
|
|
67
83
|
entityType: entityTypeField.nullish(),
|
|
68
84
|
entityId: entityIdField.nullish(),
|
|
@@ -86,12 +102,19 @@ var contextFields = {
|
|
|
86
102
|
requestId: requestIdField.nullish(),
|
|
87
103
|
// Deployment context
|
|
88
104
|
environment: environmentField.nullish(),
|
|
89
|
-
source: sourceField.nullish(),
|
|
90
105
|
serviceName: serviceNameField.nullish(),
|
|
91
106
|
scope: scopeField.nullish(),
|
|
92
107
|
// Experimentation
|
|
93
108
|
experimentId: experimentIdField.nullish()
|
|
94
109
|
};
|
|
110
|
+
var contextFields = {
|
|
111
|
+
...contextFieldsBase,
|
|
112
|
+
executionSource: executionSourceField.nullish(),
|
|
113
|
+
tags: tagsField.nullish()
|
|
114
|
+
};
|
|
115
|
+
({
|
|
116
|
+
source: sourceField.nullish()
|
|
117
|
+
});
|
|
95
118
|
var commonFilterFields = {
|
|
96
119
|
timestamp: dateRangeSchema.optional().describe("Filter by timestamp range"),
|
|
97
120
|
traceId: z.string().optional().describe("Filter by trace ID"),
|
|
@@ -102,9 +125,7 @@ var commonFilterFields = {
|
|
|
102
125
|
organizationId: organizationIdField.optional(),
|
|
103
126
|
experimentId: experimentIdField.optional(),
|
|
104
127
|
serviceName: serviceNameField.optional(),
|
|
105
|
-
environment: environmentField.optional()
|
|
106
|
-
};
|
|
107
|
-
var observabilitySignalFilterFields = {
|
|
128
|
+
environment: environmentField.optional(),
|
|
108
129
|
parentEntityType: parentEntityTypeField.optional(),
|
|
109
130
|
parentEntityName: parentEntityNameField.optional(),
|
|
110
131
|
rootEntityType: rootEntityTypeField.optional(),
|
|
@@ -114,7 +135,7 @@ var observabilitySignalFilterFields = {
|
|
|
114
135
|
sessionId: sessionIdField.optional(),
|
|
115
136
|
threadId: threadIdField.optional(),
|
|
116
137
|
requestId: requestIdField.optional(),
|
|
117
|
-
|
|
138
|
+
executionSource: executionSourceField.optional(),
|
|
118
139
|
tags: z.array(z.string()).optional().describe("Filter by tags (must have all specified tags)")
|
|
119
140
|
};
|
|
120
141
|
var traceIdField = z.string().describe("Unique trace identifier");
|
|
@@ -130,10 +151,12 @@ var logRecordSchema = z.object({
|
|
|
130
151
|
// Correlation
|
|
131
152
|
traceId: traceIdField.nullish(),
|
|
132
153
|
spanId: spanIdField.nullish(),
|
|
133
|
-
// Context fields
|
|
154
|
+
// Context fields
|
|
134
155
|
...contextFields,
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated Use `executionSource` instead.
|
|
158
|
+
*/
|
|
159
|
+
source: z.string().nullish().describe("Execution source"),
|
|
137
160
|
metadata: metadataField.nullish()
|
|
138
161
|
}).describe("Log record as stored in the database");
|
|
139
162
|
z.object({
|
|
@@ -148,8 +171,11 @@ z.object({
|
|
|
148
171
|
}).describe("Arguments for batch creating logs");
|
|
149
172
|
var logsFilterSchema = z.object({
|
|
150
173
|
...commonFilterFields,
|
|
151
|
-
...observabilitySignalFilterFields,
|
|
152
174
|
// Log-specific filters
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated Use `executionSource` instead.
|
|
177
|
+
*/
|
|
178
|
+
source: z.string().optional().describe("Filter by execution source"),
|
|
153
179
|
level: z.union([logLevelSchema, z.array(logLevelSchema)]).optional().describe("Filter by log level(s)")
|
|
154
180
|
}).describe("Filters for querying logs");
|
|
155
181
|
var logsOrderByFieldSchema = z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
|
|
@@ -168,7 +194,7 @@ var listLogsResponseSchema = z.object({
|
|
|
168
194
|
});
|
|
169
195
|
var scorerIdField = z.string().describe("Identifier of the scorer (e.g., relevance, accuracy)");
|
|
170
196
|
var scorerVersionField = z.string().describe("Version of the scorer");
|
|
171
|
-
var
|
|
197
|
+
var scoreSourceField = z.string().describe("Source of the score (e.g., manual, automated, experiment)");
|
|
172
198
|
var scoreValueField = z.number().describe("Score value (range defined by scorer)");
|
|
173
199
|
var scoreReasonField = z.string().describe("Explanation for the score");
|
|
174
200
|
var scoreRecordSchema = z.object({
|
|
@@ -179,10 +205,15 @@ var scoreRecordSchema = z.object({
|
|
|
179
205
|
// Score data
|
|
180
206
|
scorerId: scorerIdField,
|
|
181
207
|
scorerVersion: scorerVersionField.nullish(),
|
|
182
|
-
|
|
208
|
+
scoreSource: scoreSourceField.nullish(),
|
|
209
|
+
/**
|
|
210
|
+
* @deprecated Use `scoreSource` instead.
|
|
211
|
+
*/
|
|
212
|
+
source: scoreSourceField.nullish(),
|
|
183
213
|
score: scoreValueField,
|
|
184
214
|
reason: scoreReasonField.nullish(),
|
|
185
|
-
|
|
215
|
+
// Context (entity hierarchy, identity, correlation, deployment, experimentation)
|
|
216
|
+
...contextFields,
|
|
186
217
|
/** Trace ID of the scoring run (links to trace that generated this score) */
|
|
187
218
|
scoreTraceId: z.string().nullish().describe("Trace ID of the scoring run for debugging score generation"),
|
|
188
219
|
// User-defined metadata (context fields stored here)
|
|
@@ -191,7 +222,11 @@ var scoreRecordSchema = z.object({
|
|
|
191
222
|
z.object({
|
|
192
223
|
scorerId: scorerIdField,
|
|
193
224
|
scorerVersion: scorerVersionField.optional(),
|
|
194
|
-
|
|
225
|
+
scoreSource: scoreSourceField.optional(),
|
|
226
|
+
/**
|
|
227
|
+
* @deprecated Use `scoreSource` instead.
|
|
228
|
+
*/
|
|
229
|
+
source: scoreSourceField.optional(),
|
|
195
230
|
score: scoreValueField,
|
|
196
231
|
reason: scoreReasonField.optional(),
|
|
197
232
|
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional scorer-specific metadata"),
|
|
@@ -212,7 +247,12 @@ z.object({
|
|
|
212
247
|
var scoresFilterSchema = z.object({
|
|
213
248
|
...commonFilterFields,
|
|
214
249
|
// Score-specific filters
|
|
215
|
-
scorerId: z.union([z.string(), z.array(z.string())]).optional().describe("Filter by scorer ID(s)")
|
|
250
|
+
scorerId: z.union([z.string(), z.array(z.string())]).optional().describe("Filter by scorer ID(s)"),
|
|
251
|
+
scoreSource: scoreSourceField.optional().describe("Filter by score source"),
|
|
252
|
+
/**
|
|
253
|
+
* @deprecated Use `scoreSource` instead.
|
|
254
|
+
*/
|
|
255
|
+
source: scoreSourceField.optional().describe("Filter by score source")
|
|
216
256
|
}).describe("Filters for querying scores");
|
|
217
257
|
var scoresOrderByFieldSchema = z.enum(["timestamp", "score"]).describe("Field to order by: 'timestamp' | 'score'");
|
|
218
258
|
var scoresOrderBySchema = z.object({
|
|
@@ -220,7 +260,7 @@ var scoresOrderBySchema = z.object({
|
|
|
220
260
|
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
221
261
|
}).describe("Order by configuration");
|
|
222
262
|
z.object({
|
|
223
|
-
filters: scoresFilterSchema.optional()
|
|
263
|
+
filters: scoresFilterSchema.optional(),
|
|
224
264
|
pagination: paginationArgsSchema.default({ page: 0, perPage: 10 }).describe("Pagination settings"),
|
|
225
265
|
orderBy: scoresOrderBySchema.default({ field: "timestamp", direction: "DESC" }).describe("Ordering configuration (defaults to timestamp desc)")
|
|
226
266
|
}).describe("Arguments for listing scores");
|
|
@@ -228,62 +268,158 @@ var listScoresResponseSchema = z.object({
|
|
|
228
268
|
pagination: paginationInfoSchema,
|
|
229
269
|
scores: z.array(scoreRecordSchema)
|
|
230
270
|
});
|
|
271
|
+
var getScoreAggregateArgsSchema = z.object({
|
|
272
|
+
scorerId: scorerIdField,
|
|
273
|
+
scoreSource: scoreSourceField.optional(),
|
|
274
|
+
aggregation: aggregationTypeSchema,
|
|
275
|
+
filters: scoresFilterSchema.optional(),
|
|
276
|
+
comparePeriod: comparePeriodSchema.optional()
|
|
277
|
+
}).describe("Arguments for getting a score aggregate");
|
|
278
|
+
var getScoreAggregateResponseSchema = z.object(aggregateResponseFields);
|
|
279
|
+
var getScoreBreakdownArgsSchema = z.object({
|
|
280
|
+
scorerId: scorerIdField,
|
|
281
|
+
scoreSource: scoreSourceField.optional(),
|
|
282
|
+
groupBy: groupBySchema,
|
|
283
|
+
aggregation: aggregationTypeSchema,
|
|
284
|
+
filters: scoresFilterSchema.optional()
|
|
285
|
+
}).describe("Arguments for getting a score breakdown");
|
|
286
|
+
var getScoreBreakdownResponseSchema = z.object({
|
|
287
|
+
groups: z.array(
|
|
288
|
+
z.object({
|
|
289
|
+
dimensions: dimensionsField,
|
|
290
|
+
value: aggregatedValueField
|
|
291
|
+
})
|
|
292
|
+
)
|
|
293
|
+
});
|
|
294
|
+
var getScoreTimeSeriesArgsSchema = z.object({
|
|
295
|
+
scorerId: scorerIdField,
|
|
296
|
+
scoreSource: scoreSourceField.optional(),
|
|
297
|
+
interval: aggregationIntervalSchema,
|
|
298
|
+
aggregation: aggregationTypeSchema,
|
|
299
|
+
filters: scoresFilterSchema.optional(),
|
|
300
|
+
groupBy: groupBySchema.optional()
|
|
301
|
+
}).describe("Arguments for getting score time series");
|
|
302
|
+
var getScoreTimeSeriesResponseSchema = z.object({
|
|
303
|
+
series: z.array(
|
|
304
|
+
z.object({
|
|
305
|
+
name: z.string().describe("Series name (scorer ID or group key)"),
|
|
306
|
+
points: z.array(
|
|
307
|
+
z.object({
|
|
308
|
+
timestamp: bucketTimestampField,
|
|
309
|
+
value: aggregatedValueField
|
|
310
|
+
})
|
|
311
|
+
)
|
|
312
|
+
})
|
|
313
|
+
)
|
|
314
|
+
});
|
|
315
|
+
var getScorePercentilesArgsSchema = z.object({
|
|
316
|
+
scorerId: scorerIdField,
|
|
317
|
+
scoreSource: scoreSourceField.optional(),
|
|
318
|
+
percentiles: percentilesSchema,
|
|
319
|
+
interval: aggregationIntervalSchema,
|
|
320
|
+
filters: scoresFilterSchema.optional()
|
|
321
|
+
}).describe("Arguments for getting score percentiles");
|
|
322
|
+
var getScorePercentilesResponseSchema = z.object({
|
|
323
|
+
series: z.array(
|
|
324
|
+
z.object({
|
|
325
|
+
percentile: percentileField,
|
|
326
|
+
points: z.array(
|
|
327
|
+
z.object({
|
|
328
|
+
timestamp: bucketTimestampField,
|
|
329
|
+
value: percentileBucketValueField
|
|
330
|
+
})
|
|
331
|
+
)
|
|
332
|
+
})
|
|
333
|
+
)
|
|
334
|
+
});
|
|
231
335
|
var feedbackSourceField = z.string().describe("Source of feedback (e.g., 'user', 'system', 'manual')");
|
|
232
336
|
var feedbackTypeField = z.string().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')");
|
|
233
337
|
var feedbackValueField = z.union([z.number(), z.string()]).describe("Feedback value (rating number or correction text)");
|
|
234
338
|
var feedbackCommentField = z.string().describe("Additional comment or context");
|
|
235
|
-
var
|
|
339
|
+
var feedbackUserIdField = z.string().describe("User who provided the feedback");
|
|
340
|
+
function normalizeLegacyFeedbackActor(input) {
|
|
341
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
342
|
+
return input;
|
|
343
|
+
}
|
|
344
|
+
const record = { ...input };
|
|
345
|
+
if (typeof record.userId === "string" && record.feedbackUserId == null) {
|
|
346
|
+
record.feedbackUserId = record.userId;
|
|
347
|
+
delete record.userId;
|
|
348
|
+
}
|
|
349
|
+
return record;
|
|
350
|
+
}
|
|
351
|
+
var feedbackRecordObjectSchema = z.object({
|
|
236
352
|
timestamp: z.date().describe("When the feedback was recorded"),
|
|
237
353
|
// Target
|
|
238
354
|
traceId: traceIdField,
|
|
239
355
|
spanId: spanIdField.nullish().describe("Span ID this feedback applies to"),
|
|
240
356
|
// Feedback data
|
|
241
|
-
|
|
357
|
+
feedbackSource: feedbackSourceField.nullish(),
|
|
358
|
+
/**
|
|
359
|
+
* @deprecated Use `feedbackSource` instead.
|
|
360
|
+
*/
|
|
361
|
+
source: feedbackSourceField.nullish(),
|
|
242
362
|
feedbackType: feedbackTypeField,
|
|
243
363
|
value: feedbackValueField,
|
|
244
364
|
comment: feedbackCommentField.nullish(),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
365
|
+
// Feedback actor identity
|
|
366
|
+
feedbackUserId: feedbackUserIdField.nullish(),
|
|
367
|
+
// Context (entity hierarchy, identity, correlation, deployment, experimentation)
|
|
368
|
+
...contextFields,
|
|
248
369
|
// Source linkage (e.g. dataset item result ID)
|
|
249
370
|
sourceId: z.string().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),
|
|
250
371
|
// User-defined metadata (context fields stored here)
|
|
251
372
|
metadata: z.record(z.string(), z.unknown()).nullish().describe("User-defined metadata")
|
|
252
|
-
})
|
|
253
|
-
z.object(
|
|
254
|
-
|
|
373
|
+
});
|
|
374
|
+
var feedbackRecordSchema = z.object(feedbackRecordObjectSchema.shape).describe("Feedback record as stored in the database");
|
|
375
|
+
var feedbackInputObjectSchema = z.object({
|
|
376
|
+
feedbackSource: feedbackSourceField.optional(),
|
|
377
|
+
/**
|
|
378
|
+
* @deprecated Use `feedbackSource` instead.
|
|
379
|
+
*/
|
|
380
|
+
source: feedbackSourceField.optional(),
|
|
255
381
|
feedbackType: feedbackTypeField,
|
|
256
382
|
value: feedbackValueField,
|
|
257
383
|
comment: feedbackCommentField.optional(),
|
|
258
|
-
|
|
384
|
+
feedbackUserId: feedbackUserIdField.optional(),
|
|
385
|
+
/**
|
|
386
|
+
* @deprecated Use `feedbackUserId` instead.
|
|
387
|
+
*/
|
|
388
|
+
userId: feedbackUserIdField.optional(),
|
|
259
389
|
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional feedback-specific metadata"),
|
|
260
390
|
experimentId: experimentIdField.optional(),
|
|
261
391
|
sourceId: z.string().optional().describe("ID of the source record this feedback is linked to")
|
|
262
|
-
})
|
|
263
|
-
|
|
392
|
+
});
|
|
393
|
+
z.object(feedbackInputObjectSchema.shape).describe("User-provided feedback input");
|
|
264
394
|
z.object({
|
|
265
|
-
feedback:
|
|
395
|
+
feedback: z.preprocess(normalizeLegacyFeedbackActor, feedbackRecordObjectSchema)
|
|
266
396
|
}).describe("Arguments for creating feedback");
|
|
267
397
|
var createFeedbackBodySchema = z.object({
|
|
268
|
-
feedback:
|
|
398
|
+
feedback: feedbackRecordObjectSchema.omit({ timestamp: true })
|
|
269
399
|
}).describe("Arguments for creating feedback");
|
|
270
400
|
var createFeedbackResponseSchema = z.object({ success: z.boolean() }).describe("Response from creating feedback");
|
|
271
401
|
z.object({
|
|
272
|
-
feedbacks: z.array(
|
|
402
|
+
feedbacks: z.array(z.preprocess(normalizeLegacyFeedbackActor, feedbackRecordObjectSchema))
|
|
273
403
|
}).describe("Arguments for batch recording feedback");
|
|
274
|
-
var
|
|
404
|
+
var feedbackFilterObjectSchema = z.object({
|
|
275
405
|
...commonFilterFields,
|
|
276
406
|
// Feedback-specific filters
|
|
277
407
|
feedbackType: z.union([z.string(), z.array(z.string())]).optional().describe("Filter by feedback type(s)"),
|
|
278
|
-
|
|
279
|
-
|
|
408
|
+
feedbackSource: feedbackSourceField.optional(),
|
|
409
|
+
/**
|
|
410
|
+
* @deprecated Use `feedbackSource` instead.
|
|
411
|
+
*/
|
|
412
|
+
source: feedbackSourceField.optional(),
|
|
413
|
+
feedbackUserId: feedbackUserIdField.optional()
|
|
414
|
+
});
|
|
415
|
+
var feedbackFilterSchema = z.object(feedbackFilterObjectSchema.shape).describe("Filters for querying feedback");
|
|
280
416
|
var feedbackOrderByFieldSchema = z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
|
|
281
417
|
var feedbackOrderBySchema = z.object({
|
|
282
418
|
field: feedbackOrderByFieldSchema.default("timestamp").describe("Field to order by"),
|
|
283
419
|
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
284
420
|
}).describe("Order by configuration");
|
|
285
421
|
z.object({
|
|
286
|
-
filters:
|
|
422
|
+
filters: z.preprocess(normalizeLegacyFeedbackActor, feedbackFilterObjectSchema).optional().describe("Optional filters to apply"),
|
|
287
423
|
pagination: paginationArgsSchema.default({ page: 0, perPage: 10 }).describe("Pagination settings"),
|
|
288
424
|
orderBy: feedbackOrderBySchema.default({ field: "timestamp", direction: "DESC" }).describe("Ordering configuration (defaults to timestamp desc)")
|
|
289
425
|
}).describe("Arguments for listing feedback");
|
|
@@ -291,6 +427,70 @@ var listFeedbackResponseSchema = z.object({
|
|
|
291
427
|
pagination: paginationInfoSchema,
|
|
292
428
|
feedback: z.array(feedbackRecordSchema)
|
|
293
429
|
});
|
|
430
|
+
var getFeedbackAggregateArgsSchema = z.object({
|
|
431
|
+
feedbackType: feedbackTypeField,
|
|
432
|
+
feedbackSource: feedbackSourceField.optional(),
|
|
433
|
+
aggregation: aggregationTypeSchema,
|
|
434
|
+
filters: feedbackFilterSchema.optional(),
|
|
435
|
+
comparePeriod: comparePeriodSchema.optional()
|
|
436
|
+
}).describe("Arguments for getting a feedback aggregate over numeric values");
|
|
437
|
+
var getFeedbackAggregateResponseSchema = z.object(aggregateResponseFields);
|
|
438
|
+
var getFeedbackBreakdownArgsSchema = z.object({
|
|
439
|
+
feedbackType: feedbackTypeField,
|
|
440
|
+
feedbackSource: feedbackSourceField.optional(),
|
|
441
|
+
groupBy: groupBySchema,
|
|
442
|
+
aggregation: aggregationTypeSchema,
|
|
443
|
+
filters: feedbackFilterSchema.optional()
|
|
444
|
+
}).describe("Arguments for getting a feedback breakdown over numeric values");
|
|
445
|
+
var getFeedbackBreakdownResponseSchema = z.object({
|
|
446
|
+
groups: z.array(
|
|
447
|
+
z.object({
|
|
448
|
+
dimensions: dimensionsField,
|
|
449
|
+
value: aggregatedValueField
|
|
450
|
+
})
|
|
451
|
+
)
|
|
452
|
+
});
|
|
453
|
+
var getFeedbackTimeSeriesArgsSchema = z.object({
|
|
454
|
+
feedbackType: feedbackTypeField,
|
|
455
|
+
feedbackSource: feedbackSourceField.optional(),
|
|
456
|
+
interval: aggregationIntervalSchema,
|
|
457
|
+
aggregation: aggregationTypeSchema,
|
|
458
|
+
filters: feedbackFilterSchema.optional(),
|
|
459
|
+
groupBy: groupBySchema.optional()
|
|
460
|
+
}).describe("Arguments for getting feedback time series over numeric values");
|
|
461
|
+
var getFeedbackTimeSeriesResponseSchema = z.object({
|
|
462
|
+
series: z.array(
|
|
463
|
+
z.object({
|
|
464
|
+
name: z.string().describe("Series name (feedback type or group key)"),
|
|
465
|
+
points: z.array(
|
|
466
|
+
z.object({
|
|
467
|
+
timestamp: bucketTimestampField,
|
|
468
|
+
value: aggregatedValueField
|
|
469
|
+
})
|
|
470
|
+
)
|
|
471
|
+
})
|
|
472
|
+
)
|
|
473
|
+
});
|
|
474
|
+
var getFeedbackPercentilesArgsSchema = z.object({
|
|
475
|
+
feedbackType: feedbackTypeField,
|
|
476
|
+
feedbackSource: feedbackSourceField.optional(),
|
|
477
|
+
percentiles: percentilesSchema,
|
|
478
|
+
interval: aggregationIntervalSchema,
|
|
479
|
+
filters: feedbackFilterSchema.optional()
|
|
480
|
+
}).describe("Arguments for getting feedback percentiles over numeric values");
|
|
481
|
+
var getFeedbackPercentilesResponseSchema = z.object({
|
|
482
|
+
series: z.array(
|
|
483
|
+
z.object({
|
|
484
|
+
percentile: percentileField,
|
|
485
|
+
points: z.array(
|
|
486
|
+
z.object({
|
|
487
|
+
timestamp: bucketTimestampField,
|
|
488
|
+
value: percentileBucketValueField
|
|
489
|
+
})
|
|
490
|
+
)
|
|
491
|
+
})
|
|
492
|
+
)
|
|
493
|
+
});
|
|
294
494
|
z.enum(["counter", "gauge", "histogram"]);
|
|
295
495
|
var metricNameField = z.string().describe("Metric name (e.g., mastra_agent_duration_ms)");
|
|
296
496
|
var metricValueField = z.number().describe("Metric value");
|
|
@@ -309,6 +509,10 @@ var metricRecordSchema = z.object({
|
|
|
309
509
|
spanId: spanIdField.nullish(),
|
|
310
510
|
// Context (entity hierarchy, identity, correlation, deployment, experimentation)
|
|
311
511
|
...contextFields,
|
|
512
|
+
/**
|
|
513
|
+
* @deprecated Use `executionSource` instead.
|
|
514
|
+
*/
|
|
515
|
+
source: z.string().nullish().describe("Execution source"),
|
|
312
516
|
// Canonical costing fields
|
|
313
517
|
provider: providerField.nullish(),
|
|
314
518
|
model: modelField.nullish(),
|
|
@@ -316,8 +520,6 @@ var metricRecordSchema = z.object({
|
|
|
316
520
|
estimatedCost: estimatedCostField.nullish(),
|
|
317
521
|
costUnit: costUnitField.nullish(),
|
|
318
522
|
costMetadata: costMetadField.nullish(),
|
|
319
|
-
// Filtering
|
|
320
|
-
tags: tagsField.nullish(),
|
|
321
523
|
// User-defined labels used for filtering
|
|
322
524
|
labels: labelsField.default({}),
|
|
323
525
|
// User-defined metadata
|
|
@@ -332,18 +534,19 @@ var createMetricRecordSchema = metricRecordSchema;
|
|
|
332
534
|
z.object({
|
|
333
535
|
metrics: z.array(createMetricRecordSchema)
|
|
334
536
|
}).describe("Arguments for batch recording metrics");
|
|
335
|
-
var aggregationTypeSchema = z.enum(["sum", "avg", "min", "max", "count", "last"]);
|
|
336
|
-
var aggregationIntervalSchema = z.enum(["1m", "5m", "15m", "1h", "1d"]);
|
|
337
537
|
z.object({
|
|
338
|
-
type: aggregationTypeSchema
|
|
339
|
-
interval: aggregationIntervalSchema.optional()
|
|
340
|
-
groupBy:
|
|
538
|
+
type: aggregationTypeSchema,
|
|
539
|
+
interval: aggregationIntervalSchema.optional(),
|
|
540
|
+
groupBy: groupBySchema.optional()
|
|
341
541
|
}).describe("Metrics aggregation configuration");
|
|
342
542
|
var metricsFilterSchema = z.object({
|
|
343
543
|
...commonFilterFields,
|
|
344
|
-
...observabilitySignalFilterFields,
|
|
345
544
|
// Metric identification
|
|
346
545
|
name: z.array(z.string()).nonempty().optional().describe("Filter by metric name(s)"),
|
|
546
|
+
/**
|
|
547
|
+
* @deprecated Use `executionSource` instead.
|
|
548
|
+
*/
|
|
549
|
+
source: z.string().optional().describe("Filter by execution source"),
|
|
347
550
|
// Canonical costing filters
|
|
348
551
|
provider: providerField.optional(),
|
|
349
552
|
model: modelField.optional(),
|
|
@@ -357,7 +560,7 @@ var metricsOrderBySchema = z.object({
|
|
|
357
560
|
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
358
561
|
}).describe("Order by configuration");
|
|
359
562
|
z.object({
|
|
360
|
-
filters: metricsFilterSchema.optional()
|
|
563
|
+
filters: metricsFilterSchema.optional(),
|
|
361
564
|
pagination: paginationArgsSchema.default({ page: 0, perPage: 10 }).describe("Pagination settings"),
|
|
362
565
|
orderBy: metricsOrderBySchema.default({ field: "timestamp", direction: "DESC" }).describe("Ordering configuration (defaults to timestamp desc)")
|
|
363
566
|
}).describe("Arguments for listing metrics");
|
|
@@ -365,33 +568,30 @@ z.object({
|
|
|
365
568
|
pagination: paginationInfoSchema,
|
|
366
569
|
metrics: z.array(metricRecordSchema)
|
|
367
570
|
});
|
|
368
|
-
var comparePeriodSchema = z.enum(["previous_period", "previous_day", "previous_week"]).describe("Comparison period for aggregate queries");
|
|
369
571
|
var getMetricAggregateArgsSchema = z.object({
|
|
370
572
|
name: z.array(z.string()).nonempty().describe("Metric name(s) to aggregate"),
|
|
371
|
-
aggregation: aggregationTypeSchema
|
|
372
|
-
filters: metricsFilterSchema.optional()
|
|
373
|
-
comparePeriod: comparePeriodSchema.optional()
|
|
573
|
+
aggregation: aggregationTypeSchema,
|
|
574
|
+
filters: metricsFilterSchema.optional(),
|
|
575
|
+
comparePeriod: comparePeriodSchema.optional()
|
|
374
576
|
}).describe("Arguments for getting a metric aggregate");
|
|
375
577
|
var getMetricAggregateResponseSchema = z.object({
|
|
376
|
-
|
|
578
|
+
...aggregateResponseFields,
|
|
377
579
|
estimatedCost: z.number().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),
|
|
378
580
|
costUnit: z.string().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),
|
|
379
|
-
previousValue: z.number().nullable().optional().describe("Value from comparison period"),
|
|
380
581
|
previousEstimatedCost: z.number().nullable().optional().describe("Aggregated estimated cost from the comparison period"),
|
|
381
|
-
changePercent: z.number().nullable().optional().describe("Percentage change from comparison period"),
|
|
382
582
|
costChangePercent: z.number().nullable().optional().describe("Percentage change in estimated cost from comparison period")
|
|
383
583
|
});
|
|
384
584
|
var getMetricBreakdownArgsSchema = z.object({
|
|
385
585
|
name: z.array(z.string()).nonempty().describe("Metric name(s) to break down"),
|
|
386
|
-
groupBy:
|
|
387
|
-
aggregation: aggregationTypeSchema
|
|
388
|
-
filters: metricsFilterSchema.optional()
|
|
586
|
+
groupBy: groupBySchema,
|
|
587
|
+
aggregation: aggregationTypeSchema,
|
|
588
|
+
filters: metricsFilterSchema.optional()
|
|
389
589
|
}).describe("Arguments for getting a metric breakdown");
|
|
390
590
|
var getMetricBreakdownResponseSchema = z.object({
|
|
391
591
|
groups: z.array(
|
|
392
592
|
z.object({
|
|
393
|
-
dimensions:
|
|
394
|
-
value:
|
|
593
|
+
dimensions: dimensionsField,
|
|
594
|
+
value: aggregatedValueField,
|
|
395
595
|
estimatedCost: z.number().nullable().optional().describe("Summed estimated cost for this group"),
|
|
396
596
|
costUnit: z.string().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")
|
|
397
597
|
})
|
|
@@ -399,10 +599,10 @@ var getMetricBreakdownResponseSchema = z.object({
|
|
|
399
599
|
});
|
|
400
600
|
var getMetricTimeSeriesArgsSchema = z.object({
|
|
401
601
|
name: z.array(z.string()).nonempty().describe("Metric name(s)"),
|
|
402
|
-
interval: aggregationIntervalSchema
|
|
403
|
-
aggregation: aggregationTypeSchema
|
|
404
|
-
filters: metricsFilterSchema.optional()
|
|
405
|
-
groupBy:
|
|
602
|
+
interval: aggregationIntervalSchema,
|
|
603
|
+
aggregation: aggregationTypeSchema,
|
|
604
|
+
filters: metricsFilterSchema.optional(),
|
|
605
|
+
groupBy: groupBySchema.optional()
|
|
406
606
|
}).describe("Arguments for getting metric time series");
|
|
407
607
|
var getMetricTimeSeriesResponseSchema = z.object({
|
|
408
608
|
series: z.array(
|
|
@@ -411,8 +611,8 @@ var getMetricTimeSeriesResponseSchema = z.object({
|
|
|
411
611
|
costUnit: z.string().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),
|
|
412
612
|
points: z.array(
|
|
413
613
|
z.object({
|
|
414
|
-
timestamp:
|
|
415
|
-
value:
|
|
614
|
+
timestamp: bucketTimestampField,
|
|
615
|
+
value: aggregatedValueField,
|
|
416
616
|
estimatedCost: z.number().nullable().optional().describe("Summed estimated cost in this bucket")
|
|
417
617
|
})
|
|
418
618
|
)
|
|
@@ -421,18 +621,18 @@ var getMetricTimeSeriesResponseSchema = z.object({
|
|
|
421
621
|
});
|
|
422
622
|
var getMetricPercentilesArgsSchema = z.object({
|
|
423
623
|
name: z.string().describe("Metric name"),
|
|
424
|
-
percentiles:
|
|
425
|
-
interval: aggregationIntervalSchema
|
|
426
|
-
filters: metricsFilterSchema.optional()
|
|
624
|
+
percentiles: percentilesSchema,
|
|
625
|
+
interval: aggregationIntervalSchema,
|
|
626
|
+
filters: metricsFilterSchema.optional()
|
|
427
627
|
}).describe("Arguments for getting metric percentiles");
|
|
428
628
|
var getMetricPercentilesResponseSchema = z.object({
|
|
429
629
|
series: z.array(
|
|
430
630
|
z.object({
|
|
431
|
-
percentile:
|
|
631
|
+
percentile: percentileField,
|
|
432
632
|
points: z.array(
|
|
433
633
|
z.object({
|
|
434
|
-
timestamp:
|
|
435
|
-
value:
|
|
634
|
+
timestamp: bucketTimestampField,
|
|
635
|
+
value: percentileBucketValueField
|
|
436
636
|
})
|
|
437
637
|
)
|
|
438
638
|
})
|
|
@@ -495,7 +695,7 @@ function createNewRoute(def, config) {
|
|
|
495
695
|
handler: (async (params) => {
|
|
496
696
|
if (!coreFeatures.has("observability:v1.13.2")) {
|
|
497
697
|
throw new HTTPException(501, {
|
|
498
|
-
message: "New observability endpoints require @mastra/core >= 1.13.
|
|
698
|
+
message: "New observability endpoints require @mastra/core >= 1.13.2, please upgrade."
|
|
499
699
|
});
|
|
500
700
|
}
|
|
501
701
|
try {
|
|
@@ -541,6 +741,42 @@ var CREATE_SCORE = createNewRoute(NEW_ROUTE_DEFS.CREATE_SCORE, {
|
|
|
541
741
|
return { success: true };
|
|
542
742
|
}
|
|
543
743
|
});
|
|
744
|
+
var GET_SCORE_AGGREGATE = createNewRoute(NEW_ROUTE_DEFS.GET_SCORE_AGGREGATE, {
|
|
745
|
+
bodySchema: getScoreAggregateArgsSchema,
|
|
746
|
+
responseSchema: getScoreAggregateResponseSchema,
|
|
747
|
+
handler: async ({ mastra, ...params }) => {
|
|
748
|
+
const args = pickParams(getScoreAggregateArgsSchema, params);
|
|
749
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
750
|
+
return await observabilityStore.getScoreAggregate(args);
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
var GET_SCORE_BREAKDOWN = createNewRoute(NEW_ROUTE_DEFS.GET_SCORE_BREAKDOWN, {
|
|
754
|
+
bodySchema: getScoreBreakdownArgsSchema,
|
|
755
|
+
responseSchema: getScoreBreakdownResponseSchema,
|
|
756
|
+
handler: async ({ mastra, ...params }) => {
|
|
757
|
+
const args = pickParams(getScoreBreakdownArgsSchema, params);
|
|
758
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
759
|
+
return await observabilityStore.getScoreBreakdown(args);
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
var GET_SCORE_TIME_SERIES = createNewRoute(NEW_ROUTE_DEFS.GET_SCORE_TIME_SERIES, {
|
|
763
|
+
bodySchema: getScoreTimeSeriesArgsSchema,
|
|
764
|
+
responseSchema: getScoreTimeSeriesResponseSchema,
|
|
765
|
+
handler: async ({ mastra, ...params }) => {
|
|
766
|
+
const args = pickParams(getScoreTimeSeriesArgsSchema, params);
|
|
767
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
768
|
+
return await observabilityStore.getScoreTimeSeries(args);
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
var GET_SCORE_PERCENTILES = createNewRoute(NEW_ROUTE_DEFS.GET_SCORE_PERCENTILES, {
|
|
772
|
+
bodySchema: getScorePercentilesArgsSchema,
|
|
773
|
+
responseSchema: getScorePercentilesResponseSchema,
|
|
774
|
+
handler: async ({ mastra, ...params }) => {
|
|
775
|
+
const args = pickParams(getScorePercentilesArgsSchema, params);
|
|
776
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
777
|
+
return await observabilityStore.getScorePercentiles(args);
|
|
778
|
+
}
|
|
779
|
+
});
|
|
544
780
|
var LIST_FEEDBACK = createNewRoute(NEW_ROUTE_DEFS.LIST_FEEDBACK, {
|
|
545
781
|
queryParamSchema: wrapSchemaForQueryParams(
|
|
546
782
|
feedbackFilterSchema.extend(paginationArgsSchema.shape).extend(feedbackOrderBySchema.shape).partial()
|
|
@@ -563,6 +799,42 @@ var CREATE_FEEDBACK = createNewRoute(NEW_ROUTE_DEFS.CREATE_FEEDBACK, {
|
|
|
563
799
|
return { success: true };
|
|
564
800
|
}
|
|
565
801
|
});
|
|
802
|
+
var GET_FEEDBACK_AGGREGATE = createNewRoute(NEW_ROUTE_DEFS.GET_FEEDBACK_AGGREGATE, {
|
|
803
|
+
bodySchema: getFeedbackAggregateArgsSchema,
|
|
804
|
+
responseSchema: getFeedbackAggregateResponseSchema,
|
|
805
|
+
handler: async ({ mastra, ...params }) => {
|
|
806
|
+
const args = pickParams(getFeedbackAggregateArgsSchema, params);
|
|
807
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
808
|
+
return await observabilityStore.getFeedbackAggregate(args);
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
var GET_FEEDBACK_BREAKDOWN = createNewRoute(NEW_ROUTE_DEFS.GET_FEEDBACK_BREAKDOWN, {
|
|
812
|
+
bodySchema: getFeedbackBreakdownArgsSchema,
|
|
813
|
+
responseSchema: getFeedbackBreakdownResponseSchema,
|
|
814
|
+
handler: async ({ mastra, ...params }) => {
|
|
815
|
+
const args = pickParams(getFeedbackBreakdownArgsSchema, params);
|
|
816
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
817
|
+
return await observabilityStore.getFeedbackBreakdown(args);
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
var GET_FEEDBACK_TIME_SERIES = createNewRoute(NEW_ROUTE_DEFS.GET_FEEDBACK_TIME_SERIES, {
|
|
821
|
+
bodySchema: getFeedbackTimeSeriesArgsSchema,
|
|
822
|
+
responseSchema: getFeedbackTimeSeriesResponseSchema,
|
|
823
|
+
handler: async ({ mastra, ...params }) => {
|
|
824
|
+
const args = pickParams(getFeedbackTimeSeriesArgsSchema, params);
|
|
825
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
826
|
+
return await observabilityStore.getFeedbackTimeSeries(args);
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
var GET_FEEDBACK_PERCENTILES = createNewRoute(NEW_ROUTE_DEFS.GET_FEEDBACK_PERCENTILES, {
|
|
830
|
+
bodySchema: getFeedbackPercentilesArgsSchema,
|
|
831
|
+
responseSchema: getFeedbackPercentilesResponseSchema,
|
|
832
|
+
handler: async ({ mastra, ...params }) => {
|
|
833
|
+
const args = pickParams(getFeedbackPercentilesArgsSchema, params);
|
|
834
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
835
|
+
return await observabilityStore.getFeedbackPercentiles(args);
|
|
836
|
+
}
|
|
837
|
+
});
|
|
566
838
|
var GET_METRIC_AGGREGATE = createNewRoute(NEW_ROUTE_DEFS.GET_METRIC_AGGREGATE, {
|
|
567
839
|
bodySchema: getMetricAggregateArgsSchema,
|
|
568
840
|
responseSchema: getMetricAggregateResponseSchema,
|
|
@@ -676,8 +948,16 @@ var NEW_ROUTES = {
|
|
|
676
948
|
LIST_LOGS,
|
|
677
949
|
LIST_SCORES,
|
|
678
950
|
CREATE_SCORE,
|
|
951
|
+
GET_SCORE_AGGREGATE,
|
|
952
|
+
GET_SCORE_BREAKDOWN,
|
|
953
|
+
GET_SCORE_TIME_SERIES,
|
|
954
|
+
GET_SCORE_PERCENTILES,
|
|
679
955
|
LIST_FEEDBACK,
|
|
680
956
|
CREATE_FEEDBACK,
|
|
957
|
+
GET_FEEDBACK_AGGREGATE,
|
|
958
|
+
GET_FEEDBACK_BREAKDOWN,
|
|
959
|
+
GET_FEEDBACK_TIME_SERIES,
|
|
960
|
+
GET_FEEDBACK_PERCENTILES,
|
|
681
961
|
GET_METRIC_AGGREGATE,
|
|
682
962
|
GET_METRIC_BREAKDOWN,
|
|
683
963
|
GET_METRIC_TIME_SERIES,
|
|
@@ -692,6 +972,6 @@ var NEW_ROUTES = {
|
|
|
692
972
|
GET_TAGS
|
|
693
973
|
};
|
|
694
974
|
|
|
695
|
-
export { CREATE_FEEDBACK, CREATE_SCORE, GET_ENTITY_NAMES, GET_ENTITY_TYPES, GET_ENVIRONMENTS, GET_METRIC_AGGREGATE, GET_METRIC_BREAKDOWN, GET_METRIC_LABEL_KEYS, GET_METRIC_LABEL_VALUES, GET_METRIC_NAMES, GET_METRIC_PERCENTILES, GET_METRIC_TIME_SERIES, GET_SERVICE_NAMES, GET_TAGS, LIST_FEEDBACK, LIST_LOGS, LIST_SCORES, NEW_ROUTES };
|
|
696
|
-
//# sourceMappingURL=chunk-
|
|
697
|
-
//# sourceMappingURL=chunk-
|
|
975
|
+
export { CREATE_FEEDBACK, CREATE_SCORE, GET_ENTITY_NAMES, GET_ENTITY_TYPES, GET_ENVIRONMENTS, GET_FEEDBACK_AGGREGATE, GET_FEEDBACK_BREAKDOWN, GET_FEEDBACK_PERCENTILES, GET_FEEDBACK_TIME_SERIES, GET_METRIC_AGGREGATE, GET_METRIC_BREAKDOWN, GET_METRIC_LABEL_KEYS, GET_METRIC_LABEL_VALUES, GET_METRIC_NAMES, GET_METRIC_PERCENTILES, GET_METRIC_TIME_SERIES, GET_SCORE_AGGREGATE, GET_SCORE_BREAKDOWN, GET_SCORE_PERCENTILES, GET_SCORE_TIME_SERIES, GET_SERVICE_NAMES, GET_TAGS, LIST_FEEDBACK, LIST_LOGS, LIST_SCORES, NEW_ROUTES };
|
|
976
|
+
//# sourceMappingURL=chunk-YFQ5JIUD.js.map
|
|
977
|
+
//# sourceMappingURL=chunk-YFQ5JIUD.js.map
|