@mastra/server 1.65.0-alpha.1 → 1.65.0-alpha.10

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.
Files changed (169) hide show
  1. package/dist/_types/@internal_voice/dist/_types/@internal_core/dist/request-context/index.d.ts +14 -1
  2. package/dist/{a2a-C7OgMND3.cjs → a2a-CW4FVjHx.cjs} +72 -21
  3. package/dist/a2a-CW4FVjHx.cjs.map +1 -0
  4. package/dist/{a2a-DdCHhKh5.js → a2a-Di7S6YaM.js} +72 -21
  5. package/dist/a2a-Di7S6YaM.js.map +1 -0
  6. package/dist/{agents-BetrUB_N.js → agents-AMeMJBI1.js} +2 -7
  7. package/dist/agents-AMeMJBI1.js.map +1 -0
  8. package/dist/{agents-CLv_RFQx.cjs → agents-C3k-sZBO.cjs} +2 -7
  9. package/dist/agents-C3k-sZBO.cjs.map +1 -0
  10. package/dist/{api-schema-manifest-CenKfsu1.js → api-schema-manifest-BHT0tcvI.js} +2 -2
  11. package/dist/{api-schema-manifest-CenKfsu1.js.map → api-schema-manifest-BHT0tcvI.js.map} +1 -1
  12. package/dist/{api-schema-manifest-BxLfDBP-.cjs → api-schema-manifest-Dk_mN3ub.cjs} +2 -2
  13. package/dist/{api-schema-manifest-BxLfDBP-.cjs.map → api-schema-manifest-Dk_mN3ub.cjs.map} +1 -1
  14. package/dist/{datasets-B3DTc52y.cjs → datasets-C63D44YJ.cjs} +2 -1
  15. package/dist/datasets-C63D44YJ.cjs.map +1 -0
  16. package/dist/{datasets-dzuIwMeB.js → datasets-DFPCu6ID.js} +2 -1
  17. package/dist/{datasets-dzuIwMeB.js.map → datasets-DFPCu6ID.js.map} +1 -1
  18. package/dist/{dist-C8lAYOI6.cjs → dist-BLP1i9vT.cjs} +28 -7
  19. package/dist/dist-BLP1i9vT.cjs.map +1 -0
  20. package/dist/{dist-BW8S4tCf.js → dist-BLvSboHt.js} +28 -7
  21. package/dist/dist-BLvSboHt.js.map +1 -0
  22. package/dist/docs/SKILL.md +2 -1
  23. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  24. package/dist/docs/references/reference-observability-tracing-trace-query.md +179 -0
  25. package/dist/{editor-builder-BDEm-gZe.js → editor-builder-BmEpZsqX.js} +2 -2
  26. package/dist/{editor-builder-BDEm-gZe.js.map → editor-builder-BmEpZsqX.js.map} +1 -1
  27. package/dist/{editor-builder-B-KatZ10.cjs → editor-builder-DeFo8Kl5.cjs} +2 -2
  28. package/dist/{editor-builder-B-KatZ10.cjs.map → editor-builder-DeFo8Kl5.cjs.map} +1 -1
  29. package/dist/{editor-builder-c7QiLUV9.js → editor-builder-DzpPA6dp.js} +2 -2
  30. package/dist/{editor-builder-c7QiLUV9.js.map → editor-builder-DzpPA6dp.js.map} +1 -1
  31. package/dist/{editor-builder-DNRVszU-.cjs → editor-builder-WLxTW05v.cjs} +2 -2
  32. package/dist/{editor-builder-DNRVszU-.cjs.map → editor-builder-WLxTW05v.cjs.map} +1 -1
  33. package/dist/{observability-new-endpoints-BxXDVoQ0.cjs → observability-new-endpoints-DF85EOQS.cjs} +178 -15
  34. package/dist/observability-new-endpoints-DF85EOQS.cjs.map +1 -0
  35. package/dist/{observability-new-endpoints-C_om-Dj7.js → observability-new-endpoints-Zm5VNGIa.js} +174 -19
  36. package/dist/observability-new-endpoints-Zm5VNGIa.js.map +1 -0
  37. package/dist/{routes-wp2lb2LI.cjs → routes-BqrG1FfY.cjs} +6 -4
  38. package/dist/routes-BqrG1FfY.cjs.map +1 -0
  39. package/dist/{routes-bRlxNTKn.js → routes-CxuspiM8.js} +7 -5
  40. package/dist/routes-CxuspiM8.js.map +1 -0
  41. package/dist/server/a2a/tasks.d.ts +13 -1
  42. package/dist/server/a2a/tasks.d.ts.map +1 -1
  43. package/dist/server/handlers/a2a.cjs +1 -1
  44. package/dist/server/handlers/a2a.d.ts.map +1 -1
  45. package/dist/server/handlers/a2a.js +1 -1
  46. package/dist/server/handlers/agent-builder.cjs +2 -2
  47. package/dist/server/handlers/agent-builder.js +2 -2
  48. package/dist/server/handlers/agents.cjs +102 -41
  49. package/dist/server/handlers/agents.cjs.map +1 -1
  50. package/dist/server/handlers/agents.d.ts +55 -55
  51. package/dist/server/handlers/agents.d.ts.map +1 -1
  52. package/dist/server/handlers/agents.js +102 -41
  53. package/dist/server/handlers/agents.js.map +1 -1
  54. package/dist/server/handlers/author-enrichment.cjs +5 -3
  55. package/dist/server/handlers/author-enrichment.cjs.map +1 -1
  56. package/dist/server/handlers/author-enrichment.d.ts +1 -1
  57. package/dist/server/handlers/author-enrichment.d.ts.map +1 -1
  58. package/dist/server/handlers/author-enrichment.js +5 -3
  59. package/dist/server/handlers/author-enrichment.js.map +1 -1
  60. package/dist/server/handlers/datasets.cjs +2 -2
  61. package/dist/server/handlers/datasets.d.ts +2 -0
  62. package/dist/server/handlers/datasets.d.ts.map +1 -1
  63. package/dist/server/handlers/datasets.js +2 -2
  64. package/dist/server/handlers/editor-builder.cjs +1 -1
  65. package/dist/server/handlers/editor-builder.js +1 -1
  66. package/dist/server/handlers/favorites-enrichment.cjs +1 -1
  67. package/dist/server/handlers/favorites-enrichment.js +1 -1
  68. package/dist/server/handlers/mcp-client-versions.cjs +1 -1
  69. package/dist/server/handlers/mcp-client-versions.js +1 -1
  70. package/dist/server/handlers/observability-new-endpoints.cjs +2 -1
  71. package/dist/server/handlers/observability-new-endpoints.d.ts +302 -56
  72. package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
  73. package/dist/server/handlers/observability-new-endpoints.js +2 -2
  74. package/dist/server/handlers/observability-shared.cjs +13 -0
  75. package/dist/server/handlers/observability-shared.cjs.map +1 -1
  76. package/dist/server/handlers/observability-shared.d.ts +8 -0
  77. package/dist/server/handlers/observability-shared.d.ts.map +1 -1
  78. package/dist/server/handlers/observability-shared.js +13 -1
  79. package/dist/server/handlers/observability-shared.js.map +1 -1
  80. package/dist/server/handlers/observability-storage-schemas.cjs +5 -0
  81. package/dist/server/handlers/observability-storage-schemas.cjs.map +1 -1
  82. package/dist/server/handlers/observability-storage-schemas.d.ts +2 -0
  83. package/dist/server/handlers/observability-storage-schemas.d.ts.map +1 -1
  84. package/dist/server/handlers/observability-storage-schemas.js +4 -1
  85. package/dist/server/handlers/observability-storage-schemas.js.map +1 -1
  86. package/dist/server/handlers/observability.cjs +26 -1
  87. package/dist/server/handlers/observability.cjs.map +1 -1
  88. package/dist/server/handlers/observability.d.ts +2 -0
  89. package/dist/server/handlers/observability.d.ts.map +1 -1
  90. package/dist/server/handlers/observability.js +26 -3
  91. package/dist/server/handlers/observability.js.map +1 -1
  92. package/dist/server/handlers/plans.cjs +1 -1
  93. package/dist/server/handlers/plans.js +1 -1
  94. package/dist/server/handlers/prompt-block-versions.cjs +1 -1
  95. package/dist/server/handlers/prompt-block-versions.js +1 -1
  96. package/dist/server/handlers/responses.d.ts +11 -11
  97. package/dist/server/handlers/scorer-versions.cjs +1 -1
  98. package/dist/server/handlers/scorer-versions.js +1 -1
  99. package/dist/server/handlers/stored-agent-favorites.cjs +1 -1
  100. package/dist/server/handlers/stored-agent-favorites.js +1 -1
  101. package/dist/server/handlers/stored-agents.cjs +2 -2
  102. package/dist/server/handlers/stored-agents.js +2 -2
  103. package/dist/server/handlers/stored-mcp-clients.cjs +1 -1
  104. package/dist/server/handlers/stored-mcp-clients.js +1 -1
  105. package/dist/server/handlers/stored-prompt-blocks.cjs +1 -1
  106. package/dist/server/handlers/stored-prompt-blocks.js +1 -1
  107. package/dist/server/handlers/stored-scorers.cjs +1 -1
  108. package/dist/server/handlers/stored-scorers.js +1 -1
  109. package/dist/server/handlers/stored-skill-favorites.cjs +2 -2
  110. package/dist/server/handlers/stored-skill-favorites.js +2 -2
  111. package/dist/server/handlers/stored-skills.cjs +2 -2
  112. package/dist/server/handlers/stored-skills.js +2 -2
  113. package/dist/server/handlers/system.cjs +7 -4
  114. package/dist/server/handlers/system.cjs.map +1 -1
  115. package/dist/server/handlers/system.d.ts +2 -0
  116. package/dist/server/handlers/system.d.ts.map +1 -1
  117. package/dist/server/handlers/system.js +7 -4
  118. package/dist/server/handlers/system.js.map +1 -1
  119. package/dist/server/handlers/tools.cjs +1 -1
  120. package/dist/server/handlers/tools.js +1 -1
  121. package/dist/server/handlers/workflows.cjs +2 -2
  122. package/dist/server/handlers/workflows.cjs.map +1 -1
  123. package/dist/server/handlers/workflows.js +2 -2
  124. package/dist/server/handlers/workflows.js.map +1 -1
  125. package/dist/server/handlers.cjs +1 -1
  126. package/dist/server/handlers.js +1 -1
  127. package/dist/server/schemas/agents.d.ts +8 -16
  128. package/dist/server/schemas/agents.d.ts.map +1 -1
  129. package/dist/server/schemas/datasets.d.ts +2 -0
  130. package/dist/server/schemas/datasets.d.ts.map +1 -1
  131. package/dist/server/schemas/feedback.d.ts +64 -0
  132. package/dist/server/schemas/feedback.d.ts.map +1 -0
  133. package/dist/server/schemas/index.cjs +5 -5
  134. package/dist/server/schemas/index.js +5 -5
  135. package/dist/server/schemas/system.d.ts +1 -0
  136. package/dist/server/schemas/system.d.ts.map +1 -1
  137. package/dist/server/server-adapter/index.cjs +9 -2
  138. package/dist/server/server-adapter/index.cjs.map +1 -1
  139. package/dist/server/server-adapter/index.d.ts +3 -0
  140. package/dist/server/server-adapter/index.d.ts.map +1 -1
  141. package/dist/server/server-adapter/index.js +8 -3
  142. package/dist/server/server-adapter/index.js.map +1 -1
  143. package/dist/server/server-adapter/routes/conversations.d.ts +3 -3
  144. package/dist/server/server-adapter/routes/datasets.d.ts +2 -0
  145. package/dist/server/server-adapter/routes/datasets.d.ts.map +1 -1
  146. package/dist/server/server-adapter/routes/legacy.d.ts +6 -6
  147. package/dist/server/server-adapter/routes/observability.d.ts +122 -1
  148. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
  149. package/dist/server/server-adapter/routes/system.d.ts +2 -0
  150. package/dist/server/server-adapter/routes/system.d.ts.map +1 -1
  151. package/dist/server/server-adapter/routes/workspace.d.ts +23 -23
  152. package/dist/{system-wl_uZdyz.cjs → system-Cfo5a63a.cjs} +3 -1
  153. package/dist/system-Cfo5a63a.cjs.map +1 -0
  154. package/dist/{system-0TbTYKJY.js → system-DT2JfUun.js} +3 -1
  155. package/dist/system-DT2JfUun.js.map +1 -0
  156. package/package.json +6 -6
  157. package/dist/a2a-C7OgMND3.cjs.map +0 -1
  158. package/dist/a2a-DdCHhKh5.js.map +0 -1
  159. package/dist/agents-BetrUB_N.js.map +0 -1
  160. package/dist/agents-CLv_RFQx.cjs.map +0 -1
  161. package/dist/datasets-B3DTc52y.cjs.map +0 -1
  162. package/dist/dist-BW8S4tCf.js.map +0 -1
  163. package/dist/dist-C8lAYOI6.cjs.map +0 -1
  164. package/dist/observability-new-endpoints-BxXDVoQ0.cjs.map +0 -1
  165. package/dist/observability-new-endpoints-C_om-Dj7.js.map +0 -1
  166. package/dist/routes-bRlxNTKn.js.map +0 -1
  167. package/dist/routes-wp2lb2LI.cjs.map +0 -1
  168. package/dist/system-0TbTYKJY.js.map +0 -1
  169. package/dist/system-wl_uZdyz.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"observability-new-endpoints.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/observability-new-endpoints.ts"],"names":[],"mappings":"AAkEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,KAAK,EAAe,aAAa,EAAsB,MAAM,0BAA0B,CAAC;AA2D/F,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBpB,CAAC;AAMH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBtB,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BtB,CAAC"}
@@ -1,2 +1,2 @@
1
- import { C as GET_TAGS, D as LIST_SCORES, E as LIST_METRICS, O as NEW_ROUTES, S as GET_SERVICE_NAMES, T as LIST_LOGS, _ as GET_SCORE, a as GET_ENVIRONMENTS, b as GET_SCORE_PERCENTILES, c as GET_FEEDBACK_PERCENTILES, d as GET_METRIC_BREAKDOWN, f as GET_METRIC_LABEL_KEYS, g as GET_METRIC_TIME_SERIES, h as GET_METRIC_PERCENTILES, i as GET_ENTITY_TYPES, k as UPDATE_FEEDBACK_REVIEW_STATUS, l as GET_FEEDBACK_TIME_SERIES, m as GET_METRIC_NAMES, n as CREATE_SCORE, o as GET_FEEDBACK_AGGREGATE, p as GET_METRIC_LABEL_VALUES, r as GET_ENTITY_NAMES, s as GET_FEEDBACK_BREAKDOWN, t as CREATE_FEEDBACK, u as GET_METRIC_AGGREGATE, v as GET_SCORE_AGGREGATE, w as LIST_FEEDBACK, x as GET_SCORE_TIME_SERIES, y as GET_SCORE_BREAKDOWN } from "../../observability-new-endpoints-C_om-Dj7.js";
2
- export { CREATE_FEEDBACK, CREATE_SCORE, GET_ENTITY_NAMES, GET_ENTITY_TYPES, GET_ENVIRONMENTS, GET_FEEDBACK_AGGREGATE, GET_FEEDBACK_BREAKDOWN, GET_FEEDBACK_PERCENTILES, GET_FEEDBACK_TIME_SERIES, GET_METRIC_AGGREGATE, GET_METRIC_BREAKDOWN, GET_METRIC_LABEL_KEYS, GET_METRIC_LABEL_VALUES, GET_METRIC_NAMES, GET_METRIC_PERCENTILES, GET_METRIC_TIME_SERIES, GET_SCORE, GET_SCORE_AGGREGATE, GET_SCORE_BREAKDOWN, GET_SCORE_PERCENTILES, GET_SCORE_TIME_SERIES, GET_SERVICE_NAMES, GET_TAGS, LIST_FEEDBACK, LIST_LOGS, LIST_METRICS, LIST_SCORES, NEW_ROUTES, UPDATE_FEEDBACK_REVIEW_STATUS };
1
+ import { A as UPDATE_FEEDBACK_REVIEW_STATUS, C as GET_TAGS, D as LIST_SCORES, E as LIST_METRICS, O as NEW_ROUTES, S as GET_SERVICE_NAMES, T as LIST_LOGS, _ as GET_SCORE, a as GET_ENVIRONMENTS, b as GET_SCORE_PERCENTILES, c as GET_FEEDBACK_PERCENTILES, d as GET_METRIC_BREAKDOWN, f as GET_METRIC_LABEL_KEYS, g as GET_METRIC_TIME_SERIES, h as GET_METRIC_PERCENTILES, i as GET_ENTITY_TYPES, k as QUERY_TRACES, l as GET_FEEDBACK_TIME_SERIES, m as GET_METRIC_NAMES, n as CREATE_SCORE, o as GET_FEEDBACK_AGGREGATE, p as GET_METRIC_LABEL_VALUES, r as GET_ENTITY_NAMES, s as GET_FEEDBACK_BREAKDOWN, t as CREATE_FEEDBACK, u as GET_METRIC_AGGREGATE, v as GET_SCORE_AGGREGATE, w as LIST_FEEDBACK, x as GET_SCORE_TIME_SERIES, y as GET_SCORE_BREAKDOWN } from "../../observability-new-endpoints-Zm5VNGIa.js";
2
+ export { CREATE_FEEDBACK, CREATE_SCORE, GET_ENTITY_NAMES, GET_ENTITY_TYPES, GET_ENVIRONMENTS, GET_FEEDBACK_AGGREGATE, GET_FEEDBACK_BREAKDOWN, GET_FEEDBACK_PERCENTILES, GET_FEEDBACK_TIME_SERIES, GET_METRIC_AGGREGATE, GET_METRIC_BREAKDOWN, GET_METRIC_LABEL_KEYS, GET_METRIC_LABEL_VALUES, GET_METRIC_NAMES, GET_METRIC_PERCENTILES, GET_METRIC_TIME_SERIES, GET_SCORE, GET_SCORE_AGGREGATE, GET_SCORE_BREAKDOWN, GET_SCORE_PERCENTILES, GET_SCORE_TIME_SERIES, GET_SERVICE_NAMES, GET_TAGS, LIST_FEEDBACK, LIST_LOGS, LIST_METRICS, LIST_SCORES, NEW_ROUTES, QUERY_TRACES, UPDATE_FEEDBACK_REVIEW_STATUS };
@@ -8,6 +8,7 @@ let _mastra_core_features = require("@mastra/core/features");
8
8
  //#region src/server/handlers/observability-shared.ts
9
9
  const OBSERVABILITY_DELTA_POLLING_FEATURE = "observability-delta-polling";
10
10
  const OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE = "Delta polling requires a newer @mastra/core with observability delta polling support. Please upgrade.";
11
+ const OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE = "trace-query";
11
12
  const OBSERVABILITY_LIST_ENDPOINTS = {
12
13
  traces: "traces",
13
14
  branches: "branches",
@@ -38,12 +39,23 @@ async function getScoresStore(mastra) {
38
39
  if (!scores) throw new require_http_exception.HTTPException(501, { message: "Scores storage domain is not available" });
39
40
  return scores;
40
41
  }
42
+ function assertObservabilityTraceQuerySupported(observabilityStore) {
43
+ if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE)) return;
44
+ throw new require_http_exception.HTTPException(501, { message: "Advanced trace queries are not supported by the configured observability store" });
45
+ }
41
46
  function assertObservabilityDeltaSupported(observabilityStore, endpoint) {
42
47
  if (!_mastra_core_features.coreFeatures.has("observability-delta-polling")) throw new require_http_exception.HTTPException(501, { message: `${OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE} (endpoint: ${endpoint})` });
43
48
  if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE)) return;
44
49
  throw new require_http_exception.HTTPException(501, { message: `Delta polling is not supported by the configured observability store for ${endpoint}` });
45
50
  }
46
51
  const NEW_ROUTE_DEFS = {
52
+ QUERY_TRACES: {
53
+ method: "POST",
54
+ path: "/observability/traces/query",
55
+ summary: "Query traces",
56
+ description: "Returns completed logical traces or distinct thread groups matching an advanced trace query",
57
+ requiresPermission: "observability:read"
58
+ },
47
59
  LIST_METRICS: {
48
60
  method: "GET",
49
61
  path: "/observability/metrics",
@@ -297,6 +309,7 @@ exports.OBSERVABILITY_DELTA_POLLING_FEATURE = OBSERVABILITY_DELTA_POLLING_FEATUR
297
309
  exports.OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE = OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE;
298
310
  exports.OBSERVABILITY_LIST_ENDPOINTS = OBSERVABILITY_LIST_ENDPOINTS;
299
311
  exports.assertObservabilityDeltaSupported = assertObservabilityDeltaSupported;
312
+ exports.assertObservabilityTraceQuerySupported = assertObservabilityTraceQuerySupported;
300
313
  exports.createObservabilityListQuerySchema = createObservabilityListQuerySchema;
301
314
  exports.getObservabilityStore = getObservabilityStore;
302
315
  exports.getScoresStore = getScoresStore;
@@ -1 +1 @@
1
- {"version":3,"file":"observability-shared.cjs","names":["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 { MastraCompositeStore, ObservabilityStorage, ScoresStorage } 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.';\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 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 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 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 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} 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":";;;;;;;;AAcA,MAAa,sCAAsC;AACnD,MAAa,8CACX;AAEF,MAAa,+BAA+B;CAC1C,QAAQ;CACR,UAAU;CACV,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;AACZ;AAIA,MAAM,8CAA8C;AAEpD,SAAS,YAAY,oBAAyE;CAI5F,OAAOA,mBAAU,cAAc;AACjC;;AAGA,SAAgB,WAAW,QAAsC;CAC/D,MAAM,UAAU,OAAO,WAAW;CAClC,IAAI,CAAC,SACH,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,2BAA2B,CAAC;CAEtE,OAAO;AACT;;AAGA,eAAsB,sBAAsB,QAA+C;CAEzF,MAAM,gBAAgB,MADN,WAAW,MACO,CAAC,CAAC,SAAS,eAAe;CAC5D,IAAI,CAAC,eAIH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,gDAA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B,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":["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 { MastraCompositeStore, ObservabilityStorage, ScoresStorage } 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';\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 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: 'Returns completed logical traces or distinct thread groups matching an advanced trace query',\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 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 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} 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":";;;;;;;;AAcA,MAAa,sCAAsC;AACnD,MAAa,8CACX;AACF,MAAM,4CAA4C;AAElD,MAAa,+BAA+B;CAC1C,QAAQ;CACR,UAAU;CACV,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;AACZ;AAIA,MAAM,8CAA8C;AAEpD,SAAS,YAAY,oBAAyE;CAI5F,OAAOA,mBAAU,cAAc;AACjC;;AAGA,SAAgB,WAAW,QAAsC;CAC/D,MAAM,UAAU,OAAO,WAAW;CAClC,IAAI,CAAC,SACH,MAAM,IAAIC,uBAAAA,cAAc,KAAK,EAAE,SAAS,2BAA2B,CAAC;CAEtE,OAAO;AACT;;AAGA,eAAsB,sBAAsB,QAA+C;CAEzF,MAAM,gBAAgB,MADN,WAAW,MACO,CAAC,CAAC,SAAS,eAAe;CAC5D,IAAI,CAAC,eAIH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS,gDAAgD,CAAC;CAE3F,OAAO;AACT;;AAGA,eAAsB,eAAe,QAAwC;CAE3E,MAAM,SAAS,MADC,WAAW,MACA,CAAC,CAAC,SAAS,QAAQ;CAC9C,IAAI,CAAC,QACH,MAAM,IAAIA,uBAAAA,cAAc,KAAK,EAAE,SAAS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ACb,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"}
@@ -19,6 +19,7 @@ export declare function getStorage(mastra: Mastra): MastraCompositeStore;
19
19
  export declare function getObservabilityStore(mastra: Mastra): Promise<ObservabilityStorage>;
20
20
  /** Retrieves the scores storage domain or throws 501 if unavailable. */
21
21
  export declare function getScoresStore(mastra: Mastra): Promise<ScoresStorage>;
22
+ export declare function assertObservabilityTraceQuerySupported(observabilityStore: ObservabilityStorage): void;
22
23
  export declare function assertObservabilityDeltaSupported(observabilityStore: ObservabilityStorage, endpoint: ObservabilityListEndpoint): void;
23
24
  export interface RouteDetails {
24
25
  method: ServerRoute['method'];
@@ -28,6 +29,13 @@ export interface RouteDetails {
28
29
  requiresPermission?: ServerRoute['requiresPermission'];
29
30
  }
30
31
  export declare const NEW_ROUTE_DEFS: {
32
+ readonly QUERY_TRACES: {
33
+ readonly method: 'POST';
34
+ readonly path: '/observability/traces/query';
35
+ readonly summary: 'Query traces';
36
+ readonly description: 'Returns completed logical traces or distinct thread groups matching an advanced trace query';
37
+ readonly requiresPermission: 'observability:read';
38
+ };
31
39
  readonly LIST_METRICS: {
32
40
  readonly method: 'GET';
33
41
  readonly path: '/observability/metrics';
@@ -1 +1 @@
1
- {"version":3,"file":"observability-shared.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/observability-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAS5D,eAAO,MAAM,mCAAmC,gCAAgC,CAAC;AACjF,eAAO,MAAM,2CAA2C,0GACiD,CAAC;AAE1G,eAAO,MAAM,4BAA4B;aACvC,MAAM,EAAE,QAAQ;aAChB,QAAQ,EAAE,UAAU;aACpB,IAAI,EAAE,MAAM;aACZ,OAAO,EAAE,SAAS;aAClB,MAAM,EAAE,QAAQ;aAChB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAEX,MAAM,MAAM,yBAAyB,GACnC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,OAAO,4BAA4B,CAAC,CAAC;AAUnF,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAM/D;AAED,+EAA+E;AAC/E,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAUzF;AAED,wEAAwE;AACxE,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAO3E;AAED,wBAAgB,iCAAiC,CAC/C,kBAAkB,EAAE,oBAAoB,EACxC,QAAQ,EAAE,yBAAyB,QAepC;AAED,MAAM,WAAW,Y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AAK;iBACb,IAAI,EAAE,uCAAuC;iBAC7C,OAAO,EAAE,kBAAkB;iBAC3B,WAAW,EAAE,uDAAuD;;;iBAIpE,MAAM,EAAE,KAAK;iBACb,IAAI,EAAE,uCAAuC;iBAC7C,OAAO,EAAE,kBAAkB;iBAC3B,WAAW,EAAE,4DAA4D;;;iBAIzE,MAAM,EAAE,KAAK;iBACb,IAAI,EAAE,wCAAwC;iBAC9C,OAAO,EAAE,mBAAmB;iBAC5B,WAAW,EAAE,wDAAwD;;;iBAIrE,MAAM,EAAE,KAAK;iBACb,IAAI,EAAE,uCAAuC;iBAC7C,OAAO,EAAE,kBAAkB;iBAC3B,WAAW,EAAE,uDAAuD;;;iBAIpE,MAAM,EAAE,KAAK;iBACb,IAAI,EAAE,+BAA+B;iBACrC,OAAO,EAAE,UAAU;iBACnB,WAAW,EAAE,2DAA2D;;CAE3B,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,cAAc,CAAC;AACvD,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC;AAEzE,wBAAgB,kCAAkC,CAChD,OAAO,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAC1C,QAAQ,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAC3C,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ;;mBAoF/C"}
@@ -6,6 +6,7 @@ import { coreFeatures } from "@mastra/core/features";
6
6
  //#region src/server/handlers/observability-shared.ts
7
7
  const OBSERVABILITY_DELTA_POLLING_FEATURE = "observability-delta-polling";
8
8
  const OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE = "Delta polling requires a newer @mastra/core with observability delta polling support. Please upgrade.";
9
+ const OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE = "trace-query";
9
10
  const OBSERVABILITY_LIST_ENDPOINTS = {
10
11
  traces: "traces",
11
12
  branches: "branches",
@@ -36,12 +37,23 @@ async function getScoresStore(mastra) {
36
37
  if (!scores) throw new HTTPException(501, { message: "Scores storage domain is not available" });
37
38
  return scores;
38
39
  }
40
+ function assertObservabilityTraceQuerySupported(observabilityStore) {
41
+ if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_TRACE_QUERY_STORAGE_FEATURE)) return;
42
+ throw new HTTPException(501, { message: "Advanced trace queries are not supported by the configured observability store" });
43
+ }
39
44
  function assertObservabilityDeltaSupported(observabilityStore, endpoint) {
40
45
  if (!coreFeatures.has("observability-delta-polling")) throw new HTTPException(501, { message: `${OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE} (endpoint: ${endpoint})` });
41
46
  if (getFeatures(observabilityStore)?.includes(OBSERVABILITY_DELTA_POLLING_STORAGE_FEATURE)) return;
42
47
  throw new HTTPException(501, { message: `Delta polling is not supported by the configured observability store for ${endpoint}` });
43
48
  }
44
49
  const NEW_ROUTE_DEFS = {
50
+ QUERY_TRACES: {
51
+ method: "POST",
52
+ path: "/observability/traces/query",
53
+ summary: "Query traces",
54
+ description: "Returns completed logical traces or distinct thread groups matching an advanced trace query",
55
+ requiresPermission: "observability:read"
56
+ },
45
57
  LIST_METRICS: {
46
58
  method: "GET",
47
59
  path: "/observability/metrics",
@@ -290,6 +302,6 @@ function createObservabilityListQuerySchema(filterSchema, orderBySchema) {
290
302
  });
291
303
  }
292
304
  //#endregion
293
- export { NEW_ROUTE_DEFS, OBSERVABILITY_DELTA_POLLING_FEATURE, OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE, OBSERVABILITY_LIST_ENDPOINTS, assertObservabilityDeltaSupported, createObservabilityListQuerySchema, getObservabilityStore, getScoresStore, getStorage };
305
+ export { NEW_ROUTE_DEFS, OBSERVABILITY_DELTA_POLLING_FEATURE, OBSERVABILITY_DELTA_POLLING_UPGRADE_MESSAGE, OBSERVABILITY_LIST_ENDPOINTS, assertObservabilityDeltaSupported, assertObservabilityTraceQuerySupported, createObservabilityListQuerySchema, getObservabilityStore, getScoresStore, getStorage };
294
306
 
295
307
  //# sourceMappingURL=observability-shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observability-shared.js","names":["candidate"],"sources":["../../../src/server/handlers/observability-shared.ts"],"sourcesContent":["import type { Mastra } from '@mastra/core';\nimport { coreFeatures } from '@mastra/core/features';\nimport type { MastraCompositeStore, ObservabilityStorage, ScoresStorage } 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.';\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 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 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 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 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} 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":";;;;;;AAcA,MAAa,sCAAsC;AACnD,MAAa,8CACX;AAEF,MAAa,+BAA+B;CAC1C,QAAQ;CACR,UAAU;CACV,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;AACZ;AAIA,MAAM,8CAA8C;AAEpD,SAAS,YAAY,oBAAyE;CAI5F,OAAOA,mBAAU,cAAc;AACjC;;AAGA,SAAgB,WAAW,QAAsC;CAC/D,MAAM,UAAU,OAAO,WAAW;CAClC,IAAI,CAAC,SACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,2BAA2B,CAAC;CAEtE,OAAO;AACT;;AAGA,eAAsB,sBAAsB,QAA+C;CAEzF,MAAM,gBAAgB,MADN,WAAW,MACO,CAAC,CAAC,SAAS,eAAe;CAC5D,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B,SAAS;IACX,CAAC;GAEL;GACA,IAAI,YAAY;IACd,IAAI,MAAM,UAAU,KAAA,GAClB,IAAI,SAAS;KACX,MAAM,EAAE,aAAa;KACrB,MAAM,CAAC,OAAO;KACd,SAAS;IACX,CAAC;IAEH,IAAI,MAAM,cAAc,KAAA,GACtB,IAAI,SAAS;KACX,MAAM,EAAE,aAAa;KACrB,MAAM,CAAC,WAAW;KAClB,SAAS;IACX,CAAC;GAEL;GACA;EACF;EAEA,IAAI,UACF,IAAI,SAAS;GACX,MAAM,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;EAEH,IAAI,UACF,IAAI,SAAS;GACX,MAAM,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;CAEL,CAAC;AACH"}
1
+ {"version":3,"file":"observability-shared.js","names":["candidate"],"sources":["../../../src/server/handlers/observability-shared.ts"],"sourcesContent":["import type { Mastra } from '@mastra/core';\nimport { coreFeatures } from '@mastra/core/features';\nimport type { MastraCompositeStore, ObservabilityStorage, ScoresStorage } 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';\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 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: 'Returns completed logical traces or distinct thread groups matching an advanced trace query',\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 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 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} 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":";;;;;;AAcA,MAAa,sCAAsC;AACnD,MAAa,8CACX;AACF,MAAM,4CAA4C;AAElD,MAAa,+BAA+B;CAC1C,QAAQ;CACR,UAAU;CACV,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;AACZ;AAIA,MAAM,8CAA8C;AAEpD,SAAS,YAAY,oBAAyE;CAI5F,OAAOA,mBAAU,cAAc;AACjC;;AAGA,SAAgB,WAAW,QAAsC;CAC/D,MAAM,UAAU,OAAO,WAAW;CAClC,IAAI,CAAC,SACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,2BAA2B,CAAC;CAEtE,OAAO;AACT;;AAGA,eAAsB,sBAAsB,QAA+C;CAEzF,MAAM,gBAAgB,MADN,WAAW,MACO,CAAC,CAAC,SAAS,eAAe;CAC5D,IAAI,CAAC,eAIH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,gDAAgD,CAAC;CAE3F,OAAO;AACT;;AAGA,eAAsB,eAAe,QAAwC;CAE3E,MAAM,SAAS,MADC,WAAW,MACA,CAAC,CAAC,SAAS,QAAQ;CAC9C,IAAI,CAAC,QACH,MAAM,IAAI,cAAc,KAAK,EAAE,SAAS,yCAAyC,CAAC;CAEpF,OAAO;AACT;AAEA,SAAgB,uCAAuC,oBAA0C;CAC/F,IAAI,YAAY,kBAAkB,CAAC,EAAE,SAAS,yCAAyC,GAAG;CAE1F,MAAM,IAAI,cAAc,KAAK,EAC3B,SAAS,iFACX,CAAC;AACH;AAEA,SAAgB,kCACd,oBACA,UACA;CACA,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Aa;KACrB,MAAM,CAAC,WAAW;KAClB,SAAS;IACX,CAAC;GAEL;GACA;EACF;EAEA,IAAI,UACF,IAAI,SAAS;GACX,MAAM,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;EAEH,IAAI,UACF,IAAI,SAAS;GACX,MAAM,EAAE,aAAa;GACrB,MAAM,CAAC,OAAO;GACd,SAAS;EACX,CAAC;CAEL,CAAC;AACH"}
@@ -37,13 +37,18 @@ const fallbackBranchArgs = zod_v4.z.object({
37
37
  depth: zod_v4.z.unknown()
38
38
  });
39
39
  const fallbackSchema = zod_v4.z.unknown();
40
+ const fallbackDeleteTracesArgs = zod_v4.z.object({ traceIds: zod_v4.z.array(zod_v4.z.string()).max(1e3) });
40
41
  const branchesFilterSchema = ns.branchesFilterSchema ?? fallbackEmptyObject;
41
42
  const branchesOrderBySchema = ns.branchesOrderBySchema ?? fallbackEmptyObject;
42
43
  const getBranchArgsSchema = ns.getBranchArgsSchema ?? fallbackBranchArgs;
43
44
  const listBranchesResponseSchema = ns.listBranchesResponseSchema ?? fallbackSchema;
44
45
  const getBranchResponseSchema = ns.getBranchResponseSchema ?? fallbackSchema;
45
46
  const listTracesLightResponseSchema = ns.listTracesLightResponseSchema ?? fallbackSchema;
47
+ const batchDeleteTracesArgsSchema = ns.batchDeleteTracesArgsSchema ?? fallbackDeleteTracesArgs;
48
+ const batchDeleteTracesResponseSchema = ns.batchDeleteTracesResponseSchema ?? zod_v4.z.object({ success: zod_v4.z.literal(true) });
46
49
  //#endregion
50
+ exports.batchDeleteTracesArgsSchema = batchDeleteTracesArgsSchema;
51
+ exports.batchDeleteTracesResponseSchema = batchDeleteTracesResponseSchema;
47
52
  exports.branchesFilterSchema = branchesFilterSchema;
48
53
  exports.branchesOrderBySchema = branchesOrderBySchema;
49
54
  exports.getBranchArgsSchema = getBranchArgsSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"observability-storage-schemas.cjs","names":["coreStorage","z"],"sources":["../../../src/server/handlers/observability-storage-schemas.ts"],"sourcesContent":["/**\n * Safe re-export of branches-related Zod schemas from `@mastra/core/storage`.\n *\n * Why this shim exists:\n * The `branches*` and `getBranch*` / `listBranches*` schemas (used to define\n * `/observability/branches` and `/observability/traces/:traceId/branches/:spanId`\n * routes) were introduced in `@mastra/core@1.32.0`. Earlier versions of\n * `@mastra/core` ship `@mastra/core/storage` but do not export these names.\n *\n * A direct named import (`import { branchesFilterSchema } from\n * '@mastra/core/storage'`) fails at ESM link time when this version of\n * `@mastra/server` is paired with `@mastra/core < 1.32.0`, taking the entire\n * user bundle down before any code runs.\n *\n * A namespace import tolerates missing names (`ns.MissingExport` is just\n * `undefined`, no link-time error). We then fall back to a permissive empty\n * `z.object({})` so the route definitions can still evaluate at module load\n * time. On old core the branches routes will register but their handlers\n * will fail at request time when the storage backend doesn't implement\n * `listBranches` / `getBranch` — which is the correct degradation, since\n * those storage methods don't exist on old core either.\n *\n * Once the consuming `@mastra/core` is on `1.32.0+` the schemas are real\n * and behaviour is identical to a direct named import.\n */\n\nimport * as coreStorage from '@mastra/core/storage';\nimport { z } from 'zod/v4';\n\n// Each export is typed as `any` on purpose: consumers of `@mastra/server` may\n// run their typecheck against a `@mastra/core` that doesn't export these names\n// (anything < 1.32.0). Pinning to the real types would push those names into\n// the emitted `.d.ts` and break downstream typecheck. `any` lets the schema\n// chains (`.extend(...)`, `.pick(...)`, `.partial()`) flow through cleanly on\n// every supported core.\n//\n// Runtime behaviour:\n// - On `@mastra/core >= 1.32.0` the real Zod schemas are re-exported.\n// - On older cores, fallbacks are used: `z.object({})` for object schemas\n// (still supports `.extend`, `.pick`, `.partial`) and `z.unknown()` for\n// response schemas. The branches/getBranch routes will register but their\n// handlers will fail at request time when the storage backend doesn't\n// implement `listBranches` / `getBranch` — the correct degradation, since\n// those methods don't exist on old core either.\nconst ns = coreStorage as Record<string, unknown>;\nconst fallbackEmptyObject = z.object({});\n// `getBranchArgsSchema` is `.pick()`ed at module-eval time; the empty fallback\n// would crash because the picked keys aren't declared. Pre-declare them as\n// permissive `z.unknown()` so the route definitions evaluate cleanly.\nconst fallbackBranchArgs = z.object({\n traceId: z.unknown(),\n spanId: z.unknown(),\n depth: z.unknown(),\n});\nconst fallbackSchema = z.unknown();\n\nexport const branchesFilterSchema: any = ns.branchesFilterSchema ?? fallbackEmptyObject;\nexport const branchesOrderBySchema: any = ns.branchesOrderBySchema ?? fallbackEmptyObject;\nexport const getBranchArgsSchema: any = ns.getBranchArgsSchema ?? fallbackBranchArgs;\nexport const listBranchesResponseSchema: any = ns.listBranchesResponseSchema ?? fallbackSchema;\nexport const getBranchResponseSchema: any = ns.getBranchResponseSchema ?? fallbackSchema;\nexport const listTracesLightResponseSchema: any = ns.listTracesLightResponseSchema ?? fallbackSchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,KAAKA;AACX,MAAM,sBAAsBC,OAAAA,EAAE,OAAO,CAAC,CAAC;AAIvC,MAAM,qBAAqBA,OAAAA,EAAE,OAAO;CAClC,SAASA,OAAAA,EAAE,QAAQ;CACnB,QAAQA,OAAAA,EAAE,QAAQ;CAClB,OAAOA,OAAAA,EAAE,QAAQ;AACnB,CAAC;AACD,MAAM,iBAAiBA,OAAAA,EAAE,QAAQ;AAEjC,MAAa,uBAA4B,GAAG,wBAAwB;AACpE,MAAa,wBAA6B,GAAG,yBAAyB;AACtE,MAAa,sBAA2B,GAAG,uBAAuB;AAClE,MAAa,6BAAkC,GAAG,8BAA8B;AAChF,MAAa,0BAA+B,GAAG,2BAA2B;AAC1E,MAAa,gCAAqC,GAAG,iCAAiC"}
1
+ {"version":3,"file":"observability-storage-schemas.cjs","names":["coreStorage","z"],"sources":["../../../src/server/handlers/observability-storage-schemas.ts"],"sourcesContent":["/**\n * Safe re-export of branches-related Zod schemas from `@mastra/core/storage`.\n *\n * Why this shim exists:\n * The `branches*` and `getBranch*` / `listBranches*` schemas (used to define\n * `/observability/branches` and `/observability/traces/:traceId/branches/:spanId`\n * routes) were introduced in `@mastra/core@1.32.0`. Earlier versions of\n * `@mastra/core` ship `@mastra/core/storage` but do not export these names.\n *\n * A direct named import (`import { branchesFilterSchema } from\n * '@mastra/core/storage'`) fails at ESM link time when this version of\n * `@mastra/server` is paired with `@mastra/core < 1.32.0`, taking the entire\n * user bundle down before any code runs.\n *\n * A namespace import tolerates missing names (`ns.MissingExport` is just\n * `undefined`, no link-time error). We then fall back to a permissive empty\n * `z.object({})` so the route definitions can still evaluate at module load\n * time. On old core the branches routes will register but their handlers\n * will fail at request time when the storage backend doesn't implement\n * `listBranches` / `getBranch` — which is the correct degradation, since\n * those storage methods don't exist on old core either.\n *\n * Once the consuming `@mastra/core` is on `1.32.0+` the schemas are real\n * and behaviour is identical to a direct named import.\n */\n\nimport * as coreStorage from '@mastra/core/storage';\nimport { z } from 'zod/v4';\n\n// Each export is typed as `any` on purpose: consumers of `@mastra/server` may\n// run their typecheck against a `@mastra/core` that doesn't export these names\n// (anything < 1.32.0). Pinning to the real types would push those names into\n// the emitted `.d.ts` and break downstream typecheck. `any` lets the schema\n// chains (`.extend(...)`, `.pick(...)`, `.partial()`) flow through cleanly on\n// every supported core.\n//\n// Runtime behaviour:\n// - On `@mastra/core >= 1.32.0` the real Zod schemas are re-exported.\n// - On older cores, fallbacks are used: `z.object({})` for object schemas\n// (still supports `.extend`, `.pick`, `.partial`) and `z.unknown()` for\n// response schemas. The branches/getBranch routes will register but their\n// handlers will fail at request time when the storage backend doesn't\n// implement `listBranches` / `getBranch` — the correct degradation, since\n// those methods don't exist on old core either.\nconst ns = coreStorage as Record<string, unknown>;\nconst fallbackEmptyObject = z.object({});\n// `getBranchArgsSchema` is `.pick()`ed at module-eval time; the empty fallback\n// would crash because the picked keys aren't declared. Pre-declare them as\n// permissive `z.unknown()` so the route definitions evaluate cleanly.\nconst fallbackBranchArgs = z.object({\n traceId: z.unknown(),\n spanId: z.unknown(),\n depth: z.unknown(),\n});\nconst fallbackSchema = z.unknown();\n\n// `batchDeleteTracesArgsSchema` predates the branches schemas, but\n// `batchDeleteTracesResponseSchema` is newer still — same shim treatment.\n// The args fallback pre-declares `traceIds` because the route `.pick()`s it\n// at module-eval time.\nconst fallbackDeleteTracesArgs = z.object({\n traceIds: z.array(z.string()).max(1000),\n});\n\nexport const branchesFilterSchema: any = ns.branchesFilterSchema ?? fallbackEmptyObject;\nexport const branchesOrderBySchema: any = ns.branchesOrderBySchema ?? fallbackEmptyObject;\nexport const getBranchArgsSchema: any = ns.getBranchArgsSchema ?? fallbackBranchArgs;\nexport const listBranchesResponseSchema: any = ns.listBranchesResponseSchema ?? fallbackSchema;\nexport const getBranchResponseSchema: any = ns.getBranchResponseSchema ?? fallbackSchema;\nexport const listTracesLightResponseSchema: any = ns.listTracesLightResponseSchema ?? fallbackSchema;\nexport const batchDeleteTracesArgsSchema: any = ns.batchDeleteTracesArgsSchema ?? fallbackDeleteTracesArgs;\nexport const batchDeleteTracesResponseSchema: any =\n ns.batchDeleteTracesResponseSchema ?? z.object({ success: z.literal(true) });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,KAAKA;AACX,MAAM,sBAAsBC,OAAAA,EAAE,OAAO,CAAC,CAAC;AAIvC,MAAM,qBAAqBA,OAAAA,EAAE,OAAO;CAClC,SAASA,OAAAA,EAAE,QAAQ;CACnB,QAAQA,OAAAA,EAAE,QAAQ;CAClB,OAAOA,OAAAA,EAAE,QAAQ;AACnB,CAAC;AACD,MAAM,iBAAiBA,OAAAA,EAAE,QAAQ;AAMjC,MAAM,2BAA2BA,OAAAA,EAAE,OAAO,EACxC,UAAUA,OAAAA,EAAE,MAAMA,OAAAA,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAI,EACxC,CAAC;AAED,MAAa,uBAA4B,GAAG,wBAAwB;AACpE,MAAa,wBAA6B,GAAG,yBAAyB;AACtE,MAAa,sBAA2B,GAAG,uBAAuB;AAClE,MAAa,6BAAkC,GAAG,8BAA8B;AAChF,MAAa,0BAA+B,GAAG,2BAA2B;AAC1E,MAAa,gCAAqC,GAAG,iCAAiC;AACtF,MAAa,8BAAmC,GAAG,+BAA+B;AAClF,MAAa,kCACX,GAAG,mCAAmCA,OAAAA,EAAE,OAAO,EAAE,SAASA,OAAAA,EAAE,QAAQ,IAAI,EAAE,CAAC"}
@@ -29,4 +29,6 @@ export declare const getBranchArgsSchema: any;
29
29
  export declare const listBranchesResponseSchema: any;
30
30
  export declare const getBranchResponseSchema: any;
31
31
  export declare const listTracesLightResponseSchema: any;
32
+ export declare const batchDeleteTracesArgsSchema: any;
33
+ export declare const batchDeleteTracesResponseSchema: any;
32
34
  //# sourceMappingURL=observability-storage-schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observability-storage-schemas.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/observability-storage-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAgCH,eAAO,MAAM,oBAAoB,EAAE,GAAoD,CAAC;AACxF,eAAO,MAAM,qBAAqB,EAAE,GAAqD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,EAAE,GAAkD,CAAC;AACrF,eAAO,MAAM,0BAA0B,EAAE,GAAqD,CAAC;AAC/F,eAAO,MAAM,uBAAuB,EAAE,GAAkD,CAAC;AACzF,eAAO,MAAM,6BAA6B,EAAE,GAAwD,CAAC"}
1
+ {"version":3,"file":"observability-storage-schemas.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/observability-storage-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAwCH,eAAO,MAAM,oBAAoB,EAAE,GAAoD,CAAC;AACxF,eAAO,MAAM,qBAAqB,EAAE,GAAqD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,EAAE,GAAkD,CAAC;AACrF,eAAO,MAAM,0BAA0B,EAAE,GAAqD,CAAC;AAC/F,eAAO,MAAM,uBAAuB,EAAE,GAAkD,CAAC;AACzF,eAAO,MAAM,6BAA6B,EAAE,GAAwD,CAAC;AACrG,eAAO,MAAM,2BAA2B,EAAE,GAAgE,CAAC;AAC3G,eAAO,MAAM,+BAA+B,EAAE,GACgC,CAAC"}
@@ -34,13 +34,16 @@ const fallbackBranchArgs = z.object({
34
34
  depth: z.unknown()
35
35
  });
36
36
  const fallbackSchema = z.unknown();
37
+ const fallbackDeleteTracesArgs = z.object({ traceIds: z.array(z.string()).max(1e3) });
37
38
  const branchesFilterSchema = ns.branchesFilterSchema ?? fallbackEmptyObject;
38
39
  const branchesOrderBySchema = ns.branchesOrderBySchema ?? fallbackEmptyObject;
39
40
  const getBranchArgsSchema = ns.getBranchArgsSchema ?? fallbackBranchArgs;
40
41
  const listBranchesResponseSchema = ns.listBranchesResponseSchema ?? fallbackSchema;
41
42
  const getBranchResponseSchema = ns.getBranchResponseSchema ?? fallbackSchema;
42
43
  const listTracesLightResponseSchema = ns.listTracesLightResponseSchema ?? fallbackSchema;
44
+ const batchDeleteTracesArgsSchema = ns.batchDeleteTracesArgsSchema ?? fallbackDeleteTracesArgs;
45
+ const batchDeleteTracesResponseSchema = ns.batchDeleteTracesResponseSchema ?? z.object({ success: z.literal(true) });
43
46
  //#endregion
44
- export { branchesFilterSchema, branchesOrderBySchema, getBranchArgsSchema, getBranchResponseSchema, listBranchesResponseSchema, listTracesLightResponseSchema };
47
+ export { batchDeleteTracesArgsSchema, batchDeleteTracesResponseSchema, branchesFilterSchema, branchesOrderBySchema, getBranchArgsSchema, getBranchResponseSchema, listBranchesResponseSchema, listTracesLightResponseSchema };
45
48
 
46
49
  //# sourceMappingURL=observability-storage-schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observability-storage-schemas.js","names":[],"sources":["../../../src/server/handlers/observability-storage-schemas.ts"],"sourcesContent":["/**\n * Safe re-export of branches-related Zod schemas from `@mastra/core/storage`.\n *\n * Why this shim exists:\n * The `branches*` and `getBranch*` / `listBranches*` schemas (used to define\n * `/observability/branches` and `/observability/traces/:traceId/branches/:spanId`\n * routes) were introduced in `@mastra/core@1.32.0`. Earlier versions of\n * `@mastra/core` ship `@mastra/core/storage` but do not export these names.\n *\n * A direct named import (`import { branchesFilterSchema } from\n * '@mastra/core/storage'`) fails at ESM link time when this version of\n * `@mastra/server` is paired with `@mastra/core < 1.32.0`, taking the entire\n * user bundle down before any code runs.\n *\n * A namespace import tolerates missing names (`ns.MissingExport` is just\n * `undefined`, no link-time error). We then fall back to a permissive empty\n * `z.object({})` so the route definitions can still evaluate at module load\n * time. On old core the branches routes will register but their handlers\n * will fail at request time when the storage backend doesn't implement\n * `listBranches` / `getBranch` — which is the correct degradation, since\n * those storage methods don't exist on old core either.\n *\n * Once the consuming `@mastra/core` is on `1.32.0+` the schemas are real\n * and behaviour is identical to a direct named import.\n */\n\nimport * as coreStorage from '@mastra/core/storage';\nimport { z } from 'zod/v4';\n\n// Each export is typed as `any` on purpose: consumers of `@mastra/server` may\n// run their typecheck against a `@mastra/core` that doesn't export these names\n// (anything < 1.32.0). Pinning to the real types would push those names into\n// the emitted `.d.ts` and break downstream typecheck. `any` lets the schema\n// chains (`.extend(...)`, `.pick(...)`, `.partial()`) flow through cleanly on\n// every supported core.\n//\n// Runtime behaviour:\n// - On `@mastra/core >= 1.32.0` the real Zod schemas are re-exported.\n// - On older cores, fallbacks are used: `z.object({})` for object schemas\n// (still supports `.extend`, `.pick`, `.partial`) and `z.unknown()` for\n// response schemas. The branches/getBranch routes will register but their\n// handlers will fail at request time when the storage backend doesn't\n// implement `listBranches` / `getBranch` — the correct degradation, since\n// those methods don't exist on old core either.\nconst ns = coreStorage as Record<string, unknown>;\nconst fallbackEmptyObject = z.object({});\n// `getBranchArgsSchema` is `.pick()`ed at module-eval time; the empty fallback\n// would crash because the picked keys aren't declared. Pre-declare them as\n// permissive `z.unknown()` so the route definitions evaluate cleanly.\nconst fallbackBranchArgs = z.object({\n traceId: z.unknown(),\n spanId: z.unknown(),\n depth: z.unknown(),\n});\nconst fallbackSchema = z.unknown();\n\nexport const branchesFilterSchema: any = ns.branchesFilterSchema ?? fallbackEmptyObject;\nexport const branchesOrderBySchema: any = ns.branchesOrderBySchema ?? fallbackEmptyObject;\nexport const getBranchArgsSchema: any = ns.getBranchArgsSchema ?? fallbackBranchArgs;\nexport const listBranchesResponseSchema: any = ns.listBranchesResponseSchema ?? fallbackSchema;\nexport const getBranchResponseSchema: any = ns.getBranchResponseSchema ?? fallbackSchema;\nexport const listTracesLightResponseSchema: any = ns.listTracesLightResponseSchema ?? fallbackSchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,KAAK;AACX,MAAM,sBAAsB,EAAE,OAAO,CAAC,CAAC;AAIvC,MAAM,qBAAqB,EAAE,OAAO;CAClC,SAAS,EAAE,QAAQ;CACnB,QAAQ,EAAE,QAAQ;CAClB,OAAO,EAAE,QAAQ;AACnB,CAAC;AACD,MAAM,iBAAiB,EAAE,QAAQ;AAEjC,MAAa,uBAA4B,GAAG,wBAAwB;AACpE,MAAa,wBAA6B,GAAG,yBAAyB;AACtE,MAAa,sBAA2B,GAAG,uBAAuB;AAClE,MAAa,6BAAkC,GAAG,8BAA8B;AAChF,MAAa,0BAA+B,GAAG,2BAA2B;AAC1E,MAAa,gCAAqC,GAAG,iCAAiC"}
1
+ {"version":3,"file":"observability-storage-schemas.js","names":[],"sources":["../../../src/server/handlers/observability-storage-schemas.ts"],"sourcesContent":["/**\n * Safe re-export of branches-related Zod schemas from `@mastra/core/storage`.\n *\n * Why this shim exists:\n * The `branches*` and `getBranch*` / `listBranches*` schemas (used to define\n * `/observability/branches` and `/observability/traces/:traceId/branches/:spanId`\n * routes) were introduced in `@mastra/core@1.32.0`. Earlier versions of\n * `@mastra/core` ship `@mastra/core/storage` but do not export these names.\n *\n * A direct named import (`import { branchesFilterSchema } from\n * '@mastra/core/storage'`) fails at ESM link time when this version of\n * `@mastra/server` is paired with `@mastra/core < 1.32.0`, taking the entire\n * user bundle down before any code runs.\n *\n * A namespace import tolerates missing names (`ns.MissingExport` is just\n * `undefined`, no link-time error). We then fall back to a permissive empty\n * `z.object({})` so the route definitions can still evaluate at module load\n * time. On old core the branches routes will register but their handlers\n * will fail at request time when the storage backend doesn't implement\n * `listBranches` / `getBranch` — which is the correct degradation, since\n * those storage methods don't exist on old core either.\n *\n * Once the consuming `@mastra/core` is on `1.32.0+` the schemas are real\n * and behaviour is identical to a direct named import.\n */\n\nimport * as coreStorage from '@mastra/core/storage';\nimport { z } from 'zod/v4';\n\n// Each export is typed as `any` on purpose: consumers of `@mastra/server` may\n// run their typecheck against a `@mastra/core` that doesn't export these names\n// (anything < 1.32.0). Pinning to the real types would push those names into\n// the emitted `.d.ts` and break downstream typecheck. `any` lets the schema\n// chains (`.extend(...)`, `.pick(...)`, `.partial()`) flow through cleanly on\n// every supported core.\n//\n// Runtime behaviour:\n// - On `@mastra/core >= 1.32.0` the real Zod schemas are re-exported.\n// - On older cores, fallbacks are used: `z.object({})` for object schemas\n// (still supports `.extend`, `.pick`, `.partial`) and `z.unknown()` for\n// response schemas. The branches/getBranch routes will register but their\n// handlers will fail at request time when the storage backend doesn't\n// implement `listBranches` / `getBranch` — the correct degradation, since\n// those methods don't exist on old core either.\nconst ns = coreStorage as Record<string, unknown>;\nconst fallbackEmptyObject = z.object({});\n// `getBranchArgsSchema` is `.pick()`ed at module-eval time; the empty fallback\n// would crash because the picked keys aren't declared. Pre-declare them as\n// permissive `z.unknown()` so the route definitions evaluate cleanly.\nconst fallbackBranchArgs = z.object({\n traceId: z.unknown(),\n spanId: z.unknown(),\n depth: z.unknown(),\n});\nconst fallbackSchema = z.unknown();\n\n// `batchDeleteTracesArgsSchema` predates the branches schemas, but\n// `batchDeleteTracesResponseSchema` is newer still — same shim treatment.\n// The args fallback pre-declares `traceIds` because the route `.pick()`s it\n// at module-eval time.\nconst fallbackDeleteTracesArgs = z.object({\n traceIds: z.array(z.string()).max(1000),\n});\n\nexport const branchesFilterSchema: any = ns.branchesFilterSchema ?? fallbackEmptyObject;\nexport const branchesOrderBySchema: any = ns.branchesOrderBySchema ?? fallbackEmptyObject;\nexport const getBranchArgsSchema: any = ns.getBranchArgsSchema ?? fallbackBranchArgs;\nexport const listBranchesResponseSchema: any = ns.listBranchesResponseSchema ?? fallbackSchema;\nexport const getBranchResponseSchema: any = ns.getBranchResponseSchema ?? fallbackSchema;\nexport const listTracesLightResponseSchema: any = ns.listTracesLightResponseSchema ?? fallbackSchema;\nexport const batchDeleteTracesArgsSchema: any = ns.batchDeleteTracesArgsSchema ?? fallbackDeleteTracesArgs;\nexport const batchDeleteTracesResponseSchema: any =\n ns.batchDeleteTracesResponseSchema ?? z.object({ success: z.literal(true) });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,KAAK;AACX,MAAM,sBAAsB,EAAE,OAAO,CAAC,CAAC;AAIvC,MAAM,qBAAqB,EAAE,OAAO;CAClC,SAAS,EAAE,QAAQ;CACnB,QAAQ,EAAE,QAAQ;CAClB,OAAO,EAAE,QAAQ;AACnB,CAAC;AACD,MAAM,iBAAiB,EAAE,QAAQ;AAMjC,MAAM,2BAA2B,EAAE,OAAO,EACxC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAI,EACxC,CAAC;AAED,MAAa,uBAA4B,GAAG,wBAAwB;AACpE,MAAa,wBAA6B,GAAG,yBAAyB;AACtE,MAAa,sBAA2B,GAAG,uBAAuB;AAClE,MAAa,6BAAkC,GAAG,8BAA8B;AAChF,MAAa,0BAA+B,GAAG,2BAA2B;AAC1E,MAAa,gCAAqC,GAAG,iCAAiC;AACtF,MAAa,8BAAmC,GAAG,+BAA+B;AAClF,MAAa,kCACX,GAAG,mCAAmC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,EAAE,CAAC"}
@@ -6,7 +6,7 @@ const require_server_handlers_error = require("./error.cjs");
6
6
  const require_server_handlers_observability_list_query_schemas = require("./observability-list-query-schemas.cjs");
7
7
  const require_server_handlers_observability_shared = require("./observability-shared.cjs");
8
8
  const require_server_handlers_observability_storage_schemas = require("./observability-storage-schemas.cjs");
9
- const require_observability_new_endpoints = require("../../observability-new-endpoints-BxXDVoQ0.cjs");
9
+ const require_observability_new_endpoints = require("../../observability-new-endpoints-DF85EOQS.cjs");
10
10
  let zod_v4 = require("zod/v4");
11
11
  let _mastra_core_evals = require("@mastra/core/evals");
12
12
  let _mastra_core_evals_scoreTraces = require("@mastra/core/evals/scoreTraces");
@@ -15,6 +15,7 @@ let _mastra_core_storage = require("@mastra/core/storage");
15
15
  var observability_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
16
16
  CREATE_FEEDBACK: () => require_observability_new_endpoints.CREATE_FEEDBACK,
17
17
  CREATE_SCORE: () => require_observability_new_endpoints.CREATE_SCORE,
18
+ DELETE_TRACES_ROUTE: () => DELETE_TRACES_ROUTE,
18
19
  GET_BRANCH_ROUTE: () => GET_BRANCH_ROUTE,
19
20
  GET_ENTITY_NAMES: () => require_observability_new_endpoints.GET_ENTITY_NAMES,
20
21
  GET_ENTITY_TYPES: () => require_observability_new_endpoints.GET_ENTITY_TYPES,
@@ -50,6 +51,7 @@ var observability_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll
50
51
  LIST_TRACES_LIGHT_ROUTE: () => LIST_TRACES_LIGHT_ROUTE,
51
52
  LIST_TRACES_ROUTE: () => LIST_TRACES_ROUTE,
52
53
  NEW_ROUTES: () => require_observability_new_endpoints.NEW_ROUTES,
54
+ QUERY_TRACES: () => require_observability_new_endpoints.QUERY_TRACES,
53
55
  SCORE_TRACES_ROUTE: () => SCORE_TRACES_ROUTE,
54
56
  UPDATE_FEEDBACK_REVIEW_STATUS: () => require_observability_new_endpoints.UPDATE_FEEDBACK_REVIEW_STATUS
55
57
  });
@@ -335,6 +337,27 @@ const GET_TRACE_TRAJECTORY_ROUTE = require_route_builder.createRoute({
335
337
  }
336
338
  }
337
339
  });
340
+ /** Route: POST /observability/traces/delete - batch delete traces with cross-signal cascade. */
341
+ const DELETE_TRACES_ROUTE = require_route_builder.createRoute({
342
+ method: "POST",
343
+ path: "/observability/traces/delete",
344
+ responseType: "json",
345
+ bodySchema: require_server_handlers_observability_storage_schemas.batchDeleteTracesArgsSchema.pick({ traceIds: true }),
346
+ responseSchema: require_server_handlers_observability_storage_schemas.batchDeleteTracesResponseSchema,
347
+ maxBodySize: 256 * 1024,
348
+ summary: "Delete traces",
349
+ description: "Deletes traces by ID, cascading to all associated data: spans, trace roots/branches, and signal events (scores, feedback, metrics, logs) that reference the deleted traces. Signals without a trace ID are untouched. Experiment traces are deleted like any other trace. On ClickHouse-backed stores, deletes are lightweight and reads may briefly return deleted rows until the delete is fully applied.",
350
+ tags: ["Observability"],
351
+ requiresAuth: true,
352
+ handler: async ({ mastra, traceIds }) => {
353
+ try {
354
+ await (await require_server_handlers_observability_shared.getObservabilityStore(mastra)).batchDeleteTraces({ traceIds });
355
+ return { success: true };
356
+ } catch (error) {
357
+ return require_server_handlers_error.handleError(error, "Error deleting traces");
358
+ }
359
+ }
360
+ });
338
361
  /** Route: POST /observability/traces/score - score traces using a specified scorer (fire-and-forget). */
339
362
  const SCORE_TRACES_ROUTE = require_route_builder.createRoute({
340
363
  method: "POST",
@@ -396,6 +419,7 @@ const LIST_SCORES_BY_SPAN_ROUTE = require_route_builder.createRoute({
396
419
  //#endregion
397
420
  exports.CREATE_FEEDBACK = require_observability_new_endpoints.CREATE_FEEDBACK;
398
421
  exports.CREATE_SCORE = require_observability_new_endpoints.CREATE_SCORE;
422
+ exports.DELETE_TRACES_ROUTE = DELETE_TRACES_ROUTE;
399
423
  exports.GET_BRANCH_ROUTE = GET_BRANCH_ROUTE;
400
424
  exports.GET_ENTITY_NAMES = require_observability_new_endpoints.GET_ENTITY_NAMES;
401
425
  exports.GET_ENTITY_TYPES = require_observability_new_endpoints.GET_ENTITY_TYPES;
@@ -431,6 +455,7 @@ exports.LIST_SCORES_BY_SPAN_ROUTE = LIST_SCORES_BY_SPAN_ROUTE;
431
455
  exports.LIST_TRACES_LIGHT_ROUTE = LIST_TRACES_LIGHT_ROUTE;
432
456
  exports.LIST_TRACES_ROUTE = LIST_TRACES_ROUTE;
433
457
  exports.NEW_ROUTES = require_observability_new_endpoints.NEW_ROUTES;
458
+ exports.QUERY_TRACES = require_observability_new_endpoints.QUERY_TRACES;
434
459
  exports.SCORE_TRACES_ROUTE = SCORE_TRACES_ROUTE;
435
460
  exports.UPDATE_FEEDBACK_REVIEW_STATUS = require_observability_new_endpoints.UPDATE_FEEDBACK_REVIEW_STATUS;
436
461
  Object.defineProperty(exports, "observability_exports", {