@mastra/server 1.79.0-alpha.7 → 1.79.0-alpha.9
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/{api-schema-manifest-CXmfl718.js → api-schema-manifest-CWRIJP-B.js} +2 -2
- package/dist/{api-schema-manifest-CXmfl718.js.map → api-schema-manifest-CWRIJP-B.js.map} +1 -1
- package/dist/{api-schema-manifest-D06vSmIN.cjs → api-schema-manifest-DUseI2VG.cjs} +2 -2
- package/dist/{api-schema-manifest-D06vSmIN.cjs.map → api-schema-manifest-DUseI2VG.cjs.map} +1 -1
- package/dist/{dist-BGzSzjTX.cjs → dist-9c3PXXpk.cjs} +100 -7
- package/dist/{dist-BGzSzjTX.cjs.map → dist-9c3PXXpk.cjs.map} +1 -1
- package/dist/{dist-BeXd4jq2.js → dist-DGCnbhNe.js} +100 -7
- package/dist/{dist-BeXd4jq2.js.map → dist-DGCnbhNe.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-guides-mcp-authentication-authorization.md +2 -2
- package/dist/docs/references/reference-observability-tracing-advanced-queries.md +40 -31
- package/dist/{observability-new-endpoints-s3ccgoif.cjs → observability-new-endpoints-AMp9bnMV.cjs} +6 -4
- package/dist/observability-new-endpoints-AMp9bnMV.cjs.map +1 -0
- package/dist/{observability-new-endpoints-DMbbmOzO.js → observability-new-endpoints-BU8JYPfh.js} +7 -5
- package/dist/observability-new-endpoints-BU8JYPfh.js.map +1 -0
- package/dist/{routes-BTqI1f9k.cjs → routes-DPojsNf1.cjs} +2 -2
- package/dist/{routes-BTqI1f9k.cjs.map → routes-DPojsNf1.cjs.map} +1 -1
- package/dist/{routes-kj3891v4.js → routes-rwufkyUe.js} +2 -2
- package/dist/{routes-kj3891v4.js.map → routes-rwufkyUe.js.map} +1 -1
- 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 +190 -170
- package/dist/server/handlers/agent-controller.cjs.map +1 -1
- package/dist/server/handlers/agent-controller.d.ts +165 -155
- package/dist/server/handlers/agent-controller.d.ts.map +1 -1
- package/dist/server/handlers/agent-controller.js +190 -170
- package/dist/server/handlers/agent-controller.js.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts +20 -4
- 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 +44 -21
- package/dist/server/handlers/observability-shared.cjs.map +1 -1
- package/dist/server/handlers/observability-shared.d.ts +15 -4
- package/dist/server/handlers/observability-shared.d.ts.map +1 -1
- package/dist/server/handlers/observability-shared.js +42 -20
- 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/system.cjs +2 -2
- package/dist/server/handlers/system.d.ts +6 -0
- package/dist/server/handlers/system.d.ts.map +1 -1
- package/dist/server/handlers/system.js +2 -2
- package/dist/server/schemas/index.cjs +1 -1
- package/dist/server/schemas/index.js +1 -1
- package/dist/server/schemas/system.d.ts +6 -0
- package/dist/server/schemas/system.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +1 -1
- package/dist/server/server-adapter/index.js +1 -1
- package/dist/server/server-adapter/routes/observability.d.ts +10 -2
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/system.d.ts +6 -0
- package/dist/server/server-adapter/routes/system.d.ts.map +1 -1
- package/dist/{system-wG9idyeI.cjs → system-BvpFMIJB.cjs} +4 -1
- package/dist/system-BvpFMIJB.cjs.map +1 -0
- package/dist/{system-CiAOa3RO.js → system-CpzPxRRq.js} +4 -1
- package/dist/system-CpzPxRRq.js.map +1 -0
- package/package.json +6 -6
- package/dist/observability-new-endpoints-DMbbmOzO.js.map +0 -1
- package/dist/observability-new-endpoints-s3ccgoif.cjs.map +0 -1
- package/dist/system-CiAOa3RO.js.map +0 -1
- package/dist/system-wG9idyeI.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -47,7 +47,7 @@ A separate provider per MCP server does one thing and not another:
|
|
|
47
47
|
|
|
48
48
|
The specification recommends support for **Client ID Metadata Documents (CIMD)**, which identify a client through an HTTPS metadata URL. It also defines pre-registration. Clients that support all registration options should prefer existing pre-registered information when available. Legacy Dynamic Client Registration (DCR) remains optional for compatibility but is deprecated for new implementations. See the versioned [client registration rules](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration).
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
`MCPOAuthClientProvider` never registers a client at runtime and doesn't support DCR. Configure exactly one client identity: `clientInformation` for a client pre-registered with the authorization server, or `clientMetadataUrl` for CIMD. Check that your authorization server supports the mechanism you choose before deploying. See the [OAuth client reference](https://mastra.ai/reference/tools/mcp-client) for configuration examples.
|
|
51
51
|
|
|
52
52
|
Mastra's interactive `authenticate()` flow uses a local loopback callback server. It isn't a hosted multi-user login endpoint. A hosted application must own its callback endpoint and associate each authorization attempt with the correct user and provider. See [interactive browser authentication](https://mastra.ai/reference/tools/mcp-client).
|
|
53
53
|
|
|
@@ -97,7 +97,7 @@ Protecting Mastra routes with `server.auth` and providing interoperable OAuth di
|
|
|
97
97
|
|
|
98
98
|
Alongside the MCP transport, Mastra registers REST routes used by Studio to list servers, inspect tools, execute tools, and read resources. See the [MCP routes reference](https://mastra.ai/reference/server/routes) for the full list. These paths use the default `/api` prefix.
|
|
99
99
|
|
|
100
|
-
The `POST /api/mcp/:serverId/tools/:toolId/execute` route calls `executeTool()` directly, without a protocol client. With a Mastra FGA provider configured, `MCPServer.executeTool()` enforces tool execution permission using the user in `requestContext`. The REST tool list also filters tools through FGA
|
|
100
|
+
The `POST /api/mcp/:serverId/tools/:toolId/execute` route calls `executeTool()` directly, without a protocol client. With a Mastra FGA provider configured, `MCPServer.executeTool()` enforces tool execution permission using the user in `requestContext`. The REST tool list also filters tools through FGA, but these permission checks don't replace route authentication.
|
|
101
101
|
|
|
102
102
|
Built-in authentication for these routes depends on `server.auth`. Without it, `requiresAuth: true` doesn't enforce authentication. Custom middleware that checks only the `/mcp` or `/sse` transport paths leaves the REST routes open. If you use custom middleware instead of `server.auth`, default-deny `/api/mcp/*` and allow access only after authentication.
|
|
103
103
|
|
|
@@ -21,18 +21,20 @@ For hosted traces, see [Query observability data on Mastra Platform](https://mas
|
|
|
21
21
|
|
|
22
22
|
The configured observability store must support each API. Call `getObservabilityCapabilities()` or `GET /api/observability/capabilities` and check these flags before showing a feature:
|
|
23
23
|
|
|
24
|
-
| Capability
|
|
25
|
-
|
|
|
26
|
-
| `traceQuery`
|
|
27
|
-
| `traceAggregate`
|
|
28
|
-
| `traceQueryRootDuration`
|
|
29
|
-
| `traceQueryTimeToFirstChunk`
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
| Capability | Store feature | Enables |
|
|
25
|
+
| -------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
26
|
+
| `traceQuery` | `trace-query` | `queryTraces()` |
|
|
27
|
+
| `traceAggregate` | `trace-aggregate` | `aggregateTraces()` |
|
|
28
|
+
| `traceQueryRootDuration` | `trace-query-root-duration` | Trace-scope `durationMs` predicates |
|
|
29
|
+
| `traceQueryTimeToFirstChunk` | `trace-query-time-to-first-chunk` | `timeToFirstChunkMs` predicates and results |
|
|
30
|
+
| `traceQueryTimeToFirstChunkSort` | `trace-query-time-to-first-chunk-sort` | `orderBy` on `timeToFirstChunkMs` |
|
|
31
|
+
| `traceQueryContextIds` | `trace-query-context-ids` | `runId`, `sessionId`, `userId`, and `organizationId` predicates |
|
|
32
|
+
| `traceQueryRootSpanFields` | `trace-query-root-span-fields` | Trace-scope `name` and `spanType` predicates, dimensions, and `countDistinct` measures |
|
|
33
|
+
| `traceQueryRootEntityId` | `trace-query-root-entity-id` | Trace-scope `entityId` predicates, dimensions, and `countDistinct` measures |
|
|
34
|
+
| `traceQueryDiscovery` | `trace-query-discovery` | [Field and value discovery](#discover-fields-and-values) |
|
|
35
|
+
| `traceQueryTenantScope` | `trace-query-tenant-scope` | [Trusted tenant scope](#trusted-tenant-scope) |
|
|
36
|
+
|
|
37
|
+
A missing `traceAggregate` value means the server doesn't support aggregation. Servers without the aggregate route return `404`, and stores without the feature return `501 TRACE_AGGREGATE_UNSUPPORTED`. Against a store without a sub-feature, a request that uses a gated field returns `501` before storage runs. Root span `name`, `spanType`, and `entityId` are the exception and return `422` with a `field_not_allowed` issue.
|
|
36
38
|
|
|
37
39
|
## Select traces
|
|
38
40
|
|
|
@@ -75,7 +77,7 @@ Span clauses examine the current root span and current child spans. The root `ti
|
|
|
75
77
|
|
|
76
78
|
| Predicate context | Fields | Operators |
|
|
77
79
|
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
78
|
-
| Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status`
|
|
80
|
+
| Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
|
|
79
81
|
| Trace metadata | `metadata.<key>` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
|
|
80
82
|
| Trace | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
|
|
81
83
|
| Trace | `tags` | `includes`, `notIncludes`, `exists`, `notExists` |
|
|
@@ -84,7 +86,7 @@ Span clauses examine the current root span and current child spans. The root `ti
|
|
|
84
86
|
| Span | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
|
|
85
87
|
| Span | `error` | `exists`, `notExists` |
|
|
86
88
|
|
|
87
|
-
Trace-scope `name` and `
|
|
89
|
+
Trace-scope `name`, `spanType`, and `entityId` read the current root span, so `{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'workflow_run' } }` selects traces started by a workflow run. Inside `spans.some` or `spans.none`, the same fields match any span in the trace.
|
|
88
90
|
|
|
89
91
|
Compose predicates with `{ op: 'and', args: [...] }`, `{ op: 'or', args: [...] }`, and `{ op: 'not', arg: ... }`. Comparison predicates place a field reference on the left and a literal on the right. Membership predicates use a field reference in `value` and a homogeneous literal array in `set`. Tag predicates name the stored tag collection in `path`. `includes` and `notIncludes` also take one tag in `value`, while `exists` and `notExists` take only `op` and `path`. See [Filter by tags](#filter-by-tags). Text predicates use the comparison shape with a string literal. See [Filter by text](#filter-by-text).
|
|
90
92
|
|
|
@@ -128,7 +130,13 @@ const slowFirstChunk = {
|
|
|
128
130
|
|
|
129
131
|
The value is `null` when the span didn't stream a chunk, for example a tool call or a workflow run. A `null` value counts as missing, so it matches `notExists` and never matches ordered predicates. A value of `0` isn't missing. It means the first chunk arrived in the same millisecond the span started.
|
|
130
132
|
|
|
131
|
-
Trace query results include the root span's `timeToFirstChunkMs`, and `querySpans()` results include each span's value.
|
|
133
|
+
Trace query results include the root span's `timeToFirstChunkMs`, and `querySpans()` results include each span's value. Stores advertise support through the `trace-query-time-to-first-chunk` feature, and the server reports it as the `traceQueryTimeToFirstChunk` capability. Against an older store, results omit the field, a predicate on it returns `501` before storage runs, and field discovery omits it.
|
|
134
|
+
|
|
135
|
+
#### Sort by time to first chunk
|
|
136
|
+
|
|
137
|
+
Pass `orderBy: [{ field: 'timeToFirstChunkMs', direction: 'desc' }]` to list the slowest first chunks first. Traces sort by the root span's value. Missing values sort last in both directions, and `0` sorts as a value. Ties break by `traceId` for traces and by span identity for `querySpans()`.
|
|
138
|
+
|
|
139
|
+
Stores advertise the sort through the `trace-query-time-to-first-chunk-sort` feature, and the server reports it as the `traceQueryTimeToFirstChunkSort` capability. Against an older store, the sort returns `501` before storage runs.
|
|
132
140
|
|
|
133
141
|
#### Filter by context identifiers
|
|
134
142
|
|
|
@@ -437,16 +445,16 @@ curl --request POST \
|
|
|
437
445
|
|
|
438
446
|
### Request fields
|
|
439
447
|
|
|
440
|
-
| Field | Required | Description
|
|
441
|
-
| ------------ | -------- |
|
|
442
|
-
| `timeRange` | Yes | Trace start-time boundary. `from` is inclusive and `to` is exclusive. Both values must be ISO timestamps, and `from` must be earlier than `to`.
|
|
443
|
-
| `where` | No | Recursive trace predicate. Supports scalar conditions and `spans.some` or `spans.none` clauses.
|
|
444
|
-
| `orderBy` | No | One item ordering results by `startedAt` or `
|
|
445
|
-
| `page` | No | `{ limit, after }`. `limit` defaults to 100 and has a maximum of 1000. Pass the opaque `page.next` value as `after`.
|
|
446
|
-
| `pagination` | No | Numbered pages: `{ page, perPage }`. Defaults to page 0 and 10 results. `perPage` has a maximum of 100.
|
|
447
|
-
| `mode` | No | Set to `'delta'` to poll using a delta cursor instead of `page` or `pagination`.
|
|
448
|
-
| `after` | No | Delta mode only. Opaque `deltaCursor` from a numbered page or previous poll. Omit to establish the current watermark.
|
|
449
|
-
| `limit` | No | Delta mode only. Maximum results per batch. Defaults to 10 and has a maximum of 100.
|
|
448
|
+
| Field | Required | Description |
|
|
449
|
+
| ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
450
|
+
| `timeRange` | Yes | Trace start-time boundary. `from` is inclusive and `to` is exclusive. Both values must be ISO timestamps, and `from` must be earlier than `to`. |
|
|
451
|
+
| `where` | No | Recursive trace predicate. Supports scalar conditions and `spans.some` or `spans.none` clauses. |
|
|
452
|
+
| `orderBy` | No | One item ordering results by `startedAt`, `endedAt`, or `timeToFirstChunkMs`, in `asc` or `desc` order. Defaults to `startedAt desc`. Not accepted in delta mode. |
|
|
453
|
+
| `page` | No | `{ limit, after }`. `limit` defaults to 100 and has a maximum of 1000. Pass the opaque `page.next` value as `after`. |
|
|
454
|
+
| `pagination` | No | Numbered pages: `{ page, perPage }`. Defaults to page 0 and 10 results. `perPage` has a maximum of 100. |
|
|
455
|
+
| `mode` | No | Set to `'delta'` to poll using a delta cursor instead of `page` or `pagination`. |
|
|
456
|
+
| `after` | No | Delta mode only. Opaque `deltaCursor` from a numbered page or previous poll. Omit to establish the current watermark. |
|
|
457
|
+
| `limit` | No | Delta mode only. Maximum results per batch. Defaults to 10 and has a maximum of 100. |
|
|
450
458
|
|
|
451
459
|
Unknown fields are rejected. Requests can't select a projection, declare joins, request counts or measures, or control authorization. Use [`aggregateTraces()`](#aggregate-traces) for counts and measures. Request bodies are limited to 256 KiB.
|
|
452
460
|
|
|
@@ -657,12 +665,13 @@ Unknown fields are rejected. Aggregation isn't paginated. Narrow the selection,
|
|
|
657
665
|
|
|
658
666
|
Dimensions read the current root span of each selected trace:
|
|
659
667
|
|
|
660
|
-
| Dimension | Notes
|
|
661
|
-
| ------------------------------------------------------------------------------------- |
|
|
662
|
-
| `entityType`, `entityName`, `environment`, `status`, `serviceName`, `executionSource` | Root span attributes.
|
|
663
|
-
| `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the root span.
|
|
664
|
-
| `name`, `spanType` | Root span name and type. Requires the `traceQueryRootSpanFields` capability.
|
|
665
|
-
| `
|
|
668
|
+
| Dimension | Notes |
|
|
669
|
+
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
670
|
+
| `entityType`, `entityName`, `environment`, `status`, `serviceName`, `executionSource` | Root span attributes. |
|
|
671
|
+
| `threadId`, `resourceId`, `userId`, `sessionId`, `organizationId`, `experimentId` | Context identifiers recorded on the root span. |
|
|
672
|
+
| `name`, `spanType` | Root span name and type. Requires the `traceQueryRootSpanFields` capability. |
|
|
673
|
+
| `entityId` | Root span entity ID. Groups traces that have no `entityName`, such as scorer runs. Requires the `traceQueryRootEntityId` capability. |
|
|
674
|
+
| `metadata.<key>` | One non-empty top-level metadata key. Values are trimmed. Missing, empty, and non-string values group as `null`. |
|
|
666
675
|
|
|
667
676
|
Every dimension except `serviceName`, `executionSource`, and `experimentId` is also a trace-scope `where` field, so you can drill into a group by adding its values to the predicate. `traceId`, `spanId`, `runId`, and `requestId` aren't groupable. Traces with no value for a dimension form their own group with a `null` value.
|
|
668
677
|
|
package/dist/{observability-new-endpoints-s3ccgoif.cjs → observability-new-endpoints-AMp9bnMV.cjs}
RENAMED
|
@@ -5,7 +5,7 @@ const require_constants = require("./constants-e7aaPCLj.cjs");
|
|
|
5
5
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
6
6
|
const require_server_handlers_observability_list_query_schemas = require("./server/handlers/observability-list-query-schemas.cjs");
|
|
7
7
|
const require_server_handlers_observability_shared = require("./server/handlers/observability-shared.cjs");
|
|
8
|
-
const require_system = require("./system-
|
|
8
|
+
const require_system = require("./system-BvpFMIJB.cjs");
|
|
9
9
|
const require_server_handlers_author_enrichment = require("./server/handlers/author-enrichment.cjs");
|
|
10
10
|
const require_server_handlers_authorship = require("./server/handlers/authorship.cjs");
|
|
11
11
|
let zod_v4 = require("zod/v4");
|
|
@@ -1034,6 +1034,7 @@ const QUERY_TRACES = createNewRoute(require_server_handlers_observability_shared
|
|
|
1034
1034
|
require_server_handlers_observability_shared.assertObservabilityTraceQueryContextIdsSupported(observabilityStore, plan.where);
|
|
1035
1035
|
require_server_handlers_observability_shared.assertObservabilityTraceQueryTimeToFirstChunkSupported(observabilityStore, plan.where);
|
|
1036
1036
|
require_server_handlers_observability_shared.assertObservabilityTraceQueryRootSpanFieldsSupported(observabilityStore, plan);
|
|
1037
|
+
require_server_handlers_observability_shared.assertObservabilityTraceQueryTimeToFirstChunkSortSupported(observabilityStore, plan.orderBy);
|
|
1037
1038
|
require_server_handlers_observability_shared.assertObservabilityTraceQueryTenantScopeSupported(observabilityStore, plan.scope);
|
|
1038
1039
|
if (plan.paginationMode === "delta" && !observabilityStore.getFeatures()?.includes("delta-polling")) throw new require_http_exception.HTTPException(501, { message: "This storage provider does not support observability delta polling" });
|
|
1039
1040
|
} catch (error) {
|
|
@@ -1249,6 +1250,7 @@ const QUERY_SPANS = createNewRoute(require_server_handlers_observability_shared.
|
|
|
1249
1250
|
require_server_handlers_observability_shared.assertObservabilitySpanQuerySupported(observabilityStore);
|
|
1250
1251
|
require_server_handlers_observability_shared.assertObservabilitySpanQueryFieldsSupported(observabilityStore, plan.where);
|
|
1251
1252
|
require_server_handlers_observability_shared.assertObservabilityTraceQueryTimeToFirstChunkSupported(observabilityStore, plan.where);
|
|
1253
|
+
require_server_handlers_observability_shared.assertObservabilityTraceQueryTimeToFirstChunkSortSupported(observabilityStore, plan.orderBy);
|
|
1252
1254
|
require_server_handlers_observability_shared.assertObservabilityTraceQueryTenantScopeSupported(observabilityStore, plan.scope);
|
|
1253
1255
|
} catch (error) {
|
|
1254
1256
|
if (error instanceof _mastra_core_storage.TraceQueryValidationError) throwTraceQueryError(422, {
|
|
@@ -1341,13 +1343,13 @@ const GET_TRACE_QUERY_FIELDS = createNewRoute(require_server_handlers_observabil
|
|
|
1341
1343
|
}
|
|
1342
1344
|
try {
|
|
1343
1345
|
const observed = await observabilityStore.getTraceQueryObservedFields(plan);
|
|
1344
|
-
const canonicalFields = _mastra_core_storage.getTraceQueryCanonicalFieldDescriptors(predicateScope, search).filter((field) => predicateScope !== "trace" || field.path !== "durationMs" || require_server_handlers_observability_shared.supportsObservabilityTraceQueryRootDuration(observabilityStore)).filter((field) => !require_server_handlers_observability_shared.isTraceQueryContextIdField(field.path) || require_server_handlers_observability_shared.supportsObservabilityTraceQueryContextIds(observabilityStore)).filter((field) => field.path !== "timeToFirstChunkMs" || require_server_handlers_observability_shared.supportsObservabilityTraceQueryTimeToFirstChunk(observabilityStore)).filter((field) => predicateScope !== "trace" ||
|
|
1346
|
+
const canonicalFields = _mastra_core_storage.getTraceQueryCanonicalFieldDescriptors(predicateScope, search).filter((field) => predicateScope !== "trace" || field.path !== "durationMs" || require_server_handlers_observability_shared.supportsObservabilityTraceQueryRootDuration(observabilityStore)).filter((field) => !require_server_handlers_observability_shared.isTraceQueryContextIdField(field.path) || require_server_handlers_observability_shared.supportsObservabilityTraceQueryContextIds(observabilityStore)).filter((field) => field.path !== "timeToFirstChunkMs" || require_server_handlers_observability_shared.supportsObservabilityTraceQueryTimeToFirstChunk(observabilityStore)).filter((field) => predicateScope !== "trace" || require_server_handlers_observability_shared.supportsObservabilityTraceQueryRootSpanField(observabilityStore, field.path));
|
|
1345
1347
|
const describesAggregate = predicateScope === "trace" && require_server_handlers_observability_shared.supportsTraceAggregateCore() && _mastra_core_storage.traceAggregateDiscoverySchema !== void 0 && require_server_handlers_observability_shared.supportsObservabilityTraceAggregate(observabilityStore);
|
|
1346
1348
|
return {
|
|
1347
1349
|
canonicalFields,
|
|
1348
1350
|
...observed,
|
|
1349
1351
|
...describesAggregate && { aggregate: {
|
|
1350
|
-
dimensions: _mastra_core_storage.getTraceAggregateDimensionDescriptors().filter((dimension) =>
|
|
1352
|
+
dimensions: _mastra_core_storage.getTraceAggregateDimensionDescriptors().filter((dimension) => require_server_handlers_observability_shared.supportsObservabilityTraceQueryRootSpanField(observabilityStore, dimension.path)),
|
|
1351
1353
|
measures: _mastra_core_storage.getTraceAggregateMeasureDescriptors()
|
|
1352
1354
|
} }
|
|
1353
1355
|
};
|
|
@@ -2199,4 +2201,4 @@ Object.defineProperty(exports, "UPDATE_FEEDBACK_REVIEW_STATUS", {
|
|
|
2199
2201
|
}
|
|
2200
2202
|
});
|
|
2201
2203
|
|
|
2202
|
-
//# sourceMappingURL=observability-new-endpoints-
|
|
2204
|
+
//# sourceMappingURL=observability-new-endpoints-AMp9bnMV.cjs.map
|