@mastra/server 1.82.0 → 1.83.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/@internal_core@0.1.4/dist/storage/index.d.ts +24 -2
- package/dist/_types/@mastra_schema-compat@1.3.17/dist/_types/@internal_ai-v6@0.0.95/dist/index.d.ts +96 -15
- package/dist/{a2a-CoiG3TAj.js → a2a-DCpd3CTv.js} +4 -4
- package/dist/{a2a-CoiG3TAj.js.map → a2a-DCpd3CTv.js.map} +1 -1
- package/dist/{a2a-DvqRdny6.cjs → a2a-kz7NjjCg.cjs} +4 -4
- package/dist/{a2a-DvqRdny6.cjs.map → a2a-kz7NjjCg.cjs.map} +1 -1
- package/dist/{agent-builder-C_L1i2eE.js → agent-builder-CocfOSi8.js} +7 -7
- package/dist/{agent-builder-C_L1i2eE.js.map → agent-builder-CocfOSi8.js.map} +1 -1
- package/dist/{agent-builder-D0Up9Fw1.cjs → agent-builder-uDstZROq.cjs} +7 -7
- package/dist/{agent-builder-D0Up9Fw1.cjs.map → agent-builder-uDstZROq.cjs.map} +1 -1
- package/dist/{agents-CgcW6lHt.js → agents-BI8ez-FT.js} +7 -7
- package/dist/{agents-CgcW6lHt.js.map → agents-BI8ez-FT.js.map} +1 -1
- package/dist/{agents-DOHGWXDa.cjs → agents-DsfsDhIT.cjs} +7 -7
- package/dist/{agents-DOHGWXDa.cjs.map → agents-DsfsDhIT.cjs.map} +1 -1
- package/dist/{api-schema-manifest-Ci2qUYHc.js → api-schema-manifest-ChxbN16M.js} +3 -3
- package/dist/{api-schema-manifest-Ci2qUYHc.js.map → api-schema-manifest-ChxbN16M.js.map} +1 -1
- package/dist/{api-schema-manifest-DCHOlOuJ.cjs → api-schema-manifest-DtYTPvh9.cjs} +3 -3
- package/dist/{api-schema-manifest-DCHOlOuJ.cjs.map → api-schema-manifest-DtYTPvh9.cjs.map} +1 -1
- package/dist/{background-tasks-BHhn4YZA.js → background-tasks-BIuEr2of.js} +3 -3
- package/dist/{background-tasks-BHhn4YZA.js.map → background-tasks-BIuEr2of.js.map} +1 -1
- package/dist/{background-tasks-Ci2tlxJC.cjs → background-tasks-BXTIp0QV.cjs} +3 -3
- package/dist/{background-tasks-Ci2tlxJC.cjs.map → background-tasks-BXTIp0QV.cjs.map} +1 -1
- package/dist/{builder-registry-m_gHCe12.js → builder-registry-Dd7pbJ5A.js} +4 -4
- package/dist/{builder-registry-m_gHCe12.js.map → builder-registry-Dd7pbJ5A.js.map} +1 -1
- package/dist/{builder-registry-D1_hGKCJ.cjs → builder-registry-DrBUA6EZ.cjs} +4 -4
- package/dist/{builder-registry-D1_hGKCJ.cjs.map → builder-registry-DrBUA6EZ.cjs.map} +1 -1
- package/dist/{channels-hhQ3vD30.js → channels-B6hwVMbV.js} +4 -4
- package/dist/{channels-hhQ3vD30.js.map → channels-B6hwVMbV.js.map} +1 -1
- package/dist/{channels-Bfkp5vYI.cjs → channels-DbfSH5O2.cjs} +4 -4
- package/dist/{channels-Bfkp5vYI.cjs.map → channels-DbfSH5O2.cjs.map} +1 -1
- package/dist/{conversations-xS7yHuG1.js → conversations-BbZYXKIa.js} +5 -5
- package/dist/{conversations-xS7yHuG1.js.map → conversations-BbZYXKIa.js.map} +1 -1
- package/dist/{conversations-Ch_VuVwY.cjs → conversations-QuKJVEFe.cjs} +5 -5
- package/dist/{conversations-Ch_VuVwY.cjs.map → conversations-QuKJVEFe.cjs.map} +1 -1
- package/dist/{dist-BKNKucT9.cjs → dist-Ctfk9X6u.cjs} +208 -247
- package/dist/dist-Ctfk9X6u.cjs.map +1 -0
- package/dist/dist-DJjVMQiv.js +1 -0
- package/dist/{dist-CIYZuix4.js → dist-OKFDPspq.js} +208 -247
- package/dist/dist-OKFDPspq.js.map +1 -0
- package/dist/{dist-DgKeISkr.cjs → dist-ZYvqJK9p.cjs} +1 -1
- package/dist/docs/SKILL.md +3 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-knowledge-overview.md +106 -0
- package/dist/docs/references/docs-server-custom-adapters.md +4 -0
- package/dist/docs/references/docs-studio-knowledge.md +45 -24
- package/dist/docs/references/reference-server-invoke-route.md +86 -0
- package/dist/docs/references/reference-server-routes.md +63 -0
- package/dist/{dynamic-workflows-DDauBnDt.js → dynamic-workflows-CyaZLmHX.js} +2 -2
- package/dist/{dynamic-workflows-DDauBnDt.js.map → dynamic-workflows-CyaZLmHX.js.map} +1 -1
- package/dist/{dynamic-workflows-CpCkqM1g.cjs → dynamic-workflows-ZmzWJXxG.cjs} +2 -2
- package/dist/{dynamic-workflows-CpCkqM1g.cjs.map → dynamic-workflows-ZmzWJXxG.cjs.map} +1 -1
- package/dist/{editor-builder-Ceen28s8.js → editor-builder-CbfX5bvL.js} +4 -4
- package/dist/{editor-builder-Ceen28s8.js.map → editor-builder-CbfX5bvL.js.map} +1 -1
- package/dist/{editor-builder-CKfy5eZY.cjs → editor-builder-CjJlqR9a.cjs} +4 -4
- package/dist/{editor-builder-CKfy5eZY.cjs.map → editor-builder-CjJlqR9a.cjs.map} +1 -1
- package/dist/{helpers-DNq3LtLq.js → helpers-B29a1nM3.js} +51 -48
- package/dist/helpers-B29a1nM3.js.map +1 -0
- package/dist/{helpers-BKtUXhz2.cjs → helpers-CylvUIZm.cjs} +56 -47
- package/dist/helpers-CylvUIZm.cjs.map +1 -0
- package/dist/{knowledge-Ba74qr0v.js → knowledge-Cd2cCq-Y.js} +4 -4
- package/dist/{knowledge-Ba74qr0v.js.map → knowledge-Cd2cCq-Y.js.map} +1 -1
- package/dist/{knowledge-urR7FFG8.cjs → knowledge-Q_SCnD9m.cjs} +4 -4
- package/dist/{knowledge-urR7FFG8.cjs.map → knowledge-Q_SCnD9m.cjs.map} +1 -1
- package/dist/{logs-B57_NKDn.js → logs-C5L6gRGr.js} +4 -4
- package/dist/{logs-B57_NKDn.js.map → logs-C5L6gRGr.js.map} +1 -1
- package/dist/{logs-BJN3M88A.cjs → logs-DWIbFIw6.cjs} +4 -4
- package/dist/{logs-BJN3M88A.cjs.map → logs-DWIbFIw6.cjs.map} +1 -1
- package/dist/{mcp-B9BILfJP.cjs → mcp-CKvOVfHn.cjs} +3 -3
- package/dist/{mcp-B9BILfJP.cjs.map → mcp-CKvOVfHn.cjs.map} +1 -1
- package/dist/{mcp-BkmWZD6M.js → mcp-CntC59iU.js} +3 -3
- package/dist/{mcp-BkmWZD6M.js.map → mcp-CntC59iU.js.map} +1 -1
- package/dist/{memory-Dqod_AK9.cjs → memory-DIos0BE-.cjs} +57 -15
- package/dist/{memory-Dqod_AK9.cjs.map → memory-DIos0BE-.cjs.map} +1 -1
- package/dist/{memory-ipOCmg0C.js → memory-JzgWJevA.js} +57 -15
- package/dist/{memory-ipOCmg0C.js.map → memory-JzgWJevA.js.map} +1 -1
- package/dist/{observability-DBtyAJnb.js → observability-BCTkIhJT.js} +3 -3
- package/dist/{observability-DBtyAJnb.js.map → observability-BCTkIhJT.js.map} +1 -1
- package/dist/{observability-BtdW6mjq.cjs → observability-mnHHbnoc.cjs} +3 -3
- package/dist/{observability-BtdW6mjq.cjs.map → observability-mnHHbnoc.cjs.map} +1 -1
- package/dist/{observability-new-endpoints-jjCgXuTF.cjs → observability-new-endpoints-B6fo20v5.cjs} +129 -955
- package/dist/observability-new-endpoints-B6fo20v5.cjs.map +1 -0
- package/dist/{observability-new-endpoints-Di7m_-xc.js → observability-new-endpoints-DHn8uKyr.js} +51 -877
- package/dist/observability-new-endpoints-DHn8uKyr.js.map +1 -0
- package/dist/observability-signal-context-BYOFtbM_.cjs +1317 -0
- package/dist/observability-signal-context-BYOFtbM_.cjs.map +1 -0
- package/dist/observability-signal-context-CL5-rCWM.js +952 -0
- package/dist/observability-signal-context-CL5-rCWM.js.map +1 -0
- package/dist/{plans-nHOnlGzr.js → plans-9hdkc-t8.js} +4 -4
- package/dist/{plans-nHOnlGzr.js.map → plans-9hdkc-t8.js.map} +1 -1
- package/dist/{plans-Djcp3C0d.cjs → plans-DMs8SVBG.cjs} +4 -4
- package/dist/{plans-Djcp3C0d.cjs.map → plans-DMs8SVBG.cjs.map} +1 -1
- package/dist/{probe-image-size-DGTRKrgq.js → probe-image-size-Cxm5QtwO.js} +2 -2
- package/dist/{probe-image-size-DGTRKrgq.js.map → probe-image-size-Cxm5QtwO.js.map} +1 -1
- package/dist/{probe-image-size-BAwk1h6w.cjs → probe-image-size-bDuzMW0E.cjs} +2 -2
- package/dist/{probe-image-size-BAwk1h6w.cjs.map → probe-image-size-bDuzMW0E.cjs.map} +1 -1
- package/dist/{responses-CEet9y8G.js → responses-B5_syoSo.js} +5 -5
- package/dist/{responses-CEet9y8G.js.map → responses-B5_syoSo.js.map} +1 -1
- package/dist/{responses-BdOStKtX.cjs → responses-CNKJoC5a.cjs} +5 -5
- package/dist/{responses-BdOStKtX.cjs.map → responses-CNKJoC5a.cjs.map} +1 -1
- package/dist/{route-builder-BxPrwNog.js → route-builder-BKEzjw_M.js} +2 -2
- package/dist/{route-builder-BxPrwNog.js.map → route-builder-BKEzjw_M.js.map} +1 -1
- package/dist/{route-builder-CvARmqnA.cjs → route-builder-DHqDrSSy.cjs} +2 -2
- package/dist/{route-builder-CvARmqnA.cjs.map → route-builder-DHqDrSSy.cjs.map} +1 -1
- package/dist/{routes-DU_FlwJP.cjs → routes-BYQ38dFx.cjs} +32 -32
- package/dist/{routes-DU_FlwJP.cjs.map → routes-BYQ38dFx.cjs.map} +1 -1
- package/dist/{routes-5FpkkzND.js → routes-C0pgNcG-.js} +32 -32
- package/dist/{routes-5FpkkzND.js.map → routes-C0pgNcG-.js.map} +1 -1
- package/dist/{schedules-D8ShgpY3.cjs → schedules-CvWX2yKR.cjs} +3 -3
- package/dist/{schedules-D8ShgpY3.cjs.map → schedules-CvWX2yKR.cjs.map} +1 -1
- package/dist/{schedules-CGViSLZC.js → schedules-D9CKB18-.js} +3 -3
- package/dist/{schedules-CGViSLZC.js.map → schedules-D9CKB18-.js.map} +1 -1
- package/dist/{schema-Bf12g7KC-DBc4NSds.js → schema-Bf12g7KC-5EUrrnSf.js} +96 -96
- package/dist/{schema-Bf12g7KC-DBc4NSds.js.map → schema-Bf12g7KC-5EUrrnSf.js.map} +1 -1
- package/dist/{schema-Bf12g7KC-plP4Ir6h.cjs → schema-Bf12g7KC-C5XzpQxe.cjs} +96 -96
- package/dist/{schema-Bf12g7KC-plP4Ir6h.cjs.map → schema-Bf12g7KC-C5XzpQxe.cjs.map} +1 -1
- package/dist/{scores-BaDFGpmr.js → scores-B3mS6vqB.js} +4 -4
- package/dist/{scores-BaDFGpmr.js.map → scores-B3mS6vqB.js.map} +1 -1
- package/dist/{scores-Bw6Tuga5.cjs → scores-Dxa8dDfV.cjs} +4 -4
- package/dist/{scores-Bw6Tuga5.cjs.map → scores-Dxa8dDfV.cjs.map} +1 -1
- package/dist/server/auth/helpers.d.ts +20 -0
- package/dist/server/auth/helpers.d.ts.map +1 -1
- package/dist/server/auth/index.cjs +2 -1
- package/dist/server/auth/index.js +2 -2
- package/dist/server/handlers/a2a.cjs +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-controller.cjs +4 -4
- package/dist/server/handlers/agent-controller.js +4 -4
- package/dist/server/handlers/agent-versions.cjs +4 -4
- package/dist/server/handlers/agent-versions.js +4 -4
- package/dist/server/handlers/agents.cjs +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/auth.cjs +4 -4
- package/dist/server/handlers/auth.js +4 -4
- package/dist/server/handlers/authorship.cjs +1 -1
- package/dist/server/handlers/authorship.js +1 -1
- package/dist/server/handlers/background-tasks.cjs +1 -1
- package/dist/server/handlers/background-tasks.js +1 -1
- package/dist/server/handlers/builder-registry.cjs +1 -1
- package/dist/server/handlers/builder-registry.js +1 -1
- package/dist/server/handlers/channels.cjs +1 -1
- package/dist/server/handlers/channels.js +1 -1
- package/dist/server/handlers/conversations.cjs +1 -1
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/datasets.cjs +3 -3
- package/dist/server/handlers/datasets.js +3 -3
- package/dist/server/handlers/dynamic-workflows.cjs +1 -1
- package/dist/server/handlers/dynamic-workflows.js +1 -1
- package/dist/server/handlers/editor-builder.cjs +1 -1
- package/dist/server/handlers/editor-builder.js +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +1 -1
- package/dist/server/handlers/favorites-enrichment.js +1 -1
- package/dist/server/handlers/gateway-memory-client.cjs +4 -1
- package/dist/server/handlers/gateway-memory-client.cjs.map +1 -1
- package/dist/server/handlers/gateway-memory-client.d.ts.map +1 -1
- package/dist/server/handlers/gateway-memory-client.js +4 -1
- package/dist/server/handlers/gateway-memory-client.js.map +1 -1
- package/dist/server/handlers/knowledge.cjs +1 -1
- package/dist/server/handlers/knowledge.js +1 -1
- package/dist/server/handlers/logs.cjs +1 -1
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/mcp-client-versions.cjs +3 -3
- package/dist/server/handlers/mcp-client-versions.js +3 -3
- package/dist/server/handlers/mcp.cjs +1 -1
- package/dist/server/handlers/mcp.js +1 -1
- package/dist/server/handlers/memory.cjs +1 -1
- package/dist/server/handlers/memory.d.ts.map +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +1 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts +84 -8
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.js +1 -1
- package/dist/server/handlers/observability-shared.cjs +1 -1
- package/dist/server/handlers/observability-shared.js +1 -1
- package/dist/server/handlers/observability-signal-context.cjs +4 -0
- package/dist/server/handlers/observability-signal-context.d.ts +42 -0
- package/dist/server/handlers/observability-signal-context.d.ts.map +1 -0
- package/dist/server/handlers/observability-signal-context.js +1 -0
- package/dist/server/handlers/observability.cjs +2 -2
- package/dist/server/handlers/observability.js +2 -2
- package/dist/server/handlers/plans.cjs +1 -1
- package/dist/server/handlers/plans.js +1 -1
- package/dist/server/handlers/processor-providers.cjs +2 -2
- package/dist/server/handlers/processor-providers.js +2 -2
- package/dist/server/handlers/processors.cjs +2 -2
- package/dist/server/handlers/processors.js +2 -2
- package/dist/server/handlers/prompt-block-versions.cjs +3 -3
- package/dist/server/handlers/prompt-block-versions.js +3 -3
- package/dist/server/handlers/responses.cjs +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/responses.storage.cjs +1 -1
- package/dist/server/handlers/responses.storage.js +1 -1
- package/dist/server/handlers/schedules.cjs +1 -1
- package/dist/server/handlers/schedules.js +1 -1
- package/dist/server/handlers/scorer-versions.cjs +3 -3
- package/dist/server/handlers/scorer-versions.js +3 -3
- package/dist/server/handlers/scores.cjs +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +5 -5
- package/dist/server/handlers/stored-agent-favorites.js +5 -5
- package/dist/server/handlers/stored-agents.cjs +7 -7
- package/dist/server/handlers/stored-agents.js +7 -7
- package/dist/server/handlers/stored-mcp-clients.cjs +3 -3
- package/dist/server/handlers/stored-mcp-clients.js +3 -3
- package/dist/server/handlers/stored-prompt-blocks.cjs +3 -3
- package/dist/server/handlers/stored-prompt-blocks.js +3 -3
- package/dist/server/handlers/stored-scorers.cjs +3 -3
- package/dist/server/handlers/stored-scorers.js +3 -3
- package/dist/server/handlers/stored-skill-favorites.cjs +5 -5
- package/dist/server/handlers/stored-skill-favorites.js +5 -5
- package/dist/server/handlers/stored-skills.cjs +5 -5
- package/dist/server/handlers/stored-skills.js +5 -5
- package/dist/server/handlers/stored-workspaces.cjs +3 -3
- package/dist/server/handlers/stored-workspaces.js +3 -3
- package/dist/server/handlers/system.cjs +3 -3
- package/dist/server/handlers/system.js +3 -3
- package/dist/server/handlers/tool-providers.cjs +3 -3
- package/dist/server/handlers/tool-providers.js +3 -3
- package/dist/server/handlers/tools.cjs +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +1 -1
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/validate-agent-instructions.cjs +1 -1
- package/dist/server/handlers/validate-agent-instructions.js +1 -1
- package/dist/server/handlers/vector.cjs +1 -1
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/workflow-builder.cjs +1 -1
- package/dist/server/handlers/workflow-builder.js +1 -1
- package/dist/server/handlers/workflows.cjs +1 -1
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers/workspace.cjs +1 -1
- package/dist/server/handlers/workspace.d.ts +23 -23
- package/dist/server/handlers/workspace.js +1 -1
- package/dist/server/handlers.cjs +16 -16
- package/dist/server/handlers.js +16 -16
- package/dist/server/schemas/index.cjs +20 -20
- package/dist/server/schemas/index.js +20 -20
- package/dist/server/server-adapter/index.cjs +231 -61
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.d.ts +67 -1
- package/dist/server/server-adapter/index.d.ts.map +1 -1
- package/dist/server/server-adapter/index.js +226 -63
- package/dist/server/server-adapter/index.js.map +1 -1
- package/dist/server/server-adapter/mcp-auth.d.ts +16 -1
- package/dist/server/server-adapter/mcp-auth.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/observability.d.ts +42 -4
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/dist/{tools-CI5oeJWT.cjs → tools-C9W7WvyI.cjs} +7 -7
- package/dist/{tools-CI5oeJWT.cjs.map → tools-C9W7WvyI.cjs.map} +1 -1
- package/dist/{tools-BAmCNGM5.js → tools-Ce7SFoT1.js} +7 -7
- package/dist/{tools-BAmCNGM5.js.map → tools-Ce7SFoT1.js.map} +1 -1
- package/dist/{utils-9PRHHTGC.cjs → utils-BXEJ6FZC.cjs} +2 -2
- package/dist/{utils-9PRHHTGC.cjs.map → utils-BXEJ6FZC.cjs.map} +1 -1
- package/dist/{utils-BhBJHsqX.cjs → utils-CL-m2SWZ.cjs} +3 -3
- package/dist/{utils-BhBJHsqX.cjs.map → utils-CL-m2SWZ.cjs.map} +1 -1
- package/dist/{utils-B15w-1hm.js → utils-CTYtskHa.js} +2 -2
- package/dist/{utils-B15w-1hm.js.map → utils-CTYtskHa.js.map} +1 -1
- package/dist/{utils-Dy_dQTlK.js → utils-y-cW3mQU.js} +3 -3
- package/dist/{utils-Dy_dQTlK.js.map → utils-y-cW3mQU.js.map} +1 -1
- package/dist/{vector-BZ1bKtwM.cjs → vector-6k7Ft7EX.cjs} +3 -3
- package/dist/{vector-BZ1bKtwM.cjs.map → vector-6k7Ft7EX.cjs.map} +1 -1
- package/dist/{vector-BAs5o6mH.js → vector-BWFSDXvg.js} +3 -3
- package/dist/{vector-BAs5o6mH.js.map → vector-BWFSDXvg.js.map} +1 -1
- package/dist/{workflow-builder-CaSfD6oL.js → workflow-builder-BNk301jl.js} +4 -4
- package/dist/{workflow-builder-CaSfD6oL.js.map → workflow-builder-BNk301jl.js.map} +1 -1
- package/dist/{workflow-builder-tr_D_ZDN.cjs → workflow-builder-CsOEskDo.cjs} +4 -4
- package/dist/{workflow-builder-tr_D_ZDN.cjs.map → workflow-builder-CsOEskDo.cjs.map} +1 -1
- package/dist/{workflows-BxXS5AfE.js → workflows-BAFGmHCW.js} +24 -13
- package/dist/workflows-BAFGmHCW.js.map +1 -0
- package/dist/{workflows-Cdi6w8JW.cjs → workflows-CJz5Eh0B.cjs} +76 -65
- package/dist/workflows-CJz5Eh0B.cjs.map +1 -0
- package/dist/{workspace-BU6sQpbV.cjs → workspace-C7PytFzz.cjs} +3 -3
- package/dist/{workspace-BU6sQpbV.cjs.map → workspace-C7PytFzz.cjs.map} +1 -1
- package/dist/{workspace-CS-GYTve.js → workspace-CYwDvH0G.js} +3 -3
- package/dist/{workspace-CS-GYTve.js.map → workspace-CYwDvH0G.js.map} +1 -1
- package/package.json +5 -5
- package/dist/dist-BKNKucT9.cjs.map +0 -1
- package/dist/dist-CIYZuix4.js.map +0 -1
- package/dist/dist-mNQb9_wX.js +0 -1
- package/dist/helpers-BKtUXhz2.cjs.map +0 -1
- package/dist/helpers-DNq3LtLq.js.map +0 -1
- package/dist/observability-new-endpoints-Di7m_-xc.js.map +0 -1
- package/dist/observability-new-endpoints-jjCgXuTF.cjs.map +0 -1
- package/dist/workflows-BxXS5AfE.js.map +0 -1
- package/dist/workflows-Cdi6w8JW.cjs.map +0 -1
package/dist/{observability-new-endpoints-Di7m_-xc.js → observability-new-endpoints-DHn8uKyr.js}
RENAMED
|
@@ -1,871 +1,17 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { a as wrapSchemaForQueryParams, i as pickParams, n as createRoute } from "./route-builder-BxPrwNog.js";
|
|
1
|
+
import { $ as listMetricsResponseSchema, A as getMetricLabelKeysArgsSchema, B as getScoreAggregateArgsSchema, C as getFeedbackPercentilesResponseSchema, D as getMetricAggregateResponseSchema, E as getMetricAggregateArgsSchema, F as getMetricNamesResponseSchema, G as getScorePercentilesResponseSchema, H as getScoreBreakdownArgsSchema, I as getMetricPercentilesArgsSchema, J as getServiceNamesResponseSchema, K as getScoreTimeSeriesArgsSchema, L as getMetricPercentilesResponseSchema, M as getMetricLabelValuesArgsSchema, N as getMetricLabelValuesResponseSchema, O as getMetricBreakdownArgsSchema, P as getMetricNamesArgsSchema, Q as listLogsResponseSchema, R as getMetricTimeSeriesArgsSchema, S as getFeedbackPercentilesArgsSchema, T as getFeedbackTimeSeriesResponseSchema, U as getScoreBreakdownResponseSchema, V as getScoreAggregateResponseSchema, W as getScorePercentilesArgsSchema, X as getTagsResponseSchema, Y as getTagsArgsSchema, Z as listFeedbackResponseSchema$1, _ as getEnvironmentsResponseSchema, a as createScoreResponseSchema, at as scoreRecordSchema, b as getFeedbackBreakdownArgsSchema, c as deleteScoresArgsSchema, d as feedbackOrderBySchema, et as listScoresResponseSchema, f as feedbackRecordSchema, g as getEntityTypesResponseSchema, h as getEntityNamesResponseSchema, i as createScoreBodySchema, it as metricsOrderBySchema, j as getMetricLabelKeysResponseSchema, k as getMetricBreakdownResponseSchema, l as deleteScoresResponseSchema, m as getEntityNamesArgsSchema, n as createFeedbackBodySchema, nt as logsOrderBySchema, o as deleteFeedbackArgsSchema, ot as scoresFilterSchema, p as feedbackReviewStatusSchema, q as getScoreTimeSeriesResponseSchema, r as createFeedbackResponseSchema, rt as metricsFilterSchema, s as deleteFeedbackResponseSchema, st as scoresOrderBySchema, t as resolveSignalContext, tt as logsFilterSchema, u as feedbackFilterSchema, v as getFeedbackAggregateArgsSchema, w as getFeedbackTimeSeriesArgsSchema, x as getFeedbackBreakdownResponseSchema, y as getFeedbackAggregateResponseSchema, z as getMetricTimeSeriesResponseSchema } from "./observability-signal-context-CL5-rCWM.js";
|
|
3
2
|
import { f as MASTRA_USER_ROLES_KEY, g as isStudioClientTypeHeader, u as MASTRA_USER_KEY } from "./constants-CXAvBYcz.js";
|
|
4
|
-
import {
|
|
5
|
-
import { getCallerPermissions } from "./server/handlers/authorship.js";
|
|
6
|
-
import { paginationArgsSchema as paginationArgsSchema$1 } from "./server/handlers/observability-list-query-schemas.js";
|
|
7
|
-
import { NEW_ROUTE_DEFS, NO_OBSERVABILITY_STORAGE_CAPABILITIES, OBSERVABILITY_LIST_ENDPOINTS, OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE, assertObservabilityAggregateTimeToFirstMeasuresSupported, assertObservabilityDeltaSupported, assertObservabilitySpanAggregateModelDimensionsSupported, assertObservabilitySpanAggregateSupported, assertObservabilitySpanQueryFieldsSupported, assertObservabilitySpanQueryModelFieldsSupported, assertObservabilitySpanQueryOutcomeFieldsSupported, assertObservabilitySpanQuerySupported, assertObservabilityThreadQuerySupported, assertObservabilityTraceAggregateSupported, assertObservabilityTraceQueryContextFieldsSupported, assertObservabilityTraceQueryDiscoverySupported, assertObservabilityTraceQueryOutcomeFieldsSupported, assertObservabilityTraceQueryRootDurationSupported, assertObservabilityTraceQueryRootSpanFieldsSupported, assertObservabilityTraceQueryRootSpanValuesSupported, assertObservabilityTraceQuerySupported, assertObservabilityTraceQueryTenantScopeSupported, assertObservabilityTraceQueryTimeToFirstChunkSortSupported, assertObservabilityTraceQueryTimeToFirstChunkSupported, assertObservabilityTraceQueryTimeToFirstTokenSortSupported, assertObservabilityTraceQueryTimeToFirstTokenSupported, createObservabilityListQuerySchema, filterObservabilityAggregateMeasureDescriptors, getObservabilityStorageCapabilities, getObservabilityStore, isObservabilityOutcomeField, supportsObservabilityTraceAggregate, supportsObservabilityTraceQueryContextField, supportsObservabilityTraceQueryOutcomeFields, supportsObservabilityTraceQueryRootDuration, supportsObservabilityTraceQueryRootSpanField, supportsObservabilityTraceQueryTimeToFirstChunk, supportsObservabilityTraceQueryTimeToFirstToken, supportsSpanAggregateCore, supportsSpanQueryCore, supportsTraceAggregateCore, supportsTraceQueryDiscoveryCore, withDiscoveryFallback } from "./server/handlers/observability-shared.js";
|
|
3
|
+
import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
|
|
8
4
|
import { l as observabilityStorageCapabilitiesSchema } from "./system-DT0pqJSk.js";
|
|
5
|
+
import { a as wrapSchemaForQueryParams, i as pickParams, n as createRoute } from "./route-builder-BKEzjw_M.js";
|
|
9
6
|
import { prepareAuthorEnrichment } from "./server/handlers/author-enrichment.js";
|
|
7
|
+
import { getCallerPermissions } from "./server/handlers/authorship.js";
|
|
8
|
+
import { handleError } from "./server/handlers/error.js";
|
|
9
|
+
import { paginationArgsSchema } from "./server/handlers/observability-list-query-schemas.js";
|
|
10
|
+
import { NEW_ROUTE_DEFS, NO_OBSERVABILITY_STORAGE_CAPABILITIES, OBSERVABILITY_LIST_ENDPOINTS, OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE, assertObservabilityAggregateTimeToFirstMeasuresSupported, assertObservabilityDeltaSupported, assertObservabilitySpanAggregateModelDimensionsSupported, assertObservabilitySpanAggregateSupported, assertObservabilitySpanQueryFieldsSupported, assertObservabilitySpanQueryModelFieldsSupported, assertObservabilitySpanQueryOutcomeFieldsSupported, assertObservabilitySpanQuerySupported, assertObservabilityThreadQuerySupported, assertObservabilityTraceAggregateSupported, assertObservabilityTraceQueryContextFieldsSupported, assertObservabilityTraceQueryDiscoverySupported, assertObservabilityTraceQueryOutcomeFieldsSupported, assertObservabilityTraceQueryRootDurationSupported, assertObservabilityTraceQueryRootSpanFieldsSupported, assertObservabilityTraceQueryRootSpanValuesSupported, assertObservabilityTraceQuerySupported, assertObservabilityTraceQueryTenantScopeSupported, assertObservabilityTraceQueryTimeToFirstChunkSortSupported, assertObservabilityTraceQueryTimeToFirstChunkSupported, assertObservabilityTraceQueryTimeToFirstTokenSortSupported, assertObservabilityTraceQueryTimeToFirstTokenSupported, createObservabilityListQuerySchema, filterObservabilityAggregateMeasureDescriptors, getObservabilityStorageCapabilities, getObservabilityStore, isObservabilityOutcomeField, supportsObservabilityTraceAggregate, supportsObservabilityTraceQueryContextField, supportsObservabilityTraceQueryOutcomeFields, supportsObservabilityTraceQueryRootDuration, supportsObservabilityTraceQueryRootSpanField, supportsObservabilityTraceQueryTimeToFirstChunk, supportsObservabilityTraceQueryTimeToFirstToken, supportsSpanAggregateCore, supportsSpanQueryCore, supportsTraceAggregateCore, supportsTraceQueryDiscoveryCore, withDiscoveryFallback } from "./server/handlers/observability-shared.js";
|
|
10
11
|
import { z } from "zod/v4";
|
|
11
12
|
import * as coreStorage from "@mastra/core/storage";
|
|
12
13
|
import { coreFeatures } from "@mastra/core/features";
|
|
13
14
|
import { generateSignalId } from "@mastra/core/observability";
|
|
14
|
-
// ../_internal-core/dist/storage/index.js
|
|
15
|
-
/** Types of entities that can produce observability spans. */
|
|
16
|
-
let EntityType$1 = /* @__PURE__ */ function(EntityType) {
|
|
17
|
-
/** Agent/Model execution */
|
|
18
|
-
EntityType["AGENT"] = "agent";
|
|
19
|
-
/** Scorer definition/execution */
|
|
20
|
-
EntityType["SCORER"] = "scorer";
|
|
21
|
-
/** RAG ingestion pipeline execution */
|
|
22
|
-
EntityType["RAG_INGESTION"] = "rag_ingestion";
|
|
23
|
-
/** Trajectory evaluation target */
|
|
24
|
-
EntityType["TRAJECTORY"] = "trajectory";
|
|
25
|
-
/** Input Processor */
|
|
26
|
-
EntityType["INPUT_PROCESSOR"] = "input_processor";
|
|
27
|
-
/** Input Step Processor */
|
|
28
|
-
EntityType["INPUT_STEP_PROCESSOR"] = "input_step_processor";
|
|
29
|
-
/** Output Processor */
|
|
30
|
-
EntityType["OUTPUT_PROCESSOR"] = "output_processor";
|
|
31
|
-
/** Output Step Processor */
|
|
32
|
-
EntityType["OUTPUT_STEP_PROCESSOR"] = "output_step_processor";
|
|
33
|
-
/** Tool Result Processor */
|
|
34
|
-
EntityType["TOOL_RESULT_PROCESSOR"] = "tool_result_processor";
|
|
35
|
-
/** Workflow Step */
|
|
36
|
-
EntityType["WORKFLOW_STEP"] = "workflow_step";
|
|
37
|
-
/** Tool */
|
|
38
|
-
EntityType["TOOL"] = "tool";
|
|
39
|
-
/** MCP server */
|
|
40
|
-
EntityType["MCP_SERVER"] = "mcp_server";
|
|
41
|
-
/** Workflow */
|
|
42
|
-
EntityType["WORKFLOW_RUN"] = "workflow_run";
|
|
43
|
-
/** Memory */
|
|
44
|
-
EntityType["MEMORY"] = "memory";
|
|
45
|
-
/** Classifier */
|
|
46
|
-
EntityType["CLASSIFIER"] = "classifier";
|
|
47
|
-
return EntityType;
|
|
48
|
-
}({});
|
|
49
|
-
z.date().describe("Database record creation time"), z.date().describe("Database record last update time").nullable();
|
|
50
|
-
/**
|
|
51
|
-
* Pagination arguments for list queries (page and perPage only)
|
|
52
|
-
* Uses z.coerce to handle string → number conversion from query params
|
|
53
|
-
*/
|
|
54
|
-
const paginationArgsSchema = z.object({
|
|
55
|
-
page: z.coerce.number().int().min(0).optional().default(0).describe("Zero-indexed page number"),
|
|
56
|
-
perPage: z.coerce.number().int().min(1).max(100).optional().default(10).describe("Number of items per page")
|
|
57
|
-
}).describe("Pagination options for list queries");
|
|
58
|
-
/**
|
|
59
|
-
* Pagination response info
|
|
60
|
-
* Used across all paginated endpoints
|
|
61
|
-
*/
|
|
62
|
-
const paginationInfoSchema = z.object({
|
|
63
|
-
total: z.number().describe("Total number of items available"),
|
|
64
|
-
page: z.number().describe("Current page"),
|
|
65
|
-
perPage: z.union([z.number(), z.literal(false)]).describe("Number of items per page, or false if pagination is disabled"),
|
|
66
|
-
hasMore: z.boolean().describe("True if more pages are available")
|
|
67
|
-
});
|
|
68
|
-
/** Opaque cursor used to resume incremental polling for observability list endpoints. */
|
|
69
|
-
const deltaCursorSchema = z.string().min(1).describe("Opaque cursor value for incremental polling");
|
|
70
|
-
/** Explicit list mode selector for observability list endpoints. */
|
|
71
|
-
const listModeSchema = z.enum(["page", "delta"]).describe("List mode: 'page' | 'delta', defaults to 'page' when omitted.");
|
|
72
|
-
/** Max number of updates returned from a delta poll window. */
|
|
73
|
-
const deltaLimitSchema = z.coerce.number().int().min(1).max(100).optional().describe("Maximum number of updates to return in one delta poll");
|
|
74
|
-
/** Default page-mode pagination used to preserve legacy list arg behavior. */
|
|
75
|
-
const defaultPaginationArgs = {
|
|
76
|
-
page: 0,
|
|
77
|
-
perPage: 10
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Enforces the shared page-vs-delta parameter rules for observability list endpoints.
|
|
81
|
-
* Keeps validation centralized while allowing endpoints to keep their own filters and orderBy schemas.
|
|
82
|
-
*/
|
|
83
|
-
function refineObservabilityListMode(value, ctx) {
|
|
84
|
-
if (value.mode === "delta") {
|
|
85
|
-
if (value.pagination !== void 0) ctx.addIssue({
|
|
86
|
-
code: "custom",
|
|
87
|
-
path: ["pagination"],
|
|
88
|
-
message: "pagination is not allowed in delta mode"
|
|
89
|
-
});
|
|
90
|
-
if (value.orderBy !== void 0) ctx.addIssue({
|
|
91
|
-
code: "custom",
|
|
92
|
-
path: ["orderBy"],
|
|
93
|
-
message: "orderBy is not allowed in delta mode"
|
|
94
|
-
});
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (value.after !== void 0) ctx.addIssue({
|
|
98
|
-
code: "custom",
|
|
99
|
-
path: ["after"],
|
|
100
|
-
message: "after is only allowed in delta mode"
|
|
101
|
-
});
|
|
102
|
-
if (value.limit !== void 0) ctx.addIssue({
|
|
103
|
-
code: "custom",
|
|
104
|
-
path: ["limit"],
|
|
105
|
-
message: "limit is only allowed in delta mode"
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Normalizes observability list args into the legacy-friendly shape expected by existing stores.
|
|
110
|
-
* Page mode remains the default, and pagination/orderBy/limit are always populated.
|
|
111
|
-
*/
|
|
112
|
-
function normalizeObservabilityListArgs(value, defaults) {
|
|
113
|
-
return {
|
|
114
|
-
mode: value.mode === "delta" ? "delta" : "page",
|
|
115
|
-
filters: value.filters,
|
|
116
|
-
pagination: value.pagination ?? defaults.pagination ?? defaultPaginationArgs,
|
|
117
|
-
orderBy: value.orderBy ?? defaults.orderBy,
|
|
118
|
-
after: value.after,
|
|
119
|
-
limit: value.limit ?? defaults.limit ?? 10
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
/** Metadata returned for a delta poll window. */
|
|
123
|
-
const deltaInfoSchema = z.object({
|
|
124
|
-
limit: z.number().describe("Maximum number of updates requested for this delta poll"),
|
|
125
|
-
hasMore: z.boolean().describe("True when more matching updates remain after this response")
|
|
126
|
-
}).describe("Incremental polling metadata");
|
|
127
|
-
/**
|
|
128
|
-
* Date range for filtering by time
|
|
129
|
-
* Uses z.coerce to handle ISO string → Date conversion from query params
|
|
130
|
-
*/
|
|
131
|
-
const dateRangeSchema$1 = z.object({
|
|
132
|
-
start: z.coerce.date().optional().describe("Start of date range (inclusive by default)"),
|
|
133
|
-
end: z.coerce.date().optional().describe("End of date range (inclusive by default)"),
|
|
134
|
-
startExclusive: z.boolean().optional().describe("When true, excludes the start date from results (uses > instead of >=)"),
|
|
135
|
-
endExclusive: z.boolean().optional().describe("When true, excludes the end date from results (uses < instead of <=)")
|
|
136
|
-
}).describe("Date range filter for timestamps");
|
|
137
|
-
const sortDirectionSchema = z.enum(["ASC", "DESC"]).describe("Sort direction: 'ASC' | 'DESC'");
|
|
138
|
-
/** Aggregation type schema shared across OLAP-style observability queries. */
|
|
139
|
-
const aggregationTypeSchema = z.enum([
|
|
140
|
-
"sum",
|
|
141
|
-
"avg",
|
|
142
|
-
"min",
|
|
143
|
-
"max",
|
|
144
|
-
"count",
|
|
145
|
-
"count_distinct",
|
|
146
|
-
"last"
|
|
147
|
-
]).describe("Aggregation function");
|
|
148
|
-
/** Aggregation interval schema shared across OLAP-style observability queries. */
|
|
149
|
-
const aggregationIntervalSchema = z.enum([
|
|
150
|
-
"1m",
|
|
151
|
-
"5m",
|
|
152
|
-
"15m",
|
|
153
|
-
"1h",
|
|
154
|
-
"1d"
|
|
155
|
-
]).describe("Time bucket interval");
|
|
156
|
-
/** Compare period for aggregate queries with period-over-period comparison. */
|
|
157
|
-
const comparePeriodSchema = z.enum([
|
|
158
|
-
"previous_period",
|
|
159
|
-
"previous_day",
|
|
160
|
-
"previous_week"
|
|
161
|
-
]).describe("Comparison period for aggregate queries");
|
|
162
|
-
/** Shared groupBy schema for OLAP-style breakdown and time-series queries. */
|
|
163
|
-
const groupBySchema = z.array(z.string()).min(1).describe("Fields to group by");
|
|
164
|
-
/** Shared percentiles schema for percentile queries. */
|
|
165
|
-
const percentilesSchema = z.array(z.number().min(0).max(1)).min(1).describe("Percentile values (0-1)");
|
|
166
|
-
/** Shared fields for aggregate OLAP responses across observability signals. */
|
|
167
|
-
const aggregateResponseFields = {
|
|
168
|
-
value: z.number().nullable().describe("Aggregated value"),
|
|
169
|
-
previousValue: z.number().nullable().optional().describe("Value from comparison period"),
|
|
170
|
-
changePercent: z.number().nullable().optional().describe("Percentage change from comparison period")
|
|
171
|
-
};
|
|
172
|
-
/** Shared field for OLAP breakdown dimension values. */
|
|
173
|
-
const dimensionsField = z.record(z.string(), z.string().nullable()).describe("Dimension values for this group");
|
|
174
|
-
/** Shared field for non-null OLAP aggregated values. */
|
|
175
|
-
const aggregatedValueField = z.number().describe("Aggregated value");
|
|
176
|
-
/** Shared field for OLAP bucket timestamps. */
|
|
177
|
-
const bucketTimestampField = z.date().describe("Bucket timestamp");
|
|
178
|
-
/** Shared field for percentile identifiers in OLAP responses. */
|
|
179
|
-
const percentileField = z.number().describe("Percentile value");
|
|
180
|
-
/** Shared field for percentile values within a time bucket. */
|
|
181
|
-
const percentileBucketValueField = z.number().describe("Percentile value at this bucket");
|
|
182
|
-
const entityTypeField = z.nativeEnum(EntityType$1).describe(`Entity type (e.g., 'agent' | 'processor' | 'tool' | 'workflow')`);
|
|
183
|
-
const entityIdField = z.string().describe("ID of the entity (e.g., \"weatherAgent\", \"orderWorkflow\")");
|
|
184
|
-
const entityNameField = z.string().describe("Name of the entity");
|
|
185
|
-
const userIdField = z.string().describe("Human end-user who triggered execution");
|
|
186
|
-
const organizationIdField = z.string().describe("Multi-tenant organization/account");
|
|
187
|
-
const resourceIdField = z.string().describe("Broader resource context (Mastra memory compatibility)");
|
|
188
|
-
const runIdField = z.string().describe("Unique execution run identifier");
|
|
189
|
-
const sessionIdField = z.string().describe("Session identifier for grouping traces");
|
|
190
|
-
const threadIdField = z.string().describe("Conversation thread identifier");
|
|
191
|
-
const requestIdField = z.string().describe("HTTP request ID for log correlation");
|
|
192
|
-
const environmentField = z.string().describe(`Environment (e.g., "production" | "staging" | "development")`);
|
|
193
|
-
const sourceField = z.string().describe(`Source of execution (e.g., "local" | "cloud" | "ci")`);
|
|
194
|
-
const executionSourceField = z.string().describe(`Source of execution (e.g., "local" | "cloud" | "ci")`);
|
|
195
|
-
const serviceNameField = z.string().describe("Name of the service");
|
|
196
|
-
const parentEntityTypeField = z.nativeEnum(EntityType$1).describe("Entity type of the parent entity");
|
|
197
|
-
const parentEntityIdField = z.string().describe("ID of the parent entity");
|
|
198
|
-
const parentEntityNameField = z.string().describe("Name of the parent entity");
|
|
199
|
-
const rootEntityTypeField = z.nativeEnum(EntityType$1).describe("Entity type of the root entity");
|
|
200
|
-
const rootEntityIdField = z.string().describe("ID of the root entity");
|
|
201
|
-
const rootEntityNameField = z.string().describe("Name of the root entity");
|
|
202
|
-
const entityVersionIdField = z.string().describe("Version ID of the entity that produced this signal (e.g., agent version, workflow version)");
|
|
203
|
-
const parentEntityVersionIdField = z.string().describe("Version ID of the parent entity that produced this signal");
|
|
204
|
-
const rootEntityVersionIdField = z.string().describe("Version ID of the root entity that produced this signal");
|
|
205
|
-
const experimentIdField = z.string().describe("Experiment or eval run identifier");
|
|
206
|
-
const scopeField = z.record(z.string(), z.unknown()).describe("Arbitrary package/app version info (e.g., {\"core\": \"1.0.0\", \"memory\": \"1.0.0\", \"gitSha\": \"abcd1234\"})");
|
|
207
|
-
const metadataField = z.record(z.string(), z.unknown()).describe("User-defined metadata for custom filtering");
|
|
208
|
-
const tagsField = z.array(z.string()).describe("Labels for filtering");
|
|
209
|
-
/**
|
|
210
|
-
* Base context fields shared across tracing and non-tracing observability records.
|
|
211
|
-
* Source/provenance is intentionally excluded because tracing uses `source`
|
|
212
|
-
* while signals use `executionSource`.
|
|
213
|
-
*/
|
|
214
|
-
const contextFieldsBase = {
|
|
215
|
-
entityType: entityTypeField.nullish(),
|
|
216
|
-
entityId: entityIdField.nullish(),
|
|
217
|
-
entityName: entityNameField.nullish(),
|
|
218
|
-
parentEntityType: parentEntityTypeField.nullish(),
|
|
219
|
-
parentEntityId: parentEntityIdField.nullish(),
|
|
220
|
-
parentEntityName: parentEntityNameField.nullish(),
|
|
221
|
-
rootEntityType: rootEntityTypeField.nullish(),
|
|
222
|
-
rootEntityId: rootEntityIdField.nullish(),
|
|
223
|
-
rootEntityName: rootEntityNameField.nullish(),
|
|
224
|
-
userId: userIdField.nullish(),
|
|
225
|
-
organizationId: organizationIdField.nullish(),
|
|
226
|
-
resourceId: resourceIdField.nullish(),
|
|
227
|
-
runId: runIdField.nullish(),
|
|
228
|
-
sessionId: sessionIdField.nullish(),
|
|
229
|
-
threadId: threadIdField.nullish(),
|
|
230
|
-
requestId: requestIdField.nullish(),
|
|
231
|
-
environment: environmentField.nullish(),
|
|
232
|
-
serviceName: serviceNameField.nullish(),
|
|
233
|
-
scope: scopeField.nullish(),
|
|
234
|
-
entityVersionId: entityVersionIdField.nullish(),
|
|
235
|
-
parentEntityVersionId: parentEntityVersionIdField.nullish(),
|
|
236
|
-
rootEntityVersionId: rootEntityVersionIdField.nullish(),
|
|
237
|
-
experimentId: experimentIdField.nullish()
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Context fields shared across observability signals other than spans (metrics, logs, scores, feedback).
|
|
241
|
-
* These use `executionSource` to avoid colliding with signal-specific provenance fields.
|
|
242
|
-
*/
|
|
243
|
-
const contextFields = {
|
|
244
|
-
...contextFieldsBase,
|
|
245
|
-
executionSource: executionSourceField.nullish(),
|
|
246
|
-
tags: tagsField.nullish()
|
|
247
|
-
};
|
|
248
|
-
({ ...contextFieldsBase }), sourceField.nullish();
|
|
249
|
-
/**
|
|
250
|
-
* Common filter fields shared across observability signal filters (metrics, logs, scores, feedback).
|
|
251
|
-
* All fields are optional — each signal extends this with signal-specific filters.
|
|
252
|
-
*/
|
|
253
|
-
const commonFilterFields = {
|
|
254
|
-
timestamp: dateRangeSchema$1.optional().describe("Filter by timestamp range"),
|
|
255
|
-
traceId: z.string().optional().describe("Filter by trace ID"),
|
|
256
|
-
spanId: z.string().optional().describe("Filter by span ID"),
|
|
257
|
-
entityType: entityTypeField.optional(),
|
|
258
|
-
entityName: entityNameField.optional(),
|
|
259
|
-
entityVersionId: entityVersionIdField.optional(),
|
|
260
|
-
parentEntityVersionId: parentEntityVersionIdField.optional(),
|
|
261
|
-
rootEntityVersionId: rootEntityVersionIdField.optional(),
|
|
262
|
-
userId: userIdField.optional(),
|
|
263
|
-
organizationId: organizationIdField.optional(),
|
|
264
|
-
experimentId: experimentIdField.optional(),
|
|
265
|
-
serviceName: serviceNameField.optional(),
|
|
266
|
-
environment: environmentField.optional(),
|
|
267
|
-
parentEntityType: parentEntityTypeField.optional(),
|
|
268
|
-
parentEntityName: parentEntityNameField.optional(),
|
|
269
|
-
rootEntityType: rootEntityTypeField.optional(),
|
|
270
|
-
rootEntityName: rootEntityNameField.optional(),
|
|
271
|
-
resourceId: resourceIdField.optional(),
|
|
272
|
-
runId: runIdField.optional(),
|
|
273
|
-
sessionId: sessionIdField.optional(),
|
|
274
|
-
threadId: threadIdField.optional(),
|
|
275
|
-
requestId: requestIdField.optional(),
|
|
276
|
-
executionSource: executionSourceField.optional(),
|
|
277
|
-
tags: z.array(z.string()).optional().describe("Filter by tags (must have all specified tags)")
|
|
278
|
-
};
|
|
279
|
-
/** Zod schema for trace ID field */
|
|
280
|
-
const traceIdField = z.string().describe("Unique trace identifier");
|
|
281
|
-
/** Zod schema for span ID field */
|
|
282
|
-
const spanIdField = z.string().describe("Unique span identifier within a trace");
|
|
283
|
-
/** Log level schema for validation */
|
|
284
|
-
const logLevelSchema = z.enum([
|
|
285
|
-
"debug",
|
|
286
|
-
"info",
|
|
287
|
-
"warn",
|
|
288
|
-
"error",
|
|
289
|
-
"fatal"
|
|
290
|
-
]);
|
|
291
|
-
const messageField = z.string().describe("Log message");
|
|
292
|
-
const logDataField = z.record(z.string(), z.unknown()).describe("Structured data attached to the log");
|
|
293
|
-
/**
|
|
294
|
-
* Schema for logs as stored in the database.
|
|
295
|
-
* Includes all fields from ExportedLog plus storage-specific fields.
|
|
296
|
-
*/
|
|
297
|
-
const logRecordSchema = z.object({
|
|
298
|
-
logId: z.string().nullish().describe("Unique id for this log event"),
|
|
299
|
-
timestamp: z.date().describe("When the log was created"),
|
|
300
|
-
level: logLevelSchema.describe("Log severity level"),
|
|
301
|
-
message: messageField,
|
|
302
|
-
data: logDataField.nullish(),
|
|
303
|
-
traceId: traceIdField.nullish(),
|
|
304
|
-
spanId: spanIdField.nullish(),
|
|
305
|
-
...contextFields,
|
|
306
|
-
/**
|
|
307
|
-
* @deprecated Use `executionSource` instead.
|
|
308
|
-
*/
|
|
309
|
-
source: z.string().nullish().describe("Execution source"),
|
|
310
|
-
metadata: metadataField.nullish()
|
|
311
|
-
}).describe("Log record as stored in the database");
|
|
312
|
-
z.object({
|
|
313
|
-
level: logLevelSchema,
|
|
314
|
-
message: messageField,
|
|
315
|
-
data: logDataField.optional(),
|
|
316
|
-
tags: tagsField.optional()
|
|
317
|
-
}).describe("User-provided log input");
|
|
318
|
-
/** Schema for creating a log record */
|
|
319
|
-
const createLogRecordSchema = logRecordSchema;
|
|
320
|
-
z.object({ logs: z.array(createLogRecordSchema) }).describe("Arguments for batch creating logs");
|
|
321
|
-
/** Schema for filtering logs in list queries */
|
|
322
|
-
const logsFilterSchema = z.object({
|
|
323
|
-
...commonFilterFields,
|
|
324
|
-
/**
|
|
325
|
-
* @deprecated Use `executionSource` instead.
|
|
326
|
-
*/
|
|
327
|
-
source: z.string().optional().describe("Filter by execution source"),
|
|
328
|
-
level: z.union([logLevelSchema, z.array(logLevelSchema)]).optional().describe("Filter by log level(s)")
|
|
329
|
-
}).describe("Filters for querying logs");
|
|
330
|
-
/** Fields available for ordering log results */
|
|
331
|
-
const logsOrderByFieldSchema = z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
|
|
332
|
-
/** Order by configuration for log queries */
|
|
333
|
-
const logsOrderBySchema = z.object({
|
|
334
|
-
field: logsOrderByFieldSchema.default("timestamp").describe("Field to order by"),
|
|
335
|
-
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
336
|
-
}).describe("Order by configuration");
|
|
337
|
-
z.object({
|
|
338
|
-
mode: listModeSchema.optional(),
|
|
339
|
-
filters: logsFilterSchema.optional().describe("Optional filters to apply"),
|
|
340
|
-
pagination: paginationArgsSchema.optional(),
|
|
341
|
-
orderBy: logsOrderBySchema.optional(),
|
|
342
|
-
after: deltaCursorSchema.optional(),
|
|
343
|
-
limit: deltaLimitSchema
|
|
344
|
-
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
|
|
345
|
-
field: "timestamp",
|
|
346
|
-
direction: "DESC"
|
|
347
|
-
} })).describe("Arguments for listing logs");
|
|
348
|
-
/** Schema for listLogs operation response */
|
|
349
|
-
const listLogsResponseSchema = z.object({
|
|
350
|
-
pagination: paginationInfoSchema.optional(),
|
|
351
|
-
delta: deltaInfoSchema.optional(),
|
|
352
|
-
deltaCursor: deltaCursorSchema.optional(),
|
|
353
|
-
logs: z.array(logRecordSchema)
|
|
354
|
-
}).describe("Response from listing logs");
|
|
355
|
-
const scorerIdField = z.string().describe("Identifier of the scorer (e.g., relevance, accuracy)");
|
|
356
|
-
const scorerNameField = z.string().describe("Display name of the scorer");
|
|
357
|
-
const scorerVersionField = z.string().describe("Version of the scorer");
|
|
358
|
-
const scoreSourceField = z.string().describe("How the score was produced (e.g., manual, automated, experiment)");
|
|
359
|
-
const scoreValueField = z.number().describe("Score value (range defined by scorer)");
|
|
360
|
-
const scoreReasonField = z.string().describe("Explanation for the score");
|
|
361
|
-
/**
|
|
362
|
-
* Schema for scores as stored in the database.
|
|
363
|
-
* Includes all fields from ExportedScore plus storage-specific fields.
|
|
364
|
-
*/
|
|
365
|
-
const scoreRecordSchema = z.object({
|
|
366
|
-
scoreId: z.string().nullish().describe("Unique id for this score event"),
|
|
367
|
-
timestamp: z.date().describe("When the score was recorded"),
|
|
368
|
-
traceId: traceIdField.nullish().describe("Trace that anchors the scored target when available"),
|
|
369
|
-
spanId: spanIdField.nullish().describe("Span ID this score applies to"),
|
|
370
|
-
scorerId: scorerIdField,
|
|
371
|
-
scorerName: scorerNameField.nullish(),
|
|
372
|
-
scorerVersion: scorerVersionField.nullish(),
|
|
373
|
-
scoreSource: scoreSourceField.nullish(),
|
|
374
|
-
/**
|
|
375
|
-
* @deprecated Use `scoreSource` instead.
|
|
376
|
-
*/
|
|
377
|
-
source: scoreSourceField.nullish(),
|
|
378
|
-
score: scoreValueField,
|
|
379
|
-
reason: scoreReasonField.nullish(),
|
|
380
|
-
...contextFields,
|
|
381
|
-
/** Trace ID of the scoring run (links to trace that generated this score) */
|
|
382
|
-
scoreTraceId: z.string().nullish().describe("Trace ID of the scoring run for debugging score generation"),
|
|
383
|
-
metadata: z.record(z.string(), z.unknown()).nullish().describe("User-defined metadata")
|
|
384
|
-
}).describe("Score record as stored in the database");
|
|
385
|
-
z.object({
|
|
386
|
-
scorerId: scorerIdField,
|
|
387
|
-
scorerName: scorerNameField.optional(),
|
|
388
|
-
scorerVersion: scorerVersionField.optional(),
|
|
389
|
-
scoreSource: scoreSourceField.optional(),
|
|
390
|
-
/**
|
|
391
|
-
* @deprecated Use `scoreSource` instead.
|
|
392
|
-
*/
|
|
393
|
-
source: scoreSourceField.optional(),
|
|
394
|
-
score: scoreValueField,
|
|
395
|
-
reason: scoreReasonField.optional(),
|
|
396
|
-
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional scorer-specific metadata"),
|
|
397
|
-
experimentId: experimentIdField.optional(),
|
|
398
|
-
scoreTraceId: z.string().optional().describe("Trace ID of the scoring run for debugging score generation"),
|
|
399
|
-
targetEntityType: entityTypeField.optional().describe("Entity type the scorer evaluated when known")
|
|
400
|
-
}).describe("User-provided score input");
|
|
401
|
-
/** Schema for creating a score record */
|
|
402
|
-
const createScoreRecordSchema = scoreRecordSchema;
|
|
403
|
-
z.object({ score: createScoreRecordSchema }).describe("Arguments for creating a score");
|
|
404
|
-
/** Schema for createScore operation body in client/server */
|
|
405
|
-
const createScoreBodySchema = z.object({ score: createScoreRecordSchema.omit({ timestamp: true }) }).describe("Arguments for creating a score");
|
|
406
|
-
/** Schema for createScore operation response */
|
|
407
|
-
const createScoreResponseSchema = z.object({ success: z.boolean() }).describe("Response from creating a score");
|
|
408
|
-
z.object({ scores: z.array(createScoreRecordSchema) }).describe("Arguments for batch recording scores");
|
|
409
|
-
const DELETE_SCORES_MAX_IDS = 1e3;
|
|
410
|
-
/** Schema for deleteScores operation arguments */
|
|
411
|
-
const deleteScoresArgsSchema = z.object({
|
|
412
|
-
scoreIds: z.array(z.string()).max(DELETE_SCORES_MAX_IDS).describe(`IDs of the score events to delete (maximum ${DELETE_SCORES_MAX_IDS})`),
|
|
413
|
-
organizationId: organizationIdField.optional().describe("Restrict deletion to scores in this organization"),
|
|
414
|
-
resourceId: resourceIdField.optional().describe("Restrict deletion to scores for this resource")
|
|
415
|
-
}).describe("Arguments for deleting scores by id");
|
|
416
|
-
/** Schema for deleteScores operation response */
|
|
417
|
-
const deleteScoresResponseSchema = z.object({ success: z.boolean() }).describe("Response from deleting scores");
|
|
418
|
-
/** Schema for filtering scores in list queries */
|
|
419
|
-
const scoresFilterSchema = z.object({
|
|
420
|
-
...commonFilterFields,
|
|
421
|
-
scorerId: z.union([z.string(), z.array(z.string())]).optional().describe("Filter by scorer ID(s)"),
|
|
422
|
-
scoreSource: scoreSourceField.optional().describe("Filter by how the score was produced"),
|
|
423
|
-
metadata: metadataField.nullish().describe("Filter by metadata key-value pairs (exact match per key)"),
|
|
424
|
-
/**
|
|
425
|
-
* @deprecated Use `scoreSource` instead.
|
|
426
|
-
*/
|
|
427
|
-
source: scoreSourceField.optional().describe("Filter by how the score was produced")
|
|
428
|
-
}).describe("Filters for querying scores");
|
|
429
|
-
/** Fields available for ordering score results */
|
|
430
|
-
const scoresOrderByFieldSchema = z.enum(["timestamp", "score"]).describe("Field to order by: 'timestamp' | 'score'");
|
|
431
|
-
/** Order by configuration for score queries */
|
|
432
|
-
const scoresOrderBySchema = z.object({
|
|
433
|
-
field: scoresOrderByFieldSchema.default("timestamp").describe("Field to order by"),
|
|
434
|
-
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
435
|
-
}).describe("Order by configuration");
|
|
436
|
-
z.object({
|
|
437
|
-
mode: listModeSchema.optional(),
|
|
438
|
-
filters: scoresFilterSchema.optional(),
|
|
439
|
-
pagination: paginationArgsSchema.optional(),
|
|
440
|
-
orderBy: scoresOrderBySchema.optional(),
|
|
441
|
-
after: deltaCursorSchema.optional(),
|
|
442
|
-
limit: deltaLimitSchema
|
|
443
|
-
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
|
|
444
|
-
field: "timestamp",
|
|
445
|
-
direction: "DESC"
|
|
446
|
-
} })).describe("Arguments for listing scores");
|
|
447
|
-
/** Schema for listScores operation response */
|
|
448
|
-
const listScoresResponseSchema = z.object({
|
|
449
|
-
pagination: paginationInfoSchema.optional(),
|
|
450
|
-
delta: deltaInfoSchema.optional(),
|
|
451
|
-
deltaCursor: deltaCursorSchema.optional(),
|
|
452
|
-
scores: z.array(scoreRecordSchema)
|
|
453
|
-
}).describe("Response from listing scores");
|
|
454
|
-
const getScoreAggregateArgsSchema = z.object({
|
|
455
|
-
scorerId: scorerIdField,
|
|
456
|
-
scoreSource: scoreSourceField.optional(),
|
|
457
|
-
aggregation: aggregationTypeSchema,
|
|
458
|
-
filters: scoresFilterSchema.optional(),
|
|
459
|
-
comparePeriod: comparePeriodSchema.optional()
|
|
460
|
-
}).describe("Arguments for getting a score aggregate");
|
|
461
|
-
const getScoreAggregateResponseSchema = z.object(aggregateResponseFields);
|
|
462
|
-
const getScoreBreakdownArgsSchema = z.object({
|
|
463
|
-
scorerId: scorerIdField,
|
|
464
|
-
scoreSource: scoreSourceField.optional(),
|
|
465
|
-
groupBy: groupBySchema,
|
|
466
|
-
aggregation: aggregationTypeSchema,
|
|
467
|
-
filters: scoresFilterSchema.optional()
|
|
468
|
-
}).describe("Arguments for getting a score breakdown");
|
|
469
|
-
const getScoreBreakdownResponseSchema = z.object({ groups: z.array(z.object({
|
|
470
|
-
dimensions: dimensionsField,
|
|
471
|
-
value: aggregatedValueField
|
|
472
|
-
})) });
|
|
473
|
-
const getScoreTimeSeriesArgsSchema = z.object({
|
|
474
|
-
scorerId: scorerIdField,
|
|
475
|
-
scoreSource: scoreSourceField.optional(),
|
|
476
|
-
interval: aggregationIntervalSchema,
|
|
477
|
-
aggregation: aggregationTypeSchema,
|
|
478
|
-
filters: scoresFilterSchema.optional(),
|
|
479
|
-
groupBy: groupBySchema.optional()
|
|
480
|
-
}).describe("Arguments for getting score time series");
|
|
481
|
-
const getScoreTimeSeriesResponseSchema = z.object({ series: z.array(z.object({
|
|
482
|
-
name: z.string().describe("Series name (scorer ID or group key)"),
|
|
483
|
-
points: z.array(z.object({
|
|
484
|
-
timestamp: bucketTimestampField,
|
|
485
|
-
value: aggregatedValueField
|
|
486
|
-
}))
|
|
487
|
-
})) });
|
|
488
|
-
const getScorePercentilesArgsSchema = z.object({
|
|
489
|
-
scorerId: scorerIdField,
|
|
490
|
-
scoreSource: scoreSourceField.optional(),
|
|
491
|
-
percentiles: percentilesSchema,
|
|
492
|
-
interval: aggregationIntervalSchema,
|
|
493
|
-
filters: scoresFilterSchema.optional()
|
|
494
|
-
}).describe("Arguments for getting score percentiles");
|
|
495
|
-
const getScorePercentilesResponseSchema = z.object({ series: z.array(z.object({
|
|
496
|
-
percentile: percentileField,
|
|
497
|
-
points: z.array(z.object({
|
|
498
|
-
timestamp: bucketTimestampField,
|
|
499
|
-
value: percentileBucketValueField
|
|
500
|
-
}))
|
|
501
|
-
})) });
|
|
502
|
-
const feedbackSourceField = z.string().describe("Source of feedback (e.g., 'user', 'system', 'manual')");
|
|
503
|
-
const feedbackTypeField = z.string().describe("Type of feedback (e.g., 'thumbs', 'rating', 'correction')");
|
|
504
|
-
const feedbackValueField = z.union([z.number(), z.string()]).describe("Feedback value (rating number or correction text)");
|
|
505
|
-
const feedbackCommentField = z.string().describe("Additional comment or context");
|
|
506
|
-
const feedbackUserIdField = z.string().describe("User who provided the feedback");
|
|
507
|
-
const feedbackReviewStatusSchema = z.enum(["needs-review", "reviewed"]);
|
|
508
|
-
function normalizeLegacyFeedbackActor(input) {
|
|
509
|
-
if (!input || typeof input !== "object" || Array.isArray(input)) return input;
|
|
510
|
-
const record = { ...input };
|
|
511
|
-
if (typeof record.userId === "string" && record.feedbackUserId == null) {
|
|
512
|
-
record.feedbackUserId = record.userId;
|
|
513
|
-
delete record.userId;
|
|
514
|
-
}
|
|
515
|
-
return record;
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* Schema for feedback as stored in the database.
|
|
519
|
-
* Includes all fields from ExportedFeedback plus storage-specific fields.
|
|
520
|
-
*/
|
|
521
|
-
const feedbackRecordObjectSchema = z.object({
|
|
522
|
-
feedbackId: z.string().nullish().describe("Unique id for this feedback event"),
|
|
523
|
-
timestamp: z.date().describe("When the feedback was recorded"),
|
|
524
|
-
traceId: traceIdField.nullish().describe("Trace that anchors the feedback target when available"),
|
|
525
|
-
spanId: spanIdField.nullish().describe("Span ID this feedback applies to"),
|
|
526
|
-
feedbackSource: feedbackSourceField.nullish(),
|
|
527
|
-
/**
|
|
528
|
-
* @deprecated Use `feedbackSource` instead.
|
|
529
|
-
*/
|
|
530
|
-
source: feedbackSourceField.nullish(),
|
|
531
|
-
feedbackType: feedbackTypeField,
|
|
532
|
-
value: feedbackValueField,
|
|
533
|
-
comment: feedbackCommentField.nullish(),
|
|
534
|
-
feedbackUserId: feedbackUserIdField.nullish(),
|
|
535
|
-
...contextFields,
|
|
536
|
-
sourceId: z.string().nullish().describe("ID of the source record this feedback is linked to (e.g. experiment result ID)"),
|
|
537
|
-
metadata: z.record(z.string(), z.unknown()).nullish().describe("User-defined metadata"),
|
|
538
|
-
reviewStatus: feedbackReviewStatusSchema.describe("Feedback review workflow status")
|
|
539
|
-
});
|
|
540
|
-
/** Feedback record fields accepted on creation: `reviewStatus` is optional and defaults to `needs-review` in storage */
|
|
541
|
-
const createFeedbackRecordObjectSchema = feedbackRecordObjectSchema.extend({ reviewStatus: feedbackReviewStatusSchema.optional().describe("Feedback review workflow status") });
|
|
542
|
-
const feedbackRecordSchema = z.object(feedbackRecordObjectSchema.shape).describe("Feedback record as stored in the database");
|
|
543
|
-
/**
|
|
544
|
-
* Schema for user-provided feedback input (minimal required fields).
|
|
545
|
-
* The span/trace context adds traceId/spanId before emitting ExportedFeedback.
|
|
546
|
-
*/
|
|
547
|
-
const feedbackInputObjectSchema = z.object({
|
|
548
|
-
feedbackSource: feedbackSourceField.optional(),
|
|
549
|
-
/**
|
|
550
|
-
* @deprecated Use `feedbackSource` instead.
|
|
551
|
-
*/
|
|
552
|
-
source: feedbackSourceField.optional(),
|
|
553
|
-
feedbackType: feedbackTypeField,
|
|
554
|
-
value: feedbackValueField,
|
|
555
|
-
comment: feedbackCommentField.optional(),
|
|
556
|
-
feedbackUserId: feedbackUserIdField.optional(),
|
|
557
|
-
/**
|
|
558
|
-
* @deprecated Use `feedbackUserId` instead.
|
|
559
|
-
*/
|
|
560
|
-
userId: feedbackUserIdField.optional(),
|
|
561
|
-
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional feedback-specific metadata"),
|
|
562
|
-
experimentId: experimentIdField.optional(),
|
|
563
|
-
sourceId: z.string().optional().describe("ID of the source record this feedback is linked to")
|
|
564
|
-
});
|
|
565
|
-
z.object(feedbackInputObjectSchema.shape).describe("User-provided feedback input");
|
|
566
|
-
z.object(createFeedbackRecordObjectSchema.shape).describe("Feedback record accepted on creation");
|
|
567
|
-
z.object({ feedback: z.preprocess(normalizeLegacyFeedbackActor, createFeedbackRecordObjectSchema) }).describe("Arguments for creating feedback");
|
|
568
|
-
/** Schema for createFeedback operation body in client/server */
|
|
569
|
-
const createFeedbackBodySchema = z.object({ feedback: createFeedbackRecordObjectSchema.omit({ timestamp: true }) }).describe("Arguments for creating feedback");
|
|
570
|
-
/** Schema for createFeedback operation response */
|
|
571
|
-
const createFeedbackResponseSchema = z.object({ success: z.boolean() }).describe("Response from creating feedback");
|
|
572
|
-
z.object({ feedbacks: z.array(z.preprocess(normalizeLegacyFeedbackActor, createFeedbackRecordObjectSchema)) }).describe("Arguments for batch recording feedback");
|
|
573
|
-
z.object({
|
|
574
|
-
feedbackId: z.string(),
|
|
575
|
-
reviewStatus: feedbackReviewStatusSchema
|
|
576
|
-
}).describe("Arguments for updating a feedback record's review status");
|
|
577
|
-
const DELETE_FEEDBACK_MAX_IDS = 1e3;
|
|
578
|
-
/** Schema for deleteFeedback operation arguments */
|
|
579
|
-
const deleteFeedbackArgsSchema = z.object({
|
|
580
|
-
feedbackIds: z.array(z.string()).max(DELETE_FEEDBACK_MAX_IDS).describe(`IDs of the feedback events to delete (maximum ${DELETE_FEEDBACK_MAX_IDS})`),
|
|
581
|
-
organizationId: organizationIdField.optional().describe("Restrict deletion to feedback in this organization"),
|
|
582
|
-
resourceId: resourceIdField.optional().describe("Restrict deletion to feedback for this resource")
|
|
583
|
-
}).describe("Arguments for deleting feedback by id");
|
|
584
|
-
/** Schema for deleteFeedback operation response */
|
|
585
|
-
const deleteFeedbackResponseSchema = z.object({ success: z.boolean() }).describe("Response from deleting feedback");
|
|
586
|
-
/** Schema for filtering feedback in list queries */
|
|
587
|
-
const feedbackFilterObjectSchema = z.object({
|
|
588
|
-
...commonFilterFields,
|
|
589
|
-
feedbackType: z.union([z.string(), z.array(z.string())]).optional().describe("Filter by feedback type(s)"),
|
|
590
|
-
feedbackSource: feedbackSourceField.optional(),
|
|
591
|
-
/**
|
|
592
|
-
* @deprecated Use `feedbackSource` instead.
|
|
593
|
-
*/
|
|
594
|
-
source: feedbackSourceField.optional(),
|
|
595
|
-
feedbackUserId: feedbackUserIdField.optional(),
|
|
596
|
-
reviewStatus: feedbackReviewStatusSchema.optional()
|
|
597
|
-
});
|
|
598
|
-
const feedbackFilterSchema = z.object(feedbackFilterObjectSchema.shape).describe("Filters for querying feedback");
|
|
599
|
-
/** Fields available for ordering feedback results */
|
|
600
|
-
const feedbackOrderByFieldSchema = z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
|
|
601
|
-
/** Order by configuration for feedback queries */
|
|
602
|
-
const feedbackOrderBySchema = z.object({
|
|
603
|
-
field: feedbackOrderByFieldSchema.default("timestamp").describe("Field to order by"),
|
|
604
|
-
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
605
|
-
}).describe("Order by configuration");
|
|
606
|
-
z.object({
|
|
607
|
-
mode: listModeSchema.optional(),
|
|
608
|
-
filters: z.preprocess(normalizeLegacyFeedbackActor, feedbackFilterObjectSchema).optional(),
|
|
609
|
-
pagination: paginationArgsSchema.optional(),
|
|
610
|
-
orderBy: feedbackOrderBySchema.optional(),
|
|
611
|
-
after: deltaCursorSchema.optional(),
|
|
612
|
-
limit: deltaLimitSchema
|
|
613
|
-
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
|
|
614
|
-
field: "timestamp",
|
|
615
|
-
direction: "DESC"
|
|
616
|
-
} })).describe("Arguments for listing feedback");
|
|
617
|
-
/** Schema for listFeedback operation response */
|
|
618
|
-
const listFeedbackResponseSchema$1 = z.object({
|
|
619
|
-
pagination: paginationInfoSchema.optional(),
|
|
620
|
-
delta: deltaInfoSchema.optional(),
|
|
621
|
-
deltaCursor: deltaCursorSchema.optional(),
|
|
622
|
-
feedback: z.array(feedbackRecordSchema)
|
|
623
|
-
}).describe("Response from listing feedback");
|
|
624
|
-
const getFeedbackAggregateArgsSchema = z.object({
|
|
625
|
-
feedbackType: feedbackTypeField,
|
|
626
|
-
feedbackSource: feedbackSourceField.optional(),
|
|
627
|
-
aggregation: aggregationTypeSchema,
|
|
628
|
-
filters: feedbackFilterSchema.optional(),
|
|
629
|
-
comparePeriod: comparePeriodSchema.optional()
|
|
630
|
-
}).describe("Arguments for getting a feedback aggregate over numeric values");
|
|
631
|
-
const getFeedbackAggregateResponseSchema = z.object(aggregateResponseFields);
|
|
632
|
-
const getFeedbackBreakdownArgsSchema = z.object({
|
|
633
|
-
feedbackType: feedbackTypeField,
|
|
634
|
-
feedbackSource: feedbackSourceField.optional(),
|
|
635
|
-
groupBy: groupBySchema,
|
|
636
|
-
aggregation: aggregationTypeSchema,
|
|
637
|
-
filters: feedbackFilterSchema.optional()
|
|
638
|
-
}).describe("Arguments for getting a feedback breakdown over numeric values");
|
|
639
|
-
const getFeedbackBreakdownResponseSchema = z.object({ groups: z.array(z.object({
|
|
640
|
-
dimensions: dimensionsField,
|
|
641
|
-
value: aggregatedValueField
|
|
642
|
-
})) });
|
|
643
|
-
const getFeedbackTimeSeriesArgsSchema = z.object({
|
|
644
|
-
feedbackType: feedbackTypeField,
|
|
645
|
-
feedbackSource: feedbackSourceField.optional(),
|
|
646
|
-
interval: aggregationIntervalSchema,
|
|
647
|
-
aggregation: aggregationTypeSchema,
|
|
648
|
-
filters: feedbackFilterSchema.optional(),
|
|
649
|
-
groupBy: groupBySchema.optional()
|
|
650
|
-
}).describe("Arguments for getting feedback time series over numeric values");
|
|
651
|
-
const getFeedbackTimeSeriesResponseSchema = z.object({ series: z.array(z.object({
|
|
652
|
-
name: z.string().describe("Series name (feedback type or group key)"),
|
|
653
|
-
points: z.array(z.object({
|
|
654
|
-
timestamp: bucketTimestampField,
|
|
655
|
-
value: aggregatedValueField
|
|
656
|
-
}))
|
|
657
|
-
})) });
|
|
658
|
-
const getFeedbackPercentilesArgsSchema = z.object({
|
|
659
|
-
feedbackType: feedbackTypeField,
|
|
660
|
-
feedbackSource: feedbackSourceField.optional(),
|
|
661
|
-
percentiles: percentilesSchema,
|
|
662
|
-
interval: aggregationIntervalSchema,
|
|
663
|
-
filters: feedbackFilterSchema.optional()
|
|
664
|
-
}).describe("Arguments for getting feedback percentiles over numeric values");
|
|
665
|
-
const getFeedbackPercentilesResponseSchema = z.object({ series: z.array(z.object({
|
|
666
|
-
percentile: percentileField,
|
|
667
|
-
points: z.array(z.object({
|
|
668
|
-
timestamp: bucketTimestampField,
|
|
669
|
-
value: percentileBucketValueField
|
|
670
|
-
}))
|
|
671
|
-
})) });
|
|
672
|
-
z.enum([
|
|
673
|
-
"counter",
|
|
674
|
-
"gauge",
|
|
675
|
-
"histogram"
|
|
676
|
-
]);
|
|
677
|
-
const metricNameField = z.string().describe("Metric name (e.g., mastra_agent_duration_ms)");
|
|
678
|
-
const metricValueField = z.number().describe("Metric value");
|
|
679
|
-
const labelsField = z.record(z.string(), z.string()).describe("Metric labels for dimensional filtering");
|
|
680
|
-
const providerField = z.string().describe("Model provider");
|
|
681
|
-
const modelField = z.string().describe("Model");
|
|
682
|
-
const estimatedCostField = z.number().describe("Estimated cost");
|
|
683
|
-
const costUnitField = z.string().describe("Unit for the estimated cost (e.g., usd)");
|
|
684
|
-
const costMetadField = z.record(z.string(), z.unknown()).nullish().describe("Structured costing metadata");
|
|
685
|
-
/**
|
|
686
|
-
* Schema for metrics as stored in the database.
|
|
687
|
-
* Each record is a single metric observation.
|
|
688
|
-
*/
|
|
689
|
-
const metricRecordSchema = z.object({
|
|
690
|
-
metricId: z.string().nullish().describe("Unique id for this metric event"),
|
|
691
|
-
timestamp: z.date().describe("When the metric was recorded"),
|
|
692
|
-
name: metricNameField,
|
|
693
|
-
value: metricValueField,
|
|
694
|
-
traceId: traceIdField.nullish(),
|
|
695
|
-
spanId: spanIdField.nullish(),
|
|
696
|
-
...contextFields,
|
|
697
|
-
/**
|
|
698
|
-
* @deprecated Use `executionSource` instead.
|
|
699
|
-
*/
|
|
700
|
-
source: z.string().nullish().describe("Execution source"),
|
|
701
|
-
provider: providerField.nullish(),
|
|
702
|
-
model: modelField.nullish(),
|
|
703
|
-
estimatedCost: estimatedCostField.nullish(),
|
|
704
|
-
costUnit: costUnitField.nullish(),
|
|
705
|
-
costMetadata: costMetadField.nullish(),
|
|
706
|
-
labels: labelsField.default({}),
|
|
707
|
-
metadata: metadataField.nullish()
|
|
708
|
-
}).describe("Metric record as stored in the database");
|
|
709
|
-
z.object({
|
|
710
|
-
name: metricNameField,
|
|
711
|
-
value: metricValueField,
|
|
712
|
-
labels: labelsField.optional()
|
|
713
|
-
}).describe("User-provided metric input");
|
|
714
|
-
/** Schema for creating a metric record (without db timestamps) */
|
|
715
|
-
const createMetricRecordSchema = metricRecordSchema;
|
|
716
|
-
z.object({ metrics: z.array(createMetricRecordSchema) }).describe("Arguments for batch recording metrics");
|
|
717
|
-
z.object({
|
|
718
|
-
type: aggregationTypeSchema,
|
|
719
|
-
interval: aggregationIntervalSchema.optional(),
|
|
720
|
-
groupBy: groupBySchema.optional()
|
|
721
|
-
}).describe("Metrics aggregation configuration");
|
|
722
|
-
/** Schema for filtering metrics in queries */
|
|
723
|
-
const metricsFilterSchema = z.object({
|
|
724
|
-
...commonFilterFields,
|
|
725
|
-
traceIds: z.array(traceIdField).nonempty().max(1e3).optional().describe("Filter by one or more trace IDs"),
|
|
726
|
-
experimentIds: z.array(experimentIdField).nonempty().max(1e3).optional().describe("Filter by one or more experiment IDs"),
|
|
727
|
-
name: z.array(z.string()).nonempty().optional().describe("Filter by metric name(s)"),
|
|
728
|
-
/**
|
|
729
|
-
* @deprecated Use `executionSource` instead.
|
|
730
|
-
*/
|
|
731
|
-
source: z.string().optional().describe("Filter by execution source"),
|
|
732
|
-
provider: providerField.optional(),
|
|
733
|
-
model: modelField.optional(),
|
|
734
|
-
costUnit: costUnitField.optional(),
|
|
735
|
-
labels: z.record(z.string(), z.string()).optional().describe("Exact match on label key-value pairs")
|
|
736
|
-
}).describe("Filters for querying metrics");
|
|
737
|
-
/** Fields available for ordering metric list results */
|
|
738
|
-
const metricsOrderByFieldSchema = z.enum(["timestamp"]).describe("Field to order by: 'timestamp'");
|
|
739
|
-
/** Order by configuration for metric list queries */
|
|
740
|
-
const metricsOrderBySchema = z.object({
|
|
741
|
-
field: metricsOrderByFieldSchema.default("timestamp").describe("Field to order by"),
|
|
742
|
-
direction: sortDirectionSchema.default("DESC").describe("Sort direction")
|
|
743
|
-
}).describe("Order by configuration");
|
|
744
|
-
z.object({
|
|
745
|
-
mode: listModeSchema.optional(),
|
|
746
|
-
filters: metricsFilterSchema.optional(),
|
|
747
|
-
pagination: paginationArgsSchema.optional(),
|
|
748
|
-
orderBy: metricsOrderBySchema.optional(),
|
|
749
|
-
after: deltaCursorSchema.optional(),
|
|
750
|
-
limit: deltaLimitSchema
|
|
751
|
-
}).strict().superRefine(refineObservabilityListMode).transform((value) => normalizeObservabilityListArgs(value, { orderBy: {
|
|
752
|
-
field: "timestamp",
|
|
753
|
-
direction: "DESC"
|
|
754
|
-
} })).describe("Arguments for listing metrics");
|
|
755
|
-
/** Schema for listMetrics operation response */
|
|
756
|
-
const listMetricsResponseSchema = z.object({
|
|
757
|
-
pagination: paginationInfoSchema.optional(),
|
|
758
|
-
delta: deltaInfoSchema.optional(),
|
|
759
|
-
deltaCursor: deltaCursorSchema.optional(),
|
|
760
|
-
metrics: z.array(metricRecordSchema)
|
|
761
|
-
}).describe("Response from listing metrics");
|
|
762
|
-
const distinctColumnSchema = z.enum([
|
|
763
|
-
"entityType",
|
|
764
|
-
"entityName",
|
|
765
|
-
"parentEntityType",
|
|
766
|
-
"parentEntityName",
|
|
767
|
-
"rootEntityType",
|
|
768
|
-
"rootEntityName",
|
|
769
|
-
"name",
|
|
770
|
-
"provider",
|
|
771
|
-
"model",
|
|
772
|
-
"environment",
|
|
773
|
-
"executionSource",
|
|
774
|
-
"serviceName",
|
|
775
|
-
"threadId",
|
|
776
|
-
"resourceId"
|
|
777
|
-
]).optional().describe("Column to apply count_distinct over (required when aggregation is 'count_distinct'). Restricted to allowlisted metric dimensions.");
|
|
778
|
-
/** Shared by the metric args schemas and dashboard metric queries, which rebuild those objects. */
|
|
779
|
-
const requireDistinctColumnRefinement = {
|
|
780
|
-
check: (data) => data.aggregation !== "count_distinct" || data.distinctColumn !== void 0,
|
|
781
|
-
options: {
|
|
782
|
-
message: "distinctColumn is required when aggregation is 'count_distinct'",
|
|
783
|
-
path: ["distinctColumn"]
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
|
-
const getMetricAggregateArgsSchema = z.object({
|
|
787
|
-
name: z.array(z.string()).nonempty().describe("Metric name(s) to aggregate"),
|
|
788
|
-
aggregation: aggregationTypeSchema,
|
|
789
|
-
distinctColumn: distinctColumnSchema,
|
|
790
|
-
filters: metricsFilterSchema.optional(),
|
|
791
|
-
comparePeriod: comparePeriodSchema.optional()
|
|
792
|
-
}).refine(requireDistinctColumnRefinement.check, requireDistinctColumnRefinement.options).describe("Arguments for getting a metric aggregate");
|
|
793
|
-
const getMetricAggregateResponseSchema = z.object({
|
|
794
|
-
...aggregateResponseFields,
|
|
795
|
-
estimatedCost: z.number().nullable().optional().describe("Aggregated estimated cost from the same filtered row set"),
|
|
796
|
-
costUnit: z.string().nullable().optional().describe("Shared cost unit for the aggregated rows, or null when mixed/unknown"),
|
|
797
|
-
previousEstimatedCost: z.number().nullable().optional().describe("Aggregated estimated cost from the comparison period"),
|
|
798
|
-
costChangePercent: z.number().nullable().optional().describe("Percentage change in estimated cost from comparison period")
|
|
799
|
-
});
|
|
800
|
-
const getMetricBreakdownArgsSchema = z.object({
|
|
801
|
-
name: z.array(z.string()).nonempty().describe("Metric name(s) to break down"),
|
|
802
|
-
groupBy: groupBySchema,
|
|
803
|
-
aggregation: aggregationTypeSchema,
|
|
804
|
-
distinctColumn: distinctColumnSchema,
|
|
805
|
-
filters: metricsFilterSchema.optional(),
|
|
806
|
-
limit: z.number().int().positive().max(1e3).optional().describe("Maximum number of groups to return (server-side TopK). Required for high-cardinality groupBy."),
|
|
807
|
-
orderDirection: sortDirectionSchema.optional().describe("Sort direction for the aggregated value (defaults to 'DESC' at the storage layer; pairs with limit for top/bottom-N).")
|
|
808
|
-
}).refine(requireDistinctColumnRefinement.check, requireDistinctColumnRefinement.options).describe("Arguments for getting a metric breakdown");
|
|
809
|
-
const getMetricBreakdownResponseSchema = z.object({ groups: z.array(z.object({
|
|
810
|
-
dimensions: dimensionsField,
|
|
811
|
-
value: aggregatedValueField,
|
|
812
|
-
estimatedCost: z.number().nullable().optional().describe("Summed estimated cost for this group"),
|
|
813
|
-
costUnit: z.string().nullable().optional().describe("Shared cost unit for this group, or null when mixed/unknown")
|
|
814
|
-
})) });
|
|
815
|
-
const getMetricTimeSeriesArgsSchema = z.object({
|
|
816
|
-
name: z.array(z.string()).nonempty().describe("Metric name(s)"),
|
|
817
|
-
interval: aggregationIntervalSchema,
|
|
818
|
-
aggregation: aggregationTypeSchema,
|
|
819
|
-
distinctColumn: distinctColumnSchema,
|
|
820
|
-
filters: metricsFilterSchema.optional(),
|
|
821
|
-
groupBy: groupBySchema.optional()
|
|
822
|
-
}).refine(requireDistinctColumnRefinement.check, requireDistinctColumnRefinement.options).describe("Arguments for getting metric time series");
|
|
823
|
-
const getMetricTimeSeriesResponseSchema = z.object({ series: z.array(z.object({
|
|
824
|
-
name: z.string().describe("Series name (metric name or group key)"),
|
|
825
|
-
costUnit: z.string().nullable().optional().describe("Shared cost unit for this series, or null when mixed/unknown"),
|
|
826
|
-
points: z.array(z.object({
|
|
827
|
-
timestamp: bucketTimestampField,
|
|
828
|
-
value: aggregatedValueField,
|
|
829
|
-
estimatedCost: z.number().nullable().optional().describe("Summed estimated cost in this bucket")
|
|
830
|
-
}))
|
|
831
|
-
})) });
|
|
832
|
-
const getMetricPercentilesArgsSchema = z.object({
|
|
833
|
-
name: z.string().describe("Metric name"),
|
|
834
|
-
percentiles: percentilesSchema,
|
|
835
|
-
interval: aggregationIntervalSchema,
|
|
836
|
-
filters: metricsFilterSchema.optional()
|
|
837
|
-
}).describe("Arguments for getting metric percentiles");
|
|
838
|
-
const getMetricPercentilesResponseSchema = z.object({ series: z.array(z.object({
|
|
839
|
-
percentile: percentileField,
|
|
840
|
-
points: z.array(z.object({
|
|
841
|
-
timestamp: bucketTimestampField,
|
|
842
|
-
value: percentileBucketValueField
|
|
843
|
-
}))
|
|
844
|
-
})) });
|
|
845
|
-
const getMetricNamesArgsSchema = z.object({
|
|
846
|
-
prefix: z.string().optional().describe("Filter metric names by prefix"),
|
|
847
|
-
limit: z.coerce.number().int().min(1).optional().describe("Maximum number of names to return")
|
|
848
|
-
}).describe("Arguments for getting metric names");
|
|
849
|
-
const getMetricNamesResponseSchema = z.object({ names: z.array(z.string()).describe("Distinct metric names") });
|
|
850
|
-
const getMetricLabelKeysArgsSchema = z.object({ metricName: z.string().describe("Metric name to get label keys for") }).describe("Arguments for getting metric label keys");
|
|
851
|
-
const getMetricLabelKeysResponseSchema = z.object({ keys: z.array(z.string()).describe("Distinct label keys for the metric") });
|
|
852
|
-
const getMetricLabelValuesArgsSchema = z.object({
|
|
853
|
-
metricName: z.string().describe("Metric name"),
|
|
854
|
-
labelKey: z.string().describe("Label key to get values for"),
|
|
855
|
-
prefix: z.string().optional().describe("Filter values by prefix"),
|
|
856
|
-
limit: z.coerce.number().int().min(1).optional().describe("Maximum number of values to return")
|
|
857
|
-
}).describe("Arguments for getting label values");
|
|
858
|
-
const getMetricLabelValuesResponseSchema = z.object({ values: z.array(z.string()).describe("Distinct label values") });
|
|
859
|
-
z.object({}).describe("Arguments for getting entity types");
|
|
860
|
-
const getEntityTypesResponseSchema = z.object({ entityTypes: z.array(entityTypeField).describe("Distinct entity types") });
|
|
861
|
-
const getEntityNamesArgsSchema = z.object({ entityType: entityTypeField.optional().describe("Optional entity type filter") }).describe("Arguments for getting entity names");
|
|
862
|
-
const getEntityNamesResponseSchema = z.object({ names: z.array(z.string()).describe("Distinct entity names") });
|
|
863
|
-
z.object({}).describe("Arguments for getting service names");
|
|
864
|
-
const getServiceNamesResponseSchema = z.object({ serviceNames: z.array(z.string()).describe("Distinct service names") });
|
|
865
|
-
z.object({}).describe("Arguments for getting environments");
|
|
866
|
-
const getEnvironmentsResponseSchema = z.object({ environments: z.array(z.string()).describe("Distinct environments") });
|
|
867
|
-
const getTagsArgsSchema = z.object({ entityType: entityTypeField.optional().describe("Optional entity type filter") }).describe("Arguments for getting tags");
|
|
868
|
-
const getTagsResponseSchema = z.object({ tags: z.array(z.string()).describe("Distinct tags") });
|
|
869
15
|
// src/server/schemas/feedback.ts
|
|
870
16
|
const listFeedbackResponseSchema = listFeedbackResponseSchema$1.extend({ feedback: z.array(feedbackRecordSchema.extend({ author: z.object({
|
|
871
17
|
id: z.string(),
|
|
@@ -1704,7 +850,7 @@ const LIST_LOGS = createNewRoute(NEW_ROUTE_DEFS.LIST_LOGS, {
|
|
|
1704
850
|
limit
|
|
1705
851
|
});
|
|
1706
852
|
}
|
|
1707
|
-
const pagination = pickParams(paginationArgsSchema
|
|
853
|
+
const pagination = pickParams(paginationArgsSchema, params);
|
|
1708
854
|
const orderBy = pickParams(logsOrderBySchema, params);
|
|
1709
855
|
return await observabilityStore.listLogs(mode === "page" ? {
|
|
1710
856
|
mode,
|
|
@@ -1733,7 +879,7 @@ const LIST_SCORES = createNewRoute(NEW_ROUTE_DEFS.LIST_SCORES, {
|
|
|
1733
879
|
limit
|
|
1734
880
|
});
|
|
1735
881
|
}
|
|
1736
|
-
const pagination = pickParams(paginationArgsSchema
|
|
882
|
+
const pagination = pickParams(paginationArgsSchema, params);
|
|
1737
883
|
const orderBy = pickParams(scoresOrderBySchema, params);
|
|
1738
884
|
return await observabilityStore.listScores(mode === "page" ? {
|
|
1739
885
|
mode,
|
|
@@ -1750,13 +896,27 @@ const LIST_SCORES = createNewRoute(NEW_ROUTE_DEFS.LIST_SCORES, {
|
|
|
1750
896
|
const CREATE_SCORE = createNewRoute(NEW_ROUTE_DEFS.CREATE_SCORE, {
|
|
1751
897
|
bodySchema: createScoreBodySchema,
|
|
1752
898
|
responseSchema: createScoreResponseSchema,
|
|
1753
|
-
|
|
1754
|
-
|
|
899
|
+
preserveHttpExceptions: true,
|
|
900
|
+
handler: async ({ mastra, requestContext, score, contextMode }) => {
|
|
901
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
902
|
+
const context = await resolveSignalContext(observabilityStore, requestContext, score, contextMode);
|
|
903
|
+
const scoreId = score.scoreId ?? generateSignalId();
|
|
904
|
+
const timestamp = score.timestamp === void 0 ? /* @__PURE__ */ new Date() : new Date(score.timestamp);
|
|
905
|
+
await observabilityStore.createScore({ score: {
|
|
1755
906
|
...score,
|
|
1756
|
-
|
|
1757
|
-
|
|
907
|
+
...context,
|
|
908
|
+
scoreId,
|
|
909
|
+
timestamp
|
|
1758
910
|
} });
|
|
1759
|
-
return {
|
|
911
|
+
return {
|
|
912
|
+
success: true,
|
|
913
|
+
data: {
|
|
914
|
+
scoreId,
|
|
915
|
+
traceId: score.traceId,
|
|
916
|
+
spanId: score.spanId ?? null,
|
|
917
|
+
timestamp: timestamp.toISOString()
|
|
918
|
+
}
|
|
919
|
+
};
|
|
1760
920
|
}
|
|
1761
921
|
});
|
|
1762
922
|
const DELETE_SCORES = createNewRoute(NEW_ROUTE_DEFS.DELETE_SCORES, {
|
|
@@ -1815,7 +975,7 @@ const LIST_FEEDBACK = createNewRoute(NEW_ROUTE_DEFS.LIST_FEEDBACK, {
|
|
|
1815
975
|
const filters = pickParams(feedbackFilterSchema, params);
|
|
1816
976
|
const observabilityStore = await getObservabilityStore(mastra);
|
|
1817
977
|
if (mode === "delta") assertObservabilityDeltaSupported(observabilityStore, OBSERVABILITY_LIST_ENDPOINTS.feedback);
|
|
1818
|
-
const pagination = pickParams(paginationArgsSchema
|
|
978
|
+
const pagination = pickParams(paginationArgsSchema, params);
|
|
1819
979
|
const orderBy = pickParams(feedbackOrderBySchema, params);
|
|
1820
980
|
const result = await observabilityStore.listFeedback(mode === "delta" ? {
|
|
1821
981
|
mode,
|
|
@@ -1848,17 +1008,31 @@ const LIST_FEEDBACK = createNewRoute(NEW_ROUTE_DEFS.LIST_FEEDBACK, {
|
|
|
1848
1008
|
const CREATE_FEEDBACK = createNewRoute(NEW_ROUTE_DEFS.CREATE_FEEDBACK, {
|
|
1849
1009
|
bodySchema: createFeedbackBodySchema,
|
|
1850
1010
|
responseSchema: createFeedbackResponseSchema,
|
|
1851
|
-
|
|
1011
|
+
preserveHttpExceptions: true,
|
|
1012
|
+
handler: async ({ mastra, requestContext, feedback, contextMode }) => {
|
|
1852
1013
|
const user = requestContext.get(MASTRA_USER_KEY);
|
|
1853
1014
|
const authenticatedId = user && typeof user === "object" && "id" in user ? user.id : void 0;
|
|
1854
|
-
|
|
1015
|
+
const observabilityStore = await getObservabilityStore(mastra);
|
|
1016
|
+
const context = await resolveSignalContext(observabilityStore, requestContext, feedback, contextMode);
|
|
1017
|
+
const feedbackId = feedback.feedbackId ?? generateSignalId();
|
|
1018
|
+
const timestamp = feedback.timestamp === void 0 ? /* @__PURE__ */ new Date() : new Date(feedback.timestamp);
|
|
1019
|
+
await observabilityStore.createFeedback({ feedback: {
|
|
1855
1020
|
...feedback,
|
|
1856
|
-
...
|
|
1857
|
-
|
|
1858
|
-
|
|
1021
|
+
...context,
|
|
1022
|
+
feedbackUserId: typeof authenticatedId === "string" && authenticatedId.trim().length > 0 ? authenticatedId : feedback.feedbackUserId ?? null,
|
|
1023
|
+
feedbackId,
|
|
1024
|
+
timestamp,
|
|
1859
1025
|
reviewStatus: feedback.reviewStatus ?? "needs-review"
|
|
1860
1026
|
} });
|
|
1861
|
-
return {
|
|
1027
|
+
return {
|
|
1028
|
+
success: true,
|
|
1029
|
+
data: {
|
|
1030
|
+
feedbackId,
|
|
1031
|
+
traceId: feedback.traceId,
|
|
1032
|
+
spanId: feedback.spanId ?? null,
|
|
1033
|
+
timestamp: timestamp.toISOString()
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1862
1036
|
}
|
|
1863
1037
|
});
|
|
1864
1038
|
const DELETE_FEEDBACK = createNewRoute(NEW_ROUTE_DEFS.DELETE_FEEDBACK, {
|
|
@@ -1929,7 +1103,7 @@ const LIST_METRICS = createNewRoute(NEW_ROUTE_DEFS.LIST_METRICS, {
|
|
|
1929
1103
|
limit
|
|
1930
1104
|
});
|
|
1931
1105
|
}
|
|
1932
|
-
const pagination = pickParams(paginationArgsSchema
|
|
1106
|
+
const pagination = pickParams(paginationArgsSchema, params);
|
|
1933
1107
|
const orderBy = pickParams(metricsOrderBySchema, params);
|
|
1934
1108
|
return await observabilityStore.listMetrics(mode === "page" ? {
|
|
1935
1109
|
mode,
|
|
@@ -2105,4 +1279,4 @@ const NEW_ROUTES = {
|
|
|
2105
1279
|
};
|
|
2106
1280
|
export { GET_TRACE_QUERY_VALUES as A, GET_SCORE_AGGREGATE as C, GET_SERVICE_NAMES as D, GET_SCORE_TIME_SERIES as E, NEW_ROUTES as F, QUERY_SPANS as I, QUERY_THREADS as L, LIST_LOGS as M, LIST_METRICS as N, GET_TAGS as O, LIST_SCORES as P, QUERY_TRACES as R, GET_SCORE as S, GET_SCORE_PERCENTILES as T, GET_METRIC_LABEL_KEYS as _, DELETE_FEEDBACK as a, GET_METRIC_PERCENTILES as b, GET_ENTITY_NAMES as c, GET_FEEDBACK_AGGREGATE as d, GET_FEEDBACK_BREAKDOWN as f, GET_METRIC_BREAKDOWN as g, GET_METRIC_AGGREGATE as h, CREATE_SCORE as i, LIST_FEEDBACK as j, GET_TRACE_QUERY_FIELDS as k, GET_ENTITY_TYPES as l, GET_FEEDBACK_TIME_SERIES as m, AGGREGATE_TRACES as n, DELETE_SCORES as o, GET_FEEDBACK_PERCENTILES as p, CREATE_FEEDBACK as r, GET_CAPABILITIES as s, AGGREGATE_SPANS as t, GET_ENVIRONMENTS as u, GET_METRIC_LABEL_VALUES as v, GET_SCORE_BREAKDOWN as w, GET_METRIC_TIME_SERIES as x, GET_METRIC_NAMES as y, UPDATE_FEEDBACK_REVIEW_STATUS as z };
|
|
2107
1281
|
|
|
2108
|
-
//# sourceMappingURL=observability-new-endpoints-
|
|
1282
|
+
//# sourceMappingURL=observability-new-endpoints-DHn8uKyr.js.map
|