@mastra/server 0.0.0-fix-zod-to-json-schema-ref-strategy-20250910193441 → 0.0.0-fix-cloud-peer-deps-20250923194656

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 (107) hide show
  1. package/CHANGELOG.md +214 -3
  2. package/README.md +0 -5
  3. package/dist/{chunk-GUI3CROV.cjs → chunk-2GDLSAVJ.cjs} +60 -22
  4. package/dist/chunk-2GDLSAVJ.cjs.map +1 -0
  5. package/dist/{chunk-QZT4RDHB.cjs → chunk-2WMATOMO.cjs} +233 -78
  6. package/dist/chunk-2WMATOMO.cjs.map +1 -0
  7. package/dist/{chunk-6LUKYSWE.cjs → chunk-57HWW2TY.cjs} +96 -119
  8. package/dist/chunk-57HWW2TY.cjs.map +1 -0
  9. package/dist/{chunk-R7NOGUZG.js → chunk-5KRXONRF.js} +43 -4
  10. package/dist/chunk-5KRXONRF.js.map +1 -0
  11. package/dist/{chunk-L265APUD.cjs → chunk-5N724Q2T.cjs} +43 -3
  12. package/dist/chunk-5N724Q2T.cjs.map +1 -0
  13. package/dist/{chunk-3THIIWWW.cjs → chunk-AVEPEUN4.cjs} +4 -3
  14. package/dist/chunk-AVEPEUN4.cjs.map +1 -0
  15. package/dist/{chunk-LJFXFCUH.js → chunk-BZT5VYDT.js} +231 -79
  16. package/dist/chunk-BZT5VYDT.js.map +1 -0
  17. package/dist/chunk-CNU4A2XU.js +129 -0
  18. package/dist/chunk-CNU4A2XU.js.map +1 -0
  19. package/dist/{chunk-B2V3PUB7.js → chunk-G662L2YZ.js} +93 -116
  20. package/dist/chunk-G662L2YZ.js.map +1 -0
  21. package/dist/chunk-GDWMF6SB.cjs +133 -0
  22. package/dist/chunk-GDWMF6SB.cjs.map +1 -0
  23. package/dist/{chunk-7QEJ5QG5.js → chunk-IYJW2OVQ.js} +60 -22
  24. package/dist/chunk-IYJW2OVQ.js.map +1 -0
  25. package/dist/{chunk-A75S4TDD.js → chunk-JRDEOHAJ.js} +19 -11
  26. package/dist/chunk-JRDEOHAJ.js.map +1 -0
  27. package/dist/{chunk-SYRRSBGL.js → chunk-KM7EJKXV.js} +8 -4
  28. package/dist/chunk-KM7EJKXV.js.map +1 -0
  29. package/dist/{chunk-J7BPKKOG.cjs → chunk-LJFAAEU7.cjs} +8 -4
  30. package/dist/chunk-LJFAAEU7.cjs.map +1 -0
  31. package/dist/{chunk-WZC6CIVD.cjs → chunk-NLWACBE7.cjs} +19 -11
  32. package/dist/chunk-NLWACBE7.cjs.map +1 -0
  33. package/dist/{chunk-2JEDATG5.cjs → chunk-PLNQ4XER.cjs} +191 -150
  34. package/dist/chunk-PLNQ4XER.cjs.map +1 -0
  35. package/dist/{chunk-5QUKZCEF.js → chunk-PUYSH3IL.js} +4 -3
  36. package/dist/chunk-PUYSH3IL.js.map +1 -0
  37. package/dist/{chunk-OTU37YZO.js → chunk-X7564COI.js} +172 -131
  38. package/dist/chunk-X7564COI.js.map +1 -0
  39. package/dist/index.cjs +4 -0
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.js +3 -0
  42. package/dist/index.js.map +1 -1
  43. package/dist/server/handlers/a2a.cjs +7 -7
  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 +16 -16
  47. package/dist/server/handlers/agent-builder.d.ts +5 -4
  48. package/dist/server/handlers/agent-builder.d.ts.map +1 -1
  49. package/dist/server/handlers/agent-builder.js +1 -1
  50. package/dist/server/handlers/agents.cjs +26 -14
  51. package/dist/server/handlers/agents.d.ts +59 -7
  52. package/dist/server/handlers/agents.d.ts.map +1 -1
  53. package/dist/server/handlers/agents.js +1 -1
  54. package/dist/server/handlers/observability.cjs +7 -3
  55. package/dist/server/handlers/observability.d.ts +18 -0
  56. package/dist/server/handlers/observability.d.ts.map +1 -1
  57. package/dist/server/handlers/observability.js +1 -1
  58. package/dist/server/handlers/scores.cjs +7 -7
  59. package/dist/server/handlers/scores.d.ts +208 -6
  60. package/dist/server/handlers/scores.d.ts.map +1 -1
  61. package/dist/server/handlers/scores.js +1 -1
  62. package/dist/server/handlers/tools.cjs +6 -6
  63. package/dist/server/handlers/tools.d.ts.map +1 -1
  64. package/dist/server/handlers/tools.js +1 -1
  65. package/dist/server/handlers/vNextNetwork.d.ts +73 -6
  66. package/dist/server/handlers/vNextNetwork.d.ts.map +1 -1
  67. package/dist/server/handlers/voice.cjs +5 -5
  68. package/dist/server/handlers/voice.d.ts +6 -4
  69. package/dist/server/handlers/voice.d.ts.map +1 -1
  70. package/dist/server/handlers/voice.js +1 -1
  71. package/dist/server/handlers/workflows.cjs +24 -16
  72. package/dist/server/handlers/workflows.d.ts +16 -7
  73. package/dist/server/handlers/workflows.d.ts.map +1 -1
  74. package/dist/server/handlers/workflows.js +1 -1
  75. package/dist/server/handlers.cjs +16 -21
  76. package/dist/server/handlers.d.ts +0 -1
  77. package/dist/server/handlers.d.ts.map +1 -1
  78. package/dist/server/handlers.js +8 -9
  79. package/dist/server/utils.d.ts +2 -0
  80. package/dist/server/utils.d.ts.map +1 -1
  81. package/package.json +8 -8
  82. package/dist/chunk-2JEDATG5.cjs.map +0 -1
  83. package/dist/chunk-3THIIWWW.cjs.map +0 -1
  84. package/dist/chunk-5QUKZCEF.js.map +0 -1
  85. package/dist/chunk-6LUKYSWE.cjs.map +0 -1
  86. package/dist/chunk-7QEJ5QG5.js.map +0 -1
  87. package/dist/chunk-A75S4TDD.js.map +0 -1
  88. package/dist/chunk-B2V3PUB7.js.map +0 -1
  89. package/dist/chunk-GUI3CROV.cjs.map +0 -1
  90. package/dist/chunk-IY34NOLA.cjs +0 -150
  91. package/dist/chunk-IY34NOLA.cjs.map +0 -1
  92. package/dist/chunk-J7BPKKOG.cjs.map +0 -1
  93. package/dist/chunk-L265APUD.cjs.map +0 -1
  94. package/dist/chunk-LJFXFCUH.js.map +0 -1
  95. package/dist/chunk-OTU37YZO.js.map +0 -1
  96. package/dist/chunk-QZT4RDHB.cjs.map +0 -1
  97. package/dist/chunk-R7NOGUZG.js.map +0 -1
  98. package/dist/chunk-SYRRSBGL.js.map +0 -1
  99. package/dist/chunk-U46VIX2V.js +0 -144
  100. package/dist/chunk-U46VIX2V.js.map +0 -1
  101. package/dist/chunk-WZC6CIVD.cjs.map +0 -1
  102. package/dist/server/handlers/network.cjs +0 -24
  103. package/dist/server/handlers/network.cjs.map +0 -1
  104. package/dist/server/handlers/network.d.ts +0 -50
  105. package/dist/server/handlers/network.d.ts.map +0 -1
  106. package/dist/server/handlers/network.js +0 -3
  107. package/dist/server/handlers/network.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,11 +1,222 @@
1
1
  # @mastra/server
2
2
 
3
- ## 0.0.0-fix-zod-to-json-schema-ref-strategy-20250910193441
3
+ ## 0.0.0-fix-cloud-peer-deps-20250923194656
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [[`b4379f7`](https://github.com/mastra-ai/mastra/commit/b4379f703fd74474f253420e8c3a684f2c4b2f8e), [`dd9119b`](https://github.com/mastra-ai/mastra/commit/dd9119b175a8f389082f75c12750e51f96d65dca), [`d34aaa1`](https://github.com/mastra-ai/mastra/commit/d34aaa1da5d3c5f991740f59e2fe6d28d3e2dd91), [`ce1e580`](https://github.com/mastra-ai/mastra/commit/ce1e580f6391e94a0c6816a9c5db0a21566a262f), [`b2babfa`](https://github.com/mastra-ai/mastra/commit/b2babfa9e75b22f2759179e71d8473f6dc5421ed), [`d8c3ba5`](https://github.com/mastra-ai/mastra/commit/d8c3ba516f4173282d293f7e64769cfc8738d360), [`3863c52`](https://github.com/mastra-ai/mastra/commit/3863c52d44b4e5779968b802d977e87adf939d8e), [`6424c7e`](https://github.com/mastra-ai/mastra/commit/6424c7ec38b6921d66212431db1e0958f441b2a7), [`db94750`](https://github.com/mastra-ai/mastra/commit/db94750a41fd29b43eb1f7ce8e97ba8b9978c91b), [`a66a371`](https://github.com/mastra-ai/mastra/commit/a66a3716b00553d7f01842be9deb34f720b10fab), [`69fc3cd`](https://github.com/mastra-ai/mastra/commit/69fc3cd0fd814901785bdcf49bf536ab1e7fd975)]:
8
- - @mastra/core@0.0.0-fix-zod-to-json-schema-ref-strategy-20250910193441
7
+ - Allow agent instructions to accept SystemMessage types ([#7987](https://github.com/mastra-ai/mastra/pull/7987))
8
+
9
+ Agents can now use rich instruction formats beyond simple strings:
10
+ - CoreSystemMessage and SystemModelMessage objects with provider-specific options
11
+ - Arrays of strings or system messages
12
+ - Dynamic instructions returning any SystemMessage type
13
+
14
+ - Add model fallback handlers and apis ([#7378](https://github.com/mastra-ai/mastra/pull/7378))
15
+
16
+ - Delayed streamVNext breaking change notice by 1 week ([#8121](https://github.com/mastra-ai/mastra/pull/8121))
17
+
18
+ - Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
19
+
20
+ - Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
21
+
22
+ - Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a)]:
23
+ - @mastra/core@0.0.0-fix-cloud-peer-deps-20250923194656
24
+
25
+ ## 0.18.0-alpha.3
26
+
27
+ ### Patch Changes
28
+
29
+ - Add model fallback handlers and apis ([#7378](https://github.com/mastra-ai/mastra/pull/7378))
30
+
31
+ - Delayed streamVNext breaking change notice by 1 week ([#8121](https://github.com/mastra-ai/mastra/pull/8121))
32
+
33
+ - Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
34
+
35
+ - Updated dependencies [[`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a)]:
36
+ - @mastra/core@0.18.0-alpha.3
37
+
38
+ ## 0.18.0-alpha.2
39
+
40
+ ### Patch Changes
41
+
42
+ - Allow agent instructions to accept SystemMessage types ([#7987](https://github.com/mastra-ai/mastra/pull/7987))
43
+
44
+ Agents can now use rich instruction formats beyond simple strings:
45
+ - CoreSystemMessage and SystemModelMessage objects with provider-specific options
46
+ - Arrays of strings or system messages
47
+ - Dynamic instructions returning any SystemMessage type
48
+
49
+ - Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
50
+
51
+ - Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55)]:
52
+ - @mastra/core@0.18.0-alpha.2
53
+
54
+ ## 0.17.2-alpha.1
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [[`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb)]:
59
+ - @mastra/core@0.17.2-alpha.1
60
+
61
+ ## 0.17.2-alpha.0
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [[`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad)]:
66
+ - @mastra/core@0.17.2-alpha.0
67
+
68
+ ## 0.17.1
69
+
70
+ ### Patch Changes
71
+
72
+ - fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
73
+
74
+ - Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
75
+ - @mastra/core@0.17.1
76
+
77
+ ## 0.17.1-alpha.0
78
+
79
+ ### Patch Changes
80
+
81
+ - fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
82
+
83
+ - Updated dependencies [[`fd00e63`](https://github.com/mastra-ai/mastra/commit/fd00e63759cbcca3473c40cac9843280b0557cff), [`ab610f6`](https://github.com/mastra-ai/mastra/commit/ab610f6f41dbfe6c9502368671485ca7a0aac09b), [`e6bda5f`](https://github.com/mastra-ai/mastra/commit/e6bda5f954ee8493ea18adc1a883f0a5b785ad9b)]:
84
+ - @mastra/core@0.17.1-alpha.0
85
+
86
+ ## 0.17.0
87
+
88
+ ### Minor Changes
89
+
90
+ - Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
91
+
92
+ ### Patch Changes
93
+
94
+ - Add helpful error message when trying to import from top-level import ([#7762](https://github.com/mastra-ai/mastra/pull/7762))
95
+
96
+ - Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
97
+
98
+ - Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
99
+
100
+ - Voice errors that are instance of a MastraError should not throw a 500 ([#7749](https://github.com/mastra-ai/mastra/pull/7749))
101
+
102
+ - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
103
+
104
+ - Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
105
+ - @mastra/core@0.17.0
106
+
107
+ ## 0.17.0-alpha.8
108
+
109
+ ### Patch Changes
110
+
111
+ - Updated dependencies [[`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a)]:
112
+ - @mastra/core@0.17.0-alpha.8
113
+
114
+ ## 0.17.0-alpha.7
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies [[`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689)]:
119
+ - @mastra/core@0.17.0-alpha.7
120
+
121
+ ## 0.17.0-alpha.6
122
+
123
+ ### Minor Changes
124
+
125
+ - Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
126
+
127
+ ### Patch Changes
128
+
129
+ - Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
130
+
131
+ - Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e)]:
132
+ - @mastra/core@0.17.0-alpha.6
133
+
134
+ ## 0.17.0-alpha.5
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [[`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373)]:
139
+ - @mastra/core@0.17.0-alpha.5
140
+
141
+ ## 0.17.0-alpha.4
142
+
143
+ ### Patch Changes
144
+
145
+ - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
146
+
147
+ - Updated dependencies [[`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b)]:
148
+ - @mastra/core@0.17.0-alpha.4
149
+
150
+ ## 0.17.0-alpha.3
151
+
152
+ ### Patch Changes
153
+
154
+ - Add helpful error message when trying to import from top-level import ([#7762](https://github.com/mastra-ai/mastra/pull/7762))
155
+
156
+ - Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
157
+
158
+ - Updated dependencies [[`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
159
+ - @mastra/core@0.17.0-alpha.3
160
+
161
+ ## 0.16.4-alpha.2
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies [[`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251)]:
166
+ - @mastra/core@0.16.4-alpha.2
167
+
168
+ ## 0.16.4-alpha.1
169
+
170
+ ### Patch Changes
171
+
172
+ - Updated dependencies [[`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4)]:
173
+ - @mastra/core@0.16.4-alpha.1
174
+
175
+ ## 0.16.4-alpha.0
176
+
177
+ ### Patch Changes
178
+
179
+ - Voice errors that are instance of a MastraError should not throw a 500 ([#7749](https://github.com/mastra-ai/mastra/pull/7749))
180
+
181
+ - Updated dependencies [[`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11)]:
182
+ - @mastra/core@0.16.4-alpha.0
183
+
184
+ ## 0.16.3
185
+
186
+ ### Patch Changes
187
+
188
+ - Delayed deprecation notice for streamVNext() replacing stream() until Sept 23rd ([#7739](https://github.com/mastra-ai/mastra/pull/7739))
189
+
190
+ - an part 3 ([#7705](https://github.com/mastra-ai/mastra/pull/7705))
191
+
192
+ - Update peer deps ([#7741](https://github.com/mastra-ai/mastra/pull/7741))
193
+
194
+ - Client SDK Agents, Mastra server - support runtimeContext with GET requests ([#7734](https://github.com/mastra-ai/mastra/pull/7734))
195
+
196
+ - Updated dependencies [[`b4379f7`](https://github.com/mastra-ai/mastra/commit/b4379f703fd74474f253420e8c3a684f2c4b2f8e), [`2a6585f`](https://github.com/mastra-ai/mastra/commit/2a6585f7cb71f023f805d521d1c3c95fb9a3aa59), [`3d26e83`](https://github.com/mastra-ai/mastra/commit/3d26e8353a945719028f087cc6ac4b06f0ce27d2), [`dd9119b`](https://github.com/mastra-ai/mastra/commit/dd9119b175a8f389082f75c12750e51f96d65dca), [`d34aaa1`](https://github.com/mastra-ai/mastra/commit/d34aaa1da5d3c5f991740f59e2fe6d28d3e2dd91), [`56e55d1`](https://github.com/mastra-ai/mastra/commit/56e55d1e9eb63e7d9e41aa46e012aae471256812), [`ce1e580`](https://github.com/mastra-ai/mastra/commit/ce1e580f6391e94a0c6816a9c5db0a21566a262f), [`b2babfa`](https://github.com/mastra-ai/mastra/commit/b2babfa9e75b22f2759179e71d8473f6dc5421ed), [`d8c3ba5`](https://github.com/mastra-ai/mastra/commit/d8c3ba516f4173282d293f7e64769cfc8738d360), [`a566c4e`](https://github.com/mastra-ai/mastra/commit/a566c4e92d86c1671707c54359b1d33934f7cc13), [`af333aa`](https://github.com/mastra-ai/mastra/commit/af333aa30fe6d1b127024b03a64736c46eddeca2), [`3863c52`](https://github.com/mastra-ai/mastra/commit/3863c52d44b4e5779968b802d977e87adf939d8e), [`6424c7e`](https://github.com/mastra-ai/mastra/commit/6424c7ec38b6921d66212431db1e0958f441b2a7), [`db94750`](https://github.com/mastra-ai/mastra/commit/db94750a41fd29b43eb1f7ce8e97ba8b9978c91b), [`a66a371`](https://github.com/mastra-ai/mastra/commit/a66a3716b00553d7f01842be9deb34f720b10fab), [`69fc3cd`](https://github.com/mastra-ai/mastra/commit/69fc3cd0fd814901785bdcf49bf536ab1e7fd975)]:
197
+ - @mastra/core@0.16.3
198
+
199
+ ## 0.16.3-alpha.1
200
+
201
+ ### Patch Changes
202
+
203
+ - Delayed deprecation notice for streamVNext() replacing stream() until Sept 23rd ([#7739](https://github.com/mastra-ai/mastra/pull/7739))
204
+
205
+ - Update peer deps ([#7741](https://github.com/mastra-ai/mastra/pull/7741))
206
+
207
+ - Client SDK Agents, Mastra server - support runtimeContext with GET requests ([#7734](https://github.com/mastra-ai/mastra/pull/7734))
208
+
209
+ - Updated dependencies [[`2a6585f`](https://github.com/mastra-ai/mastra/commit/2a6585f7cb71f023f805d521d1c3c95fb9a3aa59), [`3d26e83`](https://github.com/mastra-ai/mastra/commit/3d26e8353a945719028f087cc6ac4b06f0ce27d2), [`56e55d1`](https://github.com/mastra-ai/mastra/commit/56e55d1e9eb63e7d9e41aa46e012aae471256812)]:
210
+ - @mastra/core@0.16.3-alpha.1
211
+
212
+ ## 0.16.3-alpha.0
213
+
214
+ ### Patch Changes
215
+
216
+ - an part 3 ([#7705](https://github.com/mastra-ai/mastra/pull/7705))
217
+
218
+ - Updated dependencies [[`b4379f7`](https://github.com/mastra-ai/mastra/commit/b4379f703fd74474f253420e8c3a684f2c4b2f8e), [`dd9119b`](https://github.com/mastra-ai/mastra/commit/dd9119b175a8f389082f75c12750e51f96d65dca), [`d34aaa1`](https://github.com/mastra-ai/mastra/commit/d34aaa1da5d3c5f991740f59e2fe6d28d3e2dd91), [`ce1e580`](https://github.com/mastra-ai/mastra/commit/ce1e580f6391e94a0c6816a9c5db0a21566a262f), [`b2babfa`](https://github.com/mastra-ai/mastra/commit/b2babfa9e75b22f2759179e71d8473f6dc5421ed), [`d8c3ba5`](https://github.com/mastra-ai/mastra/commit/d8c3ba516f4173282d293f7e64769cfc8738d360), [`a566c4e`](https://github.com/mastra-ai/mastra/commit/a566c4e92d86c1671707c54359b1d33934f7cc13), [`af333aa`](https://github.com/mastra-ai/mastra/commit/af333aa30fe6d1b127024b03a64736c46eddeca2), [`3863c52`](https://github.com/mastra-ai/mastra/commit/3863c52d44b4e5779968b802d977e87adf939d8e), [`6424c7e`](https://github.com/mastra-ai/mastra/commit/6424c7ec38b6921d66212431db1e0958f441b2a7), [`db94750`](https://github.com/mastra-ai/mastra/commit/db94750a41fd29b43eb1f7ce8e97ba8b9978c91b), [`a66a371`](https://github.com/mastra-ai/mastra/commit/a66a3716b00553d7f01842be9deb34f720b10fab), [`69fc3cd`](https://github.com/mastra-ai/mastra/commit/69fc3cd0fd814901785bdcf49bf536ab1e7fd975)]:
219
+ - @mastra/core@0.16.3-alpha.0
9
220
 
10
221
  ## 0.16.2
11
222
 
package/README.md CHANGED
@@ -65,8 +65,3 @@ pnpm run pull:openapispec
65
65
  ```
66
66
 
67
67
  within the `@mastra/server` directory.
68
-
69
- ## License
70
-
71
- Released under the Elastic License 2.0. The full license text is available in
72
- this repository.
@@ -20,19 +20,23 @@ async function getScorersFromSystem({
20
20
  const agents = mastra.getAgents();
21
21
  const workflows = mastra.getWorkflows();
22
22
  const scorersMap = /* @__PURE__ */ new Map();
23
- for (const [_agentId, agent] of Object.entries(agents)) {
23
+ for (const [agentId, agent] of Object.entries(agents)) {
24
24
  const scorers = await agent.getScorers({
25
25
  runtimeContext
26
26
  }) || {};
27
27
  if (Object.keys(scorers).length > 0) {
28
- for (const [scorerId, scorer] of Object.entries(scorers)) {
29
- if (scorersMap.has(scorerId)) {
30
- scorersMap.get(scorerId)?.agentIds.push(agent.name);
28
+ for (const [_scorerId, scorer] of Object.entries(scorers)) {
29
+ const scorerName = scorer.scorer.name;
30
+ if (scorersMap.has(scorerName)) {
31
+ scorersMap.get(scorerName)?.agentIds.push(agentId);
32
+ scorersMap.get(scorerName)?.agentNames.push(agent.name);
31
33
  } else {
32
- scorersMap.set(scorerId, {
34
+ scorersMap.set(scorerName, {
33
35
  workflowIds: [],
34
36
  ...scorer,
35
- agentIds: [agent.name]
37
+ agentNames: [agent.name],
38
+ agentIds: [agentId],
39
+ isRegistered: false
36
40
  });
37
41
  }
38
42
  }
@@ -43,19 +47,37 @@ async function getScorersFromSystem({
43
47
  runtimeContext
44
48
  }) || {};
45
49
  if (Object.keys(scorers).length > 0) {
46
- for (const [scorerId, scorer] of Object.entries(scorers)) {
47
- if (scorersMap.has(scorerId)) {
48
- scorersMap.get(scorerId)?.workflowIds.push(workflowId);
50
+ for (const [_scorerId, scorer] of Object.entries(scorers)) {
51
+ const scorerName = scorer.scorer.name;
52
+ if (scorersMap.has(scorerName)) {
53
+ scorersMap.get(scorerName)?.workflowIds.push(workflowId);
49
54
  } else {
50
- scorersMap.set(scorerId, {
55
+ scorersMap.set(scorerName, {
51
56
  agentIds: [],
57
+ agentNames: [],
52
58
  ...scorer,
53
- workflowIds: [workflowId]
59
+ workflowIds: [workflowId],
60
+ isRegistered: false
54
61
  });
55
62
  }
56
63
  }
57
64
  }
58
65
  }
66
+ const registeredScorers = await mastra.getScorers();
67
+ for (const [_scorerId, scorer] of Object.entries(registeredScorers || {})) {
68
+ const scorerName = scorer.name;
69
+ if (scorersMap.has(scorerName)) {
70
+ scorersMap.get(scorerName).isRegistered = true;
71
+ } else {
72
+ scorersMap.set(scorerName, {
73
+ scorer,
74
+ agentIds: [],
75
+ agentNames: [],
76
+ workflowIds: [],
77
+ isRegistered: true
78
+ });
79
+ }
80
+ }
59
81
  return Object.fromEntries(scorersMap.entries());
60
82
  }
61
83
  async function getScorersHandler({ mastra, runtimeContext }) {
@@ -86,11 +108,14 @@ async function getScoresByRunIdHandler({
86
108
  pagination
87
109
  }) {
88
110
  try {
89
- const scores = await mastra.getStorage()?.getScoresByRunId?.({
111
+ const scoreResults = await mastra.getStorage()?.getScoresByRunId?.({
90
112
  runId,
91
113
  pagination
92
- }) || [];
93
- return scores;
114
+ }) || { pagination: { total: 0, page: 0, perPage: 0, hasMore: false }, scores: [] };
115
+ return {
116
+ pagination: scoreResults.pagination,
117
+ scores: scoreResults.scores.map((score) => ({ ...score, ...getTraceDetails(score.traceId) }))
118
+ };
94
119
  } catch (error) {
95
120
  return chunkRE4RPXT2_cjs.handleError(error, "Error getting scores by run id");
96
121
  }
@@ -103,13 +128,16 @@ async function getScoresByScorerIdHandler({
103
128
  entityType
104
129
  }) {
105
130
  try {
106
- const scores = await mastra.getStorage()?.getScoresByScorerId?.({
131
+ const scoreResults = await mastra.getStorage()?.getScoresByScorerId?.({
107
132
  scorerId,
108
133
  pagination,
109
134
  entityId,
110
135
  entityType
111
- }) || [];
112
- return scores;
136
+ }) || { pagination: { total: 0, page: 0, perPage: 0, hasMore: false }, scores: [] };
137
+ return {
138
+ pagination: scoreResults.pagination,
139
+ scores: scoreResults.scores.map((score) => ({ ...score, ...getTraceDetails(score.traceId) }))
140
+ };
113
141
  } catch (error) {
114
142
  return chunkRE4RPXT2_cjs.handleError(error, "Error getting scores by scorer id");
115
143
  }
@@ -129,16 +157,26 @@ async function getScoresByEntityIdHandler({
129
157
  const workflow = mastra.getWorkflowById(entityId);
130
158
  entityIdToUse = workflow.id;
131
159
  }
132
- const scores = await mastra.getStorage()?.getScoresByEntityId?.({
160
+ const scoreResults = await mastra.getStorage()?.getScoresByEntityId?.({
133
161
  entityId: entityIdToUse,
134
162
  entityType,
135
163
  pagination
136
- }) || [];
137
- return scores;
164
+ }) || { pagination: { total: 0, page: 0, perPage: 0, hasMore: false }, scores: [] };
165
+ return {
166
+ pagination: scoreResults.pagination,
167
+ scores: scoreResults.scores.map((score) => ({ ...score, ...getTraceDetails(score.traceId) }))
168
+ };
138
169
  } catch (error) {
139
170
  return chunkRE4RPXT2_cjs.handleError(error, "Error getting scores by entity id");
140
171
  }
141
172
  }
173
+ function getTraceDetails(traceIdWithSpanId) {
174
+ if (!traceIdWithSpanId) {
175
+ return {};
176
+ }
177
+ const [traceId, spanId] = traceIdWithSpanId.split("-");
178
+ return { traceId, spanId };
179
+ }
142
180
  async function saveScoreHandler({ mastra, score }) {
143
181
  try {
144
182
  const scores = await mastra.getStorage()?.saveScore?.(score) || [];
@@ -155,5 +193,5 @@ exports.getScoresByRunIdHandler = getScoresByRunIdHandler;
155
193
  exports.getScoresByScorerIdHandler = getScoresByScorerIdHandler;
156
194
  exports.saveScoreHandler = saveScoreHandler;
157
195
  exports.scores_exports = scores_exports;
158
- //# sourceMappingURL=chunk-GUI3CROV.cjs.map
159
- //# sourceMappingURL=chunk-GUI3CROV.cjs.map
196
+ //# sourceMappingURL=chunk-2GDLSAVJ.cj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AgB,iBAAA,EAA4B;AACnD,EAAA,IAAI,CAAC,iBAAA,EAAmB;AACtB,IAAA,OAAO,EAAC;AAAA,EACV;AAEA,EAAA,MAAM,CAAC,OAAA,EAAS,MAAM,CAAA,GAAI,iBAAA,CAAkB,MAAM,GAAG,CAAA;AACrD,EAAA,OAAO,EAAE,SAAS,MAAA,EAAO;AAC3B;AAEA,eAAsB,gBAAA,CAAiB,EAAE,MAAA,EAAQ,KAAA,EAAM,EAAsC;AAC3F,EAAA,IAAI;AACF,IAAA,MAAM,MAAA,GAAU,MAAM,MAAA,CAAO,UAAA,IAAc,SAAA,GAAY,KAAK,KAAM,EAAC;AACnE,IAAA,OAAO,MAAA;AAAA,EACT,SAAS,KAAA,EAAO;AACd,IAAA,OAAOA,6BAAA,CAAY,OAAO,oBAAoB,CAAA;AAAA,EAChD;AACF","file":"chunk-2GDLSAVJ.cjs","sourcesContent":["import type { RuntimeContext } from '@mastra/core/runtime-context';\nimport type { MastraScorerEntry, ScoreRowData } from '@mastra/core/scores';\nimport type { StoragePagination } from '@mastra/core/storage';\nimport type { Context } from '../types';\nimport { handleError } from './error';\n\nasync function getScorersFromSystem({\n mastra,\n runtimeContext,\n}: Context & {\n runtimeContext: RuntimeContext;\n}) {\n const agents = mastra.getAgents();\n const workflows = mastra.getWorkflows();\n\n const scorersMap = new Map<\n string,\n MastraScorerEntry & { agentIds: string[]; agentNames: string[]; workflowIds: string[]; isRegistered: boolean }\n >();\n\n for (const [agentId, agent] of Object.entries(agents)) {\n const scorers =\n (await agent.getScorers({\n runtimeContext,\n })) || {};\n\n if (Object.keys(scorers).length > 0) {\n for (const [_scorerId, scorer] of Object.entries(scorers)) {\n const scorerName = scorer.scorer.name;\n if (scorersMap.has(scorerName)) {\n scorersMap.get(scorerName)?.agentIds.push(agentId);\n scorersMap.get(scorerName)?.agentNames.push(agent.name);\n } else {\n scorersMap.set(scorerName, {\n workflowIds: [],\n ...scorer,\n agentNames: [agent.name],\n agentIds: [agentId],\n isRegistered: false,\n });\n }\n }\n }\n }\n\n for (const [workflowId, workflow] of Object.entries(workflows)) {\n const scorers =\n (await workflow.getScorers({\n runtimeContext,\n })) || {};\n\n if (Object.keys(scorers).length > 0) {\n for (const [_scorerId, scorer] of Object.entries(scorers)) {\n const scorerName = scorer.scorer.name;\n if (scorersMap.has(scorerName)) {\n scorersMap.get(scorerName)?.workflowIds.push(workflowId);\n } else {\n scorersMap.set(scorerName, {\n agentIds: [],\n agentNames: [],\n ...scorer,\n workflowIds: [workflowId],\n isRegistered: false,\n });\n }\n }\n }\n }\n\n const registeredScorers = await mastra.getScorers();\n for (const [_scorerId, scorer] of Object.entries(registeredScorers || {})) {\n const scorerName = scorer.name;\n if (scorersMap.has(scorerName)) {\n scorersMap.get(scorerName)!.isRegistered = true;\n } else {\n scorersMap.set(scorerName, {\n scorer: scorer,\n agentIds: [],\n agentNames: [],\n workflowIds: [],\n isRegistered: true,\n });\n }\n }\n\n return Object.fromEntries(scorersMap.entries());\n}\n\nexport async function getScorersHandler({ mastra, runtimeContext }: Context & { runtimeContext: RuntimeContext }) {\n const scorers = await getScorersFromSystem({\n mastra,\n runtimeContext,\n });\n\n return scorers;\n}\n\nexport async function getScorerHandler({\n mastra,\n scorerId,\n runtimeContext,\n}: Context & { scorerId: string; runtimeContext: RuntimeContext }) {\n const scorers = await getScorersFromSystem({\n mastra,\n runtimeContext,\n });\n\n const scorer = scorers[scorerId];\n\n if (!scorer) {\n return null;\n }\n\n return scorer;\n}\n\nexport async function getScoresByRunIdHandler({\n mastra,\n runId,\n pagination,\n}: Context & { runId: string; pagination: StoragePagination }) {\n try {\n const scoreResults = (await mastra.getStorage()?.getScoresByRunId?.({\n runId,\n pagination,\n })) || { pagination: { total: 0, page: 0, perPage: 0, hasMore: false }, scores: [] };\n return {\n pagination: scoreResults.pagination,\n scores: scoreResults.scores.map(score => ({ ...score, ...getTraceDetails(score.traceId) })),\n };\n } catch (error) {\n return handleError(error, 'Error getting scores by run id');\n }\n}\n\nexport async function getScoresByScorerIdHandler({\n mastra,\n scorerId,\n pagination,\n entityId,\n entityType,\n}: Context & { scorerId: string; pagination: StoragePagination; entityId?: string; entityType?: string }) {\n try {\n const scoreResults = (await mastra.getStorage()?.getScoresByScorerId?.({\n scorerId,\n pagination,\n entityId,\n entityType,\n })) || { pagination: { total: 0, page: 0, perPage: 0, hasMore: false }, scores: [] };\n return {\n pagination: scoreResults.pagination,\n scores: scoreResults.scores.map(score => ({ ...score, ...getTraceDetails(score.traceId) })),\n };\n } catch (error) {\n return handleError(error, 'Error getting scores by scorer id');\n }\n}\n\nexport async function getScoresByEntityIdHandler({\n mastra,\n entityId,\n entityType,\n pagination,\n}: Context & { entityId: string; entityType: string; pagination: StoragePagination }) {\n try {\n let entityIdToUse = entityId;\n\n if (entityType === 'AGENT') {\n const agent = mastra.getAgentById(entityId);\n entityIdToUse = agent.id;\n } else if (entityType === 'WORKFLOW') {\n const workflow = mastra.getWorkflowById(entityId);\n entityIdToUse = workflow.id;\n }\n\n const scoreResults = (await mastra.getStorage()?.getScoresByEntityId?.({\n entityId: entityIdToUse,\n entityType,\n pagination,\n })) || { pagination: { total: 0, page: 0, perPage: 0, hasMore: false }, scores: [] };\n\n return {\n pagination: scoreResults.pagination,\n scores: scoreResults.scores.map(score => ({ ...score, ...getTraceDetails(score.traceId) })),\n };\n } catch (error) {\n return handleError(error, 'Error getting scores by entity id');\n }\n}\n\nfunction getTraceDetails(traceIdWithSpanId?: string) {\n if (!traceIdWithSpanId) {\n return {};\n }\n\n const [traceId, spanId] = traceIdWithSpanId.split('-');\n return { traceId, spanId };\n}\n\nexport async function saveScoreHandler({ mastra, score }: Context & { score: ScoreRowData }) {\n try {\n const scores = (await mastra.getStorage()?.saveScore?.(score)) || [];\n return scores;\n } catch (error) {\n return handleError(error, 'Error saving score');\n }\n}\n"]}