@mastra/server 0.0.0-remove-unused-import-20250909212718 → 0.0.0-roamin-openaivoice-speak-options-passing-20250926163614

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 +268 -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-R7NOGUZG.js → chunk-5KRXONRF.js} +43 -4
  6. package/dist/chunk-5KRXONRF.js.map +1 -0
  7. package/dist/{chunk-L265APUD.cjs → chunk-5N724Q2T.cjs} +43 -3
  8. package/dist/chunk-5N724Q2T.cjs.map +1 -0
  9. package/dist/{chunk-5QUKZCEF.js → chunk-6IJWRJZE.js} +4 -3
  10. package/dist/chunk-6IJWRJZE.js.map +1 -0
  11. package/dist/{chunk-M2YFWHSB.js → chunk-BOVFMBXY.js} +231 -79
  12. package/dist/chunk-BOVFMBXY.js.map +1 -0
  13. package/dist/{chunk-6LUKYSWE.cjs → chunk-CML3EOO5.cjs} +96 -119
  14. package/dist/chunk-CML3EOO5.cjs.map +1 -0
  15. package/dist/{chunk-7QEJ5QG5.js → chunk-IYJW2OVQ.js} +60 -22
  16. package/dist/chunk-IYJW2OVQ.js.map +1 -0
  17. package/dist/{chunk-A75S4TDD.js → chunk-JRDEOHAJ.js} +19 -11
  18. package/dist/chunk-JRDEOHAJ.js.map +1 -0
  19. package/dist/{chunk-SYRRSBGL.js → chunk-KM7EJKXV.js} +8 -4
  20. package/dist/chunk-KM7EJKXV.js.map +1 -0
  21. package/dist/{chunk-J7BPKKOG.cjs → chunk-LJFAAEU7.cjs} +8 -4
  22. package/dist/chunk-LJFAAEU7.cjs.map +1 -0
  23. package/dist/{chunk-MLGHQDZZ.js → chunk-N5ID53SA.js} +174 -133
  24. package/dist/chunk-N5ID53SA.js.map +1 -0
  25. package/dist/{chunk-B2V3PUB7.js → chunk-NH7XUTIO.js} +93 -116
  26. package/dist/chunk-NH7XUTIO.js.map +1 -0
  27. package/dist/{chunk-WZC6CIVD.cjs → chunk-NLWACBE7.cjs} +19 -11
  28. package/dist/chunk-NLWACBE7.cjs.map +1 -0
  29. package/dist/{chunk-3THIIWWW.cjs → chunk-OPI3FZYH.cjs} +4 -3
  30. package/dist/chunk-OPI3FZYH.cjs.map +1 -0
  31. package/dist/{chunk-YITREQVN.cjs → chunk-QNWXF57L.cjs} +193 -152
  32. package/dist/chunk-QNWXF57L.cjs.map +1 -0
  33. package/dist/{chunk-RW2D3G4K.cjs → chunk-SXENNNR7.cjs} +233 -78
  34. package/dist/chunk-SXENNNR7.cjs.map +1 -0
  35. package/dist/chunk-VY4ENABS.cjs +135 -0
  36. package/dist/chunk-VY4ENABS.cjs.map +1 -0
  37. package/dist/chunk-YWOK4F5A.js +131 -0
  38. package/dist/chunk-YWOK4F5A.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 +64 -8
  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 +77 -10
  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-3THIIWWW.cjs.map +0 -1
  83. package/dist/chunk-5QUKZCEF.js.map +0 -1
  84. package/dist/chunk-6LUKYSWE.cjs.map +0 -1
  85. package/dist/chunk-7QEJ5QG5.js.map +0 -1
  86. package/dist/chunk-A75S4TDD.js.map +0 -1
  87. package/dist/chunk-B2V3PUB7.js.map +0 -1
  88. package/dist/chunk-GUI3CROV.cjs.map +0 -1
  89. package/dist/chunk-IY34NOLA.cjs +0 -150
  90. package/dist/chunk-IY34NOLA.cjs.map +0 -1
  91. package/dist/chunk-J7BPKKOG.cjs.map +0 -1
  92. package/dist/chunk-L265APUD.cjs.map +0 -1
  93. package/dist/chunk-M2YFWHSB.js.map +0 -1
  94. package/dist/chunk-MLGHQDZZ.js.map +0 -1
  95. package/dist/chunk-R7NOGUZG.js.map +0 -1
  96. package/dist/chunk-RW2D3G4K.cjs.map +0 -1
  97. package/dist/chunk-SYRRSBGL.js.map +0 -1
  98. package/dist/chunk-U46VIX2V.js +0 -144
  99. package/dist/chunk-U46VIX2V.js.map +0 -1
  100. package/dist/chunk-WZC6CIVD.cjs.map +0 -1
  101. package/dist/chunk-YITREQVN.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,6 +1,264 @@
1
1
  # @mastra/server
2
2
 
3
- ## 0.0.0-remove-unused-import-20250909212718
3
+ ## 0.0.0-roamin-openaivoice-speak-options-passing-20250926163614
4
+
5
+ ### Patch Changes
6
+
7
+ - add a way to hide the deploy mastra cloud button ([#8137](https://github.com/mastra-ai/mastra/pull/8137))
8
+
9
+ - Add types in the streamVNext codepath, fixes for various issues across multiple packages surfaced from type issues, align return types. ([#8010](https://github.com/mastra-ai/mastra/pull/8010))
10
+
11
+ - When step is created from agent or tool, add the description and component key to show that ([#8151](https://github.com/mastra-ai/mastra/pull/8151))
12
+
13
+ - Updated dependencies [[`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`809eea0`](https://github.com/mastra-ai/mastra/commit/809eea092fa80c3f69b9eaf078d843b57fd2a88e), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`db1891a`](https://github.com/mastra-ai/mastra/commit/db1891a4707443720b7cd8a260dc7e1d49b3609c), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5)]:
14
+ - @mastra/core@0.0.0-roamin-openaivoice-speak-options-passing-20250926163614
15
+
16
+ ## 0.18.1-alpha.0
17
+
18
+ ### Patch Changes
19
+
20
+ - add a way to hide the deploy mastra cloud button ([#8137](https://github.com/mastra-ai/mastra/pull/8137))
21
+
22
+ - Add types in the streamVNext codepath, fixes for various issues across multiple packages surfaced from type issues, align return types. ([#8010](https://github.com/mastra-ai/mastra/pull/8010))
23
+
24
+ - When step is created from agent or tool, add the description and component key to show that ([#8151](https://github.com/mastra-ai/mastra/pull/8151))
25
+
26
+ - Updated dependencies [[`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5)]:
27
+ - @mastra/core@0.18.1-alpha.0
28
+
29
+ ## 0.18.0
30
+
31
+ ### Patch Changes
32
+
33
+ - Allow agent instructions to accept SystemMessage types ([#7987](https://github.com/mastra-ai/mastra/pull/7987))
34
+
35
+ Agents can now use rich instruction formats beyond simple strings:
36
+ - CoreSystemMessage and SystemModelMessage objects with provider-specific options
37
+ - Arrays of strings or system messages
38
+ - Dynamic instructions returning any SystemMessage type
39
+
40
+ - Add model fallback handlers and apis ([#7378](https://github.com/mastra-ai/mastra/pull/7378))
41
+
42
+ - Delayed streamVNext breaking change notice by 1 week ([#8121](https://github.com/mastra-ai/mastra/pull/8121))
43
+
44
+ - Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
45
+
46
+ - Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
47
+
48
+ - 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)]:
49
+ - @mastra/core@0.18.0
50
+
51
+ ## 0.18.0-alpha.3
52
+
53
+ ### Patch Changes
54
+
55
+ - Add model fallback handlers and apis ([#7378](https://github.com/mastra-ai/mastra/pull/7378))
56
+
57
+ - Delayed streamVNext breaking change notice by 1 week ([#8121](https://github.com/mastra-ai/mastra/pull/8121))
58
+
59
+ - Add server api to score traces ([#8064](https://github.com/mastra-ai/mastra/pull/8064))
60
+
61
+ - 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)]:
62
+ - @mastra/core@0.18.0-alpha.3
63
+
64
+ ## 0.18.0-alpha.2
65
+
66
+ ### Patch Changes
67
+
68
+ - Allow agent instructions to accept SystemMessage types ([#7987](https://github.com/mastra-ai/mastra/pull/7987))
69
+
70
+ Agents can now use rich instruction formats beyond simple strings:
71
+ - CoreSystemMessage and SystemModelMessage objects with provider-specific options
72
+ - Arrays of strings or system messages
73
+ - Dynamic instructions returning any SystemMessage type
74
+
75
+ - Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
76
+
77
+ - 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)]:
78
+ - @mastra/core@0.18.0-alpha.2
79
+
80
+ ## 0.17.2-alpha.1
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [[`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb)]:
85
+ - @mastra/core@0.17.2-alpha.1
86
+
87
+ ## 0.17.2-alpha.0
88
+
89
+ ### Patch Changes
90
+
91
+ - 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)]:
92
+ - @mastra/core@0.17.2-alpha.0
93
+
94
+ ## 0.17.1
95
+
96
+ ### Patch Changes
97
+
98
+ - fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
99
+
100
+ - 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)]:
101
+ - @mastra/core@0.17.1
102
+
103
+ ## 0.17.1-alpha.0
104
+
105
+ ### Patch Changes
106
+
107
+ - fix workflow resuming issue in the playground ([#7988](https://github.com/mastra-ai/mastra/pull/7988))
108
+
109
+ - 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)]:
110
+ - @mastra/core@0.17.1-alpha.0
111
+
112
+ ## 0.17.0
113
+
114
+ ### Minor Changes
115
+
116
+ - Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
117
+
118
+ ### Patch Changes
119
+
120
+ - Add helpful error message when trying to import from top-level import ([#7762](https://github.com/mastra-ai/mastra/pull/7762))
121
+
122
+ - Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
123
+
124
+ - Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
125
+
126
+ - Voice errors that are instance of a MastraError should not throw a 500 ([#7749](https://github.com/mastra-ai/mastra/pull/7749))
127
+
128
+ - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
129
+
130
+ - 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)]:
131
+ - @mastra/core@0.17.0
132
+
133
+ ## 0.17.0-alpha.8
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [[`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a)]:
138
+ - @mastra/core@0.17.0-alpha.8
139
+
140
+ ## 0.17.0-alpha.7
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies [[`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689)]:
145
+ - @mastra/core@0.17.0-alpha.7
146
+
147
+ ## 0.17.0-alpha.6
148
+
149
+ ### Minor Changes
150
+
151
+ - Remove original AgentNetwork ([#7919](https://github.com/mastra-ai/mastra/pull/7919))
152
+
153
+ ### Patch Changes
154
+
155
+ - Resumable streams ([#7949](https://github.com/mastra-ai/mastra/pull/7949))
156
+
157
+ - 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)]:
158
+ - @mastra/core@0.17.0-alpha.6
159
+
160
+ ## 0.17.0-alpha.5
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [[`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373)]:
165
+ - @mastra/core@0.17.0-alpha.5
166
+
167
+ ## 0.17.0-alpha.4
168
+
169
+ ### Patch Changes
170
+
171
+ - Update package.json and README ([#7886](https://github.com/mastra-ai/mastra/pull/7886))
172
+
173
+ - 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)]:
174
+ - @mastra/core@0.17.0-alpha.4
175
+
176
+ ## 0.17.0-alpha.3
177
+
178
+ ### Patch Changes
179
+
180
+ - Add helpful error message when trying to import from top-level import ([#7762](https://github.com/mastra-ai/mastra/pull/7762))
181
+
182
+ - Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
183
+
184
+ - 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)]:
185
+ - @mastra/core@0.17.0-alpha.3
186
+
187
+ ## 0.16.4-alpha.2
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [[`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251)]:
192
+ - @mastra/core@0.16.4-alpha.2
193
+
194
+ ## 0.16.4-alpha.1
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [[`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4)]:
199
+ - @mastra/core@0.16.4-alpha.1
200
+
201
+ ## 0.16.4-alpha.0
202
+
203
+ ### Patch Changes
204
+
205
+ - Voice errors that are instance of a MastraError should not throw a 500 ([#7749](https://github.com/mastra-ai/mastra/pull/7749))
206
+
207
+ - 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)]:
208
+ - @mastra/core@0.16.4-alpha.0
209
+
210
+ ## 0.16.3
211
+
212
+ ### Patch Changes
213
+
214
+ - Delayed deprecation notice for streamVNext() replacing stream() until Sept 23rd ([#7739](https://github.com/mastra-ai/mastra/pull/7739))
215
+
216
+ - an part 3 ([#7705](https://github.com/mastra-ai/mastra/pull/7705))
217
+
218
+ - Update peer deps ([#7741](https://github.com/mastra-ai/mastra/pull/7741))
219
+
220
+ - Client SDK Agents, Mastra server - support runtimeContext with GET requests ([#7734](https://github.com/mastra-ai/mastra/pull/7734))
221
+
222
+ - 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)]:
223
+ - @mastra/core@0.16.3
224
+
225
+ ## 0.16.3-alpha.1
226
+
227
+ ### Patch Changes
228
+
229
+ - Delayed deprecation notice for streamVNext() replacing stream() until Sept 23rd ([#7739](https://github.com/mastra-ai/mastra/pull/7739))
230
+
231
+ - Update peer deps ([#7741](https://github.com/mastra-ai/mastra/pull/7741))
232
+
233
+ - Client SDK Agents, Mastra server - support runtimeContext with GET requests ([#7734](https://github.com/mastra-ai/mastra/pull/7734))
234
+
235
+ - 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)]:
236
+ - @mastra/core@0.16.3-alpha.1
237
+
238
+ ## 0.16.3-alpha.0
239
+
240
+ ### Patch Changes
241
+
242
+ - an part 3 ([#7705](https://github.com/mastra-ai/mastra/pull/7705))
243
+
244
+ - 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)]:
245
+ - @mastra/core@0.16.3-alpha.0
246
+
247
+ ## 0.16.2
248
+
249
+ ### Patch Changes
250
+
251
+ - Updated dependencies [[`61926ef`](https://github.com/mastra-ai/mastra/commit/61926ef40d415b805a63527cffe27a50542e15e5)]:
252
+ - @mastra/core@0.16.2
253
+
254
+ ## 0.16.2-alpha.0
255
+
256
+ ### Patch Changes
257
+
258
+ - Updated dependencies [[`61926ef`](https://github.com/mastra-ai/mastra/commit/61926ef40d415b805a63527cffe27a50542e15e5)]:
259
+ - @mastra/core@0.16.2-alpha.0
260
+
261
+ ## 0.16.1
4
262
 
5
263
  ### Patch Changes
6
264
 
@@ -8,8 +266,15 @@
8
266
 
9
267
  - Fix a bug where `typescript` was bundled into `dist` ([#7585](https://github.com/mastra-ai/mastra/pull/7585))
10
268
 
11
- - Updated dependencies [[`47b6dc9`](https://github.com/mastra-ai/mastra/commit/47b6dc94f4976d4f3d3882e8f19eb365bbc5976c), [`827d876`](https://github.com/mastra-ai/mastra/commit/827d8766f36a900afcaf64a040f7ba76249009b3), [`0662d02`](https://github.com/mastra-ai/mastra/commit/0662d02ef16916e67531890639fcd72c69cfb6e2), [`565d65f`](https://github.com/mastra-ai/mastra/commit/565d65fc16314a99f081975ec92f2636dff0c86d), [`6189844`](https://github.com/mastra-ai/mastra/commit/61898448e65bda02bb814fb15801a89dc6476938), [`4da3d68`](https://github.com/mastra-ai/mastra/commit/4da3d68a778e5c4d5a17351ef223289fe2f45a45), [`fd9bbfe`](https://github.com/mastra-ai/mastra/commit/fd9bbfee22484f8493582325f53e8171bf8e682b), [`7eaf1d1`](https://github.com/mastra-ai/mastra/commit/7eaf1d1cec7e828d7a98efc2a748ac395bbdba3b), [`d7a8f59`](https://github.com/mastra-ai/mastra/commit/d7a8f59154b0621aec4f41a6b2ea2b3882f03cb7), [`0b0bbb2`](https://github.com/mastra-ai/mastra/commit/0b0bbb24f4198ead69792e92b68a350f52b45cf3), [`d951f41`](https://github.com/mastra-ai/mastra/commit/d951f41771e4e5da8da4b9f870949f9509e38756), [`4dda259`](https://github.com/mastra-ai/mastra/commit/4dda2593b6343f9258671de5fb237aeba3ef6bb7), [`8049e2e`](https://github.com/mastra-ai/mastra/commit/8049e2e8cce80a00353c64894c62b695ac34e35e), [`f3427cd`](https://github.com/mastra-ai/mastra/commit/f3427cdaf9eecd63360dfc897a4acbf5f4143a4e), [`defed1c`](https://github.com/mastra-ai/mastra/commit/defed1ca8040cc8d42e645c5a50a1bc52a4918d7), [`6991ced`](https://github.com/mastra-ai/mastra/commit/6991cedcb5a44a49d9fe58ef67926e1f96ba55b1), [`9cb9c42`](https://github.com/mastra-ai/mastra/commit/9cb9c422854ee81074989dd2d8dccc0500ba8d3e), [`8334859`](https://github.com/mastra-ai/mastra/commit/83348594d4f37b311ba4a94d679c5f8721d796d4), [`05f13b8`](https://github.com/mastra-ai/mastra/commit/05f13b8fb269ccfc4de98e9db58dbe16eae55a5e)]:
12
- - @mastra/core@0.0.0-remove-unused-import-20250909212718
269
+ - Updated dependencies [[`47b6dc9`](https://github.com/mastra-ai/mastra/commit/47b6dc94f4976d4f3d3882e8f19eb365bbc5976c), [`827d876`](https://github.com/mastra-ai/mastra/commit/827d8766f36a900afcaf64a040f7ba76249009b3), [`0662d02`](https://github.com/mastra-ai/mastra/commit/0662d02ef16916e67531890639fcd72c69cfb6e2), [`565d65f`](https://github.com/mastra-ai/mastra/commit/565d65fc16314a99f081975ec92f2636dff0c86d), [`6189844`](https://github.com/mastra-ai/mastra/commit/61898448e65bda02bb814fb15801a89dc6476938), [`4da3d68`](https://github.com/mastra-ai/mastra/commit/4da3d68a778e5c4d5a17351ef223289fe2f45a45), [`fd9bbfe`](https://github.com/mastra-ai/mastra/commit/fd9bbfee22484f8493582325f53e8171bf8e682b), [`7eaf1d1`](https://github.com/mastra-ai/mastra/commit/7eaf1d1cec7e828d7a98efc2a748ac395bbdba3b), [`6f046b5`](https://github.com/mastra-ai/mastra/commit/6f046b5ccc5c8721302a9a61d5d16c12374cc8d7), [`d7a8f59`](https://github.com/mastra-ai/mastra/commit/d7a8f59154b0621aec4f41a6b2ea2b3882f03cb7), [`0b0bbb2`](https://github.com/mastra-ai/mastra/commit/0b0bbb24f4198ead69792e92b68a350f52b45cf3), [`d951f41`](https://github.com/mastra-ai/mastra/commit/d951f41771e4e5da8da4b9f870949f9509e38756), [`4dda259`](https://github.com/mastra-ai/mastra/commit/4dda2593b6343f9258671de5fb237aeba3ef6bb7), [`8049e2e`](https://github.com/mastra-ai/mastra/commit/8049e2e8cce80a00353c64894c62b695ac34e35e), [`f3427cd`](https://github.com/mastra-ai/mastra/commit/f3427cdaf9eecd63360dfc897a4acbf5f4143a4e), [`defed1c`](https://github.com/mastra-ai/mastra/commit/defed1ca8040cc8d42e645c5a50a1bc52a4918d7), [`6991ced`](https://github.com/mastra-ai/mastra/commit/6991cedcb5a44a49d9fe58ef67926e1f96ba55b1), [`9cb9c42`](https://github.com/mastra-ai/mastra/commit/9cb9c422854ee81074989dd2d8dccc0500ba8d3e), [`8334859`](https://github.com/mastra-ai/mastra/commit/83348594d4f37b311ba4a94d679c5f8721d796d4), [`05f13b8`](https://github.com/mastra-ai/mastra/commit/05f13b8fb269ccfc4de98e9db58dbe16eae55a5e)]:
270
+ - @mastra/core@0.16.1
271
+
272
+ ## 0.16.1-alpha.3
273
+
274
+ ### Patch Changes
275
+
276
+ - Updated dependencies [[`fd9bbfe`](https://github.com/mastra-ai/mastra/commit/fd9bbfee22484f8493582325f53e8171bf8e682b)]:
277
+ - @mastra/core@0.16.1-alpha.3
13
278
 
14
279
  ## 0.16.1-alpha.2
15
280
 
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.cjs.map
197
+ //# sourceMappingURL=chunk-2GDLSAVJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server/handlers/scores.ts"],"names":["__export","handleError"],"mappings":";;;;;;AAAA,IAAA,cAAA,GAAA;AAAAA,0BAAA,CAAA,cAAA,EAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,iBAAA,EAAA,MAAA,iB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AAE,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"]}
@@ -1,12 +1,14 @@
1
1
  import { handleError } from './chunk-CY4TP3FK.js';
2
2
  import { HTTPException } from './chunk-MMROOK5J.js';
3
3
  import { __export } from './chunk-G3PMV62Z.js';
4
+ import { scoreTraces } from '@mastra/core/scores/scoreTraces';
4
5
 
5
6
  // src/server/handlers/observability.ts
6
7
  var observability_exports = {};
7
8
  __export(observability_exports, {
8
9
  getAITraceHandler: () => getAITraceHandler,
9
- getAITracesPaginatedHandler: () => getAITracesPaginatedHandler
10
+ getAITracesPaginatedHandler: () => getAITracesPaginatedHandler,
11
+ scoreTracesHandler: () => scoreTracesHandler
10
12
  });
11
13
  async function getAITraceHandler({ mastra, traceId }) {
12
14
  try {
@@ -59,7 +61,44 @@ async function getAITracesPaginatedHandler({ mastra, body }) {
59
61
  handleError(error, "Error getting AI traces paginated");
60
62
  }
61
63
  }
64
+ async function scoreTracesHandler({ mastra, body }) {
65
+ try {
66
+ if (!body) {
67
+ throw new HTTPException(400, { message: "Request body is required" });
68
+ }
69
+ const { scorerName, targets } = body;
70
+ if (!scorerName) {
71
+ throw new HTTPException(400, { message: "Scorer Name is required" });
72
+ }
73
+ if (!targets || targets.length === 0) {
74
+ throw new HTTPException(400, { message: "At least one target is required" });
75
+ }
76
+ const storage = mastra.getStorage();
77
+ if (!storage) {
78
+ throw new HTTPException(500, { message: "Storage is not available" });
79
+ }
80
+ const scorer = mastra.getScorerByName(scorerName);
81
+ if (!scorer) {
82
+ throw new HTTPException(404, { message: `Scorer '${scorerName}' not found` });
83
+ }
84
+ const logger = mastra.getLogger();
85
+ scoreTraces({
86
+ scorerName,
87
+ targets,
88
+ mastra
89
+ }).catch((error) => {
90
+ logger?.error(`Background trace scoring failed: ${error.message}`, error);
91
+ });
92
+ return {
93
+ status: "success",
94
+ message: `Scoring started for ${targets.length} ${targets.length === 1 ? "trace" : "traces"}`,
95
+ traceCount: targets.length
96
+ };
97
+ } catch (error) {
98
+ handleError(error, "Error processing trace scoring");
99
+ }
100
+ }
62
101
 
63
- export { getAITraceHandler, getAITracesPaginatedHandler, observability_exports };
64
- //# sourceMappingURL=chunk-R7NOGUZG.js.map
65
- //# sourceMappingURL=chunk-R7NOGUZG.js.map
102
+ export { getAITraceHandler, getAITracesPaginatedHandler, observability_exports, scoreTracesHandler };
103
+ //# sourceMappingURL=chunk-5KRXONRF.js.map
104
+ //# sourceMappingURL=chunk-5KRXONRF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server/handlers/observability.ts"],"names":[],"mappings":";;;;;;AAAA,IAAA,qBAAA,GAAA;AAAA,QAAA,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C3F,YAAY,OAAA,CAAQ;AAAA,KACtB;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,WAAA,CAAY,OAAO,gCAAgC,CAAA;AAAA,EACrD;AACF","file":"chunk-5KRXONRF.js","sourcesContent":["import type { AITracesPaginatedArg } from '@mastra/core';\nimport { scoreTraces } from '@mastra/core/scores/scoreTraces';\nimport { HTTPException } from '../http-exception';\nimport type { Context } from '../types';\nimport { handleError } from './error';\n\ninterface ObservabilityContext extends Context {\n traceId?: string;\n body?: AITracesPaginatedArg;\n}\n\ninterface ScoreTracesContext extends Context {\n body?: {\n scorerName: string;\n targets: Array<{\n traceId: string;\n spanId?: string;\n }>;\n };\n}\n\n/**\n * Get a complete AI trace by trace ID\n * Returns all spans in the trace with their parent-child relationships\n */\nexport async function getAITraceHandler({ mastra, traceId }: ObservabilityContext & { traceId: string }) {\n try {\n if (!traceId) {\n throw new HTTPException(400, { message: 'Trace ID is required' });\n }\n\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n const trace = await storage.getAITrace(traceId);\n\n if (!trace) {\n throw new HTTPException(404, { message: `Trace with ID '${traceId}' not found` });\n }\n\n return trace;\n } catch (error) {\n handleError(error, 'Error getting AI trace');\n }\n}\n\n/**\n * Get paginated AI traces with filtering and pagination\n * Returns only root spans (parent spans) for pagination, not child spans\n */\nexport async function getAITracesPaginatedHandler({ mastra, body }: ObservabilityContext) {\n try {\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n if (!body) {\n throw new HTTPException(400, { message: 'Request body is required' });\n }\n\n const { filters, pagination } = body;\n\n if (pagination?.page && pagination.page < 0) {\n throw new HTTPException(400, { message: 'Page must be a non-negative integer' });\n }\n\n if (pagination?.perPage && pagination.perPage < 0) {\n throw new HTTPException(400, { message: 'Per page must be a non-negative integer' });\n }\n\n if (pagination?.dateRange) {\n const { start, end } = pagination.dateRange;\n\n if (start && !(start instanceof Date)) {\n throw new HTTPException(400, { message: 'Invalid date format in date range' });\n }\n\n if (end && !(end instanceof Date)) {\n throw new HTTPException(400, { message: 'Invalid date format in date range' });\n }\n }\n\n return storage.getAITracesPaginated({\n pagination,\n filters,\n });\n } catch (error) {\n handleError(error, 'Error getting AI traces paginated');\n }\n}\n\n/**\n * Score traces using a specified scorer\n * Fire-and-forget approach - returns immediately while scoring runs in background\n */\nexport async function scoreTracesHandler({ mastra, body }: ScoreTracesContext) {\n try {\n if (!body) {\n throw new HTTPException(400, { message: 'Request body is required' });\n }\n\n const { scorerName, targets } = body;\n\n if (!scorerName) {\n throw new HTTPException(400, { message: 'Scorer Name is required' });\n }\n\n if (!targets || targets.length === 0) {\n throw new HTTPException(400, { message: 'At least one target is required' });\n }\n\n const storage = mastra.getStorage();\n if (!storage) {\n throw new HTTPException(500, { message: 'Storage is not available' });\n }\n\n const scorer = mastra.getScorerByName(scorerName);\n if (!scorer) {\n throw new HTTPException(404, { message: `Scorer '${scorerName}' not found` });\n }\n\n const logger = mastra.getLogger();\n scoreTraces({\n scorerName,\n targets,\n mastra,\n }).catch(error => {\n logger?.error(`Background trace scoring failed: ${error.message}`, error);\n });\n\n // Return immediate response\n return {\n status: 'success',\n message: `Scoring started for ${targets.length} ${targets.length === 1 ? 'trace' : 'traces'}`,\n traceCount: targets.length,\n };\n } catch (error) {\n handleError(error, 'Error processing trace scoring');\n }\n}\n"]}