@mastra/server 1.38.0-alpha.9 → 1.39.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/CHANGELOG.md +267 -0
  2. package/dist/_types/@mastra_schema-compat/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +11 -8
  3. package/dist/{api-schema-manifest-E3RU6MLF.cjs → api-schema-manifest-ALHYYJMN.cjs} +4 -4
  4. package/dist/{api-schema-manifest-E3RU6MLF.cjs.map → api-schema-manifest-ALHYYJMN.cjs.map} +1 -1
  5. package/dist/{api-schema-manifest-DNC2KIKD.js → api-schema-manifest-PQ6VZTB3.js} +3 -3
  6. package/dist/{api-schema-manifest-DNC2KIKD.js.map → api-schema-manifest-PQ6VZTB3.js.map} +1 -1
  7. package/dist/chunk-2ONW75MN.cjs +477 -0
  8. package/dist/chunk-2ONW75MN.cjs.map +1 -0
  9. package/dist/{chunk-CJMJQR2K.cjs → chunk-3APAH25G.cjs} +4 -4
  10. package/dist/{chunk-CJMJQR2K.cjs.map → chunk-3APAH25G.cjs.map} +1 -1
  11. package/dist/{chunk-PXYR3D6L.cjs → chunk-3D55EABW.cjs} +3 -9
  12. package/dist/chunk-3D55EABW.cjs.map +1 -0
  13. package/dist/{chunk-WXJSYUBX.cjs → chunk-3KXE2KXE.cjs} +4 -4
  14. package/dist/{chunk-WXJSYUBX.cjs.map → chunk-3KXE2KXE.cjs.map} +1 -1
  15. package/dist/{chunk-APV6QKRZ.cjs → chunk-4W7KQRF5.cjs} +28 -28
  16. package/dist/{chunk-APV6QKRZ.cjs.map → chunk-4W7KQRF5.cjs.map} +1 -1
  17. package/dist/{chunk-L33BLLID.cjs → chunk-544IXGBW.cjs} +168 -166
  18. package/dist/chunk-544IXGBW.cjs.map +1 -0
  19. package/dist/{chunk-VH6QCEN7.cjs → chunk-5DDUXRAY.cjs} +102 -102
  20. package/dist/{chunk-VH6QCEN7.cjs.map → chunk-5DDUXRAY.cjs.map} +1 -1
  21. package/dist/{chunk-DNKTFFOV.cjs → chunk-5WB7PKHN.cjs} +4 -4
  22. package/dist/{chunk-DNKTFFOV.cjs.map → chunk-5WB7PKHN.cjs.map} +1 -1
  23. package/dist/{chunk-ODIMB6T6.cjs → chunk-6MP52DMQ.cjs} +7 -7
  24. package/dist/{chunk-ODIMB6T6.cjs.map → chunk-6MP52DMQ.cjs.map} +1 -1
  25. package/dist/{chunk-3LUN33E7.cjs → chunk-76ONC2XD.cjs} +85 -19
  26. package/dist/chunk-76ONC2XD.cjs.map +1 -0
  27. package/dist/{chunk-TLMAHJTC.cjs → chunk-77IY4RTO.cjs} +16 -16
  28. package/dist/{chunk-TLMAHJTC.cjs.map → chunk-77IY4RTO.cjs.map} +1 -1
  29. package/dist/{chunk-5PCUNLFX.js → chunk-AEH5OCIH.js} +3 -3
  30. package/dist/{chunk-5PCUNLFX.js.map → chunk-AEH5OCIH.js.map} +1 -1
  31. package/dist/{chunk-WADS7CD7.js → chunk-AW5INHG7.js} +4 -4
  32. package/dist/{chunk-WADS7CD7.js.map → chunk-AW5INHG7.js.map} +1 -1
  33. package/dist/{chunk-P7FVOCQB.cjs → chunk-AX6REP5O.cjs} +4 -4
  34. package/dist/{chunk-P7FVOCQB.cjs.map → chunk-AX6REP5O.cjs.map} +1 -1
  35. package/dist/{chunk-4DVNH3KJ.js → chunk-B5NMA52D.js} +4 -4
  36. package/dist/{chunk-4DVNH3KJ.js.map → chunk-B5NMA52D.js.map} +1 -1
  37. package/dist/{chunk-4T6DC425.js → chunk-CBG6LUEW.js} +3 -3
  38. package/dist/{chunk-4T6DC425.js.map → chunk-CBG6LUEW.js.map} +1 -1
  39. package/dist/{chunk-SDBN3DIS.cjs → chunk-D5M3VILP.cjs} +26 -26
  40. package/dist/{chunk-SDBN3DIS.cjs.map → chunk-D5M3VILP.cjs.map} +1 -1
  41. package/dist/{chunk-Z2ZMHHQW.js → chunk-E7AEYMKH.js} +3 -3
  42. package/dist/{chunk-Z2ZMHHQW.js.map → chunk-E7AEYMKH.js.map} +1 -1
  43. package/dist/{chunk-J6OD53OV.js → chunk-ESJTIVEQ.js} +12 -3
  44. package/dist/chunk-ESJTIVEQ.js.map +1 -0
  45. package/dist/{chunk-T2FBYRYD.cjs → chunk-ET7KSUVJ.cjs} +12 -2
  46. package/dist/chunk-ET7KSUVJ.cjs.map +1 -0
  47. package/dist/{chunk-T6IXA4ZQ.js → chunk-FQCCUWMS.js} +3 -3
  48. package/dist/{chunk-T6IXA4ZQ.js.map → chunk-FQCCUWMS.js.map} +1 -1
  49. package/dist/{chunk-QRIHD5UO.js → chunk-G2CL5JMK.js} +5 -5
  50. package/dist/{chunk-QRIHD5UO.js.map → chunk-G2CL5JMK.js.map} +1 -1
  51. package/dist/{chunk-XDOMY4VL.cjs → chunk-GAERIPY2.cjs} +5 -5
  52. package/dist/{chunk-XDOMY4VL.cjs.map → chunk-GAERIPY2.cjs.map} +1 -1
  53. package/dist/{chunk-QM3NYDZZ.js → chunk-HEBNJ6KJ.js} +4 -4
  54. package/dist/{chunk-QM3NYDZZ.js.map → chunk-HEBNJ6KJ.js.map} +1 -1
  55. package/dist/{chunk-AT5ZCHIV.cjs → chunk-HGREXGI2.cjs} +3 -3
  56. package/dist/{chunk-AT5ZCHIV.cjs.map → chunk-HGREXGI2.cjs.map} +1 -1
  57. package/dist/{chunk-RBONVWGZ.js → chunk-HJVMQDSZ.js} +9 -3
  58. package/dist/chunk-HJVMQDSZ.js.map +1 -0
  59. package/dist/{chunk-MFYZWOKE.cjs → chunk-IGE7NPFH.cjs} +5 -5
  60. package/dist/{chunk-MFYZWOKE.cjs.map → chunk-IGE7NPFH.cjs.map} +1 -1
  61. package/dist/{chunk-UFYCA27U.js → chunk-IONXSX77.js} +5 -3
  62. package/dist/chunk-IONXSX77.js.map +1 -0
  63. package/dist/{chunk-RTYOFB6W.cjs → chunk-IU3ZRZSG.cjs} +5 -3
  64. package/dist/chunk-IU3ZRZSG.cjs.map +1 -0
  65. package/dist/{chunk-76I5G5W5.js → chunk-JMEMSVJ5.js} +4 -9
  66. package/dist/chunk-JMEMSVJ5.js.map +1 -0
  67. package/dist/{chunk-56F2IRK3.js → chunk-K6XESXNQ.js} +3 -3
  68. package/dist/{chunk-56F2IRK3.js.map → chunk-K6XESXNQ.js.map} +1 -1
  69. package/dist/{chunk-43KD3CRE.cjs → chunk-LBVQK4LO.cjs} +16 -5
  70. package/dist/chunk-LBVQK4LO.cjs.map +1 -0
  71. package/dist/{chunk-IJFPP2XB.js → chunk-LNBKA6IA.js} +69 -4
  72. package/dist/chunk-LNBKA6IA.js.map +1 -0
  73. package/dist/{chunk-BKYFKSJI.js → chunk-LPYCF5B2.js} +3 -3
  74. package/dist/{chunk-BKYFKSJI.js.map → chunk-LPYCF5B2.js.map} +1 -1
  75. package/dist/{chunk-DRXZDKLU.js → chunk-LQQCTO6D.js} +3 -3
  76. package/dist/{chunk-DRXZDKLU.js.map → chunk-LQQCTO6D.js.map} +1 -1
  77. package/dist/{chunk-HX5BGP6D.cjs → chunk-LYF4J3JE.cjs} +17 -17
  78. package/dist/{chunk-HX5BGP6D.cjs.map → chunk-LYF4J3JE.cjs.map} +1 -1
  79. package/dist/chunk-NQLS4Z3W.js +472 -0
  80. package/dist/chunk-NQLS4Z3W.js.map +1 -0
  81. package/dist/{chunk-KSZXXQHZ.js → chunk-NTE3Q3BA.js} +3 -3
  82. package/dist/{chunk-KSZXXQHZ.js.map → chunk-NTE3Q3BA.js.map} +1 -1
  83. package/dist/{chunk-5FPJ4RT4.js → chunk-OCWY55IQ.js} +3 -3
  84. package/dist/{chunk-5FPJ4RT4.js.map → chunk-OCWY55IQ.js.map} +1 -1
  85. package/dist/{chunk-GPAQ47NG.cjs → chunk-QVFQUBC7.cjs} +9 -3
  86. package/dist/chunk-QVFQUBC7.cjs.map +1 -0
  87. package/dist/{chunk-7GOHECZP.js → chunk-SEAEQN2H.js} +3 -3
  88. package/dist/{chunk-7GOHECZP.js.map → chunk-SEAEQN2H.js.map} +1 -1
  89. package/dist/{chunk-6XSS54BL.cjs → chunk-THXUZHS6.cjs} +7 -7
  90. package/dist/{chunk-6XSS54BL.cjs.map → chunk-THXUZHS6.cjs.map} +1 -1
  91. package/dist/{chunk-M7HLT2GO.js → chunk-UOQHTFYI.js} +3 -3
  92. package/dist/{chunk-M7HLT2GO.js.map → chunk-UOQHTFYI.js.map} +1 -1
  93. package/dist/{chunk-5SK4SJJH.js → chunk-V4G7MSFL.js} +3 -3
  94. package/dist/{chunk-5SK4SJJH.js.map → chunk-V4G7MSFL.js.map} +1 -1
  95. package/dist/{chunk-XB6H6LOM.js → chunk-VSB4S6R5.js} +3 -3
  96. package/dist/{chunk-XB6H6LOM.js.map → chunk-VSB4S6R5.js.map} +1 -1
  97. package/dist/{chunk-4DGDQWQQ.cjs → chunk-VWFP6O2W.cjs} +14 -14
  98. package/dist/{chunk-4DGDQWQQ.cjs.map → chunk-VWFP6O2W.cjs.map} +1 -1
  99. package/dist/{chunk-ZNMKBPTN.cjs → chunk-WUPBIK5J.cjs} +15 -15
  100. package/dist/{chunk-ZNMKBPTN.cjs.map → chunk-WUPBIK5J.cjs.map} +1 -1
  101. package/dist/{chunk-F27R55RI.cjs → chunk-XGFN7MMF.cjs} +4 -4
  102. package/dist/{chunk-F27R55RI.cjs.map → chunk-XGFN7MMF.cjs.map} +1 -1
  103. package/dist/{chunk-YW252K6H.js → chunk-XNGC2C6Z.js} +20 -18
  104. package/dist/chunk-XNGC2C6Z.js.map +1 -0
  105. package/dist/{chunk-7GSR7HQ2.js → chunk-Y5CIOSHU.js} +4 -4
  106. package/dist/{chunk-7GSR7HQ2.js.map → chunk-Y5CIOSHU.js.map} +1 -1
  107. package/dist/{chunk-OJNVSXOF.js → chunk-YH4WGIEH.js} +16 -5
  108. package/dist/chunk-YH4WGIEH.js.map +1 -0
  109. package/dist/{chunk-NSXV3FWO.cjs → chunk-ZIWTQGJV.cjs} +20 -20
  110. package/dist/{chunk-NSXV3FWO.cjs.map → chunk-ZIWTQGJV.cjs.map} +1 -1
  111. package/dist/constants-DVRTNEGY-A5OAGF3M.js +3 -0
  112. package/dist/{constants-SPS7MR4D-YRZDDIPO.js.map → constants-DVRTNEGY-A5OAGF3M.js.map} +1 -1
  113. package/dist/{constants-SPS7MR4D-ZMHAFWSH.cjs → constants-DVRTNEGY-ZGCNETZ3.cjs} +8 -8
  114. package/dist/{constants-SPS7MR4D-ZMHAFWSH.cjs.map → constants-DVRTNEGY-ZGCNETZ3.cjs.map} +1 -1
  115. package/dist/{dist-HIWM6H43.js → dist-LWX2CRMH.js} +304 -125
  116. package/dist/dist-LWX2CRMH.js.map +1 -0
  117. package/dist/{dist-LZYJXHUM.cjs → dist-QFLLP7OJ.cjs} +336 -157
  118. package/dist/dist-QFLLP7OJ.cjs.map +1 -0
  119. package/dist/docs/SKILL.md +1 -1
  120. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  121. package/dist/{observational-memory-TJFOX3YN-A2QE2E3I.cjs → observational-memory-G52HNRHE-73KIWQ2G.cjs} +31 -31
  122. package/dist/{observational-memory-TJFOX3YN-A2QE2E3I.cjs.map → observational-memory-G52HNRHE-73KIWQ2G.cjs.map} +1 -1
  123. package/dist/{observational-memory-TJFOX3YN-P3KG2OXA.js → observational-memory-G52HNRHE-RHA4V77M.js} +4 -4
  124. package/dist/{observational-memory-TJFOX3YN-P3KG2OXA.js.map → observational-memory-G52HNRHE-RHA4V77M.js.map} +1 -1
  125. package/dist/server/auth/helpers.d.ts +3 -4
  126. package/dist/server/auth/helpers.d.ts.map +1 -1
  127. package/dist/server/auth/index.cjs +15 -15
  128. package/dist/server/auth/index.js +1 -1
  129. package/dist/server/handlers/a2a.cjs +14 -14
  130. package/dist/server/handlers/a2a.js +1 -1
  131. package/dist/server/handlers/agent-builder.cjs +17 -17
  132. package/dist/server/handlers/agent-builder.js +1 -1
  133. package/dist/server/handlers/agent-versions.cjs +8 -8
  134. package/dist/server/handlers/agent-versions.js +1 -1
  135. package/dist/server/handlers/agents.cjs +45 -45
  136. package/dist/server/handlers/agents.d.ts +4 -0
  137. package/dist/server/handlers/agents.d.ts.map +1 -1
  138. package/dist/server/handlers/agents.js +1 -1
  139. package/dist/server/handlers/auth.cjs +12 -12
  140. package/dist/server/handlers/auth.js +1 -1
  141. package/dist/server/handlers/conversations.cjs +5 -5
  142. package/dist/server/handlers/conversations.js +1 -1
  143. package/dist/server/handlers/memory.cjs +27 -27
  144. package/dist/server/handlers/memory.d.ts.map +1 -1
  145. package/dist/server/handlers/memory.js +1 -1
  146. package/dist/server/handlers/responses.cjs +4 -4
  147. package/dist/server/handlers/responses.js +1 -1
  148. package/dist/server/handlers/scorer-versions.cjs +8 -8
  149. package/dist/server/handlers/scorer-versions.js +1 -1
  150. package/dist/server/handlers/scores.cjs +7 -7
  151. package/dist/server/handlers/scores.js +1 -1
  152. package/dist/server/handlers/stored-agent-favorites.cjs +3 -3
  153. package/dist/server/handlers/stored-agent-favorites.js +1 -1
  154. package/dist/server/handlers/stored-agents.cjs +12 -8
  155. package/dist/server/handlers/stored-agents.d.ts +26 -0
  156. package/dist/server/handlers/stored-agents.d.ts.map +1 -1
  157. package/dist/server/handlers/stored-agents.js +1 -1
  158. package/dist/server/handlers/stored-scorers.cjs +6 -6
  159. package/dist/server/handlers/stored-scorers.js +1 -1
  160. package/dist/server/handlers/system.cjs +3 -3
  161. package/dist/server/handlers/system.js +1 -1
  162. package/dist/server/handlers/tools.cjs +6 -6
  163. package/dist/server/handlers/tools.js +1 -1
  164. package/dist/server/handlers/workflows.cjs +27 -27
  165. package/dist/server/handlers/workflows.js +1 -1
  166. package/dist/server/handlers.cjs +18 -18
  167. package/dist/server/handlers.js +9 -9
  168. package/dist/server/schemas/agents.d.ts +2 -0
  169. package/dist/server/schemas/agents.d.ts.map +1 -1
  170. package/dist/server/schemas/index.cjs +119 -115
  171. package/dist/server/schemas/index.js +5 -5
  172. package/dist/server/schemas/stored-agents.d.ts +17 -0
  173. package/dist/server/schemas/stored-agents.d.ts.map +1 -1
  174. package/dist/server/server-adapter/index.cjs +23 -16
  175. package/dist/server/server-adapter/index.cjs.map +1 -1
  176. package/dist/server/server-adapter/index.d.ts.map +1 -1
  177. package/dist/server/server-adapter/index.js +11 -4
  178. package/dist/server/server-adapter/index.js.map +1 -1
  179. package/dist/server/server-adapter/routes/stored-agents.d.ts +2 -1
  180. package/dist/server/server-adapter/routes/stored-agents.d.ts.map +1 -1
  181. package/dist/working-memory-state-J7ASTNXX-JNDYMEET.js +3 -0
  182. package/dist/working-memory-state-J7ASTNXX-JNDYMEET.js.map +1 -0
  183. package/dist/working-memory-state-J7ASTNXX-WEIO7C67.cjs +24 -0
  184. package/dist/working-memory-state-J7ASTNXX-WEIO7C67.cjs.map +1 -0
  185. package/package.json +9 -9
  186. package/dist/chunk-3LUN33E7.cjs.map +0 -1
  187. package/dist/chunk-43KD3CRE.cjs.map +0 -1
  188. package/dist/chunk-76I5G5W5.js.map +0 -1
  189. package/dist/chunk-GPAQ47NG.cjs.map +0 -1
  190. package/dist/chunk-IJFPP2XB.js.map +0 -1
  191. package/dist/chunk-J6OD53OV.js.map +0 -1
  192. package/dist/chunk-L33BLLID.cjs.map +0 -1
  193. package/dist/chunk-OJNVSXOF.js.map +0 -1
  194. package/dist/chunk-PXYR3D6L.cjs.map +0 -1
  195. package/dist/chunk-RBONVWGZ.js.map +0 -1
  196. package/dist/chunk-RTYOFB6W.cjs.map +0 -1
  197. package/dist/chunk-T2FBYRYD.cjs.map +0 -1
  198. package/dist/chunk-UFYCA27U.js.map +0 -1
  199. package/dist/chunk-YW252K6H.js.map +0 -1
  200. package/dist/constants-SPS7MR4D-YRZDDIPO.js +0 -3
  201. package/dist/dist-HIWM6H43.js.map +0 -1
  202. package/dist/dist-LZYJXHUM.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,272 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 1.39.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `GET /stored/agents/:storedAgentId/dependents` endpoint that lists agents ([#17183](https://github.com/mastra-ai/mastra/pull/17183))
8
+ referencing a stored agent as a sub-agent.
9
+
10
+ ```ts
11
+ const { dependents, hiddenCount } = await client.getStoredAgent(id).dependents();
12
+ // { dependents: [{ id: 'parent-1', name: 'Triager' }], hiddenCount: 2 }
13
+ ```
14
+
15
+ - `dependents` — caller-readable agents (public agents and the caller's own private
16
+ agents) with `id` + `name`.
17
+ - `hiddenCount` — cross-workspace dependents the caller cannot read, only surfaced
18
+ when the target agent is public.
19
+
20
+ Access mirrors `GET /stored/agents/:storedAgentId` — 404 when the caller cannot
21
+ read the target.
22
+
23
+ ### Patch Changes
24
+
25
+ - Fixed memory status incorrectly reporting memory as enabled for agents without memory configured. The /api/memory/status endpoint now returns false for a resolved agent that has no memory, even when the Mastra instance has storage configured. Previously, Studio would render memory UI for such agents. ([#17506](https://github.com/mastra-ai/mastra/pull/17506))
26
+
27
+ - Fixed subscribed client tools so browser-executed tool results continue through the existing thread subscription instead of opening and canceling a second stream. This prevents closed-stream errors in apps like Agent Builder when multiple client tools run during one response. ([#17532](https://github.com/mastra-ai/mastra/pull/17532))
28
+
29
+ - Updated dependencies [[`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
30
+ - @mastra/core@1.39.0-alpha.0
31
+
32
+ ## 1.38.0
33
+
34
+ ### Minor Changes
35
+
36
+ - Added an agent override export API and server-side ownership enforcement. ([#17228](https://github.com/mastra-ai/mastra/pull/17228))
37
+
38
+ The server and client now expose an agent override export endpoint so Studio can download an agent's overrides as JSON for review or commit workflows. Saves are enforced server-side against each agent's `editor` config, so only owned fields (instructions, tools, or tool descriptions) are persisted and fields locked by the `editor` config are stripped.
39
+
40
+ The system packages response also reports the active editor `source` so clients can render the correct editing experience.
41
+
42
+ - Added `isZodError` helper and `ZodErrorLike` type, exported from `@mastra/server/server-adapter` (and `@mastra/server/handlers/error`). Use these instead of `instanceof ZodError` when handling validation errors in custom server adapters or middleware so the check survives consumers that pin a different `zod` package instance than the one bundled with `@mastra/server`. ([#17172](https://github.com/mastra-ai/mastra/pull/17172))
43
+
44
+ ```ts
45
+ import { isZodError } from '@mastra/server/server-adapter';
46
+
47
+ try {
48
+ await schema.parseAsync(input);
49
+ } catch (error) {
50
+ if (isZodError(error)) {
51
+ // structural check — works across zod v3/v4 realms
52
+ return formatValidationError(error);
53
+ }
54
+ throw error;
55
+ }
56
+ ```
57
+
58
+ Underpins the fix for [#17167](https://github.com/mastra-ai/mastra/issues/17167).
59
+
60
+ - Add fire-and-forget workflow resume that returns immediately with `{ runId }` without awaiting the run output. ([#17230](https://github.com/mastra-ai/mastra/pull/17230))
61
+
62
+ For `@mastra/inngest`, this skips the `getRunOutput()` polling that previously raced a realtime subscription against the Inngest runs API and could surface spurious 404s even though the durable workflow was running fine.
63
+ - `Run.resumeAsync()` added to core: dispatches the resume in the background and returns `{ runId }` immediately. Engines that poll for results (Inngest) override it to skip polling entirely.
64
+ - `InngestRun.resumeAsync()` sends the resume event and returns `{ runId }`, skipping polling. Send-time failures (bad payload, event send failure) still reject synchronously and roll back the snapshot.
65
+ - New `POST /workflows/:workflowId/resume-no-wait` and `POST /agent-builder/:actionId/resume-no-wait` routes return `{ runId }` immediately.
66
+ - New client SDK `run.resumeNoWait()` resolves with `{ runId }`.
67
+
68
+ The existing `resumeAsync()` client/server surface is unchanged and still resolves with the full workflow result, so there is no breaking change.
69
+
70
+ `resumeNoWait` is intentionally additive in v1. In Mastra v2 the fire-and-forget behavior is planned to become the default behavior of `resumeAsync()` (mirroring `start`/`resume` semantics), at which point `resumeNoWait` and the `resume-no-wait` routes will be removed. The code paths carry `TODO(v2)` comments documenting this consolidation.
71
+
72
+ - Add experimental HTTP message routes for agent threads. Servers now expose `POST /agents/:agentId/send-message` and `POST /agents/:agentId/queue-message` for message-first input while keeping `/agents/:agentId/signals` available for lower-level signals and compatibility. ([#17237](https://github.com/mastra-ai/mastra/pull/17237))
73
+
74
+ - Added a `PATCH /tool-providers/:providerId/connections/:connectionId` endpoint and matching client SDK method so authors can rename a connection's display label after creation. ([#17249](https://github.com/mastra-ai/mastra/pull/17249))
75
+
76
+ **Rename a connection from the client SDK**
77
+
78
+ ```ts
79
+ import { MastraClient } from '@mastra/client-js';
80
+
81
+ const client = new MastraClient({ baseUrl: '…' });
82
+
83
+ await client.getToolProvider('composio').updateConnection('auth_abc', {
84
+ label: 'Work inbox',
85
+ });
86
+ ```
87
+
88
+ Pass `label: null` (or an empty string) to clear the existing label. Labels are 1–32 characters and accept letters, digits, spaces, underscores, and hyphens (`[A-Za-z0-9 _-]+`).
89
+
90
+ **Ownership enforced server-side**
91
+
92
+ Non-owners get a 403 unless they hold `tool-providers:admin`. Shared connections are reachable by every author. The label is stored on the connection row itself, so the rename flows to every agent that pins the connection — no per-agent edit needed.
93
+
94
+ - Added the v1 ToolProvider runtime, server routes, client SDK methods, and editor wiring that power OAuth-backed integrations on stored agents. ([#17248](https://github.com/mastra-ai/mastra/pull/17248))
95
+
96
+ **Stored agents can now pin OAuth connections per toolkit**
97
+
98
+ A stored agent's config accepts a new `toolProviders` shape that tells the runtime which connection to bind for each toolkit at execution time. Connections can be scoped per-author, shared across an org, or supplied by the caller.
99
+
100
+ ```ts
101
+ {
102
+ toolProviders: {
103
+ composio: {
104
+ connections: {
105
+ gmail: [{ kind: 'author', toolkit: 'gmail', connectionId: 'auth_abc', scope: 'per-author' }],
106
+ },
107
+ tools: {
108
+ GMAIL_FETCH_EMAILS: { toolkit: 'gmail' },
109
+ },
110
+ },
111
+ },
112
+ }
113
+ ```
114
+
115
+ **New client SDK surface for managing connections**
116
+
117
+ ```ts
118
+ import { MastraClient } from '@mastra/client-js';
119
+
120
+ const client = new MastraClient({ baseUrl: '…' });
121
+ const composio = client.toolProvider('composio');
122
+
123
+ const { items } = await composio.listConnections({ toolkit: 'gmail' });
124
+ await composio.disconnectConnection('auth_abc');
125
+ ```
126
+
127
+ **New `ToolProvider` interface for custom providers**
128
+
129
+ Providers implement a VNext surface (`listToolkitsVNext`, `listToolsVNext`, `resolveToolsVNext`) plus the auth round-trip (`authorize`, `getAuthStatus`, `listConnections`, `disconnectConnection`, `listConnectionFields`, `health`). The Composio provider has been rewritten on this surface; the older catalog methods remain as `@deprecated` shims for back-compat.
130
+
131
+ Connections list responses use `page`/`perPage` pagination, matching the rest of the server surface.
132
+
133
+ Both stored agents (`editor.agent.getById(...)`) and code-defined agents with stored overrides (`editor.agent.applyStoredOverrides(...)`) resolve `toolProviders` at request time, merging provider-resolved tools alongside code/registry/MCP/integration tools.
134
+
135
+ Stored agents that don't set `toolProviders` continue to work unchanged. The Studio/Builder UI ships separately.
136
+
137
+ ### Patch Changes
138
+
139
+ - Separated thread subscription cleanup from active-run aborts so closing or switching a listener only unsubscribes that listener, while explicit cancel still aborts the active run. ([#17310](https://github.com/mastra-ai/mastra/pull/17310))
140
+
141
+ - Added sseFlushOnConnect route option to scope the SSE connected comment to subscribe endpoints only ([#17158](https://github.com/mastra-ai/mastra/pull/17158))
142
+
143
+ - Added subscription-native tool approval APIs so approving or declining a tool call resumes through the active thread subscription instead of requiring a separate continuation stream. New messages are queued while a tool approval is waiting, preventing overlapping runs from duplicating approval requests. ([#17311](https://github.com/mastra-ai/mastra/pull/17311))
144
+
145
+ ```ts
146
+ await agent.sendToolApproval({
147
+ resourceId: 'user-123',
148
+ threadId: 'thread-123',
149
+ toolCallId: 'tool-call-123',
150
+ approved: true,
151
+ });
152
+ ```
153
+
154
+ - Moved shared voice primitives and route metadata into the new `@internal/voice` package so voice providers no longer depend on `@mastra/core` and server voice routes share the same route definitions. ([#16725](https://github.com/mastra-ai/mastra/pull/16725))
155
+
156
+ `@mastra/core/voice` continues to re-export the voice APIs for backwards compatibility.
157
+
158
+ - Fix custom providers appearing twice in Studio's provider selector. ([#17441](https://github.com/mastra-ai/mastra/pull/17441))
159
+
160
+ In dev mode, `GatewayRegistry` registers custom gateways so `PROVIDER_REGISTRY` already contains them with prefixed keys (e.g. `"melioffice/genai"`). The `/agents/providers` handler then called `gateway.fetchProviders()` again and re-added them, but the live call returns raw unprefixed keys (e.g. `"genai"`) which after prefixing produce the same key — however in some cases the keys differed, causing both entries to appear in the UI.
161
+
162
+ The fix skips adding a provider from the live `fetchProviders()` call if it is already present in `allProviders` from `PROVIDER_REGISTRY`.
163
+
164
+ - Fixed a startup crash that affected deployments pinning an older `@mastra/core` version. The server now boots successfully even when the installed `@mastra/core` doesn't include the Agent Builder runtime. ([#17382](https://github.com/mastra-ai/mastra/pull/17382))
165
+
166
+ **Symptom**
167
+
168
+ Deployed servers failed to start with `ERR_MODULE_NOT_FOUND` pointing at `@mastra/core/dist/agent-builder/ee/index.js`, even on apps that never used the Agent Builder.
169
+
170
+ **What changed**
171
+
172
+ The server no longer eagerly loads the Agent Builder runtime at boot. It's loaded on demand, only when a request actually needs it on an app that has configured a `MastraEditor` with builder support.
173
+
174
+ No application code changes required.
175
+
176
+ - Fixed sub-agent version resolution in supervisor mode. Sub-agents now inherit the parent's draft/published version semantics — when chatting in the editor (draft mode), sub-agents resolve to their latest draft version; in the main agent chat (published mode), sub-agents resolve to their published version. Previously, sub-agents without explicit per-agent version overrides always fell back to the code-defined default, ignoring the parent's version context. ([#17165](https://github.com/mastra-ai/mastra/pull/17165))
177
+
178
+ - Stored agent and skill POST, PATCH, and skill publish responses now include `isFavorited`, matching GET behavior. Clients can read favorite status from write responses without an extra GET request. ([#17246](https://github.com/mastra-ai/mastra/pull/17246))
179
+
180
+ Under auth-off, write responses also omit `favoriteCount` to match GET, so the response shape is consistent across all single-entity endpoints.
181
+
182
+ - Fixed memory status reporting for agents that do not support Mastra memory. The memory status endpoint now preserves storage fallback for regular agents while allowing integrations to opt out of memory UI. ([#16906](https://github.com/mastra-ai/mastra/pull/16906))
183
+
184
+ - Scoped the SSE connected comment to subscribe routes only and added SSE comment passthrough for Fastify and NestJS adapters ([#17158](https://github.com/mastra-ai/mastra/pull/17158))
185
+
186
+ - Hardened v1 ToolProvider connection routes and SDK forwarding. ([#17248](https://github.com/mastra-ai/mastra/pull/17248))
187
+
188
+ **Fail closed on unknown `connectionId`**
189
+
190
+ `DELETE /tool-providers/:providerId/connections/:connectionId` and
191
+ `GET …/usage` now return `403` when storage is configured but no persisted
192
+ row matches the supplied `connectionId` and the caller isn't an admin.
193
+ Previously these routes fell through to the caller's own `authorId`, which
194
+ let non-admin callers probe (and trigger provider-side `revokeConnection`
195
+ for) IDs that didn't belong to them.
196
+
197
+ **Aligned authorize label validation with stored label rules**
198
+
199
+ `POST /tool-providers/:providerId/authorize` now enforces the same label
200
+ rules the stored `toolProviders` config uses (`min(1)`, `max(32)`,
201
+ `/^[A-Za-z0-9 _-]+$/`). Labels that pass `authorize` are now guaranteed to
202
+ pass downstream stored-agent validation.
203
+
204
+ **SDK forwards `toolkit` on connection-scoped operations**
205
+
206
+ `@mastra/client-js`:
207
+
208
+ ```ts
209
+ await client.toolProviders.get('composio').disconnectConnection('ca_xxx', {
210
+ toolkit: 'gmail',
211
+ force: true,
212
+ });
213
+
214
+ const usage = await client.toolProviders.get('composio').getConnectionUsage('ca_xxx', { toolkit: 'gmail' });
215
+ ```
216
+
217
+ `disconnectConnection` now forwards `params.toolkit` (previously dropped)
218
+ and `getConnectionUsage` accepts an optional `{ toolkit }` parameter so
219
+ toolkit-scoped connection lookups disambiguate correctly server-side.
220
+
221
+ - Lazy-load `@mastra/core/tool-provider` inside the tool-provider handler so ([#17248](https://github.com/mastra-ai/mastra/pull/17248))
222
+ `@mastra/server` evaluates under any peer-compatible `@mastra/core` (peer floor
223
+ remains `>=1.34.0-0`). The handler no longer imports `SHARED_BUCKET_ID` or
224
+ `UnknownToolProviderError` at module load — `SHARED_BUCKET_ID` is mirrored as a
225
+ local literal (verified in lockstep with core via a regression test), and
226
+ `UnknownToolProviderError` is resolved via a cached `await import(...)` inside
227
+ `resolveProvider` so the real class identity is preserved for `instanceof`.
228
+
229
+ OSS users running `Mastra` without a `MastraEditor` are unaffected: every
230
+ tool-provider route still short-circuits with HTTP 500 "Editor is not
231
+ configured" via `requireEditor(...)` before any core/tool-provider value is
232
+ touched. Users with a `MastraEditor` already pull a compatible core
233
+ transitively through `@mastra/editor`. Tool-provider routes require the new
234
+ core exports at request time only — older cores surface a clear runtime error
235
+ instead of crashing the server at boot.
236
+
237
+ - Improved observability and error isolation in the v1 ToolProvider runtime. ([#17248](https://github.com/mastra-ai/mastra/pull/17248))
238
+
239
+ **Better visibility into connection-scope misconfiguration**
240
+
241
+ When an agent runs with a stored ToolProvider connection whose scope cannot be resolved from the request context, the runtime now logs a one-shot warning and falls back to a shared bucket instead of silently routing every caller to the same OAuth account. Multi-tenant deployments get a clear signal when their identity wiring isn't reaching the runtime.
242
+
243
+ **One bad toolkit no longer disables sibling providers**
244
+
245
+ If a provider returns more connections for a toolkit than its declared capabilities allow, the runtime now logs and skips that toolkit instead of throwing. Other providers and other toolkits on the same agent continue to resolve normally.
246
+
247
+ - Workflows now support an optional `metadata` field for attaching custom key-value data such as `displayName`, `author`, or `category`. Metadata is preserved through serialization and returned in workflow info API responses. ([#17355](https://github.com/mastra-ai/mastra/pull/17355))
248
+
249
+ ```typescript
250
+ // Define a workflow with metadata
251
+ const myWorkflow = createWorkflow({
252
+ id: 'data-processing',
253
+ metadata: {
254
+ displayName: 'Data Processing Pipeline',
255
+
256
+ category: 'ETL',
257
+ },
258
+ inputSchema: z.object({ ... }),
259
+ outputSchema: z.object({ ... }),
260
+ });
261
+
262
+ // Retrieve workflow info with metadata via the Mastra Server API
263
+ const workflowInfo = await mastraClient.getWorkflow('data-processing');
264
+ console.log(workflowInfo.metadata?.displayName); // "Data Processing Pipeline"
265
+ ```
266
+
267
+ - Updated dependencies [[`fa63872`](https://github.com/mastra-ai/mastra/commit/fa6387280954e6b667bec5714b55ba082bc627ff), [`d779de3`](https://github.com/mastra-ai/mastra/commit/d779de3cd9d2e7ed8110547190e2f15e786a0e41), [`1750c97`](https://github.com/mastra-ai/mastra/commit/1750c975d6179fbf6db2813b15229d4f8f23fc55), [`9283971`](https://github.com/mastra-ai/mastra/commit/928397157009b4aef4d5fdf3a0a273cb371beb55), [`f07b646`](https://github.com/mastra-ai/mastra/commit/f07b64604ab7d25391179790b7fd4823df9e2dff), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`40f9297`](https://github.com/mastra-ai/mastra/commit/40f9297003b921c62373d3e8d3a4bda76c9f6de3), [`19a8658`](https://github.com/mastra-ai/mastra/commit/19a86589c788ef48bb6c1b0612cc82a201857379), [`850af77`](https://github.com/mastra-ai/mastra/commit/850af7779cb87c350804488734544a5b1843de25), [`0f0d1ba`](https://github.com/mastra-ai/mastra/commit/0f0d1ba67bfcb2204e571401662f1eceefc03357), [`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15), [`8c31bcd`](https://github.com/mastra-ai/mastra/commit/8c31bcdb00e597880d5939b1b7d7566fbe5dacae), [`0e32507`](https://github.com/mastra-ai/mastra/commit/0e32507962cdfa5569b7bda5bc6fb3dd34e40b03), [`95b14cd`](https://github.com/mastra-ai/mastra/commit/95b14cdd820e86d97ac05fe568424c513a252e31), [`07c3de7`](https://github.com/mastra-ai/mastra/commit/07c3de7f7bc418beccaea3b5e6b7f7cdda79d492), [`0bf2d93`](https://github.com/mastra-ai/mastra/commit/0bf2d932d20e2936f2d9abb8c0a86e24fbc97ec6), [`7b0d34c`](https://github.com/mastra-ai/mastra/commit/7b0d34cfe4a2fce22ac86ae17404685ff67a2ddb), [`a659a77`](https://github.com/mastra-ai/mastra/commit/a659a779bdebe3a52a518c56d2260592d0240fe0), [`aa36be2`](https://github.com/mastra-ai/mastra/commit/aa36be23aa513b7dc53cb8ca16b7fab8f20e43ad), [`3332be9`](https://github.com/mastra-ai/mastra/commit/3332be9701ecd77aba840959d9a1d1ce7aef02d3), [`212c635`](https://github.com/mastra-ai/mastra/commit/212c635203e61d036ab41db8ff86c3893dc795b3), [`d8838ae`](https://github.com/mastra-ai/mastra/commit/d8838ae80b69780361693d27098f7f6684af12fe), [`9aa5a73`](https://github.com/mastra-ai/mastra/commit/9aa5a73e7e110f6e9365eec69364a33d5f03bb56), [`f73c789`](https://github.com/mastra-ai/mastra/commit/f73c789e8ef21561580395d2c410119cab5848c8), [`8bd16da`](https://github.com/mastra-ai/mastra/commit/8bd16da73a4cb874d739373643dbd6a6e7f88684), [`c8630f8`](https://github.com/mastra-ai/mastra/commit/c8630f80d4f40cb5d22e60ab162b618b1907167a), [`94dfef6`](https://github.com/mastra-ai/mastra/commit/94dfef6e2bf19a88467ea3940afcbce88a433f0f), [`47f71dc`](https://github.com/mastra-ai/mastra/commit/47f71dc6fbcbd12d71e21a979e676e20a02bd77d), [`50ceae2`](https://github.com/mastra-ai/mastra/commit/50ceae270878e2f8fb2b2c6c2faab09df0007c8a), [`a122f79`](https://github.com/mastra-ai/mastra/commit/a122f79427ae225ec79c7b2ed46278da48d04b17), [`8cdde58`](https://github.com/mastra-ai/mastra/commit/8cdde5875bbba6702d9df226f2b20232b8d75d6c), [`3a081c1`](https://github.com/mastra-ai/mastra/commit/3a081c1255c5ae8c99f6dad91cc612934ef6f2bd), [`49f8abc`](https://github.com/mastra-ai/mastra/commit/49f8abce8258e4f2f87bd326acfbdb641264a47c), [`847ff1e`](https://github.com/mastra-ai/mastra/commit/847ff1e0d94368d94b2e173e4e0908e115568ef3), [`0c1ed1d`](https://github.com/mastra-ai/mastra/commit/0c1ed1d00c7d87b5ac99ca95896211a2fa9189fa), [`259d409`](https://github.com/mastra-ai/mastra/commit/259d409a514174299dbde1ff5e1121209b3ba850), [`9e16c68`](https://github.com/mastra-ai/mastra/commit/9e16c6818b6485ccb43df28aba6f3a2219d28662), [`cefca33`](https://github.com/mastra-ai/mastra/commit/cefca33ae666e69810c935fedf95a929c173d1d7), [`d00e8c5`](https://github.com/mastra-ai/mastra/commit/d00e8c50daebe5bce5bf2f48bde39c86fc3d2fe4), [`36fa7e2`](https://github.com/mastra-ai/mastra/commit/36fa7e24d14e58a1eb46147097b32f583e5b8775), [`87e9774`](https://github.com/mastra-ai/mastra/commit/87e97741c1e493cd6d62f478eb810b49bda4d57c), [`65a72e7`](https://github.com/mastra-ai/mastra/commit/65a72e70c25eedea8ff985a6624b96be2850236b), [`fe9eacd`](https://github.com/mastra-ai/mastra/commit/fe9eacd9545a0a9d64aad31c9fa90294a425289e), [`4c02027`](https://github.com/mastra-ai/mastra/commit/4c020277235eaa6b1dc957c90ad0639eef213992), [`0f77241`](https://github.com/mastra-ai/mastra/commit/0f7724108806703799a8ba80ad0f09414afd5066), [`849efb9`](https://github.com/mastra-ai/mastra/commit/849efb9fca6dc976589c1f90a303fea618769109), [`92ff509`](https://github.com/mastra-ai/mastra/commit/92ff5098ef8a990438ca038077021a5f7541ec1d), [`3fce5e7`](https://github.com/mastra-ai/mastra/commit/3fce5e70d011d289043e75003ef3336ed4aa43c3), [`a763592`](https://github.com/mastra-ai/mastra/commit/a763592c3db46963ef1011cfe16fe372816e775e), [`db79c86`](https://github.com/mastra-ai/mastra/commit/db79c86c60723d57e02f9636ca2611bd4515f194), [`6855012`](https://github.com/mastra-ai/mastra/commit/685501247cc4717506f3e89beed03509d63a5370), [`80c7737`](https://github.com/mastra-ai/mastra/commit/80c7737e32d7917b5f356957d67c169d01744fd3), [`7fef31c`](https://github.com/mastra-ai/mastra/commit/7fef31c0d2a6d362a43a647a8a4f6ab893758a23), [`7fef31c`](https://github.com/mastra-ai/mastra/commit/7fef31c0d2a6d362a43a647a8a4f6ab893758a23), [`3f1cf47`](https://github.com/mastra-ai/mastra/commit/3f1cf476f74c1e4cc2df908837e05853a5347e31)]:
268
+ - @mastra/core@1.38.0
269
+
3
270
  ## 1.38.0-alpha.9
4
271
 
5
272
  ### Patch Changes
@@ -1549,16 +1549,16 @@ declare interface EventSourceMessage {
1549
1549
  * implementation in that browsers will default this to `message`, whereas this parser will
1550
1550
  * leave this as `undefined` if not explicitly declared.
1551
1551
  */
1552
- event?: string | undefined
1552
+ event?: string | undefined;
1553
1553
  /**
1554
1554
  * ID of the message, if any was provided by the server. Can be used by clients to keep the
1555
1555
  * last received message ID in sync when reconnecting.
1556
1556
  */
1557
- id?: string | undefined
1557
+ id?: string | undefined;
1558
1558
  /**
1559
1559
  * The data received for this message
1560
1560
  */
1561
- data: string
1561
+ data: string;
1562
1562
  }
1563
1563
 
1564
1564
  /**
@@ -1582,8 +1582,11 @@ declare interface EventSourceMessage {
1582
1582
  *
1583
1583
  * @public
1584
1584
  */
1585
- declare class EventSourceParserStream extends TransformStream<string, EventSourceMessage> {
1586
- constructor({onError, onRetry, onComment}?: StreamOptions)
1585
+ declare class EventSourceParserStream extends TransformStream<
1586
+ string,
1587
+ EventSourceMessage
1588
+ > {
1589
+ constructor({ onError, onRetry, onComment }?: StreamOptions);
1587
1590
  }
1588
1591
 
1589
1592
  /**
@@ -6830,19 +6833,19 @@ declare interface StreamOptions {
6830
6833
  *
6831
6834
  * @defaultValue `undefined`
6832
6835
  */
6833
- onError?: ('terminate' | ((error: Error) => void)) | undefined
6836
+ onError?: ("terminate" | ((error: Error) => void)) | undefined;
6834
6837
  /**
6835
6838
  * Callback for when a reconnection interval is sent from the server.
6836
6839
  *
6837
6840
  * @param retry - The number of milliseconds to wait before reconnecting.
6838
6841
  */
6839
- onRetry?: ((retry: number) => void) | undefined
6842
+ onRetry?: ((retry: number) => void) | undefined;
6840
6843
  /**
6841
6844
  * Callback for when a comment is encountered in the stream.
6842
6845
  *
6843
6846
  * @param comment - The comment encountered in the stream.
6844
6847
  */
6845
- onComment?: ((comment: string) => void) | undefined
6848
+ onComment?: ((comment: string) => void) | undefined;
6846
6849
  }
6847
6850
 
6848
6851
  /**
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkL33BLLID_cjs = require('./chunk-L33BLLID.cjs');
3
+ var chunk544IXGBW_cjs = require('./chunk-544IXGBW.cjs');
4
4
  var chunkRZR7PLFW_cjs = require('./chunk-RZR7PLFW.cjs');
5
5
 
6
6
  // src/server/server-adapter/api-schema-manifest.ts
@@ -34,7 +34,7 @@ function inferResponseShape(responseSchema) {
34
34
  function isManifestRoute(route) {
35
35
  return route.responseType === "json" && !route.deprecated;
36
36
  }
37
- function buildApiSchemaManifest(routes = chunkL33BLLID_cjs.SERVER_ROUTES) {
37
+ function buildApiSchemaManifest(routes = chunk544IXGBW_cjs.SERVER_ROUTES) {
38
38
  return {
39
39
  version: 1,
40
40
  routes: routes.filter(isManifestRoute).map((route) => {
@@ -54,5 +54,5 @@ function buildApiSchemaManifest(routes = chunkL33BLLID_cjs.SERVER_ROUTES) {
54
54
  }
55
55
 
56
56
  exports.buildApiSchemaManifest = buildApiSchemaManifest;
57
- //# sourceMappingURL=api-schema-manifest-E3RU6MLF.cjs.map
58
- //# sourceMappingURL=api-schema-manifest-E3RU6MLF.cjs.map
57
+ //# sourceMappingURL=api-schema-manifest-ALHYYJMN.cjs.map
58
+ //# sourceMappingURL=api-schema-manifest-ALHYYJMN.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/server-adapter/api-schema-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ONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"names":["schemaToJsonSchema","SERVER_ROUTES"],"mappings":";;;;;;AA2BA,SAAS,cAAc,MAAA,EAA4D;AACjF,EAAA,OAAO,MAAA,GAASA,oCAAA,CAAmB,MAAM,CAAA,GAAI,MAAA;AAC/C;AAEA,SAAS,aAAa,KAAA,EAAyC;AAC7D,EAAA,OAAO,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAK,KAAA,GAAwB,MAAA;AAChG;AAEA,SAAS,WAAW,MAAA,EAAkE;AACpF,EAAA,MAAM,OAAO,MAAA,EAAQ,IAAA;AACrB,EAAA,OAAO,MAAM,OAAA,CAAQ,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,GAAI,IAAA;AACpD;AAEA,SAAS,mBAAmB,cAAA,EAAiE;AAC3F,EAAA,IAAI,CAAC,cAAA,EAAgB,OAAO,EAAE,MAAM,SAAA,EAAU;AAE9C,EAAA,MAAM,IAAA,GAAO,WAAW,cAAc,CAAA;AACtC,EAAA,IAAI,IAAA,KAAS,OAAA,EAAS,OAAO,EAAE,MAAM,OAAA,EAAQ;AAC7C,EAAA,IAAI,IAAA,KAAS,QAAA,EAAU,OAAO,EAAE,MAAM,QAAA,EAAS;AAE/C,EAAA,MAAM,UAAA,GAC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ACd,MAAM,KAAA,CAAM,IAAA;AAAA,QACZ,cAAc,KAAA,CAAM,YAAA;AAAA,QACpB,eAAA,EAAiB,aAAA,CAAc,KAAA,CAAM,eAAe,CAAA;AAAA,QACpD,gBAAA,EAAkB,aAAA,CAAc,KAAA,CAAM,gBAAgB,CAAA;AAAA,QACtD,UAAA,EAAY,aAAA,CAAc,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C,cAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,cAAc;AAAA,OAClD;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"api-schema-manifest-ALHYYJMN.cjs","sourcesContent":["import type { JSONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { SERVER_ROUTES } from './chunk-YW252K6H.js';
1
+ import { SERVER_ROUTES } from './chunk-XNGC2C6Z.js';
2
2
  import { schemaToJsonSchema } from './chunk-YQL3TXSD.js';
3
3
 
4
4
  // src/server/server-adapter/api-schema-manifest.ts
@@ -52,5 +52,5 @@ function buildApiSchemaManifest(routes = SERVER_ROUTES) {
52
52
  }
53
53
 
54
54
  export { buildApiSchemaManifest };
55
- //# sourceMappingURL=api-schema-manifest-DNC2KIKD.js.map
56
- //# sourceMappingURL=api-schema-manifest-DNC2KIKD.js.map
55
+ //# sourceMappingURL=api-schema-manifest-PQ6VZTB3.js.map
56
+ //# sourceMappingURL=api-schema-manifest-PQ6VZTB3.js.map
@@ -1 +1 @@
1
-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Schema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/server/server-adapter/api-schema-manifest.ts"],"names":[],"mappings":";;;;AA2BA,SAAS,cAAc,MAAA,EAA4D;AACjF,EAAA,OAAO,MAAA,GAAS,kBAAA,CAAmB,MAAM,CAAA,GAAI,MAAA;AAC/C;AAEA,SAAS,aAAa,KAAA,EAAyC;AAC7D,EAAA,OAAO,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAK,KAAA,GAAwB,MAAA;AAChG;AAEA,SAAS,WAAW,MAAA,EAAkE;AACpF,EAAA,MAAM,OAAO,MAAA,EAAQ,IAAA;AACrB,EAAA,OAAO,MAAM,OAAA,CAAQ,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,GAAI,IAAA;AACpD;AAEA,SAAS,mBAAmB,cAAA,EAAiE;AAC3F,EAAA,IAAI,CAAC,cAAA,EAAgB,OAAO,EAAE,MAAM,SAAA,EAAU;AAE9C,EAAA,MAAM,IAAA,GAAO,WAAW,cAAc,CAAA;AACtC,EAAA,IAAI,IAAA,KAAS,OAAA,EAAS,OAAO,EAAE,MAAM,OAAA,EAAQ;AAC7C,EAAA,IAAI,IAAA,KAAS,QAAA,EAAU,OAAO,EAAE,MAAM,QAAA,EAAS;AAE/C,EAAA,MAAM,UAAA,GACJ,cAAA,CAAe,UAAA,IAAc,CA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,QACZ,cAAc,KAAA,CAAM,YAAA;AAAA,QACpB,eAAA,EAAiB,aAAA,CAAc,KAAA,CAAM,eAAe,CAAA;AAAA,QACpD,gBAAA,EAAkB,aAAA,CAAc,KAAA,CAAM,gBAAgB,CAAA;AAAA,QACtD,UAAA,EAAY,aAAA,CAAc,KAAA,CAAM,UAAU,CAAA;AAAA,QAC1C,cAAA;AAAA,QACA,aAAA,EAAe,mBAAmB,cAAc;AAAA,OAClD;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"api-schema-manifest-PQ6VZTB3.js","sourcesContent":["import type { JSONSchema7 } from '@mastra/schema-compat';\nimport { schemaToJsonSchema } from './openapi-utils';\nimport { SERVER_ROUTES } from './routes/index';\nimport type { ServerRoute } from './routes/index';\n\nexport interface ApiSchemaResponseShape {\n kind: 'array' | 'record' | 'object-property' | 'single' | 'unknown';\n listProperty?: string;\n paginationProperty?: string;\n}\n\nexport interface ApiSchemaManifestRoute {\n method: string;\n path: string;\n responseType: string;\n pathParamSchema?: JSONSchema7;\n queryParamSchema?: JSONSchema7;\n bodySchema?: JSONSchema7;\n responseSchema?: JSONSchema7;\n responseShape: ApiSchemaResponseShape;\n}\n\nexport interface ApiSchemaManifest {\n version: 1;\n routes: ApiSchemaManifestRoute[];\n}\n\nfunction convertSchema(schema: ServerRoute['bodySchema']): JSONSchema7 | undefined {\n return schema ? schemaToJsonSchema(schema) : undefined;\n}\n\nfunction asJsonSchema(value: unknown): JSONSchema7 | undefined {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as JSONSchema7) : undefined;\n}\n\nfunction schemaType(schema: JSONSchema7 | undefined): JSONSchema7['type'] | undefined {\n const type = schema?.type;\n return Array.isArray(type) ? type.find(Boolean) : type;\n}\n\nfunction inferResponseShape(responseSchema: JSONSchema7 | undefined): ApiSchemaResponseShape {\n if (!responseSchema) return { kind: 'unknown' };\n\n const type = schemaType(responseSchema);\n if (type === 'array') return { kind: 'array' };\n if (type !== 'object') return { kind: 'single' };\n\n const properties =\n responseSchema.properties && !Array.isArray(responseSchema.properties) ? responseSchema.properties : {};\n const propertyNames = Object.keys(properties);\n const paginationProperty = 'page' in properties ? 'page' : 'pagination' in properties ? 'pagination' : undefined;\n const listProperty = Object.entries(properties).find(\n ([, property]) => schemaType(asJsonSchema(property)) === 'array',\n )?.[0];\n\n if (listProperty && (paginationProperty || propertyNames.length <= 2)) {\n return { kind: 'object-property', listProperty, paginationProperty };\n }\n if (responseSchema.additionalProperties && propertyNames.length === 0) return { kind: 'record' };\n return { kind: 'single' };\n}\n\nfunction isManifestRoute(route: ServerRoute): boolean {\n return route.responseType === 'json' && !route.deprecated;\n}\n\nexport function buildApiSchemaManifest(routes: readonly ServerRoute[] = SERVER_ROUTES): ApiSchemaManifest {\n return {\n version: 1,\n routes: routes.filter(isManifestRoute).map(route => {\n const responseSchema = convertSchema(route.responseSchema);\n return {\n method: route.method,\n path: route.path,\n responseType: route.responseType,\n pathParamSchema: convertSchema(route.pathParamSchema),\n queryParamSchema: convertSchema(route.queryParamSchema),\n bodySchema: convertSchema(route.bodySchema),\n responseSchema,\n responseShape: inferResponseShape(responseSchema),\n };\n }),\n };\n}\n"]}