@mastra/server 0.0.0-fix-request-context-as-query-key-20251209093005 → 0.0.0-fix-prompt-enhance-route-20251210210827

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 (84) hide show
  1. package/CHANGELOG.md +66 -3
  2. package/dist/{chunk-7N3PD4SV.js → chunk-6V57U52D.js} +3 -3
  3. package/dist/{chunk-7N3PD4SV.js.map → chunk-6V57U52D.js.map} +1 -1
  4. package/dist/{chunk-C4J473OZ.js → chunk-ACZ2PUKX.js} +51 -7
  5. package/dist/chunk-ACZ2PUKX.js.map +1 -0
  6. package/dist/{chunk-X4QMPCTP.cjs → chunk-BMYZ4DO6.cjs} +12 -2
  7. package/dist/chunk-BMYZ4DO6.cjs.map +1 -0
  8. package/dist/{chunk-DHWPHLGF.cjs → chunk-BNGT3NIC.cjs} +14 -14
  9. package/dist/{chunk-DHWPHLGF.cjs.map → chunk-BNGT3NIC.cjs.map} +1 -1
  10. package/dist/{chunk-ESZ6V5WB.cjs → chunk-C3UIIRAT.cjs} +8 -4
  11. package/dist/chunk-C3UIIRAT.cjs.map +1 -0
  12. package/dist/{chunk-F4H7J6YV.cjs → chunk-IPXCJ2HO.cjs} +38 -8
  13. package/dist/chunk-IPXCJ2HO.cjs.map +1 -0
  14. package/dist/{chunk-WE4USCF3.js → chunk-KPSSRYGH.js} +11 -3
  15. package/dist/{chunk-X4QMPCTP.cjs.map → chunk-KPSSRYGH.js.map} +1 -1
  16. package/dist/{chunk-TKL4TD2V.js → chunk-LNCCLJQ6.js} +34 -5
  17. package/dist/chunk-LNCCLJQ6.js.map +1 -0
  18. package/dist/{chunk-US6Y5RLR.cjs → chunk-LQSZ4FJJ.cjs} +21 -21
  19. package/dist/{chunk-US6Y5RLR.cjs.map → chunk-LQSZ4FJJ.cjs.map} +1 -1
  20. package/dist/{chunk-UTIOKR5C.js → chunk-MQLS6Z7A.js} +8 -4
  21. package/dist/chunk-MQLS6Z7A.js.map +1 -0
  22. package/dist/{chunk-LBSJWPXK.cjs → chunk-PUFCKXFW.cjs} +2 -2
  23. package/dist/chunk-PUFCKXFW.cjs.map +1 -0
  24. package/dist/{chunk-QNVYGEJ4.js → chunk-SRQY5IWD.js} +3 -3
  25. package/dist/{chunk-QNVYGEJ4.js.map → chunk-SRQY5IWD.js.map} +1 -1
  26. package/dist/{chunk-FMTSLS25.cjs → chunk-W3QZMAHX.cjs} +102 -57
  27. package/dist/chunk-W3QZMAHX.cjs.map +1 -0
  28. package/dist/{chunk-VDJHDTPP.js → chunk-XKBWSWY5.js} +4 -4
  29. package/dist/{chunk-VDJHDTPP.js.map → chunk-XKBWSWY5.js.map} +1 -1
  30. package/dist/{chunk-VD3WO2TJ.cjs → chunk-XO6UQB2N.cjs} +45 -45
  31. package/dist/{chunk-VD3WO2TJ.cjs.map → chunk-XO6UQB2N.cjs.map} +1 -1
  32. package/dist/{chunk-XNKZPXCY.js → chunk-XW2HXQDO.js} +2 -2
  33. package/dist/chunk-XW2HXQDO.js.map +1 -0
  34. package/dist/server/handlers/agent-builder.cjs +19 -19
  35. package/dist/server/handlers/agent-builder.js +1 -1
  36. package/dist/server/handlers/agents.cjs +27 -23
  37. package/dist/server/handlers/agents.d.ts +19 -0
  38. package/dist/server/handlers/agents.d.ts.map +1 -1
  39. package/dist/server/handlers/agents.js +1 -1
  40. package/dist/server/handlers/mcp.cjs +9 -9
  41. package/dist/server/handlers/mcp.js +1 -1
  42. package/dist/server/handlers/memory.cjs +24 -24
  43. package/dist/server/handlers/memory.d.ts +20 -20
  44. package/dist/server/handlers/memory.js +1 -1
  45. package/dist/server/handlers/test-utils.cjs +2 -2
  46. package/dist/server/handlers/test-utils.cjs.map +1 -1
  47. package/dist/server/handlers/test-utils.d.ts +3 -3
  48. package/dist/server/handlers/test-utils.d.ts.map +1 -1
  49. package/dist/server/handlers/test-utils.js +2 -2
  50. package/dist/server/handlers/test-utils.js.map +1 -1
  51. package/dist/server/handlers/tools.cjs +6 -6
  52. package/dist/server/handlers/tools.js +1 -1
  53. package/dist/server/handlers/voice.cjs +8 -8
  54. package/dist/server/handlers/voice.js +1 -1
  55. package/dist/server/handlers/workflows.cjs +30 -26
  56. package/dist/server/handlers/workflows.d.ts +6 -0
  57. package/dist/server/handlers/workflows.d.ts.map +1 -1
  58. package/dist/server/handlers/workflows.js +1 -1
  59. package/dist/server/handlers.cjs +14 -14
  60. package/dist/server/handlers.js +7 -7
  61. package/dist/server/schemas/agents.d.ts +26 -0
  62. package/dist/server/schemas/agents.d.ts.map +1 -1
  63. package/dist/server/schemas/memory.d.ts +20 -20
  64. package/dist/server/schemas/memory.d.ts.map +1 -1
  65. package/dist/server/server-adapter/index.cjs +114 -115
  66. package/dist/server/server-adapter/index.cjs.map +1 -1
  67. package/dist/server/server-adapter/index.d.ts +1 -5
  68. package/dist/server/server-adapter/index.d.ts.map +1 -1
  69. package/dist/server/server-adapter/index.js +12 -13
  70. package/dist/server/server-adapter/index.js.map +1 -1
  71. package/dist/server/server-adapter/routes/agents.d.ts.map +1 -1
  72. package/dist/server/server-adapter/routes/index.d.ts +3 -3
  73. package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
  74. package/dist/server/server-adapter/routes/workflows.d.ts.map +1 -1
  75. package/package.json +7 -7
  76. package/dist/chunk-C4J473OZ.js.map +0 -1
  77. package/dist/chunk-ESZ6V5WB.cjs.map +0 -1
  78. package/dist/chunk-F4H7J6YV.cjs.map +0 -1
  79. package/dist/chunk-FMTSLS25.cjs.map +0 -1
  80. package/dist/chunk-LBSJWPXK.cjs.map +0 -1
  81. package/dist/chunk-TKL4TD2V.js.map +0 -1
  82. package/dist/chunk-UTIOKR5C.js.map +0 -1
  83. package/dist/chunk-WE4USCF3.js.map +0 -1
  84. package/dist/chunk-XNKZPXCY.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mastra/server
2
2
 
3
- ## 0.0.0-fix-request-context-as-query-key-20251209093005
3
+ ## 0.0.0-fix-prompt-enhance-route-20251210210827
4
4
 
5
5
  ### Major Changes
6
6
 
@@ -332,6 +332,10 @@
332
332
  These packages support mastra server routes on express and hono respectively.
333
333
  Better abstractions will be built on top of these packages in the near future, enabling users to easily attach mastra routes to any existing server framework.
334
334
 
335
+ - Fix type safety for message ordering - restrict `orderBy` to only accept `'createdAt'` field ([#11069](https://github.com/mastra-ai/mastra/pull/11069))
336
+
337
+ Messages don't have an `updatedAt` field, but the previous type allowed ordering by it, which would return empty results. This change adds compile-time type safety by making `StorageOrderBy` generic and restricting `StorageListMessagesInput.orderBy` to only accept `'createdAt'`. The API validation schemas have also been updated to reject invalid orderBy values at runtime.
338
+
335
339
  - Add agent id to the list agent ([#9770](https://github.com/mastra-ai/mastra/pull/9770))
336
340
 
337
341
  - Update tool execution signature ([#9587](https://github.com/mastra-ai/mastra/pull/9587))
@@ -390,6 +394,25 @@
390
394
 
391
395
  - Fix scorers listing filtring ([#9801](https://github.com/mastra-ai/mastra/pull/9801))
392
396
 
397
+ - ### Breaking Changes ([#11028](https://github.com/mastra-ai/mastra/pull/11028))
398
+ - Renamed `RuntimeContext` type to `ServerContext` to avoid confusion with the user-facing `RequestContext` (previously called `RuntimeContext`)
399
+ - Removed `playground` and `isDev` options from server adapter constructors - these only set context variables without any actual functionality
400
+
401
+ ### Changes
402
+
403
+ **@mastra/server**
404
+ - Renamed `RuntimeContext` type to `ServerContext` in route handler types
405
+ - Renamed `createTestRuntimeContext` to `createTestServerContext` in test utilities
406
+ - Renamed `isPlayground` parameter to `isStudio` in `formatAgent` function
407
+
408
+ **@mastra/hono**
409
+ - Removed `playground` and `isDev` from `HonoVariables` type
410
+ - Removed setting of `playground` and `isDev` context variables in middleware
411
+
412
+ **@mastra/express**
413
+ - Removed `playground` and `isDev` from `Express.Locals` interface
414
+ - Removed setting of `playground` and `isDev` in response locals
415
+
393
416
  - Fixes issue where clicking the reset button in the model picker would fail to restore the original LanguageModelV2 (or any other types) object that was passed during agent construction. ([#9481](https://github.com/mastra-ai/mastra/pull/9481))
394
417
 
395
418
  - Unified MastraServer API with MCP transport routes ([#10644](https://github.com/mastra-ai/mastra/pull/10644))
@@ -411,8 +434,16 @@
411
434
  - Added comprehensive MCP endpoint tests for both Hono and Express adapters
412
435
  - Added GitHub Actions workflow for server adapter CI testing
413
436
 
437
+ - Add missing `/api/agents/:agentId/instructions/enhance` endpoint that was referenced by `@mastra/client-js` and `@mastra/playground-ui` ([`e98a9ae`](https://github.com/mastra-ai/mastra/commit/e98a9aecc4141b8e78d05fd6a4eda98059be2b9b))
438
+
414
439
  - Update peer dependencies to match core package version bump (1.0.0) ([#9489](https://github.com/mastra-ai/mastra/pull/9489))
415
440
 
441
+ - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
442
+
443
+ ```typescript
444
+ await workflow.deleteWorkflowRunById(runId);
445
+ ```
446
+
416
447
  - Allow direct access to server app handle directly from Mastra instance. ([#10598](https://github.com/mastra-ai/mastra/pull/10598))
417
448
 
418
449
  ```ts
@@ -506,8 +537,40 @@
506
537
 
507
538
  - Remove format from stream/generate ([#9577](https://github.com/mastra-ai/mastra/pull/9577))
508
539
 
509
- - Updated dependencies [[`ac0d2f4`](https://github.com/mastra-ai/mastra/commit/ac0d2f4ff8831f72c1c66c2be809706d17f65789), [`2319326`](https://github.com/mastra-ai/mastra/commit/2319326f8c64e503a09bbcf14be2dd65405445e0), [`72df8ae`](https://github.com/mastra-ai/mastra/commit/72df8ae595584cdd7747d5c39ffaca45e4507227), [`39c9743`](https://github.com/mastra-ai/mastra/commit/39c97432d084294f8ba85fbf3ef28098ff21459e), [`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`9198899`](https://github.com/mastra-ai/mastra/commit/91988995c427b185c33714b7f3be955367911324), [`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394), [`21a15de`](https://github.com/mastra-ai/mastra/commit/21a15de369fe82aac26bb642ed7be73505475e8b), [`fec5129`](https://github.com/mastra-ai/mastra/commit/fec5129de7fc64423ea03661a56cef31dc747a0d), [`1a0d3fc`](https://github.com/mastra-ai/mastra/commit/1a0d3fc811482c9c376cdf79ee615c23bae9b2d6), [`85d7ee1`](https://github.com/mastra-ai/mastra/commit/85d7ee18ff4e14d625a8a30ec6656bb49804989b), [`c6c1092`](https://github.com/mastra-ai/mastra/commit/c6c1092f8fbf76109303f69e000e96fd1960c4ce), [`0491e7c`](https://github.com/mastra-ai/mastra/commit/0491e7c9b714cb0ba22187ee062147ec2dd7c712), [`f6f4903`](https://github.com/mastra-ai/mastra/commit/f6f4903397314f73362061dc5a3e8e7c61ea34aa), [`85a628b`](https://github.com/mastra-ai/mastra/commit/85a628b1224a8f64cd82ea7f033774bf22df7a7e), [`0e8ed46`](https://github.com/mastra-ai/mastra/commit/0e8ed467c54d6901a6a365f270ec15d6faadb36c), [`6c049d9`](https://github.com/mastra-ai/mastra/commit/6c049d94063fdcbd5b81c4912a2bf82a92c9cc0b), [`910db9e`](https://github.com/mastra-ai/mastra/commit/910db9e0312888495eb5617b567f247d03303814), [`2f897df`](https://github.com/mastra-ai/mastra/commit/2f897df208508f46f51b7625e5dd20c37f93e0e3), [`d629361`](https://github.com/mastra-ai/mastra/commit/d629361a60f6565b5bfb11976fdaf7308af858e2), [`feb7ee4`](https://github.com/mastra-ai/mastra/commit/feb7ee4d09a75edb46c6669a3beaceec78811747), [`c237233`](https://github.com/mastra-ai/mastra/commit/c23723399ccedf7f5744b3f40997b79246bfbe64), [`08c31c1`](https://github.com/mastra-ai/mastra/commit/08c31c188ebccd598acaf55e888b6397d01f7eae), [`15f9e21`](https://github.com/mastra-ai/mastra/commit/15f9e216177201ea6e3f6d0bfb063fcc0953444f), [`3443770`](https://github.com/mastra-ai/mastra/commit/3443770662df8eb24c9df3589b2792d78cfcb811), [`b0e2ea5`](https://github.com/mastra-ai/mastra/commit/b0e2ea5b52c40fae438b9e2f7baee6f0f89c5442), [`f0a07e0`](https://github.com/mastra-ai/mastra/commit/f0a07e0111b3307c5fabfa4094c5c2cfb734fbe6), [`ff94dea`](https://github.com/mastra-ai/mastra/commit/ff94dea935f4e34545c63bcb6c29804732698809), [`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`aaa40e7`](https://github.com/mastra-ai/mastra/commit/aaa40e788628b319baa8e889407d11ad626547fa), [`1521d71`](https://github.com/mastra-ai/mastra/commit/1521d716e5daedc74690c983fbd961123c56756b), [`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6), [`c456e01`](https://github.com/mastra-ai/mastra/commit/c456e0149e3c176afcefdbd9bb1d2c5917723725), [`ebac155`](https://github.com/mastra-ai/mastra/commit/ebac15564a590117db7078233f927a7e28a85106), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`5948e6a`](https://github.com/mastra-ai/mastra/commit/5948e6a5146c83666ba3f294b2be576c82a513fb), [`5b2ff46`](https://github.com/mastra-ai/mastra/commit/5b2ff4651df70c146523a7fca773f8eb0a2272f8), [`db41688`](https://github.com/mastra-ai/mastra/commit/db4168806d007417e2e60b4f68656dca4e5f40c9), [`8940859`](https://github.com/mastra-ai/mastra/commit/89408593658199b4ad67f7b65e888f344e64a442), [`ab035c2`](https://github.com/mastra-ai/mastra/commit/ab035c2ef6d8cc7bb25f06f1a38508bd9e6f126b), [`e629310`](https://github.com/mastra-ai/mastra/commit/e629310f1a73fa236d49ec7a1d1cceb6229dc7cc), [`5ca599d`](https://github.com/mastra-ai/mastra/commit/5ca599d0bb59a1595f19f58473fcd67cc71cef58), [`4c6b492`](https://github.com/mastra-ai/mastra/commit/4c6b492c4dd591c6a592520c1f6855d6e936d71f), [`bff1145`](https://github.com/mastra-ai/mastra/commit/bff114556b3cbadad9b2768488708f8ad0e91475), [`dff01d8`](https://github.com/mastra-ai/mastra/commit/dff01d81ce1f4e4087cfac20fa868e6db138dd14), [`5c8ca24`](https://github.com/mastra-ai/mastra/commit/5c8ca247094e0cc2cdbd7137822fb47241f86e77), [`9d819d5`](https://github.com/mastra-ai/mastra/commit/9d819d54b61481639f4008e4694791bddf187edd), [`e191844`](https://github.com/mastra-ai/mastra/commit/e1918444ca3f80e82feef1dad506cd4ec6e2875f), [`22553f1`](https://github.com/mastra-ai/mastra/commit/22553f11c63ee5e966a9c034a349822249584691), [`81dc110`](https://github.com/mastra-ai/mastra/commit/81dc11008d147cf5bdc8996ead1aa61dbdebb6fc), [`7237163`](https://github.com/mastra-ai/mastra/commit/72371635dbf96a87df4b073cc48fc655afbdce3d), [`2500740`](https://github.com/mastra-ai/mastra/commit/2500740ea23da067d6e50ec71c625ab3ce275e64), [`653e65a`](https://github.com/mastra-ai/mastra/commit/653e65ae1f9502c2958a32f47a5a2df11e612a92), [`873ecbb`](https://github.com/mastra-ai/mastra/commit/873ecbb517586aa17d2f1e99283755b3ebb2863f), [`4f9bbe5`](https://github.com/mastra-ai/mastra/commit/4f9bbe5968f42c86f4930b8193de3c3c17e5bd36), [`fd3d338`](https://github.com/mastra-ai/mastra/commit/fd3d338a2c362174ed5b383f1f011ad9fb0302aa), [`02e51fe`](https://github.com/mastra-ai/mastra/commit/02e51feddb3d4155cfbcc42624fd0d0970d032c0), [`71c8d6c`](https://github.com/mastra-ai/mastra/commit/71c8d6c161253207b2b9588bdadb7eed604f7253), [`7aedb74`](https://github.com/mastra-ai/mastra/commit/7aedb74883adf66af38e270e4068fd42e7a37036), [`c6fd6fe`](https://github.com/mastra-ai/mastra/commit/c6fd6fedd09e9cf8004b03a80925f5e94826ad7e), [`8f02d80`](https://github.com/mastra-ai/mastra/commit/8f02d800777397e4b45d7f1ad041988a8b0c6630), [`6179a9b`](https://github.com/mastra-ai/mastra/commit/6179a9ba36ffac326de3cc3c43cdc8028d37c251), [`8f3fa3a`](https://github.com/mastra-ai/mastra/commit/8f3fa3a652bb77da092f913ec51ae46e3a7e27dc), [`c30400a`](https://github.com/mastra-ai/mastra/commit/c30400a49b994b1b97256fe785eb6c906fc2b232), [`00f4921`](https://github.com/mastra-ai/mastra/commit/00f4921dd2c91a1e5446799599ef7116a8214a1a), [`1a46a56`](https://github.com/mastra-ai/mastra/commit/1a46a566f45a3fcbadc1cf36bf86d351f264bfa3), [`ca8041c`](https://github.com/mastra-ai/mastra/commit/ca8041cce0379fda22ed293a565bcb5b6ddca68a), [`7051bf3`](https://github.com/mastra-ai/mastra/commit/7051bf38b3b122a069008f861f7bfc004a6d9f6e), [`a8f1494`](https://github.com/mastra-ai/mastra/commit/a8f1494f4bbdc2770bcf327d4c7d869e332183f1), [`d7aad50`](https://github.com/mastra-ai/mastra/commit/d7aad501ce61646b76b4b511e558ac4eea9884d0), [`69e0a87`](https://github.com/mastra-ai/mastra/commit/69e0a878896a2da9494945d86e056a5f8f05b851), [`cd29ad2`](https://github.com/mastra-ai/mastra/commit/cd29ad23a255534e8191f249593849ed29160886), [`bdf4d8c`](https://github.com/mastra-ai/mastra/commit/bdf4d8cdc656d8a2c21d81834bfa3bfa70f56c16), [`854e3da`](https://github.com/mastra-ai/mastra/commit/854e3dad5daac17a91a20986399d3a51f54bf68b), [`ce18d38`](https://github.com/mastra-ai/mastra/commit/ce18d38678c65870350d123955014a8432075fd9), [`3cf540b`](https://github.com/mastra-ai/mastra/commit/3cf540b9fbfea8f4fc8d3a2319a4e6c0b0cbfd52), [`352a5d6`](https://github.com/mastra-ai/mastra/commit/352a5d625cfe09849b21e8f52a24c9f0366759d5), [`1c6ce51`](https://github.com/mastra-ai/mastra/commit/1c6ce51f875915ab57fd36873623013699a2a65d), [`898a972`](https://github.com/mastra-ai/mastra/commit/898a9727d286c2510d6b702dfd367e6aaf5c6b0f), [`0793497`](https://github.com/mastra-ai/mastra/commit/079349753620c40246ffd673e3f9d7d9820beff3), [`a97003a`](https://github.com/mastra-ai/mastra/commit/a97003aa1cf2f4022a41912324a1e77263b326b8), [`ccc141e`](https://github.com/mastra-ai/mastra/commit/ccc141ed27da0abc3a3fc28e9e5128152e8e37f4), [`01f8878`](https://github.com/mastra-ai/mastra/commit/01f88783de25e4de048c1c8aace43e26373c6ea5), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`4c77209`](https://github.com/mastra-ai/mastra/commit/4c77209e6c11678808b365d545845918c40045c8), [`a854ede`](https://github.com/mastra-ai/mastra/commit/a854ede62bf5ac0945a624ac48913dd69c73aabf), [`fe3b897`](https://github.com/mastra-ai/mastra/commit/fe3b897c2ccbcd2b10e81b099438c7337feddf89), [`c576fc0`](https://github.com/mastra-ai/mastra/commit/c576fc0b100b2085afded91a37c97a0ea0ec09c7), [`3defc80`](https://github.com/mastra-ai/mastra/commit/3defc80cf2b88a1b7fc1cc4ddcb91e982a614609), [`00123ba`](https://github.com/mastra-ai/mastra/commit/00123ba96dc9e5cd0b110420ebdba56d8f237b25), [`16153fe`](https://github.com/mastra-ai/mastra/commit/16153fe7eb13c99401f48e6ca32707c965ee28b9), [`9f4a683`](https://github.com/mastra-ai/mastra/commit/9f4a6833e88b52574665c028fd5508ad5c2f6004), [`bc94344`](https://github.com/mastra-ai/mastra/commit/bc943444a1342d8a662151b7bce1df7dae32f59c), [`cccf9c8`](https://github.com/mastra-ai/mastra/commit/cccf9c8b2d2dfc1a5e63919395b83d78c89682a0), [`29c4309`](https://github.com/mastra-ai/mastra/commit/29c4309f818b24304c041bcb4a8f19b5f13f6b62), [`16785ce`](https://github.com/mastra-ai/mastra/commit/16785ced928f6f22638f4488cf8a125d99211799), [`57d157f`](https://github.com/mastra-ai/mastra/commit/57d157f0b163a95c3e6c9eae31bdb11d1bfc64f9), [`61a5705`](https://github.com/mastra-ai/mastra/commit/61a570551278b6743e64243b3ce7d73de915ca8a), [`903f67d`](https://github.com/mastra-ai/mastra/commit/903f67d184504a273893818c02b961f5423a79ad), [`d827d08`](https://github.com/mastra-ai/mastra/commit/d827d0808ffe1f3553a84e975806cc989b9735dd), [`2a90c55`](https://github.com/mastra-ai/mastra/commit/2a90c55a86a9210697d5adaab5ee94584b079adc), [`db70a48`](https://github.com/mastra-ai/mastra/commit/db70a48aeeeeb8e5f92007e8ede52c364ce15287), [`eb09742`](https://github.com/mastra-ai/mastra/commit/eb09742197f66c4c38154c3beec78313e69760b2), [`de8239b`](https://github.com/mastra-ai/mastra/commit/de8239bdcb1d8c0cfa06da21f1569912a66bbc8a), [`23c10a1`](https://github.com/mastra-ai/mastra/commit/23c10a1efdd9a693c405511ab2dc8a1236603162), [`b5e6cd7`](https://github.com/mastra-ai/mastra/commit/b5e6cd77fc8c8e64e0494c1d06cee3d84e795d1e), [`f0fdc14`](https://github.com/mastra-ai/mastra/commit/f0fdc14ee233d619266b3d2bbdeea7d25cfc6d13), [`db18bc9`](https://github.com/mastra-ai/mastra/commit/db18bc9c3825e2c1a0ad9a183cc9935f6691bfa1), [`96d35f6`](https://github.com/mastra-ai/mastra/commit/96d35f61376bc2b1bf148648a2c1985bd51bef55), [`9b37b56`](https://github.com/mastra-ai/mastra/commit/9b37b565e1f2a76c24f728945cc740c2b09be9da), [`5cbe88a`](https://github.com/mastra-ai/mastra/commit/5cbe88aefbd9f933bca669fd371ea36bf939ac6d), [`41a23c3`](https://github.com/mastra-ai/mastra/commit/41a23c32f9877d71810f37e24930515df2ff7a0f), [`a1bd7b8`](https://github.com/mastra-ai/mastra/commit/a1bd7b8571db16b94eb01588f451a74758c96d65), [`d78b38d`](https://github.com/mastra-ai/mastra/commit/d78b38d898fce285260d3bbb4befade54331617f), [`a0a5b4b`](https://github.com/mastra-ai/mastra/commit/a0a5b4bbebe6c701ebbadf744873aa0d5ca01371), [`ce0a73a`](https://github.com/mastra-ai/mastra/commit/ce0a73abeaa75b10ca38f9e40a255a645d50ebfb), [`5d171ad`](https://github.com/mastra-ai/mastra/commit/5d171ad9ef340387276b77c2bb3e83e83332d729), [`0633100`](https://github.com/mastra-ai/mastra/commit/0633100a911ad22f5256471bdf753da21c104742), [`3759cb0`](https://github.com/mastra-ai/mastra/commit/3759cb064935b5f74c65ac2f52a1145f7352899d), [`c710c16`](https://github.com/mastra-ai/mastra/commit/c710c1652dccfdc4111c8412bca7a6bb1d48b441), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`cfae733`](https://github.com/mastra-ai/mastra/commit/cfae73394f4920635e6c919c8e95ff9a0788e2e5), [`e3dfda7`](https://github.com/mastra-ai/mastra/commit/e3dfda7b11bf3b8c4bb55637028befb5f387fc74), [`69ea758`](https://github.com/mastra-ai/mastra/commit/69ea758358edd7117f191c2e69c8bb5fc79e7a1a), [`651e772`](https://github.com/mastra-ai/mastra/commit/651e772eb1475fb13e126d3fcc01751297a88214), [`a02e542`](https://github.com/mastra-ai/mastra/commit/a02e542d23179bad250b044b17ff023caa61739f), [`f03ae60`](https://github.com/mastra-ai/mastra/commit/f03ae60500fe350c9d828621006cdafe1975fdd8), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`a372c64`](https://github.com/mastra-ai/mastra/commit/a372c640ad1fd12e8f0613cebdc682fc156b4d95), [`993ad98`](https://github.com/mastra-ai/mastra/commit/993ad98d7ad3bebda9ecef5fec5c94349a0d04bc), [`676ccc7`](https://github.com/mastra-ai/mastra/commit/676ccc7fe92468d2d45d39c31a87825c89fd1ea0), [`3ff2c17`](https://github.com/mastra-ai/mastra/commit/3ff2c17a58e312fad5ea37377262c12d92ca0908), [`d1e74a0`](https://github.com/mastra-ai/mastra/commit/d1e74a0a293866dece31022047f5dbab65a304d0), [`844ea5d`](https://github.com/mastra-ai/mastra/commit/844ea5dc0c248961e7bf73629ae7dcff503e853c), [`398fde3`](https://github.com/mastra-ai/mastra/commit/398fde3f39e707cda79372cdae8f9870e3b57c8d), [`c10398d`](https://github.com/mastra-ai/mastra/commit/c10398d5b88f1d4af556f4267ff06f1d11e89179), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`b61b93f`](https://github.com/mastra-ai/mastra/commit/b61b93f9e058b11dd2eec169853175d31dbdd567), [`bae33d9`](https://github.com/mastra-ai/mastra/commit/bae33d91a63fbb64d1e80519e1fc1acaed1e9013), [`39e7869`](https://github.com/mastra-ai/mastra/commit/39e7869bc7d0ee391077ce291474d8a84eedccff), [`0d7618b`](https://github.com/mastra-ai/mastra/commit/0d7618bc650bf2800934b243eca5648f4aeed9c2), [`7b763e5`](https://github.com/mastra-ai/mastra/commit/7b763e52fc3eaf699c2a99f2adf418dd46e4e9a5), [`d36cfbb`](https://github.com/mastra-ai/mastra/commit/d36cfbbb6565ba5f827883cc9bb648eb14befdc1), [`8846867`](https://github.com/mastra-ai/mastra/commit/8846867ffa9a3746767618e314bebac08eb77d87), [`c0b731f`](https://github.com/mastra-ai/mastra/commit/c0b731fb27d712dc8582e846df5c0332a6a0c5ba), [`5761926`](https://github.com/mastra-ai/mastra/commit/57619260c4a2cdd598763abbacd90de594c6bc76), [`3697853`](https://github.com/mastra-ai/mastra/commit/3697853deeb72017d90e0f38a93c1e29221aeca0), [`c900fdd`](https://github.com/mastra-ai/mastra/commit/c900fdd504c41348efdffb205cfe80d48c38fa33), [`b2e45ec`](https://github.com/mastra-ai/mastra/commit/b2e45eca727a8db01a81ba93f1a5219c7183c839), [`43ca8f2`](https://github.com/mastra-ai/mastra/commit/43ca8f2c7334851cc7b4d3d2f037d8784bfbdd5f), [`d6d49f7`](https://github.com/mastra-ai/mastra/commit/d6d49f7b8714fa19a52ff9c7cf7fb7e73751901e), [`00c2387`](https://github.com/mastra-ai/mastra/commit/00c2387f5f04a365316f851e58666ac43f8c4edf), [`a534e95`](https://github.com/mastra-ai/mastra/commit/a534e9591f83b3cc1ebff99c67edf4cda7bf81d3), [`9d0e7fe`](https://github.com/mastra-ai/mastra/commit/9d0e7feca8ed98de959f53476ee1456073673348), [`53d927c`](https://github.com/mastra-ai/mastra/commit/53d927cc6f03bff33655b7e2b788da445a08731d), [`ad6250d`](https://github.com/mastra-ai/mastra/commit/ad6250dbdaad927e29f74a27b83f6c468b50a705), [`604a79f`](https://github.com/mastra-ai/mastra/commit/604a79fecf276e26a54a3fe01bb94e65315d2e0e), [`42a42cf`](https://github.com/mastra-ai/mastra/commit/42a42cf3132b9786feecbb8c13c583dce5b0e198), [`3f2faf2`](https://github.com/mastra-ai/mastra/commit/3f2faf2e2d685d6c053cc5af1bf9fedf267b2ce5), [`22f64bc`](https://github.com/mastra-ai/mastra/commit/22f64bc1d37149480b58bf2fefe35b79a1e3e7d5), [`3a73998`](https://github.com/mastra-ai/mastra/commit/3a73998fa4ebeb7f3dc9301afe78095fc63e7999), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`ae08bf0`](https://github.com/mastra-ai/mastra/commit/ae08bf0ebc6a4e4da992b711c4a389c32ba84cf4), [`0bed332`](https://github.com/mastra-ai/mastra/commit/0bed332843f627202c6520eaf671771313cd20f3), [`887f0b4`](https://github.com/mastra-ai/mastra/commit/887f0b4746cdbd7cb7d6b17ac9f82aeb58037ea5), [`2562143`](https://github.com/mastra-ai/mastra/commit/256214336b4faa78646c9c1776612393790d8784), [`b7959e6`](https://github.com/mastra-ai/mastra/commit/b7959e6e25a46b480f9ea2217c4c6c588c423791), [`bda6370`](https://github.com/mastra-ai/mastra/commit/bda637009360649aaf579919e7873e33553c273e), [`d7acd8e`](https://github.com/mastra-ai/mastra/commit/d7acd8e987b5d7eff4fd98b0906c17c06a2e83d5), [`c7f1f7d`](https://github.com/mastra-ai/mastra/commit/c7f1f7d24f61f247f018cc2d1f33bf63212959a7), [`0bddc6d`](https://github.com/mastra-ai/mastra/commit/0bddc6d8dbd6f6008c0cba2e4960a2da75a55af1), [`21735a7`](https://github.com/mastra-ai/mastra/commit/21735a7ef306963554a69a89b44f06c3bcd85141), [`735d8c1`](https://github.com/mastra-ai/mastra/commit/735d8c1c0d19fbc09e6f8b66cf41bc7655993838), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b), [`acf322e`](https://github.com/mastra-ai/mastra/commit/acf322e0f1fd0189684cf529d91c694bea918a45), [`2ca67cc`](https://github.com/mastra-ai/mastra/commit/2ca67cc3bb1f6a617353fdcab197d9efebe60d6f), [`e16d553`](https://github.com/mastra-ai/mastra/commit/e16d55338403c7553531cc568125c63d53653dff), [`c942802`](https://github.com/mastra-ai/mastra/commit/c942802a477a925b01859a7b8688d4355715caaa), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9), [`1d877b8`](https://github.com/mastra-ai/mastra/commit/1d877b8d7b536a251c1a7a18db7ddcf4f68d6f8b), [`cc34739`](https://github.com/mastra-ai/mastra/commit/cc34739c34b6266a91bea561119240a7acf47887), [`c218bd3`](https://github.com/mastra-ai/mastra/commit/c218bd3759e32423735b04843a09404572631014), [`9e67002`](https://github.com/mastra-ai/mastra/commit/9e67002b52c9be19936c420a489dbee9c5fd6a78), [`2c4438b`](https://github.com/mastra-ai/mastra/commit/2c4438b87817ab7eed818c7990fef010475af1a3), [`35edc49`](https://github.com/mastra-ai/mastra/commit/35edc49ac0556db609189641d6341e76771b81fc), [`4d59f58`](https://github.com/mastra-ai/mastra/commit/4d59f58de2d90d6e2810a19d4518e38ddddb9038), [`ef11a61`](https://github.com/mastra-ai/mastra/commit/ef11a61920fa0ed08a5b7ceedd192875af119749), [`2b8893c`](https://github.com/mastra-ai/mastra/commit/2b8893cb108ef9acb72ee7835cd625610d2c1a4a), [`8e5c75b`](https://github.com/mastra-ai/mastra/commit/8e5c75bdb1d08a42d45309a4c72def4b6890230f), [`e1bb9c9`](https://github.com/mastra-ai/mastra/commit/e1bb9c94b4eb68b019ae275981be3feb769b5365), [`351a11f`](https://github.com/mastra-ai/mastra/commit/351a11fcaf2ed1008977fa9b9a489fc422e51cd4), [`e59e0d3`](https://github.com/mastra-ai/mastra/commit/e59e0d32afb5fcf2c9f3c00c8f81f6c21d3a63fa), [`465ac05`](https://github.com/mastra-ai/mastra/commit/465ac0526a91d175542091c675181f1a96c98c46), [`fa8409b`](https://github.com/mastra-ai/mastra/commit/fa8409bc39cfd8ba6643b9db5269b90b22e2a2f7), [`e7266a2`](https://github.com/mastra-ai/mastra/commit/e7266a278db02035c97a5e9cd9d1669a6b7a535d), [`173c535`](https://github.com/mastra-ai/mastra/commit/173c535c0645b0da404fe09f003778f0b0d4e019)]:
510
- - @mastra/core@0.0.0-fix-request-context-as-query-key-20251209093005
540
+ - Updated dependencies [[`ac0d2f4`](https://github.com/mastra-ai/mastra/commit/ac0d2f4ff8831f72c1c66c2be809706d17f65789), [`2319326`](https://github.com/mastra-ai/mastra/commit/2319326f8c64e503a09bbcf14be2dd65405445e0), [`72df8ae`](https://github.com/mastra-ai/mastra/commit/72df8ae595584cdd7747d5c39ffaca45e4507227), [`39c9743`](https://github.com/mastra-ai/mastra/commit/39c97432d084294f8ba85fbf3ef28098ff21459e), [`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`9198899`](https://github.com/mastra-ai/mastra/commit/91988995c427b185c33714b7f3be955367911324), [`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394), [`21a15de`](https://github.com/mastra-ai/mastra/commit/21a15de369fe82aac26bb642ed7be73505475e8b), [`fec5129`](https://github.com/mastra-ai/mastra/commit/fec5129de7fc64423ea03661a56cef31dc747a0d), [`1a0d3fc`](https://github.com/mastra-ai/mastra/commit/1a0d3fc811482c9c376cdf79ee615c23bae9b2d6), [`85d7ee1`](https://github.com/mastra-ai/mastra/commit/85d7ee18ff4e14d625a8a30ec6656bb49804989b), [`c6c1092`](https://github.com/mastra-ai/mastra/commit/c6c1092f8fbf76109303f69e000e96fd1960c4ce), [`0491e7c`](https://github.com/mastra-ai/mastra/commit/0491e7c9b714cb0ba22187ee062147ec2dd7c712), [`f6f4903`](https://github.com/mastra-ai/mastra/commit/f6f4903397314f73362061dc5a3e8e7c61ea34aa), [`85a628b`](https://github.com/mastra-ai/mastra/commit/85a628b1224a8f64cd82ea7f033774bf22df7a7e), [`0e8ed46`](https://github.com/mastra-ai/mastra/commit/0e8ed467c54d6901a6a365f270ec15d6faadb36c), [`6c049d9`](https://github.com/mastra-ai/mastra/commit/6c049d94063fdcbd5b81c4912a2bf82a92c9cc0b), [`910db9e`](https://github.com/mastra-ai/mastra/commit/910db9e0312888495eb5617b567f247d03303814), [`2f897df`](https://github.com/mastra-ai/mastra/commit/2f897df208508f46f51b7625e5dd20c37f93e0e3), [`d629361`](https://github.com/mastra-ai/mastra/commit/d629361a60f6565b5bfb11976fdaf7308af858e2), [`feb7ee4`](https://github.com/mastra-ai/mastra/commit/feb7ee4d09a75edb46c6669a3beaceec78811747), [`c237233`](https://github.com/mastra-ai/mastra/commit/c23723399ccedf7f5744b3f40997b79246bfbe64), [`38380b6`](https://github.com/mastra-ai/mastra/commit/38380b60fca905824bdf6b43df307a58efb1aa15), [`08c31c1`](https://github.com/mastra-ai/mastra/commit/08c31c188ebccd598acaf55e888b6397d01f7eae), [`15f9e21`](https://github.com/mastra-ai/mastra/commit/15f9e216177201ea6e3f6d0bfb063fcc0953444f), [`3443770`](https://github.com/mastra-ai/mastra/commit/3443770662df8eb24c9df3589b2792d78cfcb811), [`b0e2ea5`](https://github.com/mastra-ai/mastra/commit/b0e2ea5b52c40fae438b9e2f7baee6f0f89c5442), [`f0a07e0`](https://github.com/mastra-ai/mastra/commit/f0a07e0111b3307c5fabfa4094c5c2cfb734fbe6), [`ff94dea`](https://github.com/mastra-ai/mastra/commit/ff94dea935f4e34545c63bcb6c29804732698809), [`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`aaa40e7`](https://github.com/mastra-ai/mastra/commit/aaa40e788628b319baa8e889407d11ad626547fa), [`1521d71`](https://github.com/mastra-ai/mastra/commit/1521d716e5daedc74690c983fbd961123c56756b), [`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6), [`c456e01`](https://github.com/mastra-ai/mastra/commit/c456e0149e3c176afcefdbd9bb1d2c5917723725), [`ebac155`](https://github.com/mastra-ai/mastra/commit/ebac15564a590117db7078233f927a7e28a85106), [`dd1c38d`](https://github.com/mastra-ai/mastra/commit/dd1c38d1b75f1b695c27b40d8d9d6ed00d5e0f6f), [`5948e6a`](https://github.com/mastra-ai/mastra/commit/5948e6a5146c83666ba3f294b2be576c82a513fb), [`5b2ff46`](https://github.com/mastra-ai/mastra/commit/5b2ff4651df70c146523a7fca773f8eb0a2272f8), [`edb07e4`](https://github.com/mastra-ai/mastra/commit/edb07e49283e0c28bd094a60e03439bf6ecf0221), [`db41688`](https://github.com/mastra-ai/mastra/commit/db4168806d007417e2e60b4f68656dca4e5f40c9), [`798d0c7`](https://github.com/mastra-ai/mastra/commit/798d0c740232653b1d754870e6b43a55c364ffe2), [`8940859`](https://github.com/mastra-ai/mastra/commit/89408593658199b4ad67f7b65e888f344e64a442), [`ab035c2`](https://github.com/mastra-ai/mastra/commit/ab035c2ef6d8cc7bb25f06f1a38508bd9e6f126b), [`e629310`](https://github.com/mastra-ai/mastra/commit/e629310f1a73fa236d49ec7a1d1cceb6229dc7cc), [`5ca599d`](https://github.com/mastra-ai/mastra/commit/5ca599d0bb59a1595f19f58473fcd67cc71cef58), [`4c6b492`](https://github.com/mastra-ai/mastra/commit/4c6b492c4dd591c6a592520c1f6855d6e936d71f), [`bff1145`](https://github.com/mastra-ai/mastra/commit/bff114556b3cbadad9b2768488708f8ad0e91475), [`dff01d8`](https://github.com/mastra-ai/mastra/commit/dff01d81ce1f4e4087cfac20fa868e6db138dd14), [`5c8ca24`](https://github.com/mastra-ai/mastra/commit/5c8ca247094e0cc2cdbd7137822fb47241f86e77), [`9d819d5`](https://github.com/mastra-ai/mastra/commit/9d819d54b61481639f4008e4694791bddf187edd), [`e191844`](https://github.com/mastra-ai/mastra/commit/e1918444ca3f80e82feef1dad506cd4ec6e2875f), [`22553f1`](https://github.com/mastra-ai/mastra/commit/22553f11c63ee5e966a9c034a349822249584691), [`81dc110`](https://github.com/mastra-ai/mastra/commit/81dc11008d147cf5bdc8996ead1aa61dbdebb6fc), [`7237163`](https://github.com/mastra-ai/mastra/commit/72371635dbf96a87df4b073cc48fc655afbdce3d), [`2500740`](https://github.com/mastra-ai/mastra/commit/2500740ea23da067d6e50ec71c625ab3ce275e64), [`653e65a`](https://github.com/mastra-ai/mastra/commit/653e65ae1f9502c2958a32f47a5a2df11e612a92), [`873ecbb`](https://github.com/mastra-ai/mastra/commit/873ecbb517586aa17d2f1e99283755b3ebb2863f), [`4f9bbe5`](https://github.com/mastra-ai/mastra/commit/4f9bbe5968f42c86f4930b8193de3c3c17e5bd36), [`fd3d338`](https://github.com/mastra-ai/mastra/commit/fd3d338a2c362174ed5b383f1f011ad9fb0302aa), [`02e51fe`](https://github.com/mastra-ai/mastra/commit/02e51feddb3d4155cfbcc42624fd0d0970d032c0), [`71c8d6c`](https://github.com/mastra-ai/mastra/commit/71c8d6c161253207b2b9588bdadb7eed604f7253), [`7aedb74`](https://github.com/mastra-ai/mastra/commit/7aedb74883adf66af38e270e4068fd42e7a37036), [`c6fd6fe`](https://github.com/mastra-ai/mastra/commit/c6fd6fedd09e9cf8004b03a80925f5e94826ad7e), [`8f02d80`](https://github.com/mastra-ai/mastra/commit/8f02d800777397e4b45d7f1ad041988a8b0c6630), [`6179a9b`](https://github.com/mastra-ai/mastra/commit/6179a9ba36ffac326de3cc3c43cdc8028d37c251), [`8f3fa3a`](https://github.com/mastra-ai/mastra/commit/8f3fa3a652bb77da092f913ec51ae46e3a7e27dc), [`c30400a`](https://github.com/mastra-ai/mastra/commit/c30400a49b994b1b97256fe785eb6c906fc2b232), [`00f4921`](https://github.com/mastra-ai/mastra/commit/00f4921dd2c91a1e5446799599ef7116a8214a1a), [`1a46a56`](https://github.com/mastra-ai/mastra/commit/1a46a566f45a3fcbadc1cf36bf86d351f264bfa3), [`ca8041c`](https://github.com/mastra-ai/mastra/commit/ca8041cce0379fda22ed293a565bcb5b6ddca68a), [`7051bf3`](https://github.com/mastra-ai/mastra/commit/7051bf38b3b122a069008f861f7bfc004a6d9f6e), [`a8f1494`](https://github.com/mastra-ai/mastra/commit/a8f1494f4bbdc2770bcf327d4c7d869e332183f1), [`d7aad50`](https://github.com/mastra-ai/mastra/commit/d7aad501ce61646b76b4b511e558ac4eea9884d0), [`69e0a87`](https://github.com/mastra-ai/mastra/commit/69e0a878896a2da9494945d86e056a5f8f05b851), [`cd29ad2`](https://github.com/mastra-ai/mastra/commit/cd29ad23a255534e8191f249593849ed29160886), [`bdf4d8c`](https://github.com/mastra-ai/mastra/commit/bdf4d8cdc656d8a2c21d81834bfa3bfa70f56c16), [`854e3da`](https://github.com/mastra-ai/mastra/commit/854e3dad5daac17a91a20986399d3a51f54bf68b), [`ce18d38`](https://github.com/mastra-ai/mastra/commit/ce18d38678c65870350d123955014a8432075fd9), [`3cf540b`](https://github.com/mastra-ai/mastra/commit/3cf540b9fbfea8f4fc8d3a2319a4e6c0b0cbfd52), [`352a5d6`](https://github.com/mastra-ai/mastra/commit/352a5d625cfe09849b21e8f52a24c9f0366759d5), [`1c6ce51`](https://github.com/mastra-ai/mastra/commit/1c6ce51f875915ab57fd36873623013699a2a65d), [`898a972`](https://github.com/mastra-ai/mastra/commit/898a9727d286c2510d6b702dfd367e6aaf5c6b0f), [`0793497`](https://github.com/mastra-ai/mastra/commit/079349753620c40246ffd673e3f9d7d9820beff3), [`2c212e7`](https://github.com/mastra-ai/mastra/commit/2c212e704c90e2db83d4109e62c03f0f6ebd2667), [`a97003a`](https://github.com/mastra-ai/mastra/commit/a97003aa1cf2f4022a41912324a1e77263b326b8), [`ccc141e`](https://github.com/mastra-ai/mastra/commit/ccc141ed27da0abc3a3fc28e9e5128152e8e37f4), [`01f8878`](https://github.com/mastra-ai/mastra/commit/01f88783de25e4de048c1c8aace43e26373c6ea5), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`b7e17d3`](https://github.com/mastra-ai/mastra/commit/b7e17d3f5390bb5a71efc112204413656fcdc18d), [`4c77209`](https://github.com/mastra-ai/mastra/commit/4c77209e6c11678808b365d545845918c40045c8), [`a854ede`](https://github.com/mastra-ai/mastra/commit/a854ede62bf5ac0945a624ac48913dd69c73aabf), [`fe3b897`](https://github.com/mastra-ai/mastra/commit/fe3b897c2ccbcd2b10e81b099438c7337feddf89), [`c576fc0`](https://github.com/mastra-ai/mastra/commit/c576fc0b100b2085afded91a37c97a0ea0ec09c7), [`3defc80`](https://github.com/mastra-ai/mastra/commit/3defc80cf2b88a1b7fc1cc4ddcb91e982a614609), [`00123ba`](https://github.com/mastra-ai/mastra/commit/00123ba96dc9e5cd0b110420ebdba56d8f237b25), [`16153fe`](https://github.com/mastra-ai/mastra/commit/16153fe7eb13c99401f48e6ca32707c965ee28b9), [`9f4a683`](https://github.com/mastra-ai/mastra/commit/9f4a6833e88b52574665c028fd5508ad5c2f6004), [`bc94344`](https://github.com/mastra-ai/mastra/commit/bc943444a1342d8a662151b7bce1df7dae32f59c), [`4ca4306`](https://github.com/mastra-ai/mastra/commit/4ca430614daa5fa04730205a302a43bf4accfe9f), [`cccf9c8`](https://github.com/mastra-ai/mastra/commit/cccf9c8b2d2dfc1a5e63919395b83d78c89682a0), [`29c4309`](https://github.com/mastra-ai/mastra/commit/29c4309f818b24304c041bcb4a8f19b5f13f6b62), [`16785ce`](https://github.com/mastra-ai/mastra/commit/16785ced928f6f22638f4488cf8a125d99211799), [`57d157f`](https://github.com/mastra-ai/mastra/commit/57d157f0b163a95c3e6c9eae31bdb11d1bfc64f9), [`61a5705`](https://github.com/mastra-ai/mastra/commit/61a570551278b6743e64243b3ce7d73de915ca8a), [`903f67d`](https://github.com/mastra-ai/mastra/commit/903f67d184504a273893818c02b961f5423a79ad), [`d827d08`](https://github.com/mastra-ai/mastra/commit/d827d0808ffe1f3553a84e975806cc989b9735dd), [`2a90c55`](https://github.com/mastra-ai/mastra/commit/2a90c55a86a9210697d5adaab5ee94584b079adc), [`db70a48`](https://github.com/mastra-ai/mastra/commit/db70a48aeeeeb8e5f92007e8ede52c364ce15287), [`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d), [`eb09742`](https://github.com/mastra-ai/mastra/commit/eb09742197f66c4c38154c3beec78313e69760b2), [`de8239b`](https://github.com/mastra-ai/mastra/commit/de8239bdcb1d8c0cfa06da21f1569912a66bbc8a), [`23c10a1`](https://github.com/mastra-ai/mastra/commit/23c10a1efdd9a693c405511ab2dc8a1236603162), [`b5e6cd7`](https://github.com/mastra-ai/mastra/commit/b5e6cd77fc8c8e64e0494c1d06cee3d84e795d1e), [`f0fdc14`](https://github.com/mastra-ai/mastra/commit/f0fdc14ee233d619266b3d2bbdeea7d25cfc6d13), [`db18bc9`](https://github.com/mastra-ai/mastra/commit/db18bc9c3825e2c1a0ad9a183cc9935f6691bfa1), [`96d35f6`](https://github.com/mastra-ai/mastra/commit/96d35f61376bc2b1bf148648a2c1985bd51bef55), [`9b37b56`](https://github.com/mastra-ai/mastra/commit/9b37b565e1f2a76c24f728945cc740c2b09be9da), [`5cbe88a`](https://github.com/mastra-ai/mastra/commit/5cbe88aefbd9f933bca669fd371ea36bf939ac6d), [`41a23c3`](https://github.com/mastra-ai/mastra/commit/41a23c32f9877d71810f37e24930515df2ff7a0f), [`a1bd7b8`](https://github.com/mastra-ai/mastra/commit/a1bd7b8571db16b94eb01588f451a74758c96d65), [`d78b38d`](https://github.com/mastra-ai/mastra/commit/d78b38d898fce285260d3bbb4befade54331617f), [`a0a5b4b`](https://github.com/mastra-ai/mastra/commit/a0a5b4bbebe6c701ebbadf744873aa0d5ca01371), [`ce0a73a`](https://github.com/mastra-ai/mastra/commit/ce0a73abeaa75b10ca38f9e40a255a645d50ebfb), [`5d171ad`](https://github.com/mastra-ai/mastra/commit/5d171ad9ef340387276b77c2bb3e83e83332d729), [`0633100`](https://github.com/mastra-ai/mastra/commit/0633100a911ad22f5256471bdf753da21c104742), [`3759cb0`](https://github.com/mastra-ai/mastra/commit/3759cb064935b5f74c65ac2f52a1145f7352899d), [`c710c16`](https://github.com/mastra-ai/mastra/commit/c710c1652dccfdc4111c8412bca7a6bb1d48b441), [`354ad0b`](https://github.com/mastra-ai/mastra/commit/354ad0b7b1b8183ac567f236a884fc7ede6d7138), [`cfae733`](https://github.com/mastra-ai/mastra/commit/cfae73394f4920635e6c919c8e95ff9a0788e2e5), [`e3dfda7`](https://github.com/mastra-ai/mastra/commit/e3dfda7b11bf3b8c4bb55637028befb5f387fc74), [`69ea758`](https://github.com/mastra-ai/mastra/commit/69ea758358edd7117f191c2e69c8bb5fc79e7a1a), [`651e772`](https://github.com/mastra-ai/mastra/commit/651e772eb1475fb13e126d3fcc01751297a88214), [`a02e542`](https://github.com/mastra-ai/mastra/commit/a02e542d23179bad250b044b17ff023caa61739f), [`f03ae60`](https://github.com/mastra-ai/mastra/commit/f03ae60500fe350c9d828621006cdafe1975fdd8), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`a372c64`](https://github.com/mastra-ai/mastra/commit/a372c640ad1fd12e8f0613cebdc682fc156b4d95), [`993ad98`](https://github.com/mastra-ai/mastra/commit/993ad98d7ad3bebda9ecef5fec5c94349a0d04bc), [`676ccc7`](https://github.com/mastra-ai/mastra/commit/676ccc7fe92468d2d45d39c31a87825c89fd1ea0), [`3ff2c17`](https://github.com/mastra-ai/mastra/commit/3ff2c17a58e312fad5ea37377262c12d92ca0908), [`d1e74a0`](https://github.com/mastra-ai/mastra/commit/d1e74a0a293866dece31022047f5dbab65a304d0), [`844ea5d`](https://github.com/mastra-ai/mastra/commit/844ea5dc0c248961e7bf73629ae7dcff503e853c), [`398fde3`](https://github.com/mastra-ai/mastra/commit/398fde3f39e707cda79372cdae8f9870e3b57c8d), [`c10398d`](https://github.com/mastra-ai/mastra/commit/c10398d5b88f1d4af556f4267ff06f1d11e89179), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`b61b93f`](https://github.com/mastra-ai/mastra/commit/b61b93f9e058b11dd2eec169853175d31dbdd567), [`bae33d9`](https://github.com/mastra-ai/mastra/commit/bae33d91a63fbb64d1e80519e1fc1acaed1e9013), [`39e7869`](https://github.com/mastra-ai/mastra/commit/39e7869bc7d0ee391077ce291474d8a84eedccff), [`0d7618b`](https://github.com/mastra-ai/mastra/commit/0d7618bc650bf2800934b243eca5648f4aeed9c2), [`7b763e5`](https://github.com/mastra-ai/mastra/commit/7b763e52fc3eaf699c2a99f2adf418dd46e4e9a5), [`d36cfbb`](https://github.com/mastra-ai/mastra/commit/d36cfbbb6565ba5f827883cc9bb648eb14befdc1), [`8846867`](https://github.com/mastra-ai/mastra/commit/8846867ffa9a3746767618e314bebac08eb77d87), [`c0b731f`](https://github.com/mastra-ai/mastra/commit/c0b731fb27d712dc8582e846df5c0332a6a0c5ba), [`5761926`](https://github.com/mastra-ai/mastra/commit/57619260c4a2cdd598763abbacd90de594c6bc76), [`3697853`](https://github.com/mastra-ai/mastra/commit/3697853deeb72017d90e0f38a93c1e29221aeca0), [`c900fdd`](https://github.com/mastra-ai/mastra/commit/c900fdd504c41348efdffb205cfe80d48c38fa33), [`b2e45ec`](https://github.com/mastra-ai/mastra/commit/b2e45eca727a8db01a81ba93f1a5219c7183c839), [`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932), [`43ca8f2`](https://github.com/mastra-ai/mastra/commit/43ca8f2c7334851cc7b4d3d2f037d8784bfbdd5f), [`d6d49f7`](https://github.com/mastra-ai/mastra/commit/d6d49f7b8714fa19a52ff9c7cf7fb7e73751901e), [`00c2387`](https://github.com/mastra-ai/mastra/commit/00c2387f5f04a365316f851e58666ac43f8c4edf), [`a534e95`](https://github.com/mastra-ai/mastra/commit/a534e9591f83b3cc1ebff99c67edf4cda7bf81d3), [`9d0e7fe`](https://github.com/mastra-ai/mastra/commit/9d0e7feca8ed98de959f53476ee1456073673348), [`53d927c`](https://github.com/mastra-ai/mastra/commit/53d927cc6f03bff33655b7e2b788da445a08731d), [`ad6250d`](https://github.com/mastra-ai/mastra/commit/ad6250dbdaad927e29f74a27b83f6c468b50a705), [`604a79f`](https://github.com/mastra-ai/mastra/commit/604a79fecf276e26a54a3fe01bb94e65315d2e0e), [`42a42cf`](https://github.com/mastra-ai/mastra/commit/42a42cf3132b9786feecbb8c13c583dce5b0e198), [`3f2faf2`](https://github.com/mastra-ai/mastra/commit/3f2faf2e2d685d6c053cc5af1bf9fedf267b2ce5), [`22f64bc`](https://github.com/mastra-ai/mastra/commit/22f64bc1d37149480b58bf2fefe35b79a1e3e7d5), [`3a73998`](https://github.com/mastra-ai/mastra/commit/3a73998fa4ebeb7f3dc9301afe78095fc63e7999), [`83d5942`](https://github.com/mastra-ai/mastra/commit/83d5942669ce7bba4a6ca4fd4da697a10eb5ebdc), [`ae08bf0`](https://github.com/mastra-ai/mastra/commit/ae08bf0ebc6a4e4da992b711c4a389c32ba84cf4), [`0bed332`](https://github.com/mastra-ai/mastra/commit/0bed332843f627202c6520eaf671771313cd20f3), [`887f0b4`](https://github.com/mastra-ai/mastra/commit/887f0b4746cdbd7cb7d6b17ac9f82aeb58037ea5), [`2562143`](https://github.com/mastra-ai/mastra/commit/256214336b4faa78646c9c1776612393790d8784), [`b7959e6`](https://github.com/mastra-ai/mastra/commit/b7959e6e25a46b480f9ea2217c4c6c588c423791), [`bda6370`](https://github.com/mastra-ai/mastra/commit/bda637009360649aaf579919e7873e33553c273e), [`d7acd8e`](https://github.com/mastra-ai/mastra/commit/d7acd8e987b5d7eff4fd98b0906c17c06a2e83d5), [`c7f1f7d`](https://github.com/mastra-ai/mastra/commit/c7f1f7d24f61f247f018cc2d1f33bf63212959a7), [`0bddc6d`](https://github.com/mastra-ai/mastra/commit/0bddc6d8dbd6f6008c0cba2e4960a2da75a55af1), [`21735a7`](https://github.com/mastra-ai/mastra/commit/21735a7ef306963554a69a89b44f06c3bcd85141), [`735d8c1`](https://github.com/mastra-ai/mastra/commit/735d8c1c0d19fbc09e6f8b66cf41bc7655993838), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b), [`acf322e`](https://github.com/mastra-ai/mastra/commit/acf322e0f1fd0189684cf529d91c694bea918a45), [`2ca67cc`](https://github.com/mastra-ai/mastra/commit/2ca67cc3bb1f6a617353fdcab197d9efebe60d6f), [`e16d553`](https://github.com/mastra-ai/mastra/commit/e16d55338403c7553531cc568125c63d53653dff), [`c942802`](https://github.com/mastra-ai/mastra/commit/c942802a477a925b01859a7b8688d4355715caaa), [`4f0331a`](https://github.com/mastra-ai/mastra/commit/4f0331a79bf6eb5ee598a5086e55de4b5a0ada03), [`a0c8c1b`](https://github.com/mastra-ai/mastra/commit/a0c8c1b87d4fee252aebda73e8637fbe01d761c9), [`1d877b8`](https://github.com/mastra-ai/mastra/commit/1d877b8d7b536a251c1a7a18db7ddcf4f68d6f8b), [`cc34739`](https://github.com/mastra-ai/mastra/commit/cc34739c34b6266a91bea561119240a7acf47887), [`c218bd3`](https://github.com/mastra-ai/mastra/commit/c218bd3759e32423735b04843a09404572631014), [`9e67002`](https://github.com/mastra-ai/mastra/commit/9e67002b52c9be19936c420a489dbee9c5fd6a78), [`2c4438b`](https://github.com/mastra-ai/mastra/commit/2c4438b87817ab7eed818c7990fef010475af1a3), [`35edc49`](https://github.com/mastra-ai/mastra/commit/35edc49ac0556db609189641d6341e76771b81fc), [`4d59f58`](https://github.com/mastra-ai/mastra/commit/4d59f58de2d90d6e2810a19d4518e38ddddb9038), [`ef11a61`](https://github.com/mastra-ai/mastra/commit/ef11a61920fa0ed08a5b7ceedd192875af119749), [`2b8893c`](https://github.com/mastra-ai/mastra/commit/2b8893cb108ef9acb72ee7835cd625610d2c1a4a), [`8e5c75b`](https://github.com/mastra-ai/mastra/commit/8e5c75bdb1d08a42d45309a4c72def4b6890230f), [`e1bb9c9`](https://github.com/mastra-ai/mastra/commit/e1bb9c94b4eb68b019ae275981be3feb769b5365), [`351a11f`](https://github.com/mastra-ai/mastra/commit/351a11fcaf2ed1008977fa9b9a489fc422e51cd4), [`e59e0d3`](https://github.com/mastra-ai/mastra/commit/e59e0d32afb5fcf2c9f3c00c8f81f6c21d3a63fa), [`465ac05`](https://github.com/mastra-ai/mastra/commit/465ac0526a91d175542091c675181f1a96c98c46), [`fa8409b`](https://github.com/mastra-ai/mastra/commit/fa8409bc39cfd8ba6643b9db5269b90b22e2a2f7), [`8a000da`](https://github.com/mastra-ai/mastra/commit/8a000da0c09c679a2312f6b3aa05b2ca78ca7393), [`e7266a2`](https://github.com/mastra-ai/mastra/commit/e7266a278db02035c97a5e9cd9d1669a6b7a535d), [`173c535`](https://github.com/mastra-ai/mastra/commit/173c535c0645b0da404fe09f003778f0b0d4e019)]:
541
+ - @mastra/core@0.0.0-fix-prompt-enhance-route-20251210210827
542
+
543
+ ## 1.0.0-beta.10
544
+
545
+ ### Patch Changes
546
+
547
+ - ### Breaking Changes ([#11028](https://github.com/mastra-ai/mastra/pull/11028))
548
+ - Renamed `RuntimeContext` type to `ServerContext` to avoid confusion with the user-facing `RequestContext` (previously called `RuntimeContext`)
549
+ - Removed `playground` and `isDev` options from server adapter constructors - these only set context variables without any actual functionality
550
+
551
+ ### Changes
552
+
553
+ **@mastra/server**
554
+ - Renamed `RuntimeContext` type to `ServerContext` in route handler types
555
+ - Renamed `createTestRuntimeContext` to `createTestServerContext` in test utilities
556
+ - Renamed `isPlayground` parameter to `isStudio` in `formatAgent` function
557
+
558
+ **@mastra/hono**
559
+ - Removed `playground` and `isDev` from `HonoVariables` type
560
+ - Removed setting of `playground` and `isDev` context variables in middleware
561
+
562
+ **@mastra/express**
563
+ - Removed `playground` and `isDev` from `Express.Locals` interface
564
+ - Removed setting of `playground` and `isDev` in response locals
565
+
566
+ - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
567
+
568
+ ```typescript
569
+ await workflow.deleteWorkflowRunById(runId);
570
+ ```
571
+
572
+ - Updated dependencies [[`edb07e4`](https://github.com/mastra-ai/mastra/commit/edb07e49283e0c28bd094a60e03439bf6ecf0221), [`b7e17d3`](https://github.com/mastra-ai/mastra/commit/b7e17d3f5390bb5a71efc112204413656fcdc18d), [`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d), [`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932), [`4f0331a`](https://github.com/mastra-ai/mastra/commit/4f0331a79bf6eb5ee598a5086e55de4b5a0ada03), [`8a000da`](https://github.com/mastra-ai/mastra/commit/8a000da0c09c679a2312f6b3aa05b2ca78ca7393)]:
573
+ - @mastra/core@1.0.0-beta.10
511
574
 
512
575
  ## 1.0.0-beta.9
513
576
 
@@ -1,5 +1,5 @@
1
1
  import { validateBody } from './chunk-XWGAT2DA.js';
2
- import { voiceSpeakersResponseSchema, agentIdPathParams, speakResponseSchema, generateSpeechBodySchema, transcribeSpeechResponseSchema, transcribeSpeechBodySchema, getListenerResponseSchema } from './chunk-WE4USCF3.js';
2
+ import { voiceSpeakersResponseSchema, agentIdPathParams, speakResponseSchema, generateSpeechBodySchema, transcribeSpeechResponseSchema, transcribeSpeechBodySchema, getListenerResponseSchema } from './chunk-KPSSRYGH.js';
3
3
  import { createRoute } from './chunk-SXVANU23.js';
4
4
  import { handleError } from './chunk-UXGQZUYZ.js';
5
5
  import { HTTPException } from './chunk-6QWQZI4Q.js';
@@ -192,5 +192,5 @@ var GET_LISTENER_ROUTE = createRoute({
192
192
  });
193
193
 
194
194
  export { GENERATE_SPEECH_DEPRECATED_ROUTE, GENERATE_SPEECH_ROUTE, GET_LISTENER_ROUTE, GET_SPEAKERS_DEPRECATED_ROUTE, GET_SPEAKERS_ROUTE, TRANSCRIBE_SPEECH_DEPRECATED_ROUTE, TRANSCRIBE_SPEECH_ROUTE, voice_exports };
195
- //# sourceMappingURL=chunk-7N3PD4SV.js.map
196
- //# sourceMappingURL=chunk-7N3PD4SV.js.map
195
+ //# sourceMappingURL=chunk-6V57U52D.js.map
196
+ //# sourceMappingURL=chunk-6V57U52D.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/handlers/voice.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,IAAA,aAAA,GAAA;AAAA,QAAA,CAAA,aAAA,EAAA;AAAA,EAAA,gCAAA,EAAA,MAAA,gCAAA;AAAA,EAAA,qBAAA,EAAA,MAAA,qBAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,6BAAA,EAAA,MAAA,6BAAA;AAAA,EAAA,kBAAA,EAAA,MAAA,kBAAA;AAAA,EAAA,kCAAA,EAAA,MAAA,kCAAA;AAAA,EAAA,uBAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AAqBO,IAAM,qBAAqB,WAAA,CAAY;AAAA,EAC5C,MAAA,EAAQ,KAAA;AAAA,EACR,IAAA,EAAM,qCAAA;AAAA,EACN,YAAA,EAAc,MAAA;AAAA,EACd,eAAA,EAAiB,iBAAA;AAAA,EACjB,cAAA,EAAgB,2BAAA;AAAA,EAChB,OAAA,EAAS,oBAAA;AAAA,EACT,WAAA,EAAa,0DAAA;AAAA,EACb,IAAA,EAAM,CAAC,QAAA,EAAU,OAAO,CAAA;AAAA,EACxB,SAAS,OAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,gBAAe,KAAM;AACtD,IAAA,IAAI;AACF,MAAA,IAAI,CAAC,OAAA,EAAS;AACZ,QAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EA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sourcesContent":["import { Readable } from 'node:stream';\nimport { MastraError } from '@mastra/core/error';\nimport { HTTPException } from '../http-exception';\nimport {\n agentIdPathParams,\n voiceSpeakersResponseSchema,\n generateSpeechBodySchema,\n speakResponseSchema,\n transcribeSpeechBodySchema,\n transcribeSpeechResponseSchema,\n getListenerResponseSchema,\n} from '../schemas/agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\n\nimport { handleError } from './error';\nimport { validateBody } from './utils';\n\n// ============================================================================\n// Route Objects\n// ============================================================================\n\nexport const GET_SPEAKERS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId/voice/speakers',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: voiceSpeakersResponseSchema,\n summary: 'Get voice speakers',\n description: 'Returns available voice speakers for the specified agent',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n const speakers = await Promise.resolve()\n .then(() => voice.getSpeakers())\n .catch(err => {\n if (err instanceof MastraError) {\n // No voice provider configured, return empty array\n return [];\n }\n throw err;\n });\n\n return speakers;\n } catch (error) {\n return handleError(error, 'Error getting speakers');\n }\n },\n});\n\nexport const GET_SPEAKERS_DEPRECATED_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId/speakers',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: voiceSpeakersResponseSchema,\n summary: 'Get available speakers for an agent',\n description: '[DEPRECATED] Use /api/agents/:agentId/voice/speakers instead. Get available speakers for an agent',\n tags: ['Agents', 'Voice'],\n handler: GET_SPEAKERS_ROUTE.handler,\n});\n\nexport const GENERATE_SPEECH_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/voice/speak',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: generateSpeechBodySchema,\n responseSchema: speakResponseSchema,\n summary: 'Generate speech',\n description: 'Generates speech audio from text using the agent voice configuration',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, text, speakerId, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n validateBody({ text });\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n if (!voice) {\n throw new HTTPException(400, { message: 'Agent does not have voice capabilities' });\n }\n\n const audioStream = await Promise.resolve()\n .then(() => voice.speak(text!, { speaker: speakerId! }))\n .catch(err => {\n if (err instanceof MastraError) {\n throw new HTTPException(400, { message: err.message });\n }\n\n throw err;\n });\n\n if (!audioStream) {\n throw new HTTPException(500, { message: 'Failed to generate speech' });\n }\n\n return audioStream as unknown as ReadableStream<any>;\n } catch (error) {\n return handleError(error, 'Error generating speech');\n }\n },\n});\n\nexport const GENERATE_SPEECH_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/speak',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: generateSpeechBodySchema,\n responseSchema: speakResponseSchema,\n summary: 'Convert text to speech',\n description:\n \"[DEPRECATED] Use /api/agents/:agentId/voice/speak instead. Convert text to speech using the agent's voice provider\",\n tags: ['Agents', 'Voice'],\n handler: GENERATE_SPEECH_ROUTE.handler,\n});\n\nexport const TRANSCRIBE_SPEECH_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/voice/listen',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: transcribeSpeechBodySchema,\n responseSchema: transcribeSpeechResponseSchema,\n summary: 'Transcribe speech',\n description: 'Transcribes speech audio to text using the agent voice configuration',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, audioData, options, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n if (!audioData) {\n throw new HTTPException(400, { message: 'Audio data is required' });\n }\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n if (!voice) {\n throw new HTTPException(400, { message: 'Agent does not have voice capabilities' });\n }\n\n const audioStream = new Readable();\n audioStream.push(audioData);\n audioStream.push(null);\n\n const text = await voice.listen(audioStream, options);\n return { text: text as string };\n } catch (error) {\n return handleError(error, 'Error transcribing speech');\n }\n },\n});\n\nexport const TRANSCRIBE_SPEECH_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/listen',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: transcribeSpeechBodySchema,\n responseSchema: transcribeSpeechResponseSchema,\n summary: 'Convert speech to text',\n description:\n \"[DEPRECATED] Use /api/agents/:agentId/voice/listen instead. Convert speech to text using the agent's voice provider. Additional provider-specific options can be passed as query parameters.\",\n tags: ['Agents', 'Voice'],\n handler: TRANSCRIBE_SPEECH_ROUTE.handler,\n});\n\nexport const GET_LISTENER_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId/voice/listener',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: getListenerResponseSchema,\n summary: 'Get voice listener',\n description: 'Returns the voice listener configuration for the agent',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n const listeners = await Promise.resolve()\n .then(() => voice.getListener())\n .catch(err => {\n if (err instanceof MastraError) {\n // No voice provider configured\n return { enabled: false };\n }\n throw err;\n });\n\n return listeners;\n } catch (error) {\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AS,OAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,gBAAe,KAAM;AACtD,IAAA,IAAI;AACF,MAAA,IAAI,CAAC,OAAA,EAAS;AACZ,QAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,wBAAwB,CAAA;AAAA,MAClE;AAEA,MAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,YAAA,CAAa,OAAO,CAAA;AAEzC,MAAA,IAAI,CAAC,KAAA,EAAO;AACV,QAAA,MAAM,IAAI,aAAA,CAAc,GAAA,EAAK,EAAE,OAAA,EAAS,mBAAmB,CAAA;AAAA,MAC7D;AAEA,MAAA,MAAM,QAAQ,MAAM,KAAA,CAAM,QAAA,CAAS,EAAE,gBAAgB,CAAA;AAErD,MAAA,MAAM,SAAA,GAAY,MAAM,OAAA,CAAQ,OAAA,EAAQ,CACrC,IAAA,CAAK,MAAM,KAAA,CAAM,WAAA,EAAa,CAAA,CAC9B,KAAA,CAAM,CAAA,GAAA,KAAO;AACZ,QAAA,IAAI,eAAe,WAAA,EAAa;AAE9B,UAAA,OAAO,EAAE,SAAS,KAAA,EAAM;AAAA,QAC1B;AACA,QAAA,MAAM,GAAA;AAAA,MACR,CAAC,CAAA;AAEH,MAAA,OAAO,SAAA;AAAA,IACT,SAAS,KAAA,EAAO;AACd,MAAA,OAAO,WAAA,CAAY,OAAO,yBAAyB,CAAA;AAAA,IACrD;AAAA,EACF;AACF,CAAC","file":"chunk-6V57U52D.js","sourcesContent":["import { Readable } from 'node:stream';\nimport { MastraError } from '@mastra/core/error';\nimport { HTTPException } from '../http-exception';\nimport {\n agentIdPathParams,\n voiceSpeakersResponseSchema,\n generateSpeechBodySchema,\n speakResponseSchema,\n transcribeSpeechBodySchema,\n transcribeSpeechResponseSchema,\n getListenerResponseSchema,\n} from '../schemas/agents';\nimport { createRoute } from '../server-adapter/routes/route-builder';\n\nimport { handleError } from './error';\nimport { validateBody } from './utils';\n\n// ============================================================================\n// Route Objects\n// ============================================================================\n\nexport const GET_SPEAKERS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId/voice/speakers',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: voiceSpeakersResponseSchema,\n summary: 'Get voice speakers',\n description: 'Returns available voice speakers for the specified agent',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n const speakers = await Promise.resolve()\n .then(() => voice.getSpeakers())\n .catch(err => {\n if (err instanceof MastraError) {\n // No voice provider configured, return empty array\n return [];\n }\n throw err;\n });\n\n return speakers;\n } catch (error) {\n return handleError(error, 'Error getting speakers');\n }\n },\n});\n\nexport const GET_SPEAKERS_DEPRECATED_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId/speakers',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: voiceSpeakersResponseSchema,\n summary: 'Get available speakers for an agent',\n description: '[DEPRECATED] Use /api/agents/:agentId/voice/speakers instead. Get available speakers for an agent',\n tags: ['Agents', 'Voice'],\n handler: GET_SPEAKERS_ROUTE.handler,\n});\n\nexport const GENERATE_SPEECH_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/voice/speak',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: generateSpeechBodySchema,\n responseSchema: speakResponseSchema,\n summary: 'Generate speech',\n description: 'Generates speech audio from text using the agent voice configuration',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, text, speakerId, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n validateBody({ text });\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n if (!voice) {\n throw new HTTPException(400, { message: 'Agent does not have voice capabilities' });\n }\n\n const audioStream = await Promise.resolve()\n .then(() => voice.speak(text!, { speaker: speakerId! }))\n .catch(err => {\n if (err instanceof MastraError) {\n throw new HTTPException(400, { message: err.message });\n }\n\n throw err;\n });\n\n if (!audioStream) {\n throw new HTTPException(500, { message: 'Failed to generate speech' });\n }\n\n return audioStream as unknown as ReadableStream<any>;\n } catch (error) {\n return handleError(error, 'Error generating speech');\n }\n },\n});\n\nexport const GENERATE_SPEECH_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/speak',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: generateSpeechBodySchema,\n responseSchema: speakResponseSchema,\n summary: 'Convert text to speech',\n description:\n \"[DEPRECATED] Use /api/agents/:agentId/voice/speak instead. Convert text to speech using the agent's voice provider\",\n tags: ['Agents', 'Voice'],\n handler: GENERATE_SPEECH_ROUTE.handler,\n});\n\nexport const TRANSCRIBE_SPEECH_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/voice/listen',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: transcribeSpeechBodySchema,\n responseSchema: transcribeSpeechResponseSchema,\n summary: 'Transcribe speech',\n description: 'Transcribes speech audio to text using the agent voice configuration',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, audioData, options, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n if (!audioData) {\n throw new HTTPException(400, { message: 'Audio data is required' });\n }\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n if (!voice) {\n throw new HTTPException(400, { message: 'Agent does not have voice capabilities' });\n }\n\n const audioStream = new Readable();\n audioStream.push(audioData);\n audioStream.push(null);\n\n const text = await voice.listen(audioStream, options);\n return { text: text as string };\n } catch (error) {\n return handleError(error, 'Error transcribing speech');\n }\n },\n});\n\nexport const TRANSCRIBE_SPEECH_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/listen',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: transcribeSpeechBodySchema,\n responseSchema: transcribeSpeechResponseSchema,\n summary: 'Convert speech to text',\n description:\n \"[DEPRECATED] Use /api/agents/:agentId/voice/listen instead. Convert speech to text using the agent's voice provider. Additional provider-specific options can be passed as query parameters.\",\n tags: ['Agents', 'Voice'],\n handler: TRANSCRIBE_SPEECH_ROUTE.handler,\n});\n\nexport const GET_LISTENER_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId/voice/listener',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: getListenerResponseSchema,\n summary: 'Get voice listener',\n description: 'Returns the voice listener configuration for the agent',\n tags: ['Agents', 'Voice'],\n handler: async ({ mastra, agentId, requestContext }) => {\n try {\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n const agent = mastra.getAgentById(agentId);\n\n if (!agent) {\n throw new HTTPException(404, { message: 'Agent not found' });\n }\n\n const voice = await agent.getVoice({ requestContext });\n\n const listeners = await Promise.resolve()\n .then(() => voice.getListener())\n .catch(err => {\n if (err instanceof MastraError) {\n // No voice provider configured\n return { enabled: false };\n }\n throw err;\n });\n\n return listeners;\n } catch (error) {\n return handleError(error, 'Error getting listeners');\n }\n },\n});\n"]}
@@ -1,5 +1,5 @@
1
1
  import { sanitizeBody, validateBody } from './chunk-XWGAT2DA.js';
2
- import { listAgentsResponseSchema, serializedAgentSchema, agentIdPathParams, generateResponseSchema, agentExecutionBodySchema, streamResponseSchema, providersResponseSchema, toolCallResponseSchema, approveToolCallBodySchema, declineToolCallBodySchema, modelManagementResponseSchema, updateAgentModelBodySchema, reorderAgentModelListBodySchema, updateAgentModelInModelListBodySchema, modelConfigIdPathParams } from './chunk-WE4USCF3.js';
2
+ import { listAgentsResponseSchema, serializedAgentSchema, agentIdPathParams, generateResponseSchema, agentExecutionBodySchema, streamResponseSchema, providersResponseSchema, toolCallResponseSchema, approveToolCallBodySchema, declineToolCallBodySchema, modelManagementResponseSchema, updateAgentModelBodySchema, reorderAgentModelListBodySchema, updateAgentModelInModelListBodySchema, modelConfigIdPathParams, enhanceInstructionsResponseSchema, enhanceInstructionsBodySchema } from './chunk-KPSSRYGH.js';
3
3
  import { stringify } from './chunk-LF2ZLOFP.js';
4
4
  import { createRoute } from './chunk-SXVANU23.js';
5
5
  import { handleError } from './chunk-UXGQZUYZ.js';
@@ -15,6 +15,7 @@ var agents_exports = {};
15
15
  __export(agents_exports, {
16
16
  APPROVE_TOOL_CALL_ROUTE: () => APPROVE_TOOL_CALL_ROUTE,
17
17
  DECLINE_TOOL_CALL_ROUTE: () => DECLINE_TOOL_CALL_ROUTE,
18
+ ENHANCE_INSTRUCTIONS_ROUTE: () => ENHANCE_INSTRUCTIONS_ROUTE,
18
19
  GENERATE_AGENT_ROUTE: () => GENERATE_AGENT_ROUTE,
19
20
  GENERATE_AGENT_VNEXT_ROUTE: () => GENERATE_AGENT_VNEXT_ROUTE,
20
21
  GENERATE_LEGACY_ROUTE: () => GENERATE_LEGACY_ROUTE,
@@ -217,7 +218,7 @@ async function formatAgent({
217
218
  mastra,
218
219
  agent,
219
220
  requestContext,
220
- isPlayground
221
+ isStudio
221
222
  }) {
222
223
  const description = agent.getDescription();
223
224
  const tools = await agent.listTools({ requestContext });
@@ -337,12 +338,12 @@ var GET_AGENT_BY_ID_ROUTE = createRoute({
337
338
  handler: async ({ agentId, mastra, requestContext }) => {
338
339
  try {
339
340
  const agent = await getAgentFromSystem({ mastra, agentId });
340
- const isPlayground = false;
341
+ const isStudio = false;
341
342
  const result = await formatAgent({
342
343
  mastra,
343
344
  agent,
344
345
  requestContext,
345
- isPlayground
346
+ isStudio
346
347
  });
347
348
  return result;
348
349
  } catch (error) {
@@ -728,6 +729,49 @@ var UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE = createRoute({
728
729
  }
729
730
  }
730
731
  });
732
+ var ENHANCE_INSTRUCTIONS_ROUTE = createRoute({
733
+ method: "POST",
734
+ path: "/api/agents/:agentId/instructions/enhance",
735
+ responseType: "json",
736
+ pathParamSchema: agentIdPathParams,
737
+ bodySchema: enhanceInstructionsBodySchema,
738
+ responseSchema: enhanceInstructionsResponseSchema,
739
+ summary: "Enhance agent instructions",
740
+ description: "Uses AI to enhance or modify agent instructions based on user feedback",
741
+ tags: ["Agents"],
742
+ handler: async ({ mastra, agentId, instructions, comment }) => {
743
+ try {
744
+ const agent = await getAgentFromSystem({ mastra, agentId });
745
+ const enhancementPrompt = `You are an expert prompt engineer. Your task is to improve the following agent instructions based on the user's feedback.
746
+
747
+ Current Instructions:
748
+ ---
749
+ ${instructions}
750
+ ---
751
+
752
+ User's Feedback/Request:
753
+ ${comment}
754
+
755
+ Please provide:
756
+ 1. An improved version of the instructions that incorporates the user's feedback
757
+ 2. A brief explanation of what changes you made and why
758
+
759
+ Important:
760
+ - Maintain the overall structure and intent of the original instructions
761
+ - Make targeted improvements based on the user's feedback
762
+ - Keep the instructions clear, concise, and actionable
763
+ - Preserve any specific formatting or sections that are important`;
764
+ const result = await agent.generate(enhancementPrompt, {
765
+ structuredOutput: {
766
+ schema: enhanceInstructionsResponseSchema
767
+ }
768
+ });
769
+ return result.object;
770
+ } catch (error) {
771
+ return handleError(error, "Error enhancing instructions");
772
+ }
773
+ }
774
+ });
731
775
  var STREAM_VNEXT_DEPRECATED_ROUTE = createRoute({
732
776
  method: "POST",
733
777
  path: "/api/agents/:agentId/streamVNext",
@@ -781,6 +825,6 @@ var STREAM_UI_MESSAGE_DEPRECATED_ROUTE = createRoute({
781
825
  handler: STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE.handler
782
826
  });
783
827
 
784
- export { APPROVE_TOOL_CALL_ROUTE, DECLINE_TOOL_CALL_ROUTE, GENERATE_AGENT_ROUTE, GENERATE_AGENT_VNEXT_ROUTE, GENERATE_LEGACY_ROUTE, GET_AGENT_BY_ID_ROUTE, GET_PROVIDERS_ROUTE, LIST_AGENTS_ROUTE, REORDER_AGENT_MODEL_LIST_ROUTE, RESET_AGENT_MODEL_ROUTE, STREAM_GENERATE_LEGACY_ROUTE, STREAM_GENERATE_ROUTE, STREAM_GENERATE_VNEXT_DEPRECATED_ROUTE, STREAM_NETWORK_ROUTE, STREAM_UI_MESSAGE_DEPRECATED_ROUTE, STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE, STREAM_VNEXT_DEPRECATED_ROUTE, UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE, UPDATE_AGENT_MODEL_ROUTE, agents_exports, getAgentFromSystem, getSerializedAgentTools, getSerializedProcessors };
785
- //# sourceMappingURL=chunk-C4J473OZ.js.map
786
- //# sourceMappingURL=chunk-C4J473OZ.js.map
828
+ export { APPROVE_TOOL_CALL_ROUTE, DECLINE_TOOL_CALL_ROUTE, ENHANCE_INSTRUCTIONS_ROUTE, GENERATE_AGENT_ROUTE, GENERATE_AGENT_VNEXT_ROUTE, GENERATE_LEGACY_ROUTE, GET_AGENT_BY_ID_ROUTE, GET_PROVIDERS_ROUTE, LIST_AGENTS_ROUTE, REORDER_AGENT_MODEL_LIST_ROUTE, RESET_AGENT_MODEL_ROUTE, STREAM_GENERATE_LEGACY_ROUTE, STREAM_GENERATE_ROUTE, STREAM_GENERATE_VNEXT_DEPRECATED_ROUTE, STREAM_NETWORK_ROUTE, STREAM_UI_MESSAGE_DEPRECATED_ROUTE, STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE, STREAM_VNEXT_DEPRECATED_ROUTE, UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE, UPDATE_AGENT_MODEL_ROUTE, agents_exports, getAgentFromSystem, getSerializedAgentTools, getSerializedProcessors };
829
+ //# sourceMappingURL=chunk-ACZ2PUK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AAA;AAAA,EACd,eAAA,EAAiB,iBAAA;AAAA,EACjB,UAAA,EAAY,wBAAA;AAAA,EACZ,cAAA,EAAgB,oBAAA;AAAA,EAChB,OAAA,EAAS,kCAAA;AAAA,EACT,WAAA,EACE,+GAAA;AAAA,EACF,IAAA,EAAM,CAAC,QAAQ,CAAA;AAAA,EACf,UAAA,EAAY,IAAA;AAAA,EACZ,SAAS,wCAAA,CAAyC;AACpD,CAAC","file":"chunk-ACZ2PUKX.js","sourcesContent":["import type { Agent, AgentModelManagerConfig } from '@mastra/core/agent';\nimport { ErrorCategory, ErrorDomain, MastraError } from '@mastra/core/error';\nimport { PROVIDER_REGISTRY } from '@mastra/core/llm';\nimport type { SystemMessage } from '@mastra/core/llm';\nimport type { InputProcessor, OutputProcessor } from '@mastra/core/processors';\nimport type { RequestContext } from '@mastra/core/request-context';\nimport { zodToJsonSchema } from '@mastra/core/utils/zod-to-json';\nimport { stringify } from 'superjson';\nimport { z } from 'zod';\n\nimport { HTTPException } from '../http-exception';\nimport {\n agentIdPathParams,\n listAgentsResponseSchema,\n serializedAgentSchema,\n agentExecutionBodySchema,\n generateResponseSchema,\n streamResponseSchema,\n providersResponseSchema,\n approveToolCallBodySchema,\n declineToolCallBodySchema,\n toolCallResponseSchema,\n updateAgentModelBodySchema,\n reorderAgentModelListBodySchema,\n updateAgentModelInModelListBodySchema,\n modelManagementResponseSchema,\n modelConfigIdPathParams,\n enhanceInstructionsBodySchema,\n enhanceInstructionsResponseSchema,\n} from '../schemas/agents';\nimport type { ServerRoute } from '../server-adapter/routes';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport type { Context } from '../types';\n\nimport { handleError } from './error';\nimport { sanitizeBody, validateBody } from './utils';\n\nexport interface SerializedProcessor {\n id: string;\n name?: string;\n}\n\nexport interface SerializedTool {\n id: string;\n description?: string;\n inputSchema?: string;\n outputSchema?: string;\n requireApproval?: boolean;\n}\n\ninterface SerializedToolInput {\n id?: string;\n description?: string;\n inputSchema?: { jsonSchema?: unknown } | unknown;\n outputSchema?: { jsonSchema?: unknown } | unknown;\n}\n\nexport interface SerializedWorkflow {\n name: string;\n steps?: Record<string, { id: string; description?: string }>;\n}\n\nexport interface SerializedAgent {\n name: string;\n description?: string;\n instructions?: SystemMessage;\n tools: Record<string, SerializedTool>;\n agents: Record<string, SerializedAgentDefinition>;\n workflows: Record<string, SerializedWorkflow>;\n inputProcessors: SerializedProcessor[];\n outputProcessors: SerializedProcessor[];\n provider?: string;\n modelId?: string;\n modelVersion?: string;\n modelList?: Array<\n Omit<AgentModelManagerConfig, 'model'> & {\n model: {\n modelId: string;\n provider: string;\n modelVersion: string;\n };\n }\n >;\n // We can't use the true types here because they are not serializable\n defaultOptions?: Record<string, unknown>;\n defaultGenerateOptionsLegacy?: Record<string, unknown>;\n defaultStreamOptionsLegacy?: Record<string, unknown>;\n}\n\nexport interface SerializedAgentWithId extends SerializedAgent {\n id: string;\n}\n\nexport async function getSerializedAgentTools(\n tools: Record<string, SerializedToolInput>,\n partial: boolean = false,\n): Promise<Record<string, SerializedTool>> {\n return Object.entries(tools || {}).reduce<Record<string, SerializedTool>>((acc, [key, tool]) => {\n const toolId = tool.id ?? `tool-${key}`;\n\n let inputSchemaForReturn: string | undefined = undefined;\n let outputSchemaForReturn: string | undefined = undefined;\n\n // Only process schemas if not in partial mode\n if (!partial) {\n try {\n if (tool.inputSchema) {\n if (tool.inputSchema && typeof tool.inputSchema === 'object' && 'jsonSchema' in tool.inputSchema) {\n inputSchemaForReturn = stringify(tool.inputSchema.jsonSchema);\n } else if (typeof tool.inputSchema === 'function') {\n const inputSchema = tool.inputSchema();\n if (inputSchema && inputSchema.jsonSchema) {\n inputSchemaForReturn = stringify(inputSchema.jsonSchema);\n }\n } else if (tool.inputSchema) {\n inputSchemaForReturn = stringify(\n zodToJsonSchema(tool.inputSchema as Parameters<typeof zodToJsonSchema>[0]),\n );\n }\n }\n\n if (tool.outputSchema) {\n if (tool.outputSchema && typeof tool.outputSchema === 'object' && 'jsonSchema' in tool.outputSchema) {\n outputSchemaForReturn = stringify(tool.outputSchema.jsonSchema);\n } else if (typeof tool.outputSchema === 'function') {\n const outputSchema = tool.outputSchema();\n if (outputSchema && outputSchema.jsonSchema) {\n outputSchemaForReturn = stringify(outputSchema.jsonSchema);\n }\n } else if (tool.outputSchema) {\n outputSchemaForReturn = stringify(\n zodToJsonSchema(tool.outputSchema as Parameters<typeof zodToJsonSchema>[0]),\n );\n }\n }\n } catch (error) {\n console.error(`Error getting serialized tool`, {\n toolId: tool.id,\n error,\n });\n }\n }\n\n acc[key] = {\n ...tool,\n id: toolId,\n inputSchema: inputSchemaForReturn,\n outputSchema: outputSchemaForReturn,\n };\n return acc;\n }, {});\n}\n\nexport function getSerializedProcessors(processors: (InputProcessor | OutputProcessor)[]): SerializedProcessor[] {\n return processors.map(processor => {\n // Processors are class instances or objects with a name property\n // Use the name property if available, otherwise fall back to constructor name\n return {\n id: processor.id,\n name: processor.name || processor.constructor.name,\n };\n });\n}\n\ninterface SerializedAgentDefinition {\n id: string;\n name: string;\n}\n\nasync function getSerializedAgentDefinition({\n agent,\n requestContext,\n}: {\n agent: Agent;\n requestContext: RequestContext;\n}): Promise<Record<string, SerializedAgentDefinition>> {\n let serializedAgentAgents: Record<string, SerializedAgentDefinition> = {};\n\n if ('listAgents' in agent) {\n const agents = await agent.listAgents({ requestContext });\n serializedAgentAgents = Object.entries(agents || {}).reduce<Record<string, SerializedAgentDefinition>>(\n (acc, [key, agent]) => {\n return {\n ...acc,\n [key]: { id: agent.id, name: agent.name },\n };\n },\n {},\n );\n }\n return serializedAgentAgents;\n}\n\nasync function formatAgentList({\n id,\n mastra,\n agent,\n requestContext,\n partial = false,\n}: {\n id: string;\n mastra: Context['mastra'];\n agent: Agent;\n requestContext: RequestContext;\n partial?: boolean;\n}): Promise<SerializedAgentWithId> {\n const description = agent.getDescription();\n const instructions = await agent.getInstructions({ requestContext });\n const tools = await agent.listTools({ requestContext });\n const llm = await agent.getLLM({ requestContext });\n const defaultGenerateOptionsLegacy = await agent.getDefaultGenerateOptionsLegacy({ requestContext });\n const defaultStreamOptionsLegacy = await agent.getDefaultStreamOptionsLegacy({ requestContext });\n const defaultOptions = await agent.getDefaultOptions({ requestContext });\n const serializedAgentTools = await getSerializedAgentTools(tools, partial);\n\n let serializedAgentWorkflows: Record<\n string,\n { name: string; steps?: Record<string, { id: string; description?: string }> }\n > = {};\n\n if ('listWorkflows' in agent) {\n const logger = mastra.getLogger();\n try {\n const workflows = await agent.listWorkflows({ requestContext });\n serializedAgentWorkflows = Object.entries(workflows || {}).reduce<\n Record<string, { name: string; steps?: Record<string, { id: string; description?: string }> }>\n >((acc, [key, workflow]) => {\n return {\n ...acc,\n [key]: {\n name: workflow.name || 'Unnamed workflow',\n },\n };\n }, {});\n } catch (error) {\n logger.error('Error getting workflows for agent', { agentName: agent.name, error });\n }\n }\n\n const serializedAgentAgents = await getSerializedAgentDefinition({ agent, requestContext });\n\n // Get and serialize processors\n const inputProcessors = await agent.listInputProcessors(requestContext);\n const outputProcessors = await agent.listOutputProcessors(requestContext);\n const serializedInputProcessors = getSerializedProcessors(inputProcessors);\n const serializedOutputProcessors = getSerializedProcessors(outputProcessors);\n\n const model = llm?.getModel();\n const models = await agent.getModelList(requestContext);\n const modelList = models?.map(md => ({\n ...md,\n model: {\n modelId: md.model.modelId,\n provider: md.model.provider,\n modelVersion: md.model.specificationVersion,\n },\n }));\n\n return {\n id: agent.id || id,\n name: agent.name,\n description,\n instructions,\n agents: serializedAgentAgents,\n tools: serializedAgentTools,\n workflows: serializedAgentWorkflows,\n inputProcessors: serializedInputProcessors,\n outputProcessors: serializedOutputProcessors,\n provider: llm?.getProvider(),\n modelId: llm?.getModelId(),\n modelVersion: model?.specificationVersion,\n defaultOptions,\n modelList,\n defaultGenerateOptionsLegacy,\n defaultStreamOptionsLegacy,\n };\n}\n\nexport async function getAgentFromSystem({ mastra, agentId }: { mastra: Context['mastra']; agentId: string }) {\n const logger = mastra.getLogger();\n\n if (!agentId) {\n throw new HTTPException(400, { message: 'Agent ID is required' });\n }\n\n let agent;\n\n try {\n agent = mastra.getAgentById(agentId);\n } catch (error) {\n logger.debug('Error getting agent from mastra, searching agents for agent', error);\n }\n\n if (!agent) {\n logger.debug(`Agent ${agentId} not found, looking through sub-agents`);\n const agents = mastra.listAgents();\n if (Object.keys(agents || {}).length) {\n for (const [_, ag] of Object.entries(agents)) {\n try {\n const subAgents = await ag.listAgents();\n\n if (subAgents[agentId]) {\n agent = subAgents[agentId];\n break;\n }\n } catch (error) {\n logger.debug('Error getting agent from agent', error);\n }\n }\n }\n }\n\n if (!agent) {\n throw new HTTPException(404, { message: `Agent with id ${agentId} not found` });\n }\n\n return agent;\n}\n\nasync function formatAgent({\n mastra,\n agent,\n requestContext,\n isStudio,\n}: {\n mastra: Context['mastra'];\n agent: Agent;\n requestContext: RequestContext;\n isStudio: boolean;\n}): Promise<SerializedAgent> {\n const description = agent.getDescription();\n const tools = await agent.listTools({ requestContext });\n\n const serializedAgentTools = await getSerializedAgentTools(tools);\n\n let serializedAgentWorkflows: Record<\n string,\n { name: string; steps: Record<string, { id: string; description?: string }> }\n > = {};\n\n if ('listWorkflows' in agent) {\n const logger = mastra.getLogger();\n try {\n const workflows = await agent.listWorkflows({ requestContext });\n\n serializedAgentWorkflows = Object.entries(workflows || {}).reduce<\n Record<string, { name: string; steps: Record<string, { id: string; description?: string }> }>\n >((acc, [key, workflow]) => {\n return {\n ...acc,\n [key]: {\n name: workflow.name || 'Unnamed workflow',\n steps: Object.entries(workflow.steps).reduce<Record<string, { id: string; description?: string }>>(\n (acc, [key, step]) => {\n return {\n ...acc,\n [key]: {\n id: step.id,\n description: step.description,\n },\n };\n },\n {},\n ),\n },\n };\n }, {});\n } catch (error) {\n logger.error('Error getting workflows for agent', { agentName: agent.name, error });\n }\n }\n\n let proxyRequestContext = requestContext;\n if (isStudio) {\n proxyRequestContext = new Proxy(requestContext, {\n get(target, prop) {\n if (prop === 'get') {\n return function (key: string) {\n const value = target.get(key);\n return value ?? `<${key}>`;\n };\n }\n return Reflect.get(target, prop);\n },\n });\n }\n\n const instructions = await agent.getInstructions({ requestContext: proxyRequestContext });\n const llm = await agent.getLLM({ requestContext });\n const defaultGenerateOptionsLegacy = await agent.getDefaultGenerateOptionsLegacy({\n requestContext: proxyRequestContext,\n });\n const defaultStreamOptionsLegacy = await agent.getDefaultStreamOptionsLegacy({ requestContext: proxyRequestContext });\n const defaultOptions = await agent.getDefaultOptions({ requestContext: proxyRequestContext });\n\n const model = llm?.getModel();\n const models = await agent.getModelList(requestContext);\n const modelList = models?.map(md => ({\n ...md,\n model: {\n modelId: md.model.modelId,\n provider: md.model.provider,\n modelVersion: md.model.specificationVersion,\n },\n }));\n\n const serializedAgentAgents = await getSerializedAgentDefinition({ agent, requestContext: proxyRequestContext });\n\n // Get and serialize processors\n const inputProcessors = await agent.listInputProcessors(proxyRequestContext);\n const outputProcessors = await agent.listOutputProcessors(proxyRequestContext);\n const serializedInputProcessors = getSerializedProcessors(inputProcessors);\n const serializedOutputProcessors = getSerializedProcessors(outputProcessors);\n\n return {\n name: agent.name,\n description,\n instructions,\n tools: serializedAgentTools,\n agents: serializedAgentAgents,\n workflows: serializedAgentWorkflows,\n inputProcessors: serializedInputProcessors,\n outputProcessors: serializedOutputProcessors,\n provider: llm?.getProvider(),\n modelId: llm?.getModelId(),\n modelVersion: model?.specificationVersion,\n modelList,\n defaultOptions,\n defaultGenerateOptionsLegacy,\n defaultStreamOptionsLegacy,\n };\n}\n\n// ============================================================================\n// Route Definitions (new pattern - handlers defined inline with createRoute)\n// ============================================================================\n\nexport const LIST_AGENTS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents',\n responseType: 'json',\n queryParamSchema: z.object({\n partial: z.string().optional(),\n }),\n responseSchema: listAgentsResponseSchema,\n summary: 'List all agents',\n description: 'Returns a list of all available agents in the system',\n tags: ['Agents'],\n handler: async ({ mastra, requestContext, partial }) => {\n try {\n const agents = mastra.listAgents();\n\n const isPartial = partial === 'true';\n const serializedAgentsMap = await Promise.all(\n Object.entries(agents).map(async ([id, agent]) => {\n return formatAgentList({ id, mastra, agent, requestContext, partial: isPartial });\n }),\n );\n\n const serializedAgents = serializedAgentsMap.reduce<Record<string, (typeof serializedAgentsMap)[number]>>(\n (acc, { id, ...rest }) => {\n acc[id] = { id, ...rest };\n return acc;\n },\n {},\n );\n\n return serializedAgents;\n } catch (error) {\n return handleError(error, 'Error getting agents');\n }\n },\n});\n\nexport const GET_AGENT_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/:agentId',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: serializedAgentSchema,\n summary: 'Get agent by ID',\n description: 'Returns details for a specific agent including configuration, tools, and memory settings',\n tags: ['Agents'],\n handler: async ({ agentId, mastra, requestContext }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n const isStudio = false; // TODO: Get from context if needed\n const result = await formatAgent({\n mastra,\n agent,\n requestContext,\n isStudio,\n });\n return result;\n } catch (error) {\n return handleError(error, 'Error getting agent');\n }\n },\n});\n\nexport const GENERATE_AGENT_ROUTE: ServerRoute<\n z.infer<typeof agentIdPathParams> & z.infer<typeof agentExecutionBodySchema>,\n unknown\n> = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/generate',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: generateResponseSchema,\n summary: 'Generate agent response',\n description: 'Executes an agent with the provided messages and returns the complete response',\n tags: ['Agents'],\n handler: async ({ agentId, mastra, abortSignal, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n const { messages, ...rest } = params;\n\n validateBody({ messages });\n\n const result = await agent.generate(messages, {\n ...rest,\n abortSignal,\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error generating from agent');\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const GENERATE_LEGACY_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/generate-legacy',\n responseType: 'json' as const,\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: generateResponseSchema,\n summary: '[DEPRECATED] Generate with legacy format',\n description: 'Legacy endpoint for generating agent responses. Use /api/agents/:agentId/generate instead.',\n tags: ['Agents', 'Legacy'],\n handler: async ({ mastra, agentId, abortSignal, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n const { messages, resourceId, resourceid, threadId, ...rest } = params;\n // Use resourceId if provided, fall back to resourceid (deprecated)\n const finalResourceId = resourceId ?? resourceid;\n\n validateBody({ messages });\n\n if ((threadId && !finalResourceId) || (!threadId && finalResourceId)) {\n throw new HTTPException(400, { message: 'Both threadId or resourceId must be provided' });\n }\n\n const result = await agent.generateLegacy(messages, {\n ...rest,\n abortSignal,\n resourceId: finalResourceId ?? '',\n threadId: threadId ?? '',\n });\n\n return result;\n } catch (error) {\n return handleError(error, 'Error generating from agent');\n }\n },\n});\n\nexport const STREAM_GENERATE_LEGACY_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/stream-legacy',\n responseType: 'datastream-response' as const,\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream with legacy format',\n description: 'Legacy endpoint for streaming agent responses. Use /api/agents/:agentId/stream instead.',\n tags: ['Agents', 'Legacy'],\n handler: async ({ mastra, agentId, abortSignal, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n const { messages, resourceId, resourceid, threadId, ...rest } = params;\n // Use resourceId if provided, fall back to resourceid (deprecated)\n const finalResourceId = resourceId ?? resourceid;\n\n validateBody({ messages });\n\n if ((threadId && !finalResourceId) || (!threadId && finalResourceId)) {\n throw new HTTPException(400, { message: 'Both threadId or resourceId must be provided' });\n }\n\n const streamResult = await agent.streamLegacy(messages, {\n ...rest,\n abortSignal,\n resourceId: finalResourceId ?? '',\n threadId: threadId ?? '',\n });\n\n const streamResponse = rest.output\n ? streamResult.toTextStreamResponse({\n headers: {\n 'Transfer-Encoding': 'chunked',\n },\n })\n : streamResult.toDataStreamResponse({\n sendUsage: true,\n sendReasoning: true,\n getErrorMessage: (error: any) => {\n return `An error occurred while processing your request. ${error instanceof Error ? error.message : JSON.stringify(error)}`;\n },\n headers: {\n 'Transfer-Encoding': 'chunked',\n },\n });\n\n return streamResponse;\n } catch (error) {\n return handleError(error, 'error streaming agent response');\n }\n },\n});\n\nexport const GET_PROVIDERS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/agents/providers',\n responseType: 'json',\n responseSchema: providersResponseSchema,\n summary: 'List AI providers',\n description: 'Returns a list of all configured AI model providers',\n tags: ['Agents'],\n handler: async () => {\n try {\n const providers = Object.entries(PROVIDER_REGISTRY).map(([id, provider]) => {\n // Check if the provider is connected by checking for its API key env var(s)\n const envVars = Array.isArray(provider.apiKeyEnvVar) ? provider.apiKeyEnvVar : [provider.apiKeyEnvVar];\n const connected = envVars.every(envVar => !!process.env[envVar]);\n\n return {\n id,\n name: provider.name,\n label: (provider as any).label || provider.name,\n description: (provider as any).description || '',\n envVar: provider.apiKeyEnvVar,\n connected,\n docUrl: provider.docUrl,\n models: [...provider.models], // Convert readonly array to regular array\n };\n });\n return { providers };\n } catch (error) {\n return handleError(error, 'Error fetching providers');\n }\n },\n});\n\nexport const GENERATE_AGENT_VNEXT_ROUTE: ServerRoute<\n z.infer<typeof agentIdPathParams> & z.infer<typeof agentExecutionBodySchema>,\n unknown\n> = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/generate/vnext',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: generateResponseSchema,\n summary: 'Generate a response from an agent',\n description: 'Generate a response from an agent',\n tags: ['Agents'],\n handler: GENERATE_AGENT_ROUTE.handler,\n});\n\nexport const STREAM_GENERATE_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/stream',\n responseType: 'stream' as const,\n streamFormat: 'sse' as const,\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream agent response',\n description: 'Executes an agent with the provided messages and streams the response in real-time',\n tags: ['Agents'],\n handler: async ({ mastra, agentId, abortSignal, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n const { messages, ...rest } = params;\n validateBody({ messages });\n\n const streamResult = await agent.stream(messages, {\n ...rest,\n abortSignal,\n });\n\n return streamResult.fullStream;\n } catch (error) {\n return handleError(error, 'error streaming agent response');\n }\n },\n});\n\nexport const STREAM_GENERATE_VNEXT_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/stream/vnext',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream a response from an agent',\n description: '[DEPRECATED] This endpoint is deprecated. Please use /stream instead.',\n tags: ['Agents'],\n deprecated: true,\n handler: STREAM_GENERATE_ROUTE.handler,\n});\n\nexport const APPROVE_TOOL_CALL_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/approve-tool-call',\n responseType: 'stream' as const,\n streamFormat: 'sse' as const,\n pathParamSchema: agentIdPathParams,\n bodySchema: approveToolCallBodySchema,\n responseSchema: toolCallResponseSchema,\n summary: 'Approve tool call',\n description: 'Approves a pending tool call and continues agent execution',\n tags: ['Agents', 'Tools'],\n handler: async ({ mastra, agentId, abortSignal, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n if (!params.runId) {\n throw new HTTPException(400, { message: 'Run id is required' });\n }\n\n if (!params.toolCallId) {\n throw new HTTPException(400, { message: 'Tool call id is required' });\n }\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n const streamResult = await agent.approveToolCall({\n ...params,\n abortSignal,\n });\n\n return streamResult.fullStream;\n } catch (error) {\n return handleError(error, 'error approving tool call');\n }\n },\n});\n\nexport const DECLINE_TOOL_CALL_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/decline-tool-call',\n responseType: 'stream' as const,\n streamFormat: 'sse' as const,\n pathParamSchema: agentIdPathParams,\n bodySchema: declineToolCallBodySchema,\n responseSchema: toolCallResponseSchema,\n summary: 'Decline tool call',\n description: 'Declines a pending tool call and continues agent execution without executing the tool',\n tags: ['Agents', 'Tools'],\n handler: async ({ mastra, agentId, abortSignal, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n if (!params.runId) {\n throw new HTTPException(400, { message: 'Run id is required' });\n }\n\n if (!params.toolCallId) {\n throw new HTTPException(400, { message: 'Tool call id is required' });\n }\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n const streamResult = await agent.declineToolCall({\n ...params,\n abortSignal,\n });\n\n return streamResult.fullStream;\n } catch (error) {\n return handleError(error, 'error declining tool call');\n }\n },\n});\n\nexport const STREAM_NETWORK_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/network',\n responseType: 'stream' as const,\n streamFormat: 'sse' as const,\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema.extend({ thread: z.string().optional() }),\n responseSchema: streamResponseSchema,\n summary: 'Stream agent network',\n description: 'Executes an agent network with multiple agents and streams the response',\n tags: ['Agents'],\n handler: async ({ mastra, messages, agentId, ...params }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n // UI Frameworks may send \"client tools\" in the body,\n // but it interferes with llm providers tool handling, so we remove them\n sanitizeBody(params, ['tools']);\n\n validateBody({ messages });\n\n const streamResult = await agent.network(messages, {\n ...params,\n memory: {\n thread: params.thread ?? params.threadId ?? '',\n resource: params.resourceId ?? '',\n options: params.memory?.options ?? {},\n },\n });\n\n return streamResult;\n } catch (error) {\n return handleError(error, 'error streaming agent loop response');\n }\n },\n});\n\nexport const UPDATE_AGENT_MODEL_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/model',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: updateAgentModelBodySchema,\n responseSchema: modelManagementResponseSchema,\n summary: 'Update agent model',\n description: 'Updates the AI model used by the agent',\n tags: ['Agents', 'Models'],\n handler: async ({ mastra, agentId, modelId, provider }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n // Use the universal Mastra router format: provider/model\n const newModel = `${provider}/${modelId}`;\n\n agent.__updateModel({ model: newModel });\n\n return { message: 'Agent model updated' };\n } catch (error) {\n return handleError(error, 'error updating agent model');\n }\n },\n});\n\nexport const RESET_AGENT_MODEL_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/model/reset',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n responseSchema: modelManagementResponseSchema,\n summary: 'Reset agent model',\n description: 'Resets the agent model to its original configuration',\n tags: ['Agents', 'Models'],\n handler: async ({ mastra, agentId }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n agent.__resetToOriginalModel();\n\n return { message: 'Agent model reset to original' };\n } catch (error) {\n return handleError(error, 'error resetting agent model');\n }\n },\n});\n\nexport const REORDER_AGENT_MODEL_LIST_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/models/reorder',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: reorderAgentModelListBodySchema,\n responseSchema: modelManagementResponseSchema,\n summary: 'Reorder agent model list',\n description: 'Reorders the model list for agents with multiple model configurations',\n tags: ['Agents', 'Models'],\n handler: async ({ mastra, agentId, reorderedModelIds }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n const modelList = await agent.getModelList();\n if (!modelList || modelList.length === 0) {\n throw new HTTPException(400, { message: 'Agent model list is not found or empty' });\n }\n\n agent.reorderModels(reorderedModelIds);\n\n return { message: 'Model list reordered' };\n } catch (error) {\n return handleError(error, 'error reordering model list');\n }\n },\n});\n\nexport const UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/models/:modelConfigId',\n responseType: 'json',\n pathParamSchema: modelConfigIdPathParams,\n bodySchema: updateAgentModelInModelListBodySchema,\n responseSchema: modelManagementResponseSchema,\n summary: 'Update model in model list',\n description: 'Updates a specific model configuration in the agent model list',\n tags: ['Agents', 'Models'],\n handler: async ({ mastra, agentId, modelConfigId, model: bodyModel, maxRetries, enabled }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n const modelList = await agent.getModelList();\n if (!modelList || modelList.length === 0) {\n throw new HTTPException(400, { message: 'Agent model list is not found or empty' });\n }\n\n const modelConfig = modelList.find(config => config.id === modelConfigId);\n if (!modelConfig) {\n throw new HTTPException(404, { message: `Model config with id ${modelConfigId} not found` });\n }\n\n const newModel =\n bodyModel?.modelId && bodyModel?.provider ? `${bodyModel.provider}/${bodyModel.modelId}` : modelConfig.model;\n\n const updated = {\n ...modelConfig,\n model: newModel,\n ...(maxRetries !== undefined ? { maxRetries } : {}),\n ...(enabled !== undefined ? { enabled } : {}),\n };\n\n agent.updateModelInModelList(updated);\n\n return { message: 'Model updated in model list' };\n } catch (error) {\n return handleError(error, 'error updating model in model list');\n }\n },\n});\n\nexport const ENHANCE_INSTRUCTIONS_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/instructions/enhance',\n responseType: 'json',\n pathParamSchema: agentIdPathParams,\n bodySchema: enhanceInstructionsBodySchema,\n responseSchema: enhanceInstructionsResponseSchema,\n summary: 'Enhance agent instructions',\n description: 'Uses AI to enhance or modify agent instructions based on user feedback',\n tags: ['Agents'],\n handler: async ({ mastra, agentId, instructions, comment }) => {\n try {\n const agent = await getAgentFromSystem({ mastra, agentId });\n\n const enhancementPrompt = `You are an expert prompt engineer. Your task is to improve the following agent instructions based on the user's feedback.\n\nCurrent Instructions:\n---\n${instructions}\n---\n\nUser's Feedback/Request:\n${comment}\n\nPlease provide:\n1. An improved version of the instructions that incorporates the user's feedback\n2. A brief explanation of what changes you made and why\n\nImportant:\n- Maintain the overall structure and intent of the original instructions\n- Make targeted improvements based on the user's feedback\n- Keep the instructions clear, concise, and actionable\n- Preserve any specific formatting or sections that are important`;\n\n const result = await agent.generate(enhancementPrompt, {\n structuredOutput: {\n schema: enhanceInstructionsResponseSchema,\n },\n });\n\n return result.object;\n } catch (error) {\n return handleError(error, 'Error enhancing instructions');\n }\n },\n});\n\nexport const STREAM_VNEXT_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/streamVNext',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream a response from an agent',\n description: '[DEPRECATED] This endpoint is deprecated. Please use /stream instead.',\n tags: ['Agents'],\n deprecated: true,\n handler: async () => {\n throw new HTTPException(410, { message: 'This endpoint is deprecated. Please use /stream instead.' });\n },\n});\n\nexport const STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/stream/vnext/ui',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream UI messages from an agent',\n description:\n '[DEPRECATED] This endpoint is deprecated. Please use the @mastra/ai-sdk package for uiMessage transformations',\n tags: ['Agents'],\n deprecated: true,\n handler: async () => {\n try {\n throw new MastraError({\n category: ErrorCategory.USER,\n domain: ErrorDomain.MASTRA_SERVER,\n id: 'DEPRECATED_ENDPOINT',\n text: 'This endpoint is deprecated. Please use the @mastra/ai-sdk package to for uiMessage transformations',\n });\n } catch (error) {\n return handleError(error, 'error streaming agent response');\n }\n },\n});\n\nexport const STREAM_UI_MESSAGE_DEPRECATED_ROUTE = createRoute({\n method: 'POST',\n path: '/api/agents/:agentId/stream/ui',\n responseType: 'stream',\n pathParamSchema: agentIdPathParams,\n bodySchema: agentExecutionBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Stream UI messages from an agent',\n description:\n '[DEPRECATED] This endpoint is deprecated. Please use the @mastra/ai-sdk package for uiMessage transformations',\n tags: ['Agents'],\n deprecated: true,\n handler: STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE.handler,\n});\n"]}
@@ -226,12 +226,22 @@ var generateResponseSchema = z__default.default.any();
226
226
  var streamResponseSchema = z__default.default.any();
227
227
  var speakResponseSchema = z__default.default.any();
228
228
  var executeToolResponseSchema = z__default.default.any();
229
+ var enhanceInstructionsBodySchema = z__default.default.object({
230
+ instructions: z__default.default.string().describe("The current agent instructions to enhance"),
231
+ comment: z__default.default.string().describe("User comment describing how to enhance the instructions")
232
+ });
233
+ var enhanceInstructionsResponseSchema = z__default.default.object({
234
+ explanation: z__default.default.string().describe("Explanation of the changes made"),
235
+ new_prompt: z__default.default.string().describe("The enhanced instructions")
236
+ });
229
237
 
230
238
  exports.agentExecutionBodySchema = agentExecutionBodySchema;
231
239
  exports.agentIdPathParams = agentIdPathParams;
232
240
  exports.agentToolPathParams = agentToolPathParams;
233
241
  exports.approveToolCallBodySchema = approveToolCallBodySchema;
234
242
  exports.declineToolCallBodySchema = declineToolCallBodySchema;
243
+ exports.enhanceInstructionsBodySchema = enhanceInstructionsBodySchema;
244
+ exports.enhanceInstructionsResponseSchema = enhanceInstructionsResponseSchema;
235
245
  exports.executeToolBodySchema = executeToolBodySchema;
236
246
  exports.executeToolContextBodySchema = executeToolContextBodySchema;
237
247
  exports.executeToolResponseSchema = executeToolResponseSchema;
@@ -255,5 +265,5 @@ exports.transcribeSpeechResponseSchema = transcribeSpeechResponseSchema;
255
265
  exports.updateAgentModelBodySchema = updateAgentModelBodySchema;
256
266
  exports.updateAgentModelInModelListBodySchema = updateAgentModelInModelListBodySchema;
257
267
  exports.voiceSpeakersResponseSchema = voiceSpeakersResponseSchema;
258
- //# sourceMappingURL=chunk-X4QMPCTP.cjs.map
259
- //# sourceMappingURL=chunk-X4QMPCTP.cjs.map
268
+ //# sourceMappingURL=chunk-BMYZ4DO6.cjs.map
269
+ //# sourceMappingURL=chunk-BMYZ4DO6.cjs.map