@mastra/server 1.78.1-alpha.0 → 1.79.0-alpha.2
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/dist/_types/@internal_core/dist/storage/index.d.ts +8 -0
- package/dist/{api-schema-manifest-aur2BK6a.js → api-schema-manifest-BgWM-O7K.js} +2 -2
- package/dist/{api-schema-manifest-aur2BK6a.js.map → api-schema-manifest-BgWM-O7K.js.map} +1 -1
- package/dist/{api-schema-manifest-Dr8PM4Qj.cjs → api-schema-manifest-CI0gyTVi.cjs} +2 -2
- package/dist/{api-schema-manifest-Dr8PM4Qj.cjs.map → api-schema-manifest-CI0gyTVi.cjs.map} +1 -1
- package/dist/{datasets-BdD8JWhx.cjs → datasets-BUC5T-fd.cjs} +6 -1
- package/dist/datasets-BUC5T-fd.cjs.map +1 -0
- package/dist/{datasets-CKwh-k4I.js → datasets-CCWuznUu.js} +6 -1
- package/dist/datasets-CCWuznUu.js.map +1 -0
- package/dist/{dist-B8rA8_Wt.cjs → dist-CKHUMrWI.cjs} +2 -2
- package/dist/{dist-B8rA8_Wt.cjs.map → dist-CKHUMrWI.cjs.map} +1 -1
- package/dist/{dist-CdMzvOLk.js → dist-hfFDNas-.js} +2 -2
- package/dist/{dist-CdMzvOLk.js.map → dist-hfFDNas-.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{observability-new-endpoints-BoALDMSi.cjs → observability-new-endpoints-BKFVVMTS.cjs} +8 -1
- package/dist/observability-new-endpoints-BKFVVMTS.cjs.map +1 -0
- package/dist/{observability-new-endpoints-CB7T6Z7c.js → observability-new-endpoints-C5VO7nLK.js} +9 -2
- package/dist/observability-new-endpoints-C5VO7nLK.js.map +1 -0
- package/dist/{routes-BhI1lW_W.js → routes-CMj-3iyu.js} +10 -9
- package/dist/routes-CMj-3iyu.js.map +1 -0
- package/dist/{routes-CuJPLAh8.cjs → routes-CeX9JLW2.cjs} +9 -8
- package/dist/routes-CeX9JLW2.cjs.map +1 -0
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-controller.cjs +43 -0
- package/dist/server/handlers/agent-controller.cjs.map +1 -1
- package/dist/server/handlers/agent-controller.d.ts +39 -0
- package/dist/server/handlers/agent-controller.d.ts.map +1 -1
- package/dist/server/handlers/agent-controller.js +44 -2
- package/dist/server/handlers/agent-controller.js.map +1 -1
- package/dist/server/handlers/datasets.cjs +11 -5
- package/dist/server/handlers/datasets.cjs.map +1 -1
- package/dist/server/handlers/datasets.d.ts +4 -0
- package/dist/server/handlers/datasets.d.ts.map +1 -1
- package/dist/server/handlers/datasets.js +11 -5
- package/dist/server/handlers/datasets.js.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts +88 -48
- 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 +29 -0
- package/dist/server/handlers/observability-shared.cjs.map +1 -1
- package/dist/server/handlers/observability-shared.d.ts +2 -1
- package/dist/server/handlers/observability-shared.d.ts.map +1 -1
- package/dist/server/handlers/observability-shared.js +29 -1
- package/dist/server/handlers/observability-shared.js.map +1 -1
- package/dist/server/handlers/observability.cjs +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/stored-agents.cjs +1 -1
- package/dist/server/handlers/stored-agents.js +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/schemas/datasets.d.ts +2 -0
- package/dist/server/schemas/datasets.d.ts.map +1 -1
- package/dist/server/schemas/index.cjs +6 -6
- package/dist/server/schemas/index.js +6 -6
- package/dist/server/server-adapter/index.cjs +1 -1
- package/dist/server/server-adapter/index.js +1 -1
- package/dist/server/server-adapter/routes/agent-controller.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/datasets.d.ts +4 -0
- package/dist/server/server-adapter/routes/datasets.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/observability.d.ts +44 -24
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/datasets-BdD8JWhx.cjs.map +0 -1
- package/dist/datasets-CKwh-k4I.js.map +0 -1
- package/dist/observability-new-endpoints-BoALDMSi.cjs.map +0 -1
- package/dist/observability-new-endpoints-CB7T6Z7c.js.map +0 -1
- package/dist/routes-BhI1lW_W.js.map +0 -1
- package/dist/routes-CuJPLAh8.cjs.map +0 -1
|
@@ -420,23 +420,29 @@ export declare const QUERY_SPANS: Omit<import("@mastra/core/server").ApiRoute, "
|
|
|
420
420
|
entityType: string | null;
|
|
421
421
|
entityId: string | null;
|
|
422
422
|
entityName: string | null;
|
|
423
|
+
entityVersionId: string | null;
|
|
424
|
+
parentEntityType: string | null;
|
|
425
|
+
parentEntityId: string | null;
|
|
426
|
+
parentEntityName: string | null;
|
|
427
|
+
parentEntityVersionId: string | null;
|
|
428
|
+
rootEntityType: string | null;
|
|
429
|
+
rootEntityId: string | null;
|
|
430
|
+
rootEntityName: string | null;
|
|
431
|
+
rootEntityVersionId: string | null;
|
|
432
|
+
threadId: string | null;
|
|
433
|
+
runId: string | null;
|
|
434
|
+
sessionId: string | null;
|
|
435
|
+
userId: string | null;
|
|
436
|
+
requestId: string | null;
|
|
437
|
+
serviceName: string | null;
|
|
438
|
+
experimentId: string | null;
|
|
439
|
+
environment: string | null;
|
|
440
|
+
executionSource: string | null;
|
|
423
441
|
model: string | null;
|
|
424
442
|
provider: string | null;
|
|
425
443
|
inputPreview: string | null;
|
|
426
|
-
inputTruncated: boolean;
|
|
427
444
|
outputPreview: string | null;
|
|
428
|
-
outputTruncated: boolean;
|
|
429
445
|
errorPreview: string | null;
|
|
430
|
-
errorTruncated: boolean;
|
|
431
|
-
cost: {
|
|
432
|
-
state: "available";
|
|
433
|
-
amount: number;
|
|
434
|
-
currency: string;
|
|
435
|
-
} | {
|
|
436
|
-
state: "missing";
|
|
437
|
-
} | {
|
|
438
|
-
state: "unavailable";
|
|
439
|
-
};
|
|
440
446
|
}[];
|
|
441
447
|
page: {
|
|
442
448
|
next: string | null;
|
|
@@ -491,23 +497,29 @@ export declare const QUERY_SPANS: Omit<import("@mastra/core/server").ApiRoute, "
|
|
|
491
497
|
entityType: z.ZodNullable<z.ZodString>;
|
|
492
498
|
entityId: z.ZodNullable<z.ZodString>;
|
|
493
499
|
entityName: z.ZodNullable<z.ZodString>;
|
|
500
|
+
entityVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
501
|
+
parentEntityType: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
502
|
+
parentEntityId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
503
|
+
parentEntityName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
504
|
+
parentEntityVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
505
|
+
rootEntityType: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
506
|
+
rootEntityId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
507
|
+
rootEntityName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
508
|
+
rootEntityVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
509
|
+
threadId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
510
|
+
runId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
511
|
+
sessionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
512
|
+
userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
513
|
+
requestId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
514
|
+
serviceName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
515
|
+
experimentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
516
|
+
environment: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
517
|
+
executionSource: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
494
518
|
model: z.ZodNullable<z.ZodString>;
|
|
495
519
|
provider: z.ZodNullable<z.ZodString>;
|
|
496
520
|
inputPreview: z.ZodNullable<z.ZodString>;
|
|
497
|
-
inputTruncated: z.ZodBoolean;
|
|
498
521
|
outputPreview: z.ZodNullable<z.ZodString>;
|
|
499
|
-
outputTruncated: z.ZodBoolean;
|
|
500
522
|
errorPreview: z.ZodNullable<z.ZodString>;
|
|
501
|
-
errorTruncated: z.ZodBoolean;
|
|
502
|
-
cost: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
503
|
-
state: z.ZodLiteral<"available">;
|
|
504
|
-
amount: z.ZodNumber;
|
|
505
|
-
currency: z.ZodString;
|
|
506
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
507
|
-
state: z.ZodLiteral<"missing">;
|
|
508
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
509
|
-
state: z.ZodLiteral<"unavailable">;
|
|
510
|
-
}, z.core.$strict>], "state">;
|
|
511
523
|
}, z.core.$strict>>;
|
|
512
524
|
page: z.ZodObject<{
|
|
513
525
|
next: z.ZodNullable<z.ZodString>;
|
|
@@ -2864,6 +2876,7 @@ export declare const GET_METRIC_AGGREGATE: Omit<import("@mastra/core/server").Ap
|
|
|
2864
2876
|
executionSource?: string | undefined;
|
|
2865
2877
|
tags?: string[] | undefined;
|
|
2866
2878
|
traceIds?: string[] | undefined;
|
|
2879
|
+
experimentIds?: string[] | undefined;
|
|
2867
2880
|
name?: string[] | undefined;
|
|
2868
2881
|
source?: string | undefined;
|
|
2869
2882
|
provider?: string | undefined;
|
|
@@ -2949,6 +2962,7 @@ export declare const GET_METRIC_AGGREGATE: Omit<import("@mastra/core/server").Ap
|
|
|
2949
2962
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
2950
2963
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2951
2964
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2965
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2952
2966
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2953
2967
|
source: z.ZodOptional<z.ZodString>;
|
|
2954
2968
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -3015,6 +3029,7 @@ export declare const GET_METRIC_BREAKDOWN: Omit<import("@mastra/core/server").Ap
|
|
|
3015
3029
|
executionSource?: string | undefined;
|
|
3016
3030
|
tags?: string[] | undefined;
|
|
3017
3031
|
traceIds?: string[] | undefined;
|
|
3032
|
+
experimentIds?: string[] | undefined;
|
|
3018
3033
|
name?: string[] | undefined;
|
|
3019
3034
|
source?: string | undefined;
|
|
3020
3035
|
provider?: string | undefined;
|
|
@@ -3101,6 +3116,7 @@ export declare const GET_METRIC_BREAKDOWN: Omit<import("@mastra/core/server").Ap
|
|
|
3101
3116
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
3102
3117
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3103
3118
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3119
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3104
3120
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3105
3121
|
source: z.ZodOptional<z.ZodString>;
|
|
3106
3122
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -3166,6 +3182,7 @@ export declare const GET_METRIC_TIME_SERIES: Omit<import("@mastra/core/server").
|
|
|
3166
3182
|
executionSource?: string | undefined;
|
|
3167
3183
|
tags?: string[] | undefined;
|
|
3168
3184
|
traceIds?: string[] | undefined;
|
|
3185
|
+
experimentIds?: string[] | undefined;
|
|
3169
3186
|
name?: string[] | undefined;
|
|
3170
3187
|
source?: string | undefined;
|
|
3171
3188
|
provider?: string | undefined;
|
|
@@ -3260,6 +3277,7 @@ export declare const GET_METRIC_TIME_SERIES: Omit<import("@mastra/core/server").
|
|
|
3260
3277
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
3261
3278
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3262
3279
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3280
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3263
3281
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3264
3282
|
source: z.ZodOptional<z.ZodString>;
|
|
3265
3283
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -3323,6 +3341,7 @@ export declare const GET_METRIC_PERCENTILES: Omit<import("@mastra/core/server").
|
|
|
3323
3341
|
executionSource?: string | undefined;
|
|
3324
3342
|
tags?: string[] | undefined;
|
|
3325
3343
|
traceIds?: string[] | undefined;
|
|
3344
|
+
experimentIds?: string[] | undefined;
|
|
3326
3345
|
name?: string[] | undefined;
|
|
3327
3346
|
source?: string | undefined;
|
|
3328
3347
|
provider?: string | undefined;
|
|
@@ -3390,6 +3409,7 @@ export declare const GET_METRIC_PERCENTILES: Omit<import("@mastra/core/server").
|
|
|
3390
3409
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
3391
3410
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3392
3411
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3412
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3393
3413
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3394
3414
|
source: z.ZodOptional<z.ZodString>;
|
|
3395
3415
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -4052,23 +4072,29 @@ export declare const NEW_ROUTES: {
|
|
|
4052
4072
|
entityType: string | null;
|
|
4053
4073
|
entityId: string | null;
|
|
4054
4074
|
entityName: string | null;
|
|
4075
|
+
entityVersionId: string | null;
|
|
4076
|
+
parentEntityType: string | null;
|
|
4077
|
+
parentEntityId: string | null;
|
|
4078
|
+
parentEntityName: string | null;
|
|
4079
|
+
parentEntityVersionId: string | null;
|
|
4080
|
+
rootEntityType: string | null;
|
|
4081
|
+
rootEntityId: string | null;
|
|
4082
|
+
rootEntityName: string | null;
|
|
4083
|
+
rootEntityVersionId: string | null;
|
|
4084
|
+
threadId: string | null;
|
|
4085
|
+
runId: string | null;
|
|
4086
|
+
sessionId: string | null;
|
|
4087
|
+
userId: string | null;
|
|
4088
|
+
requestId: string | null;
|
|
4089
|
+
serviceName: string | null;
|
|
4090
|
+
experimentId: string | null;
|
|
4091
|
+
environment: string | null;
|
|
4092
|
+
executionSource: string | null;
|
|
4055
4093
|
model: string | null;
|
|
4056
4094
|
provider: string | null;
|
|
4057
4095
|
inputPreview: string | null;
|
|
4058
|
-
inputTruncated: boolean;
|
|
4059
4096
|
outputPreview: string | null;
|
|
4060
|
-
outputTruncated: boolean;
|
|
4061
4097
|
errorPreview: string | null;
|
|
4062
|
-
errorTruncated: boolean;
|
|
4063
|
-
cost: {
|
|
4064
|
-
state: "available";
|
|
4065
|
-
amount: number;
|
|
4066
|
-
currency: string;
|
|
4067
|
-
} | {
|
|
4068
|
-
state: "missing";
|
|
4069
|
-
} | {
|
|
4070
|
-
state: "unavailable";
|
|
4071
|
-
};
|
|
4072
4098
|
}[];
|
|
4073
4099
|
page: {
|
|
4074
4100
|
next: string | null;
|
|
@@ -4123,23 +4149,29 @@ export declare const NEW_ROUTES: {
|
|
|
4123
4149
|
entityType: z.ZodNullable<z.ZodString>;
|
|
4124
4150
|
entityId: z.ZodNullable<z.ZodString>;
|
|
4125
4151
|
entityName: z.ZodNullable<z.ZodString>;
|
|
4152
|
+
entityVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4153
|
+
parentEntityType: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4154
|
+
parentEntityId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4155
|
+
parentEntityName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4156
|
+
parentEntityVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4157
|
+
rootEntityType: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4158
|
+
rootEntityId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4159
|
+
rootEntityName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4160
|
+
rootEntityVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4161
|
+
threadId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4162
|
+
runId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4163
|
+
sessionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4164
|
+
userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4165
|
+
requestId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4166
|
+
serviceName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4167
|
+
experimentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4168
|
+
environment: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4169
|
+
executionSource: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
4126
4170
|
model: z.ZodNullable<z.ZodString>;
|
|
4127
4171
|
provider: z.ZodNullable<z.ZodString>;
|
|
4128
4172
|
inputPreview: z.ZodNullable<z.ZodString>;
|
|
4129
|
-
inputTruncated: z.ZodBoolean;
|
|
4130
4173
|
outputPreview: z.ZodNullable<z.ZodString>;
|
|
4131
|
-
outputTruncated: z.ZodBoolean;
|
|
4132
4174
|
errorPreview: z.ZodNullable<z.ZodString>;
|
|
4133
|
-
errorTruncated: z.ZodBoolean;
|
|
4134
|
-
cost: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4135
|
-
state: z.ZodLiteral<"available">;
|
|
4136
|
-
amount: z.ZodNumber;
|
|
4137
|
-
currency: z.ZodString;
|
|
4138
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
4139
|
-
state: z.ZodLiteral<"missing">;
|
|
4140
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
4141
|
-
state: z.ZodLiteral<"unavailable">;
|
|
4142
|
-
}, z.core.$strict>], "state">;
|
|
4143
4175
|
}, z.core.$strict>>;
|
|
4144
4176
|
page: z.ZodObject<{
|
|
4145
4177
|
next: z.ZodNullable<z.ZodString>;
|
|
@@ -6231,6 +6263,7 @@ export declare const NEW_ROUTES: {
|
|
|
6231
6263
|
executionSource?: string | undefined;
|
|
6232
6264
|
tags?: string[] | undefined;
|
|
6233
6265
|
traceIds?: string[] | undefined;
|
|
6266
|
+
experimentIds?: string[] | undefined;
|
|
6234
6267
|
name?: string[] | undefined;
|
|
6235
6268
|
source?: string | undefined;
|
|
6236
6269
|
provider?: string | undefined;
|
|
@@ -6316,6 +6349,7 @@ export declare const NEW_ROUTES: {
|
|
|
6316
6349
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
6317
6350
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6318
6351
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6352
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6319
6353
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6320
6354
|
source: z.ZodOptional<z.ZodString>;
|
|
6321
6355
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -6382,6 +6416,7 @@ export declare const NEW_ROUTES: {
|
|
|
6382
6416
|
executionSource?: string | undefined;
|
|
6383
6417
|
tags?: string[] | undefined;
|
|
6384
6418
|
traceIds?: string[] | undefined;
|
|
6419
|
+
experimentIds?: string[] | undefined;
|
|
6385
6420
|
name?: string[] | undefined;
|
|
6386
6421
|
source?: string | undefined;
|
|
6387
6422
|
provider?: string | undefined;
|
|
@@ -6468,6 +6503,7 @@ export declare const NEW_ROUTES: {
|
|
|
6468
6503
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
6469
6504
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6470
6505
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6506
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6471
6507
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6472
6508
|
source: z.ZodOptional<z.ZodString>;
|
|
6473
6509
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -6533,6 +6569,7 @@ export declare const NEW_ROUTES: {
|
|
|
6533
6569
|
executionSource?: string | undefined;
|
|
6534
6570
|
tags?: string[] | undefined;
|
|
6535
6571
|
traceIds?: string[] | undefined;
|
|
6572
|
+
experimentIds?: string[] | undefined;
|
|
6536
6573
|
name?: string[] | undefined;
|
|
6537
6574
|
source?: string | undefined;
|
|
6538
6575
|
provider?: string | undefined;
|
|
@@ -6627,6 +6664,7 @@ export declare const NEW_ROUTES: {
|
|
|
6627
6664
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
6628
6665
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6629
6666
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6667
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6630
6668
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6631
6669
|
source: z.ZodOptional<z.ZodString>;
|
|
6632
6670
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -6690,6 +6728,7 @@ export declare const NEW_ROUTES: {
|
|
|
6690
6728
|
executionSource?: string | undefined;
|
|
6691
6729
|
tags?: string[] | undefined;
|
|
6692
6730
|
traceIds?: string[] | undefined;
|
|
6731
|
+
experimentIds?: string[] | undefined;
|
|
6693
6732
|
name?: string[] | undefined;
|
|
6694
6733
|
source?: string | undefined;
|
|
6695
6734
|
provider?: string | undefined;
|
|
@@ -6757,6 +6796,7 @@ export declare const NEW_ROUTES: {
|
|
|
6757
6796
|
executionSource: z.ZodOptional<z.ZodString>;
|
|
6758
6797
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6759
6798
|
traceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6799
|
+
experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6760
6800
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6761
6801
|
source: z.ZodOptional<z.ZodString>;
|
|
6762
6802
|
provider: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability-new-endpoints.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/observability-new-endpoints.ts"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAY3B,OAAO,KAAK,EAAe,aAAa,EAAsB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"observability-new-endpoints.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/observability-new-endpoints.ts"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAY3B,OAAO,KAAK,EAAe,aAAa,EAAsB,MAAM,0BAA0B,CAAC;AAwN/F,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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READS, L as QUERY_TRACES, M as LIST_METRICS, N as LIST_SCORES, O as GET_TRACE_QUERY_FIELDS, P as NEW_ROUTES, R as UPDATE_FEEDBACK_REVIEW_STATUS, S as GET_SCORE_AGGREGATE, T as GET_SCORE_TIME_SERIES, _ as GET_METRIC_LABEL_VALUES, a as DELETE_SCORES, b as GET_METRIC_TIME_SERIES, c as GET_ENTITY_TYPES, d as GET_FEEDBACK_BREAKDOWN, f as GET_FEEDBACK_PERCENTILES, g as GET_METRIC_LABEL_KEYS, h as GET_METRIC_BREAKDOWN, i as DELETE_FEEDBACK, j as LIST_LOGS, k as GET_TRACE_QUERY_VALUES, l as GET_ENVIRONMENTS, m as GET_METRIC_AGGREGATE, n as CREATE_FEEDBACK, o as GET_CAPABILITIES, p as GET_FEEDBACK_TIME_SERIES, r as CREATE_SCORE, s as GET_ENTITY_NAMES, t as AGGREGATE_TRACES, u as GET_FEEDBACK_AGGREGATE, v as GET_METRIC_NAMES, w as GET_SCORE_PERCENTILES, x as GET_SCORE, y as GET_METRIC_PERCENTILES } from "../../observability-new-endpoints-
|
|
1
|
+
import { A as LIST_FEEDBACK, C as GET_SCORE_BREAKDOWN, D as GET_TAGS, E as GET_SERVICE_NAMES, F as QUERY_SPANS, I as QUERY_THREADS, L as QUERY_TRACES, M as LIST_METRICS, N as LIST_SCORES, O as GET_TRACE_QUERY_FIELDS, P as NEW_ROUTES, R as UPDATE_FEEDBACK_REVIEW_STATUS, S as GET_SCORE_AGGREGATE, T as GET_SCORE_TIME_SERIES, _ as GET_METRIC_LABEL_VALUES, a as DELETE_SCORES, b as GET_METRIC_TIME_SERIES, c as GET_ENTITY_TYPES, d as GET_FEEDBACK_BREAKDOWN, f as GET_FEEDBACK_PERCENTILES, g as GET_METRIC_LABEL_KEYS, h as GET_METRIC_BREAKDOWN, i as DELETE_FEEDBACK, j as LIST_LOGS, k as GET_TRACE_QUERY_VALUES, l as GET_ENVIRONMENTS, m as GET_METRIC_AGGREGATE, n as CREATE_FEEDBACK, o as GET_CAPABILITIES, p as GET_FEEDBACK_TIME_SERIES, r as CREATE_SCORE, s as GET_ENTITY_NAMES, t as AGGREGATE_TRACES, u as GET_FEEDBACK_AGGREGATE, v as GET_METRIC_NAMES, w as GET_SCORE_PERCENTILES, x as GET_SCORE, y as GET_METRIC_PERCENTILES } from "../../observability-new-endpoints-C5VO7nLK.js";
|
|
2
2
|
export { AGGREGATE_TRACES, CREATE_FEEDBACK, CREATE_SCORE, DELETE_FEEDBACK, DELETE_SCORES, GET_CAPABILITIES, 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, GET_SCORE_AGGREGATE, GET_SCORE_BREAKDOWN, GET_SCORE_PERCENTILES, GET_SCORE_TIME_SERIES, GET_SERVICE_NAMES, GET_TAGS, GET_TRACE_QUERY_FIELDS, GET_TRACE_QUERY_VALUES, LIST_FEEDBACK, LIST_LOGS, LIST_METRICS, LIST_SCORES, NEW_ROUTES, QUERY_SPANS, QUERY_THREADS, QUERY_TRACES, UPDATE_FEEDBACK_REVIEW_STATUS };
|
|
@@ -13,6 +13,24 @@ const OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE = "Delta polling requires a ne
|
|
|
13
13
|
const OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE = "trace-query";
|
|
14
14
|
const OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE = "trace-aggregate";
|
|
15
15
|
const OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE = "span-query";
|
|
16
|
+
const SPAN_QUERY_CONTEXT_FIELDS = /* @__PURE__ */ new Set([
|
|
17
|
+
"traceId",
|
|
18
|
+
"spanId",
|
|
19
|
+
"parentSpanId",
|
|
20
|
+
"threadId",
|
|
21
|
+
"resourceId",
|
|
22
|
+
"requestId",
|
|
23
|
+
"serviceName",
|
|
24
|
+
"experimentId",
|
|
25
|
+
"environment",
|
|
26
|
+
"executionSource",
|
|
27
|
+
"parentEntityType",
|
|
28
|
+
"parentEntityId",
|
|
29
|
+
"parentEntityName",
|
|
30
|
+
"rootEntityType",
|
|
31
|
+
"rootEntityId",
|
|
32
|
+
"rootEntityName"
|
|
33
|
+
]);
|
|
16
34
|
const OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE = "trace-query-root-duration";
|
|
17
35
|
const OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE = "trace-query-context-ids";
|
|
18
36
|
const TRACE_QUERY_CONTEXT_ID_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -81,6 +99,16 @@ function assertObservabilitySpanQuerySupported(observabilityStore) {
|
|
|
81
99
|
if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE)) return;
|
|
82
100
|
throw new require_http_exception.HTTPException(501, { message: "Span queries are not supported by the configured observability store" });
|
|
83
101
|
}
|
|
102
|
+
function assertObservabilitySpanQueryFieldsSupported(observabilityStore, predicate) {
|
|
103
|
+
if (!predicate || getFeatures(observabilityStore)?.includes("span-query-context-fields")) return;
|
|
104
|
+
if (predicate.type === "boolean") for (const arg of predicate.args) assertObservabilitySpanQueryFieldsSupported(observabilityStore, arg);
|
|
105
|
+
else if (predicate.type === "not") assertObservabilitySpanQueryFieldsSupported(observabilityStore, predicate.arg);
|
|
106
|
+
else if (SPAN_QUERY_CONTEXT_FIELDS.has(predicate.field)) throw new _mastra_core_storage.TraceQueryValidationError([{
|
|
107
|
+
code: "field_not_allowed",
|
|
108
|
+
path: ["where"],
|
|
109
|
+
message: `Filtering by ${predicate.field} requires an updated storage adapter with span query context-field support.`
|
|
110
|
+
}]);
|
|
111
|
+
}
|
|
84
112
|
function usesRootDuration(predicate) {
|
|
85
113
|
if (!predicate) return false;
|
|
86
114
|
if (predicate.type === "boolean") return predicate.args.some(usesRootDuration);
|
|
@@ -577,6 +605,7 @@ exports.OBSERVABILITY_LIST_ENDPOINTS = OBSERVABILITY_LIST_ENDPOINTS;
|
|
|
577
605
|
exports.OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_CORE_FEATURE = OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_CORE_FEATURE;
|
|
578
606
|
exports.OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE = OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE;
|
|
579
607
|
exports.assertObservabilityDeltaSupported = assertObservabilityDeltaSupported;
|
|
608
|
+
exports.assertObservabilitySpanQueryFieldsSupported = assertObservabilitySpanQueryFieldsSupported;
|
|
580
609
|
exports.assertObservabilitySpanQuerySupported = assertObservabilitySpanQuerySupported;
|
|
581
610
|
exports.assertObservabilityThreadQuerySupported = assertObservabilityThreadQuerySupported;
|
|
582
611
|
exports.assertObservabilityTraceAggregateSupported = assertObservabilityTraceAggregateSupported;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability-shared.cjs","names":["coreStorage","candidate","HTTPException","coreFeatures","z","paginationArgsSchema","wrapSchemaForQueryParams","listModeSchema","deltaCursorSchema","deltaLimitSchema"],"sources":["../../../src/server/handlers/observability-shared.ts"],"sourcesContent":["import type { Mastra } from '@mastra/core';\nimport { coreFeatures } from '@mastra/core/features';\nimport type {\n MastraCompositeStore,\n ObservabilityStorage,\n ScoresStorage,\n TrustedThreadPredicate,\n TrustedTraceQueryPredicate,\n} from '@mastra/core/storage';\nimport * as coreStorage from '@mastra/core/storage';\nimport { z } from 'zod/v4';\nimport { HTTPException } from '../http-exception';\nimport type { ServerRoute } from '../server-adapter/routes';\nimport { wrapSchemaForQueryParams } from '../server-adapter/routes/route-builder';\nimport {\n deltaCursorSchema,\n deltaLimitSchema,\n listModeSchema,\n paginationArgsSchema,\n} from './observability-list-query-schemas';\n\nexport const OBSERVABILITY_DELTA_POLLING_FEATURE = 'observability-delta-polling';\nexport const OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE =\n 'Delta polling requires a newer @mastra/core with observability delta polling support. Please upgrade.';\nconst OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE = 'trace-query';\nconst OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE = 'trace-aggregate';\nconst OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE = 'span-query';\nconst OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE = 'trace-query-root-duration';\nconst OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE = 'trace-query-context-ids';\nconst TRACE_QUERY_CONTEXT_ID_FIELDS = new Set(['runId', 'sessionId', 'userId', 'organizationId']);\nconst OBSERVABILITY_TRACE_QUERY_DISCOVERY_STORAGE_FEATURE = 'trace-query-discovery';\nconst OBSERVABILITY_THREAD_QUERY_STORAGE_FEATURE = 'thread-query';\nconst OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_STORAGE_FEATURE = 'trace-query-tenant-scope';\nconst OBSERVABILITY_FEEDBACK_STORAGE_FEATURE = 'feedback';\nexport const OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_CORE_FEATURE = 'observability-trace-query-tenant-scope';\nexport const OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE =\n 'Trusted tenant scope requires a newer @mastra/core with trace-query tenant scope support. Please upgrade.';\n\nexport function supportsTraceQueryDiscoveryCore() {\n return (\n coreStorage.getTraceQueryFieldsArgsSchema !== undefined &&\n coreStorage.getTraceQueryFieldsResponseSchema !== undefined &&\n coreStorage.getTraceQueryValuesArgsSchema !== undefined &&\n coreStorage.getTraceQueryValuesResponseSchema !== undefined &&\n typeof coreStorage.planTraceQueryObservedFields === 'function' &&\n typeof coreStorage.planTraceQueryValues === 'function' &&\n typeof coreStorage.getTraceQueryCanonicalFieldDescriptors === 'function' &&\n typeof coreStorage.TraceQueryResourceLimitError === 'function'\n );\n}\n\nexport function supportsTraceAggregateCore() {\n return (\n coreStorage.traceAggregateRequestSchema !== undefined &&\n coreStorage.traceAggregateResponseSchema !== undefined &&\n typeof coreStorage.planTraceAggregate === 'function'\n );\n}\n\nexport function supportsSpanQueryCore() {\n return (\n coreStorage.spanQueryRequestSchema !== undefined &&\n coreStorage.spanQueryResponseSchema !== undefined &&\n typeof coreStorage.planSpanQuery === 'function'\n );\n}\n\nexport const OBSERVABILITY_LIST_ENDPOINTS = {\n traces: 'traces',\n branches: 'branches',\n logs: 'logs',\n metrics: 'metrics',\n scores: 'scores',\n feedback: 'feedback',\n} as const;\n\nexport type ObservabilityListEndpoint =\n (typeof OBSERVABILITY_LIST_ENDPOINTS)[keyof typeof OBSERVABILITY_LIST_ENDPOINTS];\nconst OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE = 'delta-polling';\n\nfunction getFeatures(observabilityStore: ObservabilityStorage): readonly string[] | undefined {\n const candidate = observabilityStore as ObservabilityStorage & {\n getFeatures?: () => readonly string[] | undefined;\n };\n return candidate.getFeatures?.();\n}\n\n/** Retrieves MastraCompositeStore or throws 500 if unavailable. */\nexport function getStorage(mastra: Mastra): MastraCompositeStore {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n return storage;\n}\n\n/** Retrieves the observability storage domain or throws 501 if unavailable. */\nexport async function getObservabilityStore(mastra: Mastra): Promise<ObservabilityStorage> {\n const storage = getStorage(mastra);\n const observability = await storage.getStore('observability');\n if (!observability) {\n // 501, not 500: a missing or explicitly disabled observability domain\n // (e.g. `domains: { observability: false }`) is a capability gap, not a\n // server failure — matching the other 501s in this file.\n throw new HTTPException(501, { message: 'Observability storage domain is not available' });\n }\n return observability;\n}\n\n/** Retrieves the scores storage domain or throws 501 if unavailable. */\nexport async function getScoresStore(mastra: Mastra): Promise<ScoresStorage> {\n const storage = getStorage(mastra);\n const scores = await storage.getStore('scores');\n if (!scores) {\n throw new HTTPException(501, { message: 'Scores storage domain is not available' });\n }\n return scores;\n}\n\nexport function assertObservabilityTraceQuerySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Advanced trace queries are not supported by the configured observability store',\n });\n}\n\nexport function supportsObservabilityTraceAggregate(observabilityStore: ObservabilityStorage) {\n return getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE) === true;\n}\n\nexport function assertObservabilityTraceAggregateSupported(observabilityStore: ObservabilityStorage) {\n if (supportsObservabilityTraceAggregate(observabilityStore)) return;\n\n throw new HTTPException(501, {\n message: 'Trace aggregation is not supported by the configured observability store',\n });\n}\n\nexport function assertObservabilitySpanQuerySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Span queries are not supported by the configured observability store',\n });\n}\n\nfunction usesRootDuration(predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined): boolean {\n if (!predicate) return false;\n if (predicate.type === 'boolean') return predicate.args.some(usesRootDuration);\n if (predicate.type === 'not') return usesRootDuration(predicate.arg);\n if (predicate.type === 'relation') {\n return predicate.collection === 'traces' && usesRootDuration(predicate.predicate);\n }\n return predicate.field === 'durationMs';\n}\n\nexport function supportsObservabilityTraceQueryRootDuration(observabilityStore: ObservabilityStorage) {\n return getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE) === true;\n}\n\nexport function assertObservabilityTraceQueryRootDurationSupported(\n observabilityStore: ObservabilityStorage,\n predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined,\n) {\n if (!usesRootDuration(predicate) || supportsObservabilityTraceQueryRootDuration(observabilityStore)) return;\n\n throw new HTTPException(501, {\n message: 'Root duration predicates are not supported by the configured observability store',\n });\n}\n\nfunction usesContextId(predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined): boolean {\n if (!predicate) return false;\n if (predicate.type === 'boolean') return predicate.args.some(usesContextId);\n if (predicate.type === 'not') return usesContextId(predicate.arg);\n if (predicate.type === 'relation') return usesContextId(predicate.predicate);\n return TRACE_QUERY_CONTEXT_ID_FIELDS.has(predicate.field);\n}\n\nexport function supportsObservabilityTraceQueryContextIds(observabilityStore: ObservabilityStorage) {\n return getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE) === true;\n}\n\nexport function isTraceQueryContextIdField(path: string): boolean {\n return TRACE_QUERY_CONTEXT_ID_FIELDS.has(path);\n}\n\nexport function assertObservabilityTraceQueryContextIdsSupported(\n observabilityStore: ObservabilityStorage,\n predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined,\n) {\n if (!usesContextId(predicate) || supportsObservabilityTraceQueryContextIds(observabilityStore)) return;\n\n throw new HTTPException(501, {\n message: 'Context identifier predicates are not supported by the configured observability store',\n });\n}\n\nexport function assertObservabilityTraceQueryDiscoverySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_DISCOVERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Trace query discovery is not supported by the configured observability store',\n });\n}\n\n/**\n * A scoped request must never run unscoped: a store that predates tenant scope would\n * silently ignore `plan.scope` and return every tenant's rows, so it is rejected instead.\n * Unscoped requests are unaffected.\n */\nexport function assertObservabilityTraceQueryTenantScopeSupported(\n observabilityStore: ObservabilityStorage,\n scope: coreStorage.TraceQueryTenantScope | undefined,\n) {\n if (scope === undefined) return;\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'The configured observability store cannot enforce the trusted tenant scope',\n });\n}\n\nexport function assertObservabilityThreadQuerySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_THREAD_QUERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Advanced thread queries are not supported by the configured observability store',\n });\n}\n\n/**\n * Returns true when the store's class chain overrides `method` below the class\n * that first declares it (the `ObservabilityStorage` base, whose default\n * throws `*_NOT_IMPLEMENTED`). Walks the store's own prototype chain instead of\n * comparing against this package's `ObservabilityStorage.prototype`, so it\n * works for stores built against older or duplicated `@mastra/core` installs\n * and for stores that predate {@link ObservabilityStorage.getFeatures}.\n */\nfunction implementsObservabilityStorageMethod(observabilityStore: object, method: string): boolean {\n if (Object.prototype.hasOwnProperty.call(observabilityStore, method)) return true;\n\n let resolvedOwner: object | undefined;\n let declaringBase: object | undefined;\n for (\n let proto: object | null = Object.getPrototypeOf(observabilityStore);\n proto && proto !== Object.prototype;\n proto = Object.getPrototypeOf(proto)\n ) {\n if (Object.prototype.hasOwnProperty.call(proto, method)) {\n resolvedOwner ??= proto;\n declaringBase = proto;\n }\n }\n return resolvedOwner !== undefined && resolvedOwner !== declaringBase;\n}\n\nexport type ObservabilityDiscoveryCapabilities = {\n entityTypes: boolean;\n entityNames: boolean;\n serviceNames: boolean;\n environments: boolean;\n tags: boolean;\n metrics: boolean;\n};\n\nexport type ObservabilityStorageCapabilities = {\n metrics: boolean;\n logs: boolean;\n discovery: ObservabilityDiscoveryCapabilities;\n deltaPolling: boolean;\n traceQuery: boolean;\n traceQueryRootDuration: boolean;\n traceQueryContextIds: boolean;\n traceQueryDiscovery: boolean;\n traceQueryTenantScope: boolean;\n traceAggregate: boolean;\n threadQuery: boolean;\n spanQuery: boolean;\n /** Days of traces the store keeps. Omitted when the store does not report a limit. */\n traceRetentionDays?: number;\n feedback: boolean;\n};\n\nexport const NO_OBSERVABILITY_STORAGE_CAPABILITIES: ObservabilityStorageCapabilities = {\n metrics: false,\n logs: false,\n discovery: {\n entityTypes: false,\n entityNames: false,\n serviceNames: false,\n environments: false,\n tags: false,\n metrics: false,\n },\n deltaPolling: false,\n traceQuery: false,\n traceQueryRootDuration: false,\n traceQueryContextIds: false,\n traceQueryDiscovery: false,\n traceQueryTenantScope: false,\n traceAggregate: false,\n threadQuery: false,\n spanQuery: false,\n feedback: false,\n};\n\n/**\n * Resolves which optional observability APIs the configured store can serve.\n *\n * Feature declarations (`getFeatures()`) are optional. When a store declares\n * a feature list, that list is final. Stores without `getFeatures()` predate\n * declarations: metrics, logs and filter discovery are detected by whether the\n * store implements the underlying method, so those packages report accurately\n * without being upgraded. Delta polling and the trace/thread query APIs depend\n * on runtime behavior a method check can't see, so they are only reported for\n * stores that declare them. Feedback is also declaration-only: Studio hides\n * the feedback UI behind this flag, and store versions that implement feedback\n * without declaring it simply don't advertise it until upgraded.\n */\nexport function getObservabilityStorageCapabilities(\n observabilityStore: ObservabilityStorage,\n): ObservabilityStorageCapabilities {\n const declaredFeatures = getFeatures(observabilityStore);\n const features = declaredFeatures ?? [];\n const newApiCore = coreFeatures.has('observability:v1.13.2');\n const declares = (feature: string) => features.includes(feature);\n // Undeclared stores must implement every method behind the feature.\n const supports = (feature: string, methods: readonly string[]) => {\n if (!newApiCore) return false;\n if (!declaredFeatures) {\n return methods.every(method => implementsObservabilityStorageMethod(observabilityStore, method));\n }\n return declares(feature);\n };\n // Stores released before the per-endpoint discovery features existed declare\n // `trace-query` and implement every discovery method, so treat it as implying discovery.\n const supportsDiscovery = (feature: string, methods: readonly string[]) =>\n supports(feature, methods) || (newApiCore && declares(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE));\n const traceQuery =\n newApiCore &&\n typeof coreStorage.planTraceQuery === 'function' &&\n declares(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE);\n const threadQuery =\n newApiCore &&\n typeof coreStorage.planThreadQuery === 'function' &&\n declares(OBSERVABILITY_THREAD_QUERY_STORAGE_FEATURE);\n\n return {\n // `listMetrics` is left out: it backs a newer route that metric dashboards don't use,\n // and older stores that implement the OLAP methods predate it.\n metrics: supports('metrics', [\n 'getMetricAggregate',\n 'getMetricBreakdown',\n 'getMetricTimeSeries',\n 'getMetricPercentiles',\n ]),\n logs: supports('logs', ['listLogs']),\n discovery: {\n entityTypes: supportsDiscovery('entity-type-discovery', ['getEntityTypes']),\n entityNames: supportsDiscovery('entity-name-discovery', ['getEntityNames']),\n serviceNames: supportsDiscovery('service-name-discovery', ['getServiceNames']),\n environments: supportsDiscovery('environment-discovery', ['getEnvironments']),\n tags: supportsDiscovery('tag-discovery', ['getTags']),\n metrics: supportsDiscovery('metric-discovery', ['getMetricNames', 'getMetricLabelKeys', 'getMetricLabelValues']),\n },\n deltaPolling:\n coreFeatures.has(OBSERVABILITY_DELTA_POLLING_FEATURE) && declares(OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE),\n traceQuery,\n traceQueryRootDuration:\n (traceQuery || threadQuery) && declares(OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE),\n traceQueryContextIds:\n (traceQuery || threadQuery) && declares(OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE),\n traceQueryDiscovery:\n newApiCore && supportsTraceQueryDiscoveryCore() && declares(OBSERVABILITY_TRACE_QUERY_DISCOVERY_STORAGE_FEATURE),\n traceQueryTenantScope:\n (traceQuery || threadQuery) &&\n coreFeatures.has(OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_CORE_FEATURE) &&\n declares(OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_STORAGE_FEATURE),\n traceAggregate:\n newApiCore && supportsTraceAggregateCore() && declares(OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE),\n threadQuery,\n spanQuery: newApiCore && supportsSpanQueryCore() && declares(OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE),\n feedback: newApiCore && declares(OBSERVABILITY_FEEDBACK_STORAGE_FEATURE),\n };\n}\n\n/**\n * Matches the `OBSERVABILITY_STORAGE_*_NOT_IMPLEMENTED` MastraError the base\n * observability store throws for every optional method a store doesn't\n * implement. Checked by id (not `instanceof`) so it holds across duplicated\n * `@mastra/core` installs.\n */\nfunction isObservabilityStorageNotImplementedError(error: unknown): boolean {\n const id = error && typeof error === 'object' && 'id' in error ? error.id : undefined;\n return typeof id === 'string' && id.startsWith('OBSERVABILITY_STORAGE_') && id.endsWith('_NOT_IMPLEMENTED');\n}\n\n/**\n * Discovery is optional for observability stores. When the configured store\n * doesn't implement a discovery method, answer with an empty result instead of\n * a 500 so filter lookups degrade quietly on stores without discovery support.\n * Clients should check `observabilityStorageCapabilities.discovery` from\n * `GET /system/packages` before calling these routes.\n */\nexport async function withDiscoveryFallback<T>(run: () => Promise<T>, empty: T): Promise<T> {\n try {\n return await run();\n } catch (error) {\n if (isObservabilityStorageNotImplementedError(error)) return empty;\n throw error;\n }\n}\n\nexport function assertObservabilityDeltaSupported(\n observabilityStore: ObservabilityStorage,\n endpoint: ObservabilityListEndpoint,\n) {\n if (!coreFeatures.has(OBSERVABILITY_DELTA_POLLING_FEATURE)) {\n throw new HTTPException(501, {\n message: `${OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE} (endpoint: ${endpoint})`,\n });\n }\n\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE)) {\n return;\n }\n\n throw new HTTPException(501, {\n message: `Delta polling is not supported by the configured observability store for ${endpoint}`,\n });\n}\n\nexport interface RouteDetails {\n method: ServerRoute['method'];\n path: `/${string}`;\n summary: string;\n description: string;\n requiresPermission?: ServerRoute['requiresPermission'];\n}\n\nexport const NEW_ROUTE_DEFS = {\n QUERY_TRACES: {\n method: 'POST',\n path: '/observability/traces/query',\n summary: 'Query traces',\n description:\n 'Returns completed logical traces or distinct thread groups matching an advanced trace query. Thread grouping remains supported but is deprecated; use queryTraceThreads instead.',\n requiresPermission: 'observability:read',\n },\n\n AGGREGATE_TRACES: {\n method: 'POST',\n path: '/observability/traces/aggregate',\n summary: 'Aggregate traces',\n description:\n 'Returns grouped and optionally time-bucketed measures (counts, durations, error rates) over completed logical traces matching an advanced trace predicate',\n requiresPermission: 'observability:read',\n },\n\n QUERY_THREADS: {\n method: 'POST',\n path: '/observability/threads/query',\n summary: 'Query threads',\n description: 'Returns thread identities matching eligible trace and cross-trace predicates',\n requiresPermission: 'observability:read',\n },\n\n QUERY_SPANS: {\n method: 'POST',\n path: '/observability/spans/query',\n summary: 'Query spans',\n description: 'Returns completed spans matching a span predicate, one row per span, with cursor pagination',\n requiresPermission: 'observability:read',\n },\n\n GET_TRACE_QUERY_FIELDS: {\n method: 'POST',\n path: '/observability/traces/query/fields',\n summary: 'Discover trace query fields',\n description: 'Returns canonical query fields and observed top-level string metadata fields',\n requiresPermission: 'observability:read',\n },\n\n GET_TRACE_QUERY_VALUES: {\n method: 'POST',\n path: '/observability/traces/query/values',\n summary: 'Discover trace query values',\n description: 'Returns bounded string value suggestions and occurrence counts for one eligible query field',\n requiresPermission: 'observability:read',\n },\n\n LIST_METRICS: {\n method: 'GET',\n path: '/observability/metrics',\n summary: 'List metrics',\n description: 'Returns a paginated list of metrics with optional filtering and sorting',\n },\n\n LIST_LOGS: {\n method: 'GET',\n path: '/observability/logs',\n summary: 'List logs',\n description: 'Returns a paginated list of logs with optional filtering and sorting',\n },\n\n LIST_SCORES: {\n method: 'GET',\n path: '/observability/scores',\n summary: 'List scores',\n description: 'Returns a paginated list of scores with optional filtering and sorting',\n },\n\n CREATE_SCORE: {\n method: 'POST',\n path: '/observability/scores',\n summary: 'Create a score',\n description: 'Creates a single score record in the observability store',\n },\n\n DELETE_SCORES: {\n method: 'DELETE',\n path: '/observability/scores',\n summary: 'Delete scores',\n description: 'Deletes score records by scoreId, optionally scoped to a tenant',\n requiresPermission: 'observability:delete',\n },\n\n GET_SCORE: {\n method: 'GET',\n path: '/observability/scores/:scoreId',\n summary: 'Get score',\n description: 'Returns a single score by scoreId',\n },\n\n GET_SCORE_AGGREGATE: {\n method: 'POST',\n path: '/observability/scores/aggregate',\n summary: 'Get score aggregate',\n description: 'Returns an aggregated score value with optional period-over-period comparison',\n requiresPermission: 'observability:read',\n },\n\n GET_SCORE_BREAKDOWN: {\n method: 'POST',\n path: '/observability/scores/breakdown',\n summary: 'Get score breakdown',\n description: 'Returns score values grouped by specified dimensions',\n requiresPermission: 'observability:read',\n },\n\n GET_SCORE_TIME_SERIES: {\n method: 'POST',\n path: '/observability/scores/timeseries',\n summary: 'Get score time series',\n description: 'Returns score values bucketed by time interval with optional grouping',\n requiresPermission: 'observability:read',\n },\n\n GET_SCORE_PERCENTILES: {\n method: 'POST',\n path: '/observability/scores/percentiles',\n summary: 'Get score percentiles',\n description: 'Returns percentile values for a score bucketed by time interval',\n requiresPermission: 'observability:read',\n },\n\n LIST_FEEDBACK: {\n method: 'GET',\n path: '/observability/feedback',\n summary: 'List feedback',\n description: 'Returns a paginated list of feedback with optional filtering and sorting',\n },\n\n CREATE_FEEDBACK: {\n method: 'POST',\n path: '/observability/feedback',\n summary: 'Create feedback',\n description: 'Creates a single feedback record in the observability store',\n },\n\n DELETE_FEEDBACK: {\n method: 'DELETE',\n path: '/observability/feedback',\n summary: 'Delete feedback',\n description: 'Deletes feedback records by feedbackId, optionally scoped to a tenant',\n requiresPermission: 'observability:delete',\n },\n\n UPDATE_FEEDBACK_REVIEW_STATUS: {\n method: 'PATCH',\n path: '/observability/feedback/:feedbackId/review-status',\n summary: 'Update feedback review status',\n description: \"Updates a feedback record's review workflow status\",\n requiresPermission: 'observability:write',\n },\n\n GET_FEEDBACK_AGGREGATE: {\n method: 'POST',\n path: '/observability/feedback/aggregate',\n summary: 'Get feedback aggregate',\n description: 'Returns an aggregated numeric feedback value with optional period-over-period comparison',\n requiresPermission: 'observability:read',\n },\n\n GET_FEEDBACK_BREAKDOWN: {\n method: 'POST',\n path: '/observability/feedback/breakdown',\n summary: 'Get feedback breakdown',\n description: 'Returns numeric feedback values grouped by specified dimensions',\n requiresPermission: 'observability:read',\n },\n\n GET_FEEDBACK_TIME_SERIES: {\n method: 'POST',\n path: '/observability/feedback/timeseries',\n summary: 'Get feedback time series',\n description: 'Returns numeric feedback values bucketed by time interval with optional grouping',\n requiresPermission: 'observability:read',\n },\n\n GET_FEEDBACK_PERCENTILES: {\n method: 'POST',\n path: '/observability/feedback/percentiles',\n summary: 'Get feedback percentiles',\n description: 'Returns percentile values for numeric feedback bucketed by time interval',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_AGGREGATE: {\n method: 'POST',\n path: '/observability/metrics/aggregate',\n summary: 'Get metric aggregate',\n description: 'Returns an aggregated metric value with optional period-over-period comparison',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_BREAKDOWN: {\n method: 'POST',\n path: '/observability/metrics/breakdown',\n summary: 'Get metric breakdown',\n description: 'Returns metric values grouped by specified dimensions',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_TIME_SERIES: {\n method: 'POST',\n path: '/observability/metrics/timeseries',\n summary: 'Get metric time series',\n description: 'Returns metric values bucketed by time interval with optional grouping',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_PERCENTILES: {\n method: 'POST',\n path: '/observability/metrics/percentiles',\n summary: 'Get metric percentiles',\n description: 'Returns percentile values for a metric bucketed by time interval',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_NAMES: {\n method: 'GET',\n path: '/observability/discovery/metric-names',\n summary: 'Get metric names',\n description: 'Returns distinct metric names with optional prefix filtering',\n },\n\n GET_METRIC_LABEL_KEYS: {\n method: 'GET',\n path: '/observability/discovery/metric-label-keys',\n summary: 'Get metric label keys',\n description: 'Returns distinct label keys for a given metric',\n },\n\n GET_METRIC_LABEL_VALUES: {\n method: 'GET',\n path: '/observability/discovery/metric-label-values',\n summary: 'Get label values',\n description: 'Returns distinct values for a given metric label key',\n },\n\n GET_ENTITY_TYPES: {\n method: 'GET',\n path: '/observability/discovery/entity-types',\n summary: 'Get entity types',\n description: 'Returns distinct entity types from observability data',\n },\n\n GET_ENTITY_NAMES: {\n method: 'GET',\n path: '/observability/discovery/entity-names',\n summary: 'Get entity names',\n description: 'Returns distinct entity names with optional type filtering',\n },\n\n GET_SERVICE_NAMES: {\n method: 'GET',\n path: '/observability/discovery/service-names',\n summary: 'Get service names',\n description: 'Returns distinct service names from observability data',\n },\n\n GET_ENVIRONMENTS: {\n method: 'GET',\n path: '/observability/discovery/environments',\n summary: 'Get environments',\n description: 'Returns distinct environments from observability data',\n },\n\n GET_TAGS: {\n method: 'GET',\n path: '/observability/discovery/tags',\n summary: 'Get tags',\n description: 'Returns distinct tags with optional entity type filtering',\n },\n\n GET_CAPABILITIES: {\n method: 'GET',\n path: '/observability/capabilities',\n summary: 'Get observability capabilities',\n description:\n 'Returns which optional observability APIs the configured observability storage supports. Every flag is false when no observability storage is configured.',\n },\n} as const satisfies Record<string, RouteDetails>;\n\nexport type NewRoutesKey = keyof typeof NEW_ROUTE_DEFS;\nexport type NewRoutesDefinitions = (typeof NEW_ROUTE_DEFS)[NewRoutesKey];\n\nexport function createObservabilityListQuerySchema<\n TFilter extends z.ZodObject<z.ZodRawShape>,\n TOrderBy extends z.ZodObject<z.ZodRawShape>,\n>(filterSchema: TFilter, orderBySchema: TOrderBy) {\n const unwrapDefault = (schema: unknown) => {\n const zodSchema = schema as z.ZodTypeAny;\n return zodSchema instanceof z.ZodDefault ? zodSchema.unwrap() : zodSchema;\n };\n const paginationShape = paginationArgsSchema.shape as unknown as Record<string, z.ZodTypeAny>;\n const orderByShape = orderBySchema.shape as unknown as Record<string, z.ZodTypeAny>;\n\n const pageSchema = unwrapDefault(paginationShape.page);\n const perPageSchema = unwrapDefault(paginationShape.perPage);\n const fieldSchema = orderByShape.field ? unwrapDefault(orderByShape.field) : z.never().optional();\n const directionSchema = orderByShape.direction ? unwrapDefault(orderByShape.direction) : z.never().optional();\n\n return wrapSchemaForQueryParams(\n z\n .object({\n ...filterSchema.shape,\n page: pageSchema,\n perPage: perPageSchema,\n field: fieldSchema,\n direction: directionSchema,\n mode: listModeSchema.optional(),\n after: deltaCursorSchema.optional(),\n limit: deltaLimitSchema,\n })\n .partial(),\n ).superRefine((value, ctx) => {\n const isDelta = value.mode === 'delta';\n const hasPagination = value.page !== undefined || value.perPage !== undefined;\n const hasOrderBy = value.field !== undefined || value.direction !== undefined;\n const hasAfter = value.after !== undefined;\n const hasLimit = value.limit !== undefined;\n\n if (isDelta) {\n if (hasPagination) {\n if (value.page !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['page'],\n message: '`page` is not allowed when `mode=delta`',\n });\n }\n if (value.perPage !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['perPage'],\n message: '`perPage` is not allowed when `mode=delta`',\n });\n }\n }\n if (hasOrderBy) {\n if (value.field !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['field'],\n message: '`field` is not allowed when `mode=delta`',\n });\n }\n if (value.direction !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['direction'],\n message: '`direction` is not allowed when `mode=delta`',\n });\n }\n }\n return;\n }\n\n if (hasAfter) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['after'],\n message: '`after` is only allowed when `mode=delta`',\n });\n }\n if (hasLimit) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['limit'],\n message: '`limit` is only allowed when `mode=delta`',\n });\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,sCAAsC;AACnD,MAAa,8CACX;AACF,MAAM,4CAA4C;AAClD,MAAM,gDAAgD;AACtD,MAAM,2CAA2C;AACjD,MAAM,0DAA0D;AAChE,MAAM,wDAAwD;AAC9D,MAAM,gDAAgC,IAAI,IA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AAY,KAAA;EACpE,MAAM,aAAa,MAAM,UAAU,KAAA,KAAa,MAAM,cAAc,KAAA;EACpE,MAAM,WAAW,MAAM,UAAU,KAAA;EACjC,MAAM,WAAW,MAAM,UAAU,KAAA;EAEjC,IAAI,SAAS;GACX,IAAI,eAAe;IACjB,IAAI,MAAM,SAAS,KAAA,GACjB,IAAI,SAAS;KACX,MAAML,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,MAAM;KACb,SAAS;IACX,CAAC;IAEH,IAAI,MAAM,YAAY,KAAA,GACpB,IAAI,SAAS;KACX,MAAMA,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,SAAS;KAChB,SAAS;IACX,CAAC;GAEL;GACA,IAAI,YAAY;IACd,IAAI,MAAM,UAAU,KAAA,GAClB,IAAI,SAAS;KACX,MAAMA,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,OAAO;KACd,SAAS;IACX,CAAC;IAEH,IAAI,MAAM,cAAc,KAAA,GACtB,IAAI,SAAS;KACX,MAAMA,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,WAAW;KAClB,SAAS;IACX,CAAC;GAEL;GACA;EACF;EAEA,IAAI,UACF,IAAI,SAAS;GACX,MAAMA,OAAAA,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;EAEH,IAAI,UACF,IAAI,SAAS;GACX,MAAMA,OAAAA,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;CAEL,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"observability-shared.cjs","names":["coreStorage","candidate","HTTPException","coreFeatures","z","paginationArgsSchema","wrapSchemaForQueryParams","listModeSchema","deltaCursorSchema","deltaLimitSchema"],"sources":["../../../src/server/handlers/observability-shared.ts"],"sourcesContent":["import type { Mastra } from '@mastra/core';\nimport { coreFeatures } from '@mastra/core/features';\nimport type {\n MastraCompositeStore,\n ObservabilityStorage,\n ScoresStorage,\n TrustedTraceQueryScalarPredicate,\n TrustedThreadPredicate,\n TrustedTraceQueryPredicate,\n} from '@mastra/core/storage';\nimport * as coreStorage from '@mastra/core/storage';\nimport { z } from 'zod/v4';\nimport { HTTPException } from '../http-exception';\nimport type { ServerRoute } from '../server-adapter/routes';\nimport { wrapSchemaForQueryParams } from '../server-adapter/routes/route-builder';\nimport {\n deltaCursorSchema,\n deltaLimitSchema,\n listModeSchema,\n paginationArgsSchema,\n} from './observability-list-query-schemas';\n\nexport const OBSERVABILITY_DELTA_POLLING_FEATURE = 'observability-delta-polling';\nexport const OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE =\n 'Delta polling requires a newer @mastra/core with observability delta polling support. Please upgrade.';\nconst OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE = 'trace-query';\nconst OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE = 'trace-aggregate';\nconst OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE = 'span-query';\nconst SPAN_QUERY_CONTEXT_FIELDS = new Set([\n 'traceId',\n 'spanId',\n 'parentSpanId',\n 'threadId',\n 'resourceId',\n 'requestId',\n 'serviceName',\n 'experimentId',\n 'environment',\n 'executionSource',\n 'parentEntityType',\n 'parentEntityId',\n 'parentEntityName',\n 'rootEntityType',\n 'rootEntityId',\n 'rootEntityName',\n]);\nconst OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE = 'trace-query-root-duration';\nconst OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE = 'trace-query-context-ids';\nconst TRACE_QUERY_CONTEXT_ID_FIELDS = new Set(['runId', 'sessionId', 'userId', 'organizationId']);\nconst OBSERVABILITY_TRACE_QUERY_DISCOVERY_STORAGE_FEATURE = 'trace-query-discovery';\nconst OBSERVABILITY_THREAD_QUERY_STORAGE_FEATURE = 'thread-query';\nconst OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_STORAGE_FEATURE = 'trace-query-tenant-scope';\nconst OBSERVABILITY_FEEDBACK_STORAGE_FEATURE = 'feedback';\nexport const OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_CORE_FEATURE = 'observability-trace-query-tenant-scope';\nexport const OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE =\n 'Trusted tenant scope requires a newer @mastra/core with trace-query tenant scope support. Please upgrade.';\n\nexport function supportsTraceQueryDiscoveryCore() {\n return (\n coreStorage.getTraceQueryFieldsArgsSchema !== undefined &&\n coreStorage.getTraceQueryFieldsResponseSchema !== undefined &&\n coreStorage.getTraceQueryValuesArgsSchema !== undefined &&\n coreStorage.getTraceQueryValuesResponseSchema !== undefined &&\n typeof coreStorage.planTraceQueryObservedFields === 'function' &&\n typeof coreStorage.planTraceQueryValues === 'function' &&\n typeof coreStorage.getTraceQueryCanonicalFieldDescriptors === 'function' &&\n typeof coreStorage.TraceQueryResourceLimitError === 'function'\n );\n}\n\nexport function supportsTraceAggregateCore() {\n return (\n coreStorage.traceAggregateRequestSchema !== undefined &&\n coreStorage.traceAggregateResponseSchema !== undefined &&\n typeof coreStorage.planTraceAggregate === 'function'\n );\n}\n\nexport function supportsSpanQueryCore() {\n return (\n coreStorage.spanQueryRequestSchema !== undefined &&\n coreStorage.spanQueryResponseSchema !== undefined &&\n typeof coreStorage.planSpanQuery === 'function'\n );\n}\n\nexport const OBSERVABILITY_LIST_ENDPOINTS = {\n traces: 'traces',\n branches: 'branches',\n logs: 'logs',\n metrics: 'metrics',\n scores: 'scores',\n feedback: 'feedback',\n} as const;\n\nexport type ObservabilityListEndpoint =\n (typeof OBSERVABILITY_LIST_ENDPOINTS)[keyof typeof OBSERVABILITY_LIST_ENDPOINTS];\nconst OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE = 'delta-polling';\n\nfunction getFeatures(observabilityStore: ObservabilityStorage): readonly string[] | undefined {\n const candidate = observabilityStore as ObservabilityStorage & {\n getFeatures?: () => readonly string[] | undefined;\n };\n return candidate.getFeatures?.();\n}\n\n/** Retrieves MastraCompositeStore or throws 500 if unavailable. */\nexport function getStorage(mastra: Mastra): MastraCompositeStore {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n return storage;\n}\n\n/** Retrieves the observability storage domain or throws 501 if unavailable. */\nexport async function getObservabilityStore(mastra: Mastra): Promise<ObservabilityStorage> {\n const storage = getStorage(mastra);\n const observability = await storage.getStore('observability');\n if (!observability) {\n // 501, not 500: a missing or explicitly disabled observability domain\n // (e.g. `domains: { observability: false }`) is a capability gap, not a\n // server failure — matching the other 501s in this file.\n throw new HTTPException(501, { message: 'Observability storage domain is not available' });\n }\n return observability;\n}\n\n/** Retrieves the scores storage domain or throws 501 if unavailable. */\nexport async function getScoresStore(mastra: Mastra): Promise<ScoresStorage> {\n const storage = getStorage(mastra);\n const scores = await storage.getStore('scores');\n if (!scores) {\n throw new HTTPException(501, { message: 'Scores storage domain is not available' });\n }\n return scores;\n}\n\nexport function assertObservabilityTraceQuerySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Advanced trace queries are not supported by the configured observability store',\n });\n}\n\nexport function supportsObservabilityTraceAggregate(observabilityStore: ObservabilityStorage) {\n return getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE) === true;\n}\n\nexport function assertObservabilityTraceAggregateSupported(observabilityStore: ObservabilityStorage) {\n if (supportsObservabilityTraceAggregate(observabilityStore)) return;\n\n throw new HTTPException(501, {\n message: 'Trace aggregation is not supported by the configured observability store',\n });\n}\n\nexport function assertObservabilitySpanQuerySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Span queries are not supported by the configured observability store',\n });\n}\n\nexport function assertObservabilitySpanQueryFieldsSupported(\n observabilityStore: ObservabilityStorage,\n predicate: TrustedTraceQueryScalarPredicate | undefined,\n) {\n if (!predicate || getFeatures(observabilityStore)?.includes('span-query-context-fields')) return;\n if (predicate.type === 'boolean') {\n for (const arg of predicate.args) assertObservabilitySpanQueryFieldsSupported(observabilityStore, arg);\n } else if (predicate.type === 'not') {\n assertObservabilitySpanQueryFieldsSupported(observabilityStore, predicate.arg);\n } else if (SPAN_QUERY_CONTEXT_FIELDS.has(predicate.field)) {\n throw new coreStorage.TraceQueryValidationError([\n {\n code: 'field_not_allowed',\n path: ['where'],\n message: `Filtering by ${predicate.field} requires an updated storage adapter with span query context-field support.`,\n },\n ]);\n }\n}\n\nfunction usesRootDuration(predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined): boolean {\n if (!predicate) return false;\n if (predicate.type === 'boolean') return predicate.args.some(usesRootDuration);\n if (predicate.type === 'not') return usesRootDuration(predicate.arg);\n if (predicate.type === 'relation') {\n return predicate.collection === 'traces' && usesRootDuration(predicate.predicate);\n }\n return predicate.field === 'durationMs';\n}\n\nexport function supportsObservabilityTraceQueryRootDuration(observabilityStore: ObservabilityStorage) {\n return getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE) === true;\n}\n\nexport function assertObservabilityTraceQueryRootDurationSupported(\n observabilityStore: ObservabilityStorage,\n predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined,\n) {\n if (!usesRootDuration(predicate) || supportsObservabilityTraceQueryRootDuration(observabilityStore)) return;\n\n throw new HTTPException(501, {\n message: 'Root duration predicates are not supported by the configured observability store',\n });\n}\n\nfunction usesContextId(predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined): boolean {\n if (!predicate) return false;\n if (predicate.type === 'boolean') return predicate.args.some(usesContextId);\n if (predicate.type === 'not') return usesContextId(predicate.arg);\n if (predicate.type === 'relation') return usesContextId(predicate.predicate);\n return TRACE_QUERY_CONTEXT_ID_FIELDS.has(predicate.field);\n}\n\nexport function supportsObservabilityTraceQueryContextIds(observabilityStore: ObservabilityStorage) {\n return getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE) === true;\n}\n\nexport function isTraceQueryContextIdField(path: string): boolean {\n return TRACE_QUERY_CONTEXT_ID_FIELDS.has(path);\n}\n\nexport function assertObservabilityTraceQueryContextIdsSupported(\n observabilityStore: ObservabilityStorage,\n predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined,\n) {\n if (!usesContextId(predicate) || supportsObservabilityTraceQueryContextIds(observabilityStore)) return;\n\n throw new HTTPException(501, {\n message: 'Context identifier predicates are not supported by the configured observability store',\n });\n}\n\nexport function assertObservabilityTraceQueryDiscoverySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_DISCOVERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Trace query discovery is not supported by the configured observability store',\n });\n}\n\n/**\n * A scoped request must never run unscoped: a store that predates tenant scope would\n * silently ignore `plan.scope` and return every tenant's rows, so it is rejected instead.\n * Unscoped requests are unaffected.\n */\nexport function assertObservabilityTraceQueryTenantScopeSupported(\n observabilityStore: ObservabilityStorage,\n scope: coreStorage.TraceQueryTenantScope | undefined,\n) {\n if (scope === undefined) return;\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'The configured observability store cannot enforce the trusted tenant scope',\n });\n}\n\nexport function assertObservabilityThreadQuerySupported(observabilityStore: ObservabilityStorage) {\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_THREAD_QUERY_STORAGE_FEATURE)) return;\n\n throw new HTTPException(501, {\n message: 'Advanced thread queries are not supported by the configured observability store',\n });\n}\n\n/**\n * Returns true when the store's class chain overrides `method` below the class\n * that first declares it (the `ObservabilityStorage` base, whose default\n * throws `*_NOT_IMPLEMENTED`). Walks the store's own prototype chain instead of\n * comparing against this package's `ObservabilityStorage.prototype`, so it\n * works for stores built against older or duplicated `@mastra/core` installs\n * and for stores that predate {@link ObservabilityStorage.getFeatures}.\n */\nfunction implementsObservabilityStorageMethod(observabilityStore: object, method: string): boolean {\n if (Object.prototype.hasOwnProperty.call(observabilityStore, method)) return true;\n\n let resolvedOwner: object | undefined;\n let declaringBase: object | undefined;\n for (\n let proto: object | null = Object.getPrototypeOf(observabilityStore);\n proto && proto !== Object.prototype;\n proto = Object.getPrototypeOf(proto)\n ) {\n if (Object.prototype.hasOwnProperty.call(proto, method)) {\n resolvedOwner ??= proto;\n declaringBase = proto;\n }\n }\n return resolvedOwner !== undefined && resolvedOwner !== declaringBase;\n}\n\nexport type ObservabilityDiscoveryCapabilities = {\n entityTypes: boolean;\n entityNames: boolean;\n serviceNames: boolean;\n environments: boolean;\n tags: boolean;\n metrics: boolean;\n};\n\nexport type ObservabilityStorageCapabilities = {\n metrics: boolean;\n logs: boolean;\n discovery: ObservabilityDiscoveryCapabilities;\n deltaPolling: boolean;\n traceQuery: boolean;\n traceQueryRootDuration: boolean;\n traceQueryContextIds: boolean;\n traceQueryDiscovery: boolean;\n traceQueryTenantScope: boolean;\n traceAggregate: boolean;\n threadQuery: boolean;\n spanQuery: boolean;\n /** Days of traces the store keeps. Omitted when the store does not report a limit. */\n traceRetentionDays?: number;\n feedback: boolean;\n};\n\nexport const NO_OBSERVABILITY_STORAGE_CAPABILITIES: ObservabilityStorageCapabilities = {\n metrics: false,\n logs: false,\n discovery: {\n entityTypes: false,\n entityNames: false,\n serviceNames: false,\n environments: false,\n tags: false,\n metrics: false,\n },\n deltaPolling: false,\n traceQuery: false,\n traceQueryRootDuration: false,\n traceQueryContextIds: false,\n traceQueryDiscovery: false,\n traceQueryTenantScope: false,\n traceAggregate: false,\n threadQuery: false,\n spanQuery: false,\n feedback: false,\n};\n\n/**\n * Resolves which optional observability APIs the configured store can serve.\n *\n * Feature declarations (`getFeatures()`) are optional. When a store declares\n * a feature list, that list is final. Stores without `getFeatures()` predate\n * declarations: metrics, logs and filter discovery are detected by whether the\n * store implements the underlying method, so those packages report accurately\n * without being upgraded. Delta polling and the trace/thread query APIs depend\n * on runtime behavior a method check can't see, so they are only reported for\n * stores that declare them. Feedback is also declaration-only: Studio hides\n * the feedback UI behind this flag, and store versions that implement feedback\n * without declaring it simply don't advertise it until upgraded.\n */\nexport function getObservabilityStorageCapabilities(\n observabilityStore: ObservabilityStorage,\n): ObservabilityStorageCapabilities {\n const declaredFeatures = getFeatures(observabilityStore);\n const features = declaredFeatures ?? [];\n const newApiCore = coreFeatures.has('observability:v1.13.2');\n const declares = (feature: string) => features.includes(feature);\n // Undeclared stores must implement every method behind the feature.\n const supports = (feature: string, methods: readonly string[]) => {\n if (!newApiCore) return false;\n if (!declaredFeatures) {\n return methods.every(method => implementsObservabilityStorageMethod(observabilityStore, method));\n }\n return declares(feature);\n };\n // Stores released before the per-endpoint discovery features existed declare\n // `trace-query` and implement every discovery method, so treat it as implying discovery.\n const supportsDiscovery = (feature: string, methods: readonly string[]) =>\n supports(feature, methods) || (newApiCore && declares(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE));\n const traceQuery =\n newApiCore &&\n typeof coreStorage.planTraceQuery === 'function' &&\n declares(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE);\n const threadQuery =\n newApiCore &&\n typeof coreStorage.planThreadQuery === 'function' &&\n declares(OBSERVABILITY_THREAD_QUERY_STORAGE_FEATURE);\n\n return {\n // `listMetrics` is left out: it backs a newer route that metric dashboards don't use,\n // and older stores that implement the OLAP methods predate it.\n metrics: supports('metrics', [\n 'getMetricAggregate',\n 'getMetricBreakdown',\n 'getMetricTimeSeries',\n 'getMetricPercentiles',\n ]),\n logs: supports('logs', ['listLogs']),\n discovery: {\n entityTypes: supportsDiscovery('entity-type-discovery', ['getEntityTypes']),\n entityNames: supportsDiscovery('entity-name-discovery', ['getEntityNames']),\n serviceNames: supportsDiscovery('service-name-discovery', ['getServiceNames']),\n environments: supportsDiscovery('environment-discovery', ['getEnvironments']),\n tags: supportsDiscovery('tag-discovery', ['getTags']),\n metrics: supportsDiscovery('metric-discovery', ['getMetricNames', 'getMetricLabelKeys', 'getMetricLabelValues']),\n },\n deltaPolling:\n coreFeatures.has(OBSERVABILITY_DELTA_POLLING_FEATURE) && declares(OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE),\n traceQuery,\n traceQueryRootDuration:\n (traceQuery || threadQuery) && declares(OBSERVABILITY_TRACE_QUERY_ROOT_DURATION_STORAGE_FEATURE),\n traceQueryContextIds:\n (traceQuery || threadQuery) && declares(OBSERVABILITY_TRACE_QUERY_CONTEXT_IDS_STORAGE_FEATURE),\n traceQueryDiscovery:\n newApiCore && supportsTraceQueryDiscoveryCore() && declares(OBSERVABILITY_TRACE_QUERY_DISCOVERY_STORAGE_FEATURE),\n traceQueryTenantScope:\n (traceQuery || threadQuery) &&\n coreFeatures.has(OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_CORE_FEATURE) &&\n declares(OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_STORAGE_FEATURE),\n traceAggregate:\n newApiCore && supportsTraceAggregateCore() && declares(OBSERVABILITY_TRACE_AGGREGATE_STORAGE_FEATURE),\n threadQuery,\n spanQuery: newApiCore && supportsSpanQueryCore() && declares(OBSERVABILITY_SPAN_QUERY_STORAGE_FEATURE),\n feedback: newApiCore && declares(OBSERVABILITY_FEEDBACK_STORAGE_FEATURE),\n };\n}\n\n/**\n * Matches the `OBSERVABILITY_STORAGE_*_NOT_IMPLEMENTED` MastraError the base\n * observability store throws for every optional method a store doesn't\n * implement. Checked by id (not `instanceof`) so it holds across duplicated\n * `@mastra/core` installs.\n */\nfunction isObservabilityStorageNotImplementedError(error: unknown): boolean {\n const id = error && typeof error === 'object' && 'id' in error ? error.id : undefined;\n return typeof id === 'string' && id.startsWith('OBSERVABILITY_STORAGE_') && id.endsWith('_NOT_IMPLEMENTED');\n}\n\n/**\n * Discovery is optional for observability stores. When the configured store\n * doesn't implement a discovery method, answer with an empty result instead of\n * a 500 so filter lookups degrade quietly on stores without discovery support.\n * Clients should check `observabilityStorageCapabilities.discovery` from\n * `GET /system/packages` before calling these routes.\n */\nexport async function withDiscoveryFallback<T>(run: () => Promise<T>, empty: T): Promise<T> {\n try {\n return await run();\n } catch (error) {\n if (isObservabilityStorageNotImplementedError(error)) return empty;\n throw error;\n }\n}\n\nexport function assertObservabilityDeltaSupported(\n observabilityStore: ObservabilityStorage,\n endpoint: ObservabilityListEndpoint,\n) {\n if (!coreFeatures.has(OBSERVABILITY_DELTA_POLLING_FEATURE)) {\n throw new HTTPException(501, {\n message: `${OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE} (endpoint: ${endpoint})`,\n });\n }\n\n if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE)) {\n return;\n }\n\n throw new HTTPException(501, {\n message: `Delta polling is not supported by the configured observability store for ${endpoint}`,\n });\n}\n\nexport interface RouteDetails {\n method: ServerRoute['method'];\n path: `/${string}`;\n summary: string;\n description: string;\n requiresPermission?: ServerRoute['requiresPermission'];\n}\n\nexport const NEW_ROUTE_DEFS = {\n QUERY_TRACES: {\n method: 'POST',\n path: '/observability/traces/query',\n summary: 'Query traces',\n description:\n 'Returns completed logical traces or distinct thread groups matching an advanced trace query. Thread grouping remains supported but is deprecated; use queryTraceThreads instead.',\n requiresPermission: 'observability:read',\n },\n\n AGGREGATE_TRACES: {\n method: 'POST',\n path: '/observability/traces/aggregate',\n summary: 'Aggregate traces',\n description:\n 'Returns grouped and optionally time-bucketed measures (counts, durations, error rates) over completed logical traces matching an advanced trace predicate',\n requiresPermission: 'observability:read',\n },\n\n QUERY_THREADS: {\n method: 'POST',\n path: '/observability/threads/query',\n summary: 'Query threads',\n description: 'Returns thread identities matching eligible trace and cross-trace predicates',\n requiresPermission: 'observability:read',\n },\n\n QUERY_SPANS: {\n method: 'POST',\n path: '/observability/spans/query',\n summary: 'Query spans',\n description: 'Returns completed spans matching a span predicate, one row per span, with cursor pagination',\n requiresPermission: 'observability:read',\n },\n\n GET_TRACE_QUERY_FIELDS: {\n method: 'POST',\n path: '/observability/traces/query/fields',\n summary: 'Discover trace query fields',\n description: 'Returns canonical query fields and observed top-level string metadata fields',\n requiresPermission: 'observability:read',\n },\n\n GET_TRACE_QUERY_VALUES: {\n method: 'POST',\n path: '/observability/traces/query/values',\n summary: 'Discover trace query values',\n description: 'Returns bounded string value suggestions and occurrence counts for one eligible query field',\n requiresPermission: 'observability:read',\n },\n\n LIST_METRICS: {\n method: 'GET',\n path: '/observability/metrics',\n summary: 'List metrics',\n description: 'Returns a paginated list of metrics with optional filtering and sorting',\n },\n\n LIST_LOGS: {\n method: 'GET',\n path: '/observability/logs',\n summary: 'List logs',\n description: 'Returns a paginated list of logs with optional filtering and sorting',\n },\n\n LIST_SCORES: {\n method: 'GET',\n path: '/observability/scores',\n summary: 'List scores',\n description: 'Returns a paginated list of scores with optional filtering and sorting',\n },\n\n CREATE_SCORE: {\n method: 'POST',\n path: '/observability/scores',\n summary: 'Create a score',\n description: 'Creates a single score record in the observability store',\n },\n\n DELETE_SCORES: {\n method: 'DELETE',\n path: '/observability/scores',\n summary: 'Delete scores',\n description: 'Deletes score records by scoreId, optionally scoped to a tenant',\n requiresPermission: 'observability:delete',\n },\n\n GET_SCORE: {\n method: 'GET',\n path: '/observability/scores/:scoreId',\n summary: 'Get score',\n description: 'Returns a single score by scoreId',\n },\n\n GET_SCORE_AGGREGATE: {\n method: 'POST',\n path: '/observability/scores/aggregate',\n summary: 'Get score aggregate',\n description: 'Returns an aggregated score value with optional period-over-period comparison',\n requiresPermission: 'observability:read',\n },\n\n GET_SCORE_BREAKDOWN: {\n method: 'POST',\n path: '/observability/scores/breakdown',\n summary: 'Get score breakdown',\n description: 'Returns score values grouped by specified dimensions',\n requiresPermission: 'observability:read',\n },\n\n GET_SCORE_TIME_SERIES: {\n method: 'POST',\n path: '/observability/scores/timeseries',\n summary: 'Get score time series',\n description: 'Returns score values bucketed by time interval with optional grouping',\n requiresPermission: 'observability:read',\n },\n\n GET_SCORE_PERCENTILES: {\n method: 'POST',\n path: '/observability/scores/percentiles',\n summary: 'Get score percentiles',\n description: 'Returns percentile values for a score bucketed by time interval',\n requiresPermission: 'observability:read',\n },\n\n LIST_FEEDBACK: {\n method: 'GET',\n path: '/observability/feedback',\n summary: 'List feedback',\n description: 'Returns a paginated list of feedback with optional filtering and sorting',\n },\n\n CREATE_FEEDBACK: {\n method: 'POST',\n path: '/observability/feedback',\n summary: 'Create feedback',\n description: 'Creates a single feedback record in the observability store',\n },\n\n DELETE_FEEDBACK: {\n method: 'DELETE',\n path: '/observability/feedback',\n summary: 'Delete feedback',\n description: 'Deletes feedback records by feedbackId, optionally scoped to a tenant',\n requiresPermission: 'observability:delete',\n },\n\n UPDATE_FEEDBACK_REVIEW_STATUS: {\n method: 'PATCH',\n path: '/observability/feedback/:feedbackId/review-status',\n summary: 'Update feedback review status',\n description: \"Updates a feedback record's review workflow status\",\n requiresPermission: 'observability:write',\n },\n\n GET_FEEDBACK_AGGREGATE: {\n method: 'POST',\n path: '/observability/feedback/aggregate',\n summary: 'Get feedback aggregate',\n description: 'Returns an aggregated numeric feedback value with optional period-over-period comparison',\n requiresPermission: 'observability:read',\n },\n\n GET_FEEDBACK_BREAKDOWN: {\n method: 'POST',\n path: '/observability/feedback/breakdown',\n summary: 'Get feedback breakdown',\n description: 'Returns numeric feedback values grouped by specified dimensions',\n requiresPermission: 'observability:read',\n },\n\n GET_FEEDBACK_TIME_SERIES: {\n method: 'POST',\n path: '/observability/feedback/timeseries',\n summary: 'Get feedback time series',\n description: 'Returns numeric feedback values bucketed by time interval with optional grouping',\n requiresPermission: 'observability:read',\n },\n\n GET_FEEDBACK_PERCENTILES: {\n method: 'POST',\n path: '/observability/feedback/percentiles',\n summary: 'Get feedback percentiles',\n description: 'Returns percentile values for numeric feedback bucketed by time interval',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_AGGREGATE: {\n method: 'POST',\n path: '/observability/metrics/aggregate',\n summary: 'Get metric aggregate',\n description: 'Returns an aggregated metric value with optional period-over-period comparison',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_BREAKDOWN: {\n method: 'POST',\n path: '/observability/metrics/breakdown',\n summary: 'Get metric breakdown',\n description: 'Returns metric values grouped by specified dimensions',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_TIME_SERIES: {\n method: 'POST',\n path: '/observability/metrics/timeseries',\n summary: 'Get metric time series',\n description: 'Returns metric values bucketed by time interval with optional grouping',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_PERCENTILES: {\n method: 'POST',\n path: '/observability/metrics/percentiles',\n summary: 'Get metric percentiles',\n description: 'Returns percentile values for a metric bucketed by time interval',\n requiresPermission: 'observability:read',\n },\n\n GET_METRIC_NAMES: {\n method: 'GET',\n path: '/observability/discovery/metric-names',\n summary: 'Get metric names',\n description: 'Returns distinct metric names with optional prefix filtering',\n },\n\n GET_METRIC_LABEL_KEYS: {\n method: 'GET',\n path: '/observability/discovery/metric-label-keys',\n summary: 'Get metric label keys',\n description: 'Returns distinct label keys for a given metric',\n },\n\n GET_METRIC_LABEL_VALUES: {\n method: 'GET',\n path: '/observability/discovery/metric-label-values',\n summary: 'Get label values',\n description: 'Returns distinct values for a given metric label key',\n },\n\n GET_ENTITY_TYPES: {\n method: 'GET',\n path: '/observability/discovery/entity-types',\n summary: 'Get entity types',\n description: 'Returns distinct entity types from observability data',\n },\n\n GET_ENTITY_NAMES: {\n method: 'GET',\n path: '/observability/discovery/entity-names',\n summary: 'Get entity names',\n description: 'Returns distinct entity names with optional type filtering',\n },\n\n GET_SERVICE_NAMES: {\n method: 'GET',\n path: '/observability/discovery/service-names',\n summary: 'Get service names',\n description: 'Returns distinct service names from observability data',\n },\n\n GET_ENVIRONMENTS: {\n method: 'GET',\n path: '/observability/discovery/environments',\n summary: 'Get environments',\n description: 'Returns distinct environments from observability data',\n },\n\n GET_TAGS: {\n method: 'GET',\n path: '/observability/discovery/tags',\n summary: 'Get tags',\n description: 'Returns distinct tags with optional entity type filtering',\n },\n\n GET_CAPABILITIES: {\n method: 'GET',\n path: '/observability/capabilities',\n summary: 'Get observability capabilities',\n description:\n 'Returns which optional observability APIs the configured observability storage supports. Every flag is false when no observability storage is configured.',\n },\n} as const satisfies Record<string, RouteDetails>;\n\nexport type NewRoutesKey = keyof typeof NEW_ROUTE_DEFS;\nexport type NewRoutesDefinitions = (typeof NEW_ROUTE_DEFS)[NewRoutesKey];\n\nexport function createObservabilityListQuerySchema<\n TFilter extends z.ZodObject<z.ZodRawShape>,\n TOrderBy extends z.ZodObject<z.ZodRawShape>,\n>(filterSchema: TFilter, orderBySchema: TOrderBy) {\n const unwrapDefault = (schema: unknown) => {\n const zodSchema = schema as z.ZodTypeAny;\n return zodSchema instanceof z.ZodDefault ? zodSchema.unwrap() : zodSchema;\n };\n const paginationShape = paginationArgsSchema.shape as unknown as Record<string, z.ZodTypeAny>;\n const orderByShape = orderBySchema.shape as unknown as Record<string, z.ZodTypeAny>;\n\n const pageSchema = unwrapDefault(paginationShape.page);\n const perPageSchema = unwrapDefault(paginationShape.perPage);\n const fieldSchema = orderByShape.field ? unwrapDefault(orderByShape.field) : z.never().optional();\n const directionSchema = orderByShape.direction ? unwrapDefault(orderByShape.direction) : z.never().optional();\n\n return wrapSchemaForQueryParams(\n z\n .object({\n ...filterSchema.shape,\n page: pageSchema,\n perPage: perPageSchema,\n field: fieldSchema,\n direction: directionSchema,\n mode: listModeSchema.optional(),\n after: deltaCursorSchema.optional(),\n limit: deltaLimitSchema,\n })\n .partial(),\n ).superRefine((value, ctx) => {\n const isDelta = value.mode === 'delta';\n const hasPagination = value.page !== undefined || value.perPage !== undefined;\n const hasOrderBy = value.field !== undefined || value.direction !== undefined;\n const hasAfter = value.after !== undefined;\n const hasLimit = value.limit !== undefined;\n\n if (isDelta) {\n if (hasPagination) {\n if (value.page !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['page'],\n message: '`page` is not allowed when `mode=delta`',\n });\n }\n if (value.perPage !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['perPage'],\n message: '`perPage` is not allowed when `mode=delta`',\n });\n }\n }\n if (hasOrderBy) {\n if (value.field !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['field'],\n message: '`field` is not allowed when `mode=delta`',\n });\n }\n if (value.direction !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['direction'],\n message: '`direction` is not allowed when `mode=delta`',\n });\n }\n }\n return;\n }\n\n if (hasAfter) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['after'],\n message: '`after` is only allowed when `mode=delta`',\n });\n }\n if (hasLimit) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['limit'],\n message: '`limit` is only allowed when `mode=delta`',\n });\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAsBA,MAAa,sCAAsC;AACnD,MAAa,8CACX;AACF,MAAM,4CAA4C;AAClD,MAAM,gDAAgD;AACtD,MAAM,2CAA2C;AACjD,MAAM,4CAA4B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,0DAA0D;AAChE,MAAM,wDAAwD;AAC9D,MAAM,gDAAgC,IAAI,IAAI;CAAC;CAAS;CAAa;CAAU;AAAgB,CAAC;AAChG,MAAM,sDAAsD;AAC5D,MAAM,6CAA6C;AACnD,MAAM,yDAAyD;AAC/D,MAAM,yCAAyC;AAC/C,MAAa,sDAAsD;AACnE,MAAa,yDACX;AAEF,SAAgB,kCAAkC;CAChD,OACEA,qBAAY,kCAAkC,KAAA,KAC9CA,qBAAY,sCAAsC,KA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C,OAAOC,yDAAAA;CACT,CAAC,CAAC,CACD,QAAQ,CACb,CAAC,CAAC,aAAa,OAAO,QAAQ;EAC5B,MAAM,UAAU,MAAM,SAAS;EAC/B,MAAM,gBAAgB,MAAM,SAAS,KAAA,KAAa,MAAM,YAAY,KAAA;EACpE,MAAM,aAAa,MAAM,UAAU,KAAA,KAAa,MAAM,cAAc,KAAA;EACpE,MAAM,WAAW,MAAM,UAAU,KAAA;EACjC,MAAM,WAAW,MAAM,UAAU,KAAA;EAEjC,IAAI,SAAS;GACX,IAAI,eAAe;IACjB,IAAI,MAAM,SAAS,KAAA,GACjB,IAAI,SAAS;KACX,MAAML,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,MAAM;KACb,SAAS;IACX,CAAC;IAEH,IAAI,MAAM,YAAY,KAAA,GACpB,IAAI,SAAS;KACX,MAAMA,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,SAAS;KAChB,SAAS;IACX,CAAC;GAEL;GACA,IAAI,YAAY;IACd,IAAI,MAAM,UAAU,KAAA,GAClB,IAAI,SAAS;KACX,MAAMA,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,OAAO;KACd,SAAS;IACX,CAAC;IAEH,IAAI,MAAM,cAAc,KAAA,GACtB,IAAI,SAAS;KACX,MAAMA,OAAAA,EAAE,aAAa;KACrB,MAAM,CAAC,WAAW;KAClB,SAAS;IACX,CAAC;GAEL;GACA;EACF;EAEA,IAAI,UACF,IAAI,SAAS;GACX,MAAMA,OAAAA,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;EAEH,IAAI,UACF,IAAI,SAAS;GACX,MAAMA,OAAAA,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;CAEL,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Mastra } from '@mastra/core';
|
|
2
|
-
import type { MastraCompositeStore, ObservabilityStorage, ScoresStorage, TrustedThreadPredicate, TrustedTraceQueryPredicate } from '@mastra/core/storage';
|
|
2
|
+
import type { MastraCompositeStore, ObservabilityStorage, ScoresStorage, TrustedTraceQueryScalarPredicate, TrustedThreadPredicate, TrustedTraceQueryPredicate } from '@mastra/core/storage';
|
|
3
3
|
import * as coreStorage from '@mastra/core/storage';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
5
5
|
import type { ServerRoute } from '../server-adapter/routes/index.js';
|
|
@@ -29,6 +29,7 @@ export declare function assertObservabilityTraceQuerySupported(observabilityStor
|
|
|
29
29
|
export declare function supportsObservabilityTraceAggregate(observabilityStore: ObservabilityStorage): boolean;
|
|
30
30
|
export declare function assertObservabilityTraceAggregateSupported(observabilityStore: ObservabilityStorage): void;
|
|
31
31
|
export declare function assertObservabilitySpanQuerySupported(observabilityStore: ObservabilityStorage): void;
|
|
32
|
+
export declare function assertObservabilitySpanQueryFieldsSupported(observabilityStore: ObservabilityStorage, predicate: TrustedTraceQueryScalarPredicate | undefined): void;
|
|
32
33
|
export declare function supportsObservabilityTraceQueryRootDuration(observabilityStore: ObservabilityStorage): boolean;
|
|
33
34
|
export declare function assertObservabilityTraceQueryRootDurationSupported(observabilityStore: ObservabilityStorage, predicate: TrustedTraceQueryPredicate | TrustedThreadPredicate | undefined): void;
|
|
34
35
|
export declare function supportsObservabilityTraceQueryContextIds(observabilityStore: ObservabilityStorage): boolean;
|