@mastra/server 0.0.0-fix-thread-list-20251105222841 → 0.0.0-fix-issue-10434-concurrent-write-corruption-20251124213939

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 (226) hide show
  1. package/CHANGELOG.md +419 -3
  2. package/dist/chunk-2NW6POYK.cjs +89 -0
  3. package/dist/chunk-2NW6POYK.cjs.map +1 -0
  4. package/dist/chunk-35NT4TMQ.cjs +201 -0
  5. package/dist/chunk-35NT4TMQ.cjs.map +1 -0
  6. package/dist/{chunk-ALOLTNSO.js → chunk-3R5EV3HV.js} +208 -21
  7. package/dist/chunk-3R5EV3HV.js.map +1 -0
  8. package/dist/{chunk-XXGID4PQ.cjs → chunk-4ECGVOJZ.cjs} +214 -21
  9. package/dist/chunk-4ECGVOJZ.cjs.map +1 -0
  10. package/dist/chunk-5PONYNYP.cjs +125 -0
  11. package/dist/chunk-5PONYNYP.cjs.map +1 -0
  12. package/dist/chunk-5W4RPVTK.cjs +49 -0
  13. package/dist/chunk-5W4RPVTK.cjs.map +1 -0
  14. package/dist/chunk-6DTV6NEW.js +116 -0
  15. package/dist/chunk-6DTV6NEW.js.map +1 -0
  16. package/dist/chunk-7WTETKRM.cjs +1064 -0
  17. package/dist/chunk-7WTETKRM.cjs.map +1 -0
  18. package/dist/chunk-AEO6IHLK.cjs +368 -0
  19. package/dist/chunk-AEO6IHLK.cjs.map +1 -0
  20. package/dist/chunk-ASZUOBKV.js +310 -0
  21. package/dist/chunk-ASZUOBKV.js.map +1 -0
  22. package/dist/{chunk-M6KNPIZZ.cjs → chunk-BM7RP6NK.cjs} +1625 -1159
  23. package/dist/chunk-BM7RP6NK.cjs.map +1 -0
  24. package/dist/{chunk-QXWWLCTQ.js → chunk-BMKFP3XR.js} +594 -131
  25. package/dist/chunk-BMKFP3XR.js.map +1 -0
  26. package/dist/chunk-ECIVTQ4E.js +354 -0
  27. package/dist/chunk-ECIVTQ4E.js.map +1 -0
  28. package/dist/chunk-FAQICBMH.js +164 -0
  29. package/dist/chunk-FAQICBMH.js.map +1 -0
  30. package/dist/chunk-FXDZLX2Y.js +192 -0
  31. package/dist/chunk-FXDZLX2Y.js.map +1 -0
  32. package/dist/{chunk-DNUO33HF.js → chunk-G7BPNX2V.js} +5 -4
  33. package/dist/chunk-G7BPNX2V.js.map +1 -0
  34. package/dist/chunk-I5VZ5SKG.js +328 -0
  35. package/dist/chunk-I5VZ5SKG.js.map +1 -0
  36. package/dist/chunk-ICANWSEW.js +204 -0
  37. package/dist/chunk-ICANWSEW.js.map +1 -0
  38. package/dist/chunk-KB5NSROG.cjs +211 -0
  39. package/dist/chunk-KB5NSROG.cjs.map +1 -0
  40. package/dist/chunk-MWQQRVQC.cjs +259 -0
  41. package/dist/chunk-MWQQRVQC.cjs.map +1 -0
  42. package/dist/chunk-PKRHEXX7.js +74 -0
  43. package/dist/chunk-PKRHEXX7.js.map +1 -0
  44. package/dist/chunk-QGWCNTG6.cjs +797 -0
  45. package/dist/chunk-QGWCNTG6.cjs.map +1 -0
  46. package/dist/chunk-R4M3BSUG.js +226 -0
  47. package/dist/chunk-R4M3BSUG.js.map +1 -0
  48. package/dist/chunk-UJNHKFBR.cjs +167 -0
  49. package/dist/chunk-UJNHKFBR.cjs.map +1 -0
  50. package/dist/chunk-UOFV2ZCI.js +878 -0
  51. package/dist/chunk-UOFV2ZCI.js.map +1 -0
  52. package/dist/{chunk-LWLSQ2W4.cjs → chunk-UZ6CYAOG.cjs} +5 -4
  53. package/dist/chunk-UZ6CYAOG.cjs.map +1 -0
  54. package/dist/chunk-VIP2H47U.js +1021 -0
  55. package/dist/chunk-VIP2H47U.js.map +1 -0
  56. package/dist/chunk-XWGAT2DA.js +44 -0
  57. package/dist/chunk-XWGAT2DA.js.map +1 -0
  58. package/dist/chunk-YJ3VDL3Z.cjs +346 -0
  59. package/dist/chunk-YJ3VDL3Z.cjs.map +1 -0
  60. package/dist/chunk-Z36N2OQA.cjs +907 -0
  61. package/dist/chunk-Z36N2OQA.cjs.map +1 -0
  62. package/dist/chunk-ZLRTFRL4.js +773 -0
  63. package/dist/chunk-ZLRTFRL4.js.map +1 -0
  64. package/dist/chunk-ZODCSH2W.cjs +322 -0
  65. package/dist/chunk-ZODCSH2W.cjs.map +1 -0
  66. package/dist/server/handlers/a2a.cjs +15 -7
  67. package/dist/server/handlers/a2a.d.ts +482 -0
  68. package/dist/server/handlers/a2a.d.ts.map +1 -1
  69. package/dist/server/handlers/a2a.js +1 -1
  70. package/dist/server/handlers/agent-builder.cjs +37 -37
  71. package/dist/server/handlers/agent-builder.d.ts +600 -77
  72. package/dist/server/handlers/agent-builder.d.ts.map +1 -1
  73. package/dist/server/handlers/agent-builder.js +1 -1
  74. package/dist/server/handlers/agents.cjs +53 -37
  75. package/dist/server/handlers/agents.d.ts +3270 -127
  76. package/dist/server/handlers/agents.d.ts.map +1 -1
  77. package/dist/server/handlers/agents.js +1 -1
  78. package/dist/server/handlers/logs.cjs +7 -7
  79. package/dist/server/handlers/logs.d.ts +135 -27
  80. package/dist/server/handlers/logs.d.ts.map +1 -1
  81. package/dist/server/handlers/logs.js +1 -1
  82. package/dist/server/handlers/memory.cjs +67 -27
  83. package/dist/server/handlers/memory.d.ts +933 -96
  84. package/dist/server/handlers/memory.d.ts.map +1 -1
  85. package/dist/server/handlers/memory.js +1 -1
  86. package/dist/server/handlers/observability.cjs +23 -7
  87. package/dist/server/handlers/observability.d.ts +124 -17
  88. package/dist/server/handlers/observability.d.ts.map +1 -1
  89. package/dist/server/handlers/observability.js +1 -1
  90. package/dist/server/handlers/scores.cjs +13 -13
  91. package/dist/server/handlers/scores.d.ts +110 -141
  92. package/dist/server/handlers/scores.d.ts.map +1 -1
  93. package/dist/server/handlers/scores.js +1 -1
  94. package/dist/server/handlers/test-utils.cjs +15 -0
  95. package/dist/server/handlers/test-utils.cjs.map +1 -0
  96. package/dist/server/handlers/test-utils.d.ts +6 -0
  97. package/dist/server/handlers/test-utils.d.ts.map +1 -0
  98. package/dist/server/handlers/test-utils.js +13 -0
  99. package/dist/server/handlers/test-utils.js.map +1 -0
  100. package/dist/server/handlers/tools.cjs +11 -11
  101. package/dist/server/handlers/tools.d.ts +69 -23
  102. package/dist/server/handlers/tools.d.ts.map +1 -1
  103. package/dist/server/handlers/tools.js +1 -1
  104. package/dist/server/handlers/utils.cjs +11 -3
  105. package/dist/server/handlers/utils.d.ts +5 -0
  106. package/dist/server/handlers/utils.d.ts.map +1 -1
  107. package/dist/server/handlers/utils.js +1 -1
  108. package/dist/server/handlers/vector.cjs +31 -7
  109. package/dist/server/handlers/vector.d.ts +93 -9
  110. package/dist/server/handlers/vector.d.ts.map +1 -1
  111. package/dist/server/handlers/vector.js +1 -1
  112. package/dist/server/handlers/voice.cjs +21 -9
  113. package/dist/server/handlers/voice.d.ts +81 -40
  114. package/dist/server/handlers/voice.d.ts.map +1 -1
  115. package/dist/server/handlers/voice.js +1 -1
  116. package/dist/server/handlers/workflows.cjs +65 -37
  117. package/dist/server/handlers/workflows.d.ts +919 -79
  118. package/dist/server/handlers/workflows.d.ts.map +1 -1
  119. package/dist/server/handlers/workflows.js +1 -1
  120. package/dist/server/handlers.cjs +22 -22
  121. package/dist/server/handlers.js +11 -11
  122. package/dist/server/schemas/a2a.d.ts +786 -0
  123. package/dist/server/schemas/a2a.d.ts.map +1 -0
  124. package/dist/server/schemas/agent-builder.d.ts +195 -0
  125. package/dist/server/schemas/agent-builder.d.ts.map +1 -0
  126. package/dist/server/schemas/agents.d.ts +1375 -0
  127. package/dist/server/schemas/agents.d.ts.map +1 -0
  128. package/dist/server/schemas/common.d.ts +165 -0
  129. package/dist/server/schemas/common.d.ts.map +1 -0
  130. package/dist/server/schemas/logs.d.ts +124 -0
  131. package/dist/server/schemas/logs.d.ts.map +1 -0
  132. package/dist/server/schemas/memory.d.ts +998 -0
  133. package/dist/server/schemas/memory.d.ts.map +1 -0
  134. package/dist/server/schemas/observability.d.ts +402 -0
  135. package/dist/server/schemas/observability.d.ts.map +1 -0
  136. package/dist/server/schemas/scores.d.ts +259 -0
  137. package/dist/server/schemas/scores.d.ts.map +1 -0
  138. package/dist/server/schemas/vectors.d.ts +107 -0
  139. package/dist/server/schemas/vectors.d.ts.map +1 -0
  140. package/dist/server/schemas/workflows.d.ts +608 -0
  141. package/dist/server/schemas/workflows.d.ts.map +1 -0
  142. package/dist/server/server-adapter/index.cjs +330 -0
  143. package/dist/server/server-adapter/index.cjs.map +1 -0
  144. package/dist/server/server-adapter/index.d.ts +52 -0
  145. package/dist/server/server-adapter/index.d.ts.map +1 -0
  146. package/dist/server/server-adapter/index.js +316 -0
  147. package/dist/server/server-adapter/index.js.map +1 -0
  148. package/dist/server/server-adapter/openapi-utils.d.ts +59 -0
  149. package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -0
  150. package/dist/server/server-adapter/routes/a2a.d.ts +3 -0
  151. package/dist/server/server-adapter/routes/a2a.d.ts.map +1 -0
  152. package/dist/server/server-adapter/routes/agent-builder.d.ts +3 -0
  153. package/dist/server/server-adapter/routes/agent-builder.d.ts.map +1 -0
  154. package/dist/server/server-adapter/routes/agents.d.ts +3 -0
  155. package/dist/server/server-adapter/routes/agents.d.ts.map +1 -0
  156. package/dist/server/server-adapter/routes/index.d.ts +41 -0
  157. package/dist/server/server-adapter/routes/index.d.ts.map +1 -0
  158. package/dist/server/server-adapter/routes/legacy.d.ts +7 -0
  159. package/dist/server/server-adapter/routes/legacy.d.ts.map +1 -0
  160. package/dist/server/server-adapter/routes/logs.d.ts +3 -0
  161. package/dist/server/server-adapter/routes/logs.d.ts.map +1 -0
  162. package/dist/server/server-adapter/routes/memory.d.ts +3 -0
  163. package/dist/server/server-adapter/routes/memory.d.ts.map +1 -0
  164. package/dist/server/server-adapter/routes/observability.d.ts +3 -0
  165. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -0
  166. package/dist/server/server-adapter/routes/route-builder.d.ts +52 -0
  167. package/dist/server/server-adapter/routes/route-builder.d.ts.map +1 -0
  168. package/dist/server/server-adapter/routes/scorers.d.ts +3 -0
  169. package/dist/server/server-adapter/routes/scorers.d.ts.map +1 -0
  170. package/dist/server/server-adapter/routes/stream-types.d.ts +10 -0
  171. package/dist/server/server-adapter/routes/stream-types.d.ts.map +1 -0
  172. package/dist/server/server-adapter/routes/tools.d.ts +3 -0
  173. package/dist/server/server-adapter/routes/tools.d.ts.map +1 -0
  174. package/dist/server/server-adapter/routes/vectors.d.ts +3 -0
  175. package/dist/server/server-adapter/routes/vectors.d.ts.map +1 -0
  176. package/dist/server/server-adapter/routes/workflows.d.ts +3 -0
  177. package/dist/server/server-adapter/routes/workflows.d.ts.map +1 -0
  178. package/dist/server/utils.d.ts +2 -1
  179. package/dist/server/utils.d.ts.map +1 -1
  180. package/package.json +23 -8
  181. package/dist/chunk-46Z2KDQL.js +0 -124
  182. package/dist/chunk-46Z2KDQL.js.map +0 -1
  183. package/dist/chunk-73PAWDM5.js +0 -83
  184. package/dist/chunk-73PAWDM5.js.map +0 -1
  185. package/dist/chunk-A5SOZY5R.js +0 -502
  186. package/dist/chunk-A5SOZY5R.js.map +0 -1
  187. package/dist/chunk-ALOLTNSO.js.map +0 -1
  188. package/dist/chunk-B6NK4KI5.cjs +0 -128
  189. package/dist/chunk-B6NK4KI5.cjs.map +0 -1
  190. package/dist/chunk-BANGX6SC.cjs +0 -200
  191. package/dist/chunk-BANGX6SC.cjs.map +0 -1
  192. package/dist/chunk-BHQH5QXD.cjs +0 -172
  193. package/dist/chunk-BHQH5QXD.cjs.map +0 -1
  194. package/dist/chunk-BTWIR2B7.cjs +0 -28
  195. package/dist/chunk-BTWIR2B7.cjs.map +0 -1
  196. package/dist/chunk-DNUO33HF.js.map +0 -1
  197. package/dist/chunk-GTZOYEAU.cjs +0 -130
  198. package/dist/chunk-GTZOYEAU.cjs.map +0 -1
  199. package/dist/chunk-IGOWG5V5.js +0 -192
  200. package/dist/chunk-IGOWG5V5.js.map +0 -1
  201. package/dist/chunk-JO2AZFJN.js +0 -165
  202. package/dist/chunk-JO2AZFJN.js.map +0 -1
  203. package/dist/chunk-JZ65BJ6H.cjs +0 -678
  204. package/dist/chunk-JZ65BJ6H.cjs.map +0 -1
  205. package/dist/chunk-KWH5QBXP.js +0 -123
  206. package/dist/chunk-KWH5QBXP.js.map +0 -1
  207. package/dist/chunk-LPCK5MAF.js +0 -122
  208. package/dist/chunk-LPCK5MAF.js.map +0 -1
  209. package/dist/chunk-LWLSQ2W4.cjs.map +0 -1
  210. package/dist/chunk-M6KNPIZZ.cjs.map +0 -1
  211. package/dist/chunk-PPMIB3FQ.cjs +0 -88
  212. package/dist/chunk-PPMIB3FQ.cjs.map +0 -1
  213. package/dist/chunk-QXWWLCTQ.js.map +0 -1
  214. package/dist/chunk-S54HNARD.cjs +0 -131
  215. package/dist/chunk-S54HNARD.cjs.map +0 -1
  216. package/dist/chunk-SIPNICB3.cjs +0 -517
  217. package/dist/chunk-SIPNICB3.cjs.map +0 -1
  218. package/dist/chunk-SRAPUMPM.cjs +0 -620
  219. package/dist/chunk-SRAPUMPM.cjs.map +0 -1
  220. package/dist/chunk-SZIFSF4T.js +0 -25
  221. package/dist/chunk-SZIFSF4T.js.map +0 -1
  222. package/dist/chunk-TWHS6DKL.js +0 -600
  223. package/dist/chunk-TWHS6DKL.js.map +0 -1
  224. package/dist/chunk-VYR3SAFM.js +0 -658
  225. package/dist/chunk-VYR3SAFM.js.map +0 -1
  226. package/dist/chunk-XXGID4PQ.cjs.map +0 -1
@@ -1,17 +1,20 @@
1
1
  'use strict';
2
2
 
3
+ var chunk7WTETKRM_cjs = require('./chunk-7WTETKRM.cjs');
3
4
  var chunkX6C7BUWN_cjs = require('./chunk-X6C7BUWN.cjs');
4
5
  var chunk2PLXW4ZX_cjs = require('./chunk-2PLXW4ZX.cjs');
5
6
  var chunkLPM6BBAX_cjs = require('./chunk-LPM6BBAX.cjs');
6
- var chunkSRAPUMPM_cjs = require('./chunk-SRAPUMPM.cjs');
7
- var chunkLWLSQ2W4_cjs = require('./chunk-LWLSQ2W4.cjs');
7
+ var chunkUZ6CYAOG_cjs = require('./chunk-UZ6CYAOG.cjs');
8
+ var chunkMWQQRVQC_cjs = require('./chunk-MWQQRVQC.cjs');
9
+ var chunk2NW6POYK_cjs = require('./chunk-2NW6POYK.cjs');
10
+ var chunkUJNHKFBR_cjs = require('./chunk-UJNHKFBR.cjs');
8
11
  var chunkV5WWQN7P_cjs = require('./chunk-V5WWQN7P.cjs');
9
12
  var chunk64ITUOXI_cjs = require('./chunk-64ITUOXI.cjs');
10
13
  var chunkO7I5CWRX_cjs = require('./chunk-O7I5CWRX.cjs');
11
14
  var agent = require('@mastra/core/agent');
12
15
  var memory = require('@mastra/core/memory');
13
16
  var utils = require('@mastra/core/utils');
14
- var zod = require('zod');
17
+ var z19 = require('zod');
15
18
  var z42 = require('zod/v4');
16
19
  var v3 = require('zod/v3');
17
20
  var tools = require('@mastra/core/tools');
@@ -25,6 +28,8 @@ var llm = require('@mastra/core/llm');
25
28
  var os = require('os');
26
29
  var workflows = require('@mastra/core/workflows');
27
30
 
31
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
32
+
28
33
  function _interopNamespace(e) {
29
34
  if (e && e.__esModule) return e;
30
35
  var n = Object.create(null);
@@ -43,6 +48,7 @@ function _interopNamespace(e) {
43
48
  return Object.freeze(n);
44
49
  }
45
50
 
51
+ var z19__default = /*#__PURE__*/_interopDefault(z19);
46
52
  var z42__namespace = /*#__PURE__*/_interopNamespace(z42);
47
53
 
48
54
  // ../../node_modules/.pnpm/@vercel+oidc@3.0.3/node_modules/@vercel/oidc/dist/get-context.js
@@ -737,24 +743,24 @@ var require_ignore = chunkO7I5CWRX_cjs.__commonJS({
737
743
  // src/server/handlers/agent-builder.ts
738
744
  var agent_builder_exports = {};
739
745
  chunkO7I5CWRX_cjs.__export(agent_builder_exports, {
740
- cancelAgentBuilderActionRunHandler: () => cancelAgentBuilderActionRunHandler,
741
- createAgentBuilderActionRunHandler: () => createAgentBuilderActionRunHandler,
742
- getAgentBuilderActionByIdHandler: () => getAgentBuilderActionByIdHandler,
743
- getAgentBuilderActionRunByIdHandler: () => getAgentBuilderActionRunByIdHandler,
744
- getAgentBuilderActionRunExecutionResultHandler: () => getAgentBuilderActionRunExecutionResultHandler,
745
- getAgentBuilderActionRunsHandler: () => getAgentBuilderActionRunsHandler,
746
- getAgentBuilderActionsHandler: () => getAgentBuilderActionsHandler,
747
- observeStreamAgentBuilderActionHandler: () => observeStreamAgentBuilderActionHandler,
748
- observeStreamLegacyAgentBuilderActionHandler: () => observeStreamLegacyAgentBuilderActionHandler,
749
- observeStreamVNextAgentBuilderActionHandler: () => observeStreamVNextAgentBuilderActionHandler,
750
- resumeAgentBuilderActionHandler: () => resumeAgentBuilderActionHandler,
751
- resumeAsyncAgentBuilderActionHandler: () => resumeAsyncAgentBuilderActionHandler,
752
- resumeStreamAgentBuilderActionHandler: () => resumeStreamAgentBuilderActionHandler,
753
- startAgentBuilderActionRunHandler: () => startAgentBuilderActionRunHandler,
754
- startAsyncAgentBuilderActionHandler: () => startAsyncAgentBuilderActionHandler,
755
- streamAgentBuilderActionHandler: () => streamAgentBuilderActionHandler,
756
- streamLegacyAgentBuilderActionHandler: () => streamLegacyAgentBuilderActionHandler,
757
- streamVNextAgentBuilderActionHandler: () => streamVNextAgentBuilderActionHandler
746
+ CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE,
747
+ CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE,
748
+ GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE: () => GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE,
749
+ GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE: () => GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE,
750
+ GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE: () => GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE,
751
+ LIST_AGENT_BUILDER_ACTIONS_ROUTE: () => LIST_AGENT_BUILDER_ACTIONS_ROUTE,
752
+ LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE: () => LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE,
753
+ OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE: () => OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE,
754
+ OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE: () => OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE,
755
+ OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE: () => OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE,
756
+ RESUME_AGENT_BUILDER_ACTION_ROUTE: () => RESUME_AGENT_BUILDER_ACTION_ROUTE,
757
+ RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE: () => RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE,
758
+ RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE: () => RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE,
759
+ START_AGENT_BUILDER_ACTION_RUN_ROUTE: () => START_AGENT_BUILDER_ACTION_RUN_ROUTE,
760
+ START_ASYNC_AGENT_BUILDER_ACTION_ROUTE: () => START_ASYNC_AGENT_BUILDER_ACTION_ROUTE,
761
+ STREAM_AGENT_BUILDER_ACTION_ROUTE: () => STREAM_AGENT_BUILDER_ACTION_ROUTE,
762
+ STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE: () => STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE,
763
+ STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE: () => STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE
758
764
  });
759
765
 
760
766
  // ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
@@ -857,7 +863,7 @@ function parseArrayDef(def, refs) {
857
863
  const res = {
858
864
  type: "array"
859
865
  };
860
- if (def.type?._def && def.type?._def?.typeName !== zod.ZodFirstPartyTypeKind.ZodAny) {
866
+ if (def.type?._def && def.type?._def?.typeName !== z19.ZodFirstPartyTypeKind.ZodAny) {
861
867
  res.items = parseDef(def.type._def, {
862
868
  ...refs,
863
869
  currentPath: [...refs.currentPath, "items"]
@@ -1398,7 +1404,7 @@ function parseRecordDef(def, refs) {
1398
1404
  if (refs.target === "openAi") {
1399
1405
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
1400
1406
  }
1401
- if (refs.target === "openApi3" && def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodEnum) {
1407
+ if (refs.target === "openApi3" && def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
1402
1408
  return {
1403
1409
  type: "object",
1404
1410
  required: def.keyType._def.values,
@@ -1422,20 +1428,20 @@ function parseRecordDef(def, refs) {
1422
1428
  if (refs.target === "openApi3") {
1423
1429
  return schema;
1424
1430
  }
1425
- if (def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
1431
+ if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
1426
1432
  const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
1427
1433
  return {
1428
1434
  ...schema,
1429
1435
  propertyNames: keyType
1430
1436
  };
1431
- } else if (def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodEnum) {
1437
+ } else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
1432
1438
  return {
1433
1439
  ...schema,
1434
1440
  propertyNames: {
1435
1441
  enum: def.keyType._def.values
1436
1442
  }
1437
1443
  };
1438
- } else if (def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === zod.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
1444
+ } else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
1439
1445
  const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
1440
1446
  return {
1441
1447
  ...schema,
@@ -1835,73 +1841,73 @@ var parseReadonlyDef = (def, refs) => {
1835
1841
  // ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
1836
1842
  var selectParser = (def, typeName, refs) => {
1837
1843
  switch (typeName) {
1838
- case zod.ZodFirstPartyTypeKind.ZodString:
1844
+ case z19.ZodFirstPartyTypeKind.ZodString:
1839
1845
  return parseStringDef(def, refs);
1840
- case zod.ZodFirstPartyTypeKind.ZodNumber:
1846
+ case z19.ZodFirstPartyTypeKind.ZodNumber:
1841
1847
  return parseNumberDef(def, refs);
1842
- case zod.ZodFirstPartyTypeKind.ZodObject:
1848
+ case z19.ZodFirstPartyTypeKind.ZodObject:
1843
1849
  return parseObjectDef(def, refs);
1844
- case zod.ZodFirstPartyTypeKind.ZodBigInt:
1850
+ case z19.ZodFirstPartyTypeKind.ZodBigInt:
1845
1851
  return parseBigintDef(def, refs);
1846
- case zod.ZodFirstPartyTypeKind.ZodBoolean:
1852
+ case z19.ZodFirstPartyTypeKind.ZodBoolean:
1847
1853
  return parseBooleanDef();
1848
- case zod.ZodFirstPartyTypeKind.ZodDate:
1854
+ case z19.ZodFirstPartyTypeKind.ZodDate:
1849
1855
  return parseDateDef(def, refs);
1850
- case zod.ZodFirstPartyTypeKind.ZodUndefined:
1856
+ case z19.ZodFirstPartyTypeKind.ZodUndefined:
1851
1857
  return parseUndefinedDef(refs);
1852
- case zod.ZodFirstPartyTypeKind.ZodNull:
1858
+ case z19.ZodFirstPartyTypeKind.ZodNull:
1853
1859
  return parseNullDef(refs);
1854
- case zod.ZodFirstPartyTypeKind.ZodArray:
1860
+ case z19.ZodFirstPartyTypeKind.ZodArray:
1855
1861
  return parseArrayDef(def, refs);
1856
- case zod.ZodFirstPartyTypeKind.ZodUnion:
1857
- case zod.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
1862
+ case z19.ZodFirstPartyTypeKind.ZodUnion:
1863
+ case z19.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
1858
1864
  return parseUnionDef(def, refs);
1859
- case zod.ZodFirstPartyTypeKind.ZodIntersection:
1865
+ case z19.ZodFirstPartyTypeKind.ZodIntersection:
1860
1866
  return parseIntersectionDef(def, refs);
1861
- case zod.ZodFirstPartyTypeKind.ZodTuple:
1867
+ case z19.ZodFirstPartyTypeKind.ZodTuple:
1862
1868
  return parseTupleDef(def, refs);
1863
- case zod.ZodFirstPartyTypeKind.ZodRecord:
1869
+ case z19.ZodFirstPartyTypeKind.ZodRecord:
1864
1870
  return parseRecordDef(def, refs);
1865
- case zod.ZodFirstPartyTypeKind.ZodLiteral:
1871
+ case z19.ZodFirstPartyTypeKind.ZodLiteral:
1866
1872
  return parseLiteralDef(def, refs);
1867
- case zod.ZodFirstPartyTypeKind.ZodEnum:
1873
+ case z19.ZodFirstPartyTypeKind.ZodEnum:
1868
1874
  return parseEnumDef(def);
1869
- case zod.ZodFirstPartyTypeKind.ZodNativeEnum:
1875
+ case z19.ZodFirstPartyTypeKind.ZodNativeEnum:
1870
1876
  return parseNativeEnumDef(def);
1871
- case zod.ZodFirstPartyTypeKind.ZodNullable:
1877
+ case z19.ZodFirstPartyTypeKind.ZodNullable:
1872
1878
  return parseNullableDef(def, refs);
1873
- case zod.ZodFirstPartyTypeKind.ZodOptional:
1879
+ case z19.ZodFirstPartyTypeKind.ZodOptional:
1874
1880
  return parseOptionalDef(def, refs);
1875
- case zod.ZodFirstPartyTypeKind.ZodMap:
1881
+ case z19.ZodFirstPartyTypeKind.ZodMap:
1876
1882
  return parseMapDef(def, refs);
1877
- case zod.ZodFirstPartyTypeKind.ZodSet:
1883
+ case z19.ZodFirstPartyTypeKind.ZodSet:
1878
1884
  return parseSetDef(def, refs);
1879
- case zod.ZodFirstPartyTypeKind.ZodLazy:
1885
+ case z19.ZodFirstPartyTypeKind.ZodLazy:
1880
1886
  return () => def.getter()._def;
1881
- case zod.ZodFirstPartyTypeKind.ZodPromise:
1887
+ case z19.ZodFirstPartyTypeKind.ZodPromise:
1882
1888
  return parsePromiseDef(def, refs);
1883
- case zod.ZodFirstPartyTypeKind.ZodNaN:
1884
- case zod.ZodFirstPartyTypeKind.ZodNever:
1889
+ case z19.ZodFirstPartyTypeKind.ZodNaN:
1890
+ case z19.ZodFirstPartyTypeKind.ZodNever:
1885
1891
  return parseNeverDef(refs);
1886
- case zod.ZodFirstPartyTypeKind.ZodEffects:
1892
+ case z19.ZodFirstPartyTypeKind.ZodEffects:
1887
1893
  return parseEffectsDef(def, refs);
1888
- case zod.ZodFirstPartyTypeKind.ZodAny:
1894
+ case z19.ZodFirstPartyTypeKind.ZodAny:
1889
1895
  return parseAnyDef(refs);
1890
- case zod.ZodFirstPartyTypeKind.ZodUnknown:
1896
+ case z19.ZodFirstPartyTypeKind.ZodUnknown:
1891
1897
  return parseUnknownDef(refs);
1892
- case zod.ZodFirstPartyTypeKind.ZodDefault:
1898
+ case z19.ZodFirstPartyTypeKind.ZodDefault:
1893
1899
  return parseDefaultDef(def, refs);
1894
- case zod.ZodFirstPartyTypeKind.ZodBranded:
1900
+ case z19.ZodFirstPartyTypeKind.ZodBranded:
1895
1901
  return parseBrandedDef(def, refs);
1896
- case zod.ZodFirstPartyTypeKind.ZodReadonly:
1902
+ case z19.ZodFirstPartyTypeKind.ZodReadonly:
1897
1903
  return parseReadonlyDef(def, refs);
1898
- case zod.ZodFirstPartyTypeKind.ZodCatch:
1904
+ case z19.ZodFirstPartyTypeKind.ZodCatch:
1899
1905
  return parseCatchDef(def, refs);
1900
- case zod.ZodFirstPartyTypeKind.ZodPipeline:
1906
+ case z19.ZodFirstPartyTypeKind.ZodPipeline:
1901
1907
  return parsePipelineDef(def, refs);
1902
- case zod.ZodFirstPartyTypeKind.ZodFunction:
1903
- case zod.ZodFirstPartyTypeKind.ZodVoid:
1904
- case zod.ZodFirstPartyTypeKind.ZodSymbol:
1908
+ case z19.ZodFirstPartyTypeKind.ZodFunction:
1909
+ case z19.ZodFirstPartyTypeKind.ZodVoid:
1910
+ case z19.ZodFirstPartyTypeKind.ZodSymbol:
1905
1911
  return void 0;
1906
1912
  default:
1907
1913
  return /* @__PURE__ */ ((_) => void 0)();
@@ -2038,7 +2044,7 @@ function patchRecordSchemas(schema) {
2038
2044
  const def = schema._zod?.def;
2039
2045
  if (def?.type === "record" && def.keyType && !def.valueType) {
2040
2046
  def.valueType = def.keyType;
2041
- def.keyType = zod.z.string();
2047
+ def.keyType = z19.z.string();
2042
2048
  }
2043
2049
  if (!def) return schema;
2044
2050
  if (def.type === "object" && def.shape) {
@@ -2080,9 +2086,9 @@ function patchRecordSchemas(schema) {
2080
2086
  }
2081
2087
  function zodToJsonSchema2(zodSchema5, target = "jsonSchema7", strategy = "relative") {
2082
2088
  const fn = "toJSONSchema";
2083
- if (fn in zod.z) {
2089
+ if (fn in z19.z) {
2084
2090
  patchRecordSchemas(zodSchema5);
2085
- return zod.z[fn](zodSchema5, {
2091
+ return z19.z[fn](zodSchema5, {
2086
2092
  unrepresentable: "any",
2087
2093
  override: (ctx) => {
2088
2094
  const def = ctx.zodSchema?._def || ctx.zodSchema?._zod?.def;
@@ -4006,11 +4012,11 @@ var NoObjectGeneratedError = class extends chunkLPM6BBAX_cjs.AISDKError {
4006
4012
  }
4007
4013
  };
4008
4014
  _a4 = symbol4;
4009
- var dataContentSchema = zod.z.union([
4010
- zod.z.string(),
4011
- zod.z.instanceof(Uint8Array),
4012
- zod.z.instanceof(ArrayBuffer),
4013
- zod.z.custom(
4015
+ var dataContentSchema = z19.z.union([
4016
+ z19.z.string(),
4017
+ z19.z.instanceof(Uint8Array),
4018
+ z19.z.instanceof(ArrayBuffer),
4019
+ z19.z.custom(
4014
4020
  // Buffer might not be available in some environments such as CloudFlare:
4015
4021
  (value) => {
4016
4022
  var _a172, _b8;
@@ -4019,102 +4025,102 @@ var dataContentSchema = zod.z.union([
4019
4025
  { message: "Must be a Buffer" }
4020
4026
  )
4021
4027
  ]);
4022
- var jsonValueSchema = zod.z.lazy(
4023
- () => zod.z.union([
4024
- zod.z.null(),
4025
- zod.z.string(),
4026
- zod.z.number(),
4027
- zod.z.boolean(),
4028
- zod.z.record(zod.z.string(), jsonValueSchema),
4029
- zod.z.array(jsonValueSchema)
4028
+ var jsonValueSchema = z19.z.lazy(
4029
+ () => z19.z.union([
4030
+ z19.z.null(),
4031
+ z19.z.string(),
4032
+ z19.z.number(),
4033
+ z19.z.boolean(),
4034
+ z19.z.record(z19.z.string(), jsonValueSchema),
4035
+ z19.z.array(jsonValueSchema)
4030
4036
  ])
4031
4037
  );
4032
- var providerMetadataSchema = zod.z.record(
4033
- zod.z.string(),
4034
- zod.z.record(zod.z.string(), jsonValueSchema)
4038
+ var providerMetadataSchema = z19.z.record(
4039
+ z19.z.string(),
4040
+ z19.z.record(z19.z.string(), jsonValueSchema)
4035
4041
  );
4036
- var toolResultContentSchema = zod.z.array(
4037
- zod.z.union([
4038
- zod.z.object({ type: zod.z.literal("text"), text: zod.z.string() }),
4039
- zod.z.object({
4040
- type: zod.z.literal("image"),
4041
- data: zod.z.string(),
4042
- mimeType: zod.z.string().optional()
4042
+ var toolResultContentSchema = z19.z.array(
4043
+ z19.z.union([
4044
+ z19.z.object({ type: z19.z.literal("text"), text: z19.z.string() }),
4045
+ z19.z.object({
4046
+ type: z19.z.literal("image"),
4047
+ data: z19.z.string(),
4048
+ mimeType: z19.z.string().optional()
4043
4049
  })
4044
4050
  ])
4045
4051
  );
4046
- var textPartSchema = zod.z.object({
4047
- type: zod.z.literal("text"),
4048
- text: zod.z.string(),
4052
+ var textPartSchema = z19.z.object({
4053
+ type: z19.z.literal("text"),
4054
+ text: z19.z.string(),
4049
4055
  providerOptions: providerMetadataSchema.optional(),
4050
4056
  experimental_providerMetadata: providerMetadataSchema.optional()
4051
4057
  });
4052
- var imagePartSchema = zod.z.object({
4053
- type: zod.z.literal("image"),
4054
- image: zod.z.union([dataContentSchema, zod.z.instanceof(URL)]),
4055
- mimeType: zod.z.string().optional(),
4058
+ var imagePartSchema = z19.z.object({
4059
+ type: z19.z.literal("image"),
4060
+ image: z19.z.union([dataContentSchema, z19.z.instanceof(URL)]),
4061
+ mimeType: z19.z.string().optional(),
4056
4062
  providerOptions: providerMetadataSchema.optional(),
4057
4063
  experimental_providerMetadata: providerMetadataSchema.optional()
4058
4064
  });
4059
- var filePartSchema = zod.z.object({
4060
- type: zod.z.literal("file"),
4061
- data: zod.z.union([dataContentSchema, zod.z.instanceof(URL)]),
4062
- filename: zod.z.string().optional(),
4063
- mimeType: zod.z.string(),
4065
+ var filePartSchema = z19.z.object({
4066
+ type: z19.z.literal("file"),
4067
+ data: z19.z.union([dataContentSchema, z19.z.instanceof(URL)]),
4068
+ filename: z19.z.string().optional(),
4069
+ mimeType: z19.z.string(),
4064
4070
  providerOptions: providerMetadataSchema.optional(),
4065
4071
  experimental_providerMetadata: providerMetadataSchema.optional()
4066
4072
  });
4067
- var reasoningPartSchema = zod.z.object({
4068
- type: zod.z.literal("reasoning"),
4069
- text: zod.z.string(),
4073
+ var reasoningPartSchema = z19.z.object({
4074
+ type: z19.z.literal("reasoning"),
4075
+ text: z19.z.string(),
4070
4076
  providerOptions: providerMetadataSchema.optional(),
4071
4077
  experimental_providerMetadata: providerMetadataSchema.optional()
4072
4078
  });
4073
- var redactedReasoningPartSchema = zod.z.object({
4074
- type: zod.z.literal("redacted-reasoning"),
4075
- data: zod.z.string(),
4079
+ var redactedReasoningPartSchema = z19.z.object({
4080
+ type: z19.z.literal("redacted-reasoning"),
4081
+ data: z19.z.string(),
4076
4082
  providerOptions: providerMetadataSchema.optional(),
4077
4083
  experimental_providerMetadata: providerMetadataSchema.optional()
4078
4084
  });
4079
- var toolCallPartSchema = zod.z.object({
4080
- type: zod.z.literal("tool-call"),
4081
- toolCallId: zod.z.string(),
4082
- toolName: zod.z.string(),
4083
- args: zod.z.unknown(),
4085
+ var toolCallPartSchema = z19.z.object({
4086
+ type: z19.z.literal("tool-call"),
4087
+ toolCallId: z19.z.string(),
4088
+ toolName: z19.z.string(),
4089
+ args: z19.z.unknown(),
4084
4090
  providerOptions: providerMetadataSchema.optional(),
4085
4091
  experimental_providerMetadata: providerMetadataSchema.optional()
4086
4092
  });
4087
- var toolResultPartSchema = zod.z.object({
4088
- type: zod.z.literal("tool-result"),
4089
- toolCallId: zod.z.string(),
4090
- toolName: zod.z.string(),
4091
- result: zod.z.unknown(),
4093
+ var toolResultPartSchema = z19.z.object({
4094
+ type: z19.z.literal("tool-result"),
4095
+ toolCallId: z19.z.string(),
4096
+ toolName: z19.z.string(),
4097
+ result: z19.z.unknown(),
4092
4098
  content: toolResultContentSchema.optional(),
4093
- isError: zod.z.boolean().optional(),
4099
+ isError: z19.z.boolean().optional(),
4094
4100
  providerOptions: providerMetadataSchema.optional(),
4095
4101
  experimental_providerMetadata: providerMetadataSchema.optional()
4096
4102
  });
4097
- var coreSystemMessageSchema = zod.z.object({
4098
- role: zod.z.literal("system"),
4099
- content: zod.z.string(),
4103
+ var coreSystemMessageSchema = z19.z.object({
4104
+ role: z19.z.literal("system"),
4105
+ content: z19.z.string(),
4100
4106
  providerOptions: providerMetadataSchema.optional(),
4101
4107
  experimental_providerMetadata: providerMetadataSchema.optional()
4102
4108
  });
4103
- var coreUserMessageSchema = zod.z.object({
4104
- role: zod.z.literal("user"),
4105
- content: zod.z.union([
4106
- zod.z.string(),
4107
- zod.z.array(zod.z.union([textPartSchema, imagePartSchema, filePartSchema]))
4109
+ var coreUserMessageSchema = z19.z.object({
4110
+ role: z19.z.literal("user"),
4111
+ content: z19.z.union([
4112
+ z19.z.string(),
4113
+ z19.z.array(z19.z.union([textPartSchema, imagePartSchema, filePartSchema]))
4108
4114
  ]),
4109
4115
  providerOptions: providerMetadataSchema.optional(),
4110
4116
  experimental_providerMetadata: providerMetadataSchema.optional()
4111
4117
  });
4112
- var coreAssistantMessageSchema = zod.z.object({
4113
- role: zod.z.literal("assistant"),
4114
- content: zod.z.union([
4115
- zod.z.string(),
4116
- zod.z.array(
4117
- zod.z.union([
4118
+ var coreAssistantMessageSchema = z19.z.object({
4119
+ role: z19.z.literal("assistant"),
4120
+ content: z19.z.union([
4121
+ z19.z.string(),
4122
+ z19.z.array(
4123
+ z19.z.union([
4118
4124
  textPartSchema,
4119
4125
  filePartSchema,
4120
4126
  reasoningPartSchema,
@@ -4126,13 +4132,13 @@ var coreAssistantMessageSchema = zod.z.object({
4126
4132
  providerOptions: providerMetadataSchema.optional(),
4127
4133
  experimental_providerMetadata: providerMetadataSchema.optional()
4128
4134
  });
4129
- var coreToolMessageSchema = zod.z.object({
4130
- role: zod.z.literal("tool"),
4131
- content: zod.z.array(toolResultPartSchema),
4135
+ var coreToolMessageSchema = z19.z.object({
4136
+ role: z19.z.literal("tool"),
4137
+ content: z19.z.array(toolResultPartSchema),
4132
4138
  providerOptions: providerMetadataSchema.optional(),
4133
4139
  experimental_providerMetadata: providerMetadataSchema.optional()
4134
4140
  });
4135
- zod.z.union([
4141
+ z19.z.union([
4136
4142
  coreSystemMessageSchema,
4137
4143
  coreUserMessageSchema,
4138
4144
  coreAssistantMessageSchema,
@@ -4342,125 +4348,125 @@ chunkLPM6BBAX_cjs.createIdGenerator({
4342
4348
  prefix: "msg",
4343
4349
  size: 24
4344
4350
  });
4345
- var ClientOrServerImplementationSchema = zod.z.object({
4346
- name: zod.z.string(),
4347
- version: zod.z.string()
4351
+ var ClientOrServerImplementationSchema = z19.z.object({
4352
+ name: z19.z.string(),
4353
+ version: z19.z.string()
4348
4354
  }).passthrough();
4349
- var BaseParamsSchema = zod.z.object({
4350
- _meta: zod.z.optional(zod.z.object({}).passthrough())
4355
+ var BaseParamsSchema = z19.z.object({
4356
+ _meta: z19.z.optional(z19.z.object({}).passthrough())
4351
4357
  }).passthrough();
4352
4358
  var ResultSchema = BaseParamsSchema;
4353
- var RequestSchema = zod.z.object({
4354
- method: zod.z.string(),
4355
- params: zod.z.optional(BaseParamsSchema)
4359
+ var RequestSchema = z19.z.object({
4360
+ method: z19.z.string(),
4361
+ params: z19.z.optional(BaseParamsSchema)
4356
4362
  });
4357
- var ServerCapabilitiesSchema = zod.z.object({
4358
- experimental: zod.z.optional(zod.z.object({}).passthrough()),
4359
- logging: zod.z.optional(zod.z.object({}).passthrough()),
4360
- prompts: zod.z.optional(
4361
- zod.z.object({
4362
- listChanged: zod.z.optional(zod.z.boolean())
4363
+ var ServerCapabilitiesSchema = z19.z.object({
4364
+ experimental: z19.z.optional(z19.z.object({}).passthrough()),
4365
+ logging: z19.z.optional(z19.z.object({}).passthrough()),
4366
+ prompts: z19.z.optional(
4367
+ z19.z.object({
4368
+ listChanged: z19.z.optional(z19.z.boolean())
4363
4369
  }).passthrough()
4364
4370
  ),
4365
- resources: zod.z.optional(
4366
- zod.z.object({
4367
- subscribe: zod.z.optional(zod.z.boolean()),
4368
- listChanged: zod.z.optional(zod.z.boolean())
4371
+ resources: z19.z.optional(
4372
+ z19.z.object({
4373
+ subscribe: z19.z.optional(z19.z.boolean()),
4374
+ listChanged: z19.z.optional(z19.z.boolean())
4369
4375
  }).passthrough()
4370
4376
  ),
4371
- tools: zod.z.optional(
4372
- zod.z.object({
4373
- listChanged: zod.z.optional(zod.z.boolean())
4377
+ tools: z19.z.optional(
4378
+ z19.z.object({
4379
+ listChanged: z19.z.optional(z19.z.boolean())
4374
4380
  }).passthrough()
4375
4381
  )
4376
4382
  }).passthrough();
4377
4383
  ResultSchema.extend({
4378
- protocolVersion: zod.z.string(),
4384
+ protocolVersion: z19.z.string(),
4379
4385
  capabilities: ServerCapabilitiesSchema,
4380
4386
  serverInfo: ClientOrServerImplementationSchema,
4381
- instructions: zod.z.optional(zod.z.string())
4387
+ instructions: z19.z.optional(z19.z.string())
4382
4388
  });
4383
4389
  var PaginatedResultSchema = ResultSchema.extend({
4384
- nextCursor: zod.z.optional(zod.z.string())
4390
+ nextCursor: z19.z.optional(z19.z.string())
4385
4391
  });
4386
- var ToolSchema = zod.z.object({
4387
- name: zod.z.string(),
4388
- description: zod.z.optional(zod.z.string()),
4389
- inputSchema: zod.z.object({
4390
- type: zod.z.literal("object"),
4391
- properties: zod.z.optional(zod.z.object({}).passthrough())
4392
+ var ToolSchema = z19.z.object({
4393
+ name: z19.z.string(),
4394
+ description: z19.z.optional(z19.z.string()),
4395
+ inputSchema: z19.z.object({
4396
+ type: z19.z.literal("object"),
4397
+ properties: z19.z.optional(z19.z.object({}).passthrough())
4392
4398
  }).passthrough()
4393
4399
  }).passthrough();
4394
4400
  PaginatedResultSchema.extend({
4395
- tools: zod.z.array(ToolSchema)
4401
+ tools: z19.z.array(ToolSchema)
4396
4402
  });
4397
- var TextContentSchema = zod.z.object({
4398
- type: zod.z.literal("text"),
4399
- text: zod.z.string()
4403
+ var TextContentSchema = z19.z.object({
4404
+ type: z19.z.literal("text"),
4405
+ text: z19.z.string()
4400
4406
  }).passthrough();
4401
- var ImageContentSchema = zod.z.object({
4402
- type: zod.z.literal("image"),
4403
- data: zod.z.string().base64(),
4404
- mimeType: zod.z.string()
4407
+ var ImageContentSchema = z19.z.object({
4408
+ type: z19.z.literal("image"),
4409
+ data: z19.z.string().base64(),
4410
+ mimeType: z19.z.string()
4405
4411
  }).passthrough();
4406
- var ResourceContentsSchema = zod.z.object({
4412
+ var ResourceContentsSchema = z19.z.object({
4407
4413
  /**
4408
4414
  * The URI of this resource.
4409
4415
  */
4410
- uri: zod.z.string(),
4416
+ uri: z19.z.string(),
4411
4417
  /**
4412
4418
  * The MIME type of this resource, if known.
4413
4419
  */
4414
- mimeType: zod.z.optional(zod.z.string())
4420
+ mimeType: z19.z.optional(z19.z.string())
4415
4421
  }).passthrough();
4416
4422
  var TextResourceContentsSchema = ResourceContentsSchema.extend({
4417
- text: zod.z.string()
4423
+ text: z19.z.string()
4418
4424
  });
4419
4425
  var BlobResourceContentsSchema = ResourceContentsSchema.extend({
4420
- blob: zod.z.string().base64()
4426
+ blob: z19.z.string().base64()
4421
4427
  });
4422
- var EmbeddedResourceSchema = zod.z.object({
4423
- type: zod.z.literal("resource"),
4424
- resource: zod.z.union([TextResourceContentsSchema, BlobResourceContentsSchema])
4428
+ var EmbeddedResourceSchema = z19.z.object({
4429
+ type: z19.z.literal("resource"),
4430
+ resource: z19.z.union([TextResourceContentsSchema, BlobResourceContentsSchema])
4425
4431
  }).passthrough();
4426
4432
  ResultSchema.extend({
4427
- content: zod.z.array(
4428
- zod.z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])
4433
+ content: z19.z.array(
4434
+ z19.z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])
4429
4435
  ),
4430
- isError: zod.z.boolean().default(false).optional()
4436
+ isError: z19.z.boolean().default(false).optional()
4431
4437
  }).or(
4432
4438
  ResultSchema.extend({
4433
- toolResult: zod.z.unknown()
4439
+ toolResult: z19.z.unknown()
4434
4440
  })
4435
4441
  );
4436
4442
  var JSONRPC_VERSION = "2.0";
4437
- var JSONRPCRequestSchema = zod.z.object({
4438
- jsonrpc: zod.z.literal(JSONRPC_VERSION),
4439
- id: zod.z.union([zod.z.string(), zod.z.number().int()])
4443
+ var JSONRPCRequestSchema = z19.z.object({
4444
+ jsonrpc: z19.z.literal(JSONRPC_VERSION),
4445
+ id: z19.z.union([z19.z.string(), z19.z.number().int()])
4440
4446
  }).merge(RequestSchema).strict();
4441
- var JSONRPCResponseSchema = zod.z.object({
4442
- jsonrpc: zod.z.literal(JSONRPC_VERSION),
4443
- id: zod.z.union([zod.z.string(), zod.z.number().int()]),
4447
+ var JSONRPCResponseSchema = z19.z.object({
4448
+ jsonrpc: z19.z.literal(JSONRPC_VERSION),
4449
+ id: z19.z.union([z19.z.string(), z19.z.number().int()]),
4444
4450
  result: ResultSchema
4445
4451
  }).strict();
4446
- var JSONRPCErrorSchema = zod.z.object({
4447
- jsonrpc: zod.z.literal(JSONRPC_VERSION),
4448
- id: zod.z.union([zod.z.string(), zod.z.number().int()]),
4449
- error: zod.z.object({
4450
- code: zod.z.number().int(),
4451
- message: zod.z.string(),
4452
- data: zod.z.optional(zod.z.unknown())
4452
+ var JSONRPCErrorSchema = z19.z.object({
4453
+ jsonrpc: z19.z.literal(JSONRPC_VERSION),
4454
+ id: z19.z.union([z19.z.string(), z19.z.number().int()]),
4455
+ error: z19.z.object({
4456
+ code: z19.z.number().int(),
4457
+ message: z19.z.string(),
4458
+ data: z19.z.optional(z19.z.unknown())
4453
4459
  })
4454
4460
  }).strict();
4455
- var JSONRPCNotificationSchema = zod.z.object({
4456
- jsonrpc: zod.z.literal(JSONRPC_VERSION)
4461
+ var JSONRPCNotificationSchema = z19.z.object({
4462
+ jsonrpc: z19.z.literal(JSONRPC_VERSION)
4457
4463
  }).merge(
4458
- zod.z.object({
4459
- method: zod.z.string(),
4460
- params: zod.z.optional(BaseParamsSchema)
4464
+ z19.z.object({
4465
+ method: z19.z.string(),
4466
+ params: z19.z.optional(BaseParamsSchema)
4461
4467
  })
4462
4468
  ).strict();
4463
- zod.z.union([
4469
+ z19.z.union([
4464
4470
  JSONRPCRequestSchema,
4465
4471
  JSONRPCNotificationSchema,
4466
4472
  JSONRPCResponseSchema,
@@ -10038,26 +10044,26 @@ function convertJsonSchemaToZod2(schema) {
10038
10044
  }
10039
10045
  if (schema.const !== void 0) {
10040
10046
  if (typeof schema.const === "string") {
10041
- return addMetadata(zod.z.literal(schema.const), schema);
10047
+ return addMetadata(z19.z.literal(schema.const), schema);
10042
10048
  } else if (typeof schema.const === "number") {
10043
- return addMetadata(zod.z.literal(schema.const), schema);
10049
+ return addMetadata(z19.z.literal(schema.const), schema);
10044
10050
  } else if (typeof schema.const === "boolean") {
10045
- return addMetadata(zod.z.literal(schema.const), schema);
10051
+ return addMetadata(z19.z.literal(schema.const), schema);
10046
10052
  } else if (schema.const === null) {
10047
- return addMetadata(zod.z.null(), schema);
10053
+ return addMetadata(z19.z.null(), schema);
10048
10054
  }
10049
- return addMetadata(zod.z.literal(schema.const), schema);
10055
+ return addMetadata(z19.z.literal(schema.const), schema);
10050
10056
  }
10051
10057
  if (schema.type) {
10052
10058
  switch (schema.type) {
10053
10059
  case "string": {
10054
10060
  if (schema.enum) {
10055
10061
  if (schema.enum.length === 0) {
10056
- return addMetadata(zod.z.string(), schema);
10062
+ return addMetadata(z19.z.string(), schema);
10057
10063
  }
10058
- return addMetadata(zod.z.enum(schema.enum), schema);
10064
+ return addMetadata(z19.z.enum(schema.enum), schema);
10059
10065
  }
10060
- let stringSchema = zod.z.string();
10066
+ let stringSchema = z19.z.string();
10061
10067
  if (schema.minLength !== void 0) {
10062
10068
  stringSchema = stringSchema.min(schema.minLength);
10063
10069
  }
@@ -10074,18 +10080,18 @@ function convertJsonSchemaToZod2(schema) {
10074
10080
  case "integer": {
10075
10081
  if (schema.enum) {
10076
10082
  if (schema.enum.length === 0) {
10077
- return addMetadata(zod.z.number(), schema);
10083
+ return addMetadata(z19.z.number(), schema);
10078
10084
  }
10079
- const options = schema.enum.map((val) => zod.z.literal(val));
10085
+ const options = schema.enum.map((val) => z19.z.literal(val));
10080
10086
  if (options.length === 1) {
10081
10087
  return addMetadata(options[0], schema);
10082
10088
  }
10083
10089
  if (options.length >= 2) {
10084
- const unionSchema = zod.z.union([options[0], options[1], ...options.slice(2)]);
10090
+ const unionSchema = z19.z.union([options[0], options[1], ...options.slice(2)]);
10085
10091
  return addMetadata(unionSchema, schema);
10086
10092
  }
10087
10093
  }
10088
- let numberSchema = schema.type === "integer" ? zod.z.number().int() : zod.z.number();
10094
+ let numberSchema = schema.type === "integer" ? z19.z.number().int() : z19.z.number();
10089
10095
  if (schema.minimum !== void 0) {
10090
10096
  numberSchema = numberSchema.min(schema.minimum);
10091
10097
  }
@@ -10106,20 +10112,20 @@ function convertJsonSchemaToZod2(schema) {
10106
10112
  case "boolean":
10107
10113
  if (schema.enum) {
10108
10114
  if (schema.enum.length === 0) {
10109
- return addMetadata(zod.z.boolean(), schema);
10115
+ return addMetadata(z19.z.boolean(), schema);
10110
10116
  }
10111
- const options = schema.enum.map((val) => zod.z.literal(val));
10117
+ const options = schema.enum.map((val) => z19.z.literal(val));
10112
10118
  if (options.length === 1) {
10113
10119
  return addMetadata(options[0], schema);
10114
10120
  }
10115
10121
  if (options.length >= 2) {
10116
- const unionSchema = zod.z.union([options[0], options[1], ...options.slice(2)]);
10122
+ const unionSchema = z19.z.union([options[0], options[1], ...options.slice(2)]);
10117
10123
  return addMetadata(unionSchema, schema);
10118
10124
  }
10119
10125
  }
10120
- return addMetadata(zod.z.boolean(), schema);
10126
+ return addMetadata(z19.z.boolean(), schema);
10121
10127
  case "null":
10122
- return addMetadata(zod.z.null(), schema);
10128
+ return addMetadata(z19.z.null(), schema);
10123
10129
  case "object":
10124
10130
  if (schema.properties) {
10125
10131
  const shape = {};
@@ -10142,19 +10148,19 @@ function convertJsonSchemaToZod2(schema) {
10142
10148
  }
10143
10149
  let zodSchema5;
10144
10150
  if (schema.additionalProperties !== false) {
10145
- zodSchema5 = zod.z.object(shape).passthrough();
10151
+ zodSchema5 = z19.z.object(shape).passthrough();
10146
10152
  } else {
10147
- zodSchema5 = zod.z.object(shape);
10153
+ zodSchema5 = z19.z.object(shape);
10148
10154
  }
10149
10155
  return addMetadata(zodSchema5, schema);
10150
10156
  }
10151
- return addMetadata(zod.z.object({}), schema);
10157
+ return addMetadata(z19.z.object({}), schema);
10152
10158
  case "array": {
10153
10159
  let arraySchema;
10154
10160
  if (schema.items) {
10155
- arraySchema = zod.z.array(convertJsonSchemaToZod2(schema.items));
10161
+ arraySchema = z19.z.array(convertJsonSchemaToZod2(schema.items));
10156
10162
  } else {
10157
- arraySchema = zod.z.array(zod.z.any());
10163
+ arraySchema = z19.z.array(z19.z.any());
10158
10164
  }
10159
10165
  if (schema.minItems !== void 0) {
10160
10166
  arraySchema = arraySchema.min(schema.minItems);
@@ -10187,18 +10193,18 @@ function convertJsonSchemaToZod2(schema) {
10187
10193
  }
10188
10194
  if (schema.enum) {
10189
10195
  if (schema.enum.length === 0) {
10190
- return addMetadata(zod.z.never(), schema);
10196
+ return addMetadata(z19.z.never(), schema);
10191
10197
  }
10192
10198
  const allStrings = schema.enum.every((val) => typeof val === "string");
10193
10199
  if (allStrings) {
10194
- return addMetadata(zod.z.enum(schema.enum), schema);
10200
+ return addMetadata(z19.z.enum(schema.enum), schema);
10195
10201
  } else {
10196
- const options = schema.enum.map((val) => zod.z.literal(val));
10202
+ const options = schema.enum.map((val) => z19.z.literal(val));
10197
10203
  if (options.length === 1) {
10198
10204
  return addMetadata(options[0], schema);
10199
10205
  }
10200
10206
  if (options.length >= 2) {
10201
- const unionSchema = zod.z.union([options[0], options[1], ...options.slice(2)]);
10207
+ const unionSchema = z19.z.union([options[0], options[1], ...options.slice(2)]);
10202
10208
  return addMetadata(unionSchema, schema);
10203
10209
  }
10204
10210
  }
@@ -10206,15 +10212,15 @@ function convertJsonSchemaToZod2(schema) {
10206
10212
  if (schema.anyOf && schema.anyOf.length >= 2) {
10207
10213
  const schemas = schema.anyOf.map(convertJsonSchemaToZod2);
10208
10214
  return addMetadata(
10209
- zod.z.union([schemas[0], schemas[1], ...schemas.slice(2)]),
10215
+ z19.z.union([schemas[0], schemas[1], ...schemas.slice(2)]),
10210
10216
  schema
10211
10217
  );
10212
10218
  }
10213
10219
  if (schema.allOf) {
10214
10220
  return addMetadata(
10215
10221
  schema.allOf.reduce(
10216
- (acc, s) => zod.z.intersection(acc, convertJsonSchemaToZod2(s)),
10217
- zod.z.object({})
10222
+ (acc, s) => z19.z.intersection(acc, convertJsonSchemaToZod2(s)),
10223
+ z19.z.object({})
10218
10224
  ),
10219
10225
  schema
10220
10226
  );
@@ -10222,11 +10228,11 @@ function convertJsonSchemaToZod2(schema) {
10222
10228
  if (schema.oneOf && schema.oneOf.length >= 2) {
10223
10229
  const schemas = schema.oneOf.map(convertJsonSchemaToZod2);
10224
10230
  return addMetadata(
10225
- zod.z.union([schemas[0], schemas[1], ...schemas.slice(2)]),
10231
+ z19.z.union([schemas[0], schemas[1], ...schemas.slice(2)]),
10226
10232
  schema
10227
10233
  );
10228
10234
  }
10229
- return addMetadata(zod.z.any(), schema);
10235
+ return addMetadata(z19.z.any(), schema);
10230
10236
  }
10231
10237
  var __create = Object.create;
10232
10238
  var __defProp3 = Object.defineProperty;
@@ -10685,7 +10691,7 @@ function parseArrayDef3(def, refs) {
10685
10691
  const res = {
10686
10692
  type: "array"
10687
10693
  };
10688
- if (def.type?._def && def.type?._def?.typeName !== zod.ZodFirstPartyTypeKind.ZodAny) {
10694
+ if (def.type?._def && def.type?._def?.typeName !== z19.ZodFirstPartyTypeKind.ZodAny) {
10689
10695
  res.items = parseDef3(def.type._def, {
10690
10696
  ...refs,
10691
10697
  currentPath: [...refs.currentPath, "items"]
@@ -11202,7 +11208,7 @@ function parseRecordDef3(def, refs) {
11202
11208
  if (refs.target === "openAi") {
11203
11209
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
11204
11210
  }
11205
- if (refs.target === "openApi3" && def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodEnum) {
11211
+ if (refs.target === "openApi3" && def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
11206
11212
  return {
11207
11213
  type: "object",
11208
11214
  required: def.keyType._def.values,
@@ -11226,20 +11232,20 @@ function parseRecordDef3(def, refs) {
11226
11232
  if (refs.target === "openApi3") {
11227
11233
  return schema;
11228
11234
  }
11229
- if (def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
11235
+ if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
11230
11236
  const { type, ...keyType } = parseStringDef3(def.keyType._def, refs);
11231
11237
  return {
11232
11238
  ...schema,
11233
11239
  propertyNames: keyType
11234
11240
  };
11235
- } else if (def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodEnum) {
11241
+ } else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
11236
11242
  return {
11237
11243
  ...schema,
11238
11244
  propertyNames: {
11239
11245
  enum: def.keyType._def.values
11240
11246
  }
11241
11247
  };
11242
- } else if (def.keyType?._def.typeName === zod.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === zod.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
11248
+ } else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
11243
11249
  const { type, ...keyType } = parseBrandedDef3(def.keyType._def, refs);
11244
11250
  return {
11245
11251
  ...schema,
@@ -11605,73 +11611,73 @@ var parseReadonlyDef3 = (def, refs) => {
11605
11611
  };
11606
11612
  var selectParser3 = (def, typeName, refs) => {
11607
11613
  switch (typeName) {
11608
- case zod.ZodFirstPartyTypeKind.ZodString:
11614
+ case z19.ZodFirstPartyTypeKind.ZodString:
11609
11615
  return parseStringDef3(def, refs);
11610
- case zod.ZodFirstPartyTypeKind.ZodNumber:
11616
+ case z19.ZodFirstPartyTypeKind.ZodNumber:
11611
11617
  return parseNumberDef3(def, refs);
11612
- case zod.ZodFirstPartyTypeKind.ZodObject:
11618
+ case z19.ZodFirstPartyTypeKind.ZodObject:
11613
11619
  return parseObjectDef3(def, refs);
11614
- case zod.ZodFirstPartyTypeKind.ZodBigInt:
11620
+ case z19.ZodFirstPartyTypeKind.ZodBigInt:
11615
11621
  return parseBigintDef3(def, refs);
11616
- case zod.ZodFirstPartyTypeKind.ZodBoolean:
11622
+ case z19.ZodFirstPartyTypeKind.ZodBoolean:
11617
11623
  return parseBooleanDef3();
11618
- case zod.ZodFirstPartyTypeKind.ZodDate:
11624
+ case z19.ZodFirstPartyTypeKind.ZodDate:
11619
11625
  return parseDateDef3(def, refs);
11620
- case zod.ZodFirstPartyTypeKind.ZodUndefined:
11626
+ case z19.ZodFirstPartyTypeKind.ZodUndefined:
11621
11627
  return parseUndefinedDef3(refs);
11622
- case zod.ZodFirstPartyTypeKind.ZodNull:
11628
+ case z19.ZodFirstPartyTypeKind.ZodNull:
11623
11629
  return parseNullDef3(refs);
11624
- case zod.ZodFirstPartyTypeKind.ZodArray:
11630
+ case z19.ZodFirstPartyTypeKind.ZodArray:
11625
11631
  return parseArrayDef3(def, refs);
11626
- case zod.ZodFirstPartyTypeKind.ZodUnion:
11627
- case zod.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
11632
+ case z19.ZodFirstPartyTypeKind.ZodUnion:
11633
+ case z19.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
11628
11634
  return parseUnionDef3(def, refs);
11629
- case zod.ZodFirstPartyTypeKind.ZodIntersection:
11635
+ case z19.ZodFirstPartyTypeKind.ZodIntersection:
11630
11636
  return parseIntersectionDef3(def, refs);
11631
- case zod.ZodFirstPartyTypeKind.ZodTuple:
11637
+ case z19.ZodFirstPartyTypeKind.ZodTuple:
11632
11638
  return parseTupleDef3(def, refs);
11633
- case zod.ZodFirstPartyTypeKind.ZodRecord:
11639
+ case z19.ZodFirstPartyTypeKind.ZodRecord:
11634
11640
  return parseRecordDef3(def, refs);
11635
- case zod.ZodFirstPartyTypeKind.ZodLiteral:
11641
+ case z19.ZodFirstPartyTypeKind.ZodLiteral:
11636
11642
  return parseLiteralDef3(def, refs);
11637
- case zod.ZodFirstPartyTypeKind.ZodEnum:
11643
+ case z19.ZodFirstPartyTypeKind.ZodEnum:
11638
11644
  return parseEnumDef3(def);
11639
- case zod.ZodFirstPartyTypeKind.ZodNativeEnum:
11645
+ case z19.ZodFirstPartyTypeKind.ZodNativeEnum:
11640
11646
  return parseNativeEnumDef3(def);
11641
- case zod.ZodFirstPartyTypeKind.ZodNullable:
11647
+ case z19.ZodFirstPartyTypeKind.ZodNullable:
11642
11648
  return parseNullableDef3(def, refs);
11643
- case zod.ZodFirstPartyTypeKind.ZodOptional:
11649
+ case z19.ZodFirstPartyTypeKind.ZodOptional:
11644
11650
  return parseOptionalDef3(def, refs);
11645
- case zod.ZodFirstPartyTypeKind.ZodMap:
11651
+ case z19.ZodFirstPartyTypeKind.ZodMap:
11646
11652
  return parseMapDef3(def, refs);
11647
- case zod.ZodFirstPartyTypeKind.ZodSet:
11653
+ case z19.ZodFirstPartyTypeKind.ZodSet:
11648
11654
  return parseSetDef3(def, refs);
11649
- case zod.ZodFirstPartyTypeKind.ZodLazy:
11655
+ case z19.ZodFirstPartyTypeKind.ZodLazy:
11650
11656
  return () => def.getter()._def;
11651
- case zod.ZodFirstPartyTypeKind.ZodPromise:
11657
+ case z19.ZodFirstPartyTypeKind.ZodPromise:
11652
11658
  return parsePromiseDef3(def, refs);
11653
- case zod.ZodFirstPartyTypeKind.ZodNaN:
11654
- case zod.ZodFirstPartyTypeKind.ZodNever:
11659
+ case z19.ZodFirstPartyTypeKind.ZodNaN:
11660
+ case z19.ZodFirstPartyTypeKind.ZodNever:
11655
11661
  return parseNeverDef3(refs);
11656
- case zod.ZodFirstPartyTypeKind.ZodEffects:
11662
+ case z19.ZodFirstPartyTypeKind.ZodEffects:
11657
11663
  return parseEffectsDef3(def, refs);
11658
- case zod.ZodFirstPartyTypeKind.ZodAny:
11664
+ case z19.ZodFirstPartyTypeKind.ZodAny:
11659
11665
  return parseAnyDef3(refs);
11660
- case zod.ZodFirstPartyTypeKind.ZodUnknown:
11666
+ case z19.ZodFirstPartyTypeKind.ZodUnknown:
11661
11667
  return parseUnknownDef3(refs);
11662
- case zod.ZodFirstPartyTypeKind.ZodDefault:
11668
+ case z19.ZodFirstPartyTypeKind.ZodDefault:
11663
11669
  return parseDefaultDef3(def, refs);
11664
- case zod.ZodFirstPartyTypeKind.ZodBranded:
11670
+ case z19.ZodFirstPartyTypeKind.ZodBranded:
11665
11671
  return parseBrandedDef3(def, refs);
11666
- case zod.ZodFirstPartyTypeKind.ZodReadonly:
11672
+ case z19.ZodFirstPartyTypeKind.ZodReadonly:
11667
11673
  return parseReadonlyDef3(def, refs);
11668
- case zod.ZodFirstPartyTypeKind.ZodCatch:
11674
+ case z19.ZodFirstPartyTypeKind.ZodCatch:
11669
11675
  return parseCatchDef3(def, refs);
11670
- case zod.ZodFirstPartyTypeKind.ZodPipeline:
11676
+ case z19.ZodFirstPartyTypeKind.ZodPipeline:
11671
11677
  return parsePipelineDef3(def, refs);
11672
- case zod.ZodFirstPartyTypeKind.ZodFunction:
11673
- case zod.ZodFirstPartyTypeKind.ZodVoid:
11674
- case zod.ZodFirstPartyTypeKind.ZodSymbol:
11678
+ case z19.ZodFirstPartyTypeKind.ZodFunction:
11679
+ case z19.ZodFirstPartyTypeKind.ZodVoid:
11680
+ case z19.ZodFirstPartyTypeKind.ZodSymbol:
11675
11681
  return void 0;
11676
11682
  default:
11677
11683
  return /* @__PURE__ */ ((_) => void 0)();
@@ -13169,11 +13175,11 @@ var NoObjectGeneratedError3 = class extends AISDKError3 {
13169
13175
  }
13170
13176
  };
13171
13177
  _a422 = symbol422;
13172
- var dataContentSchema3 = zod.z.union([
13173
- zod.z.string(),
13174
- zod.z.instanceof(Uint8Array),
13175
- zod.z.instanceof(ArrayBuffer),
13176
- zod.z.custom(
13178
+ var dataContentSchema3 = z19.z.union([
13179
+ z19.z.string(),
13180
+ z19.z.instanceof(Uint8Array),
13181
+ z19.z.instanceof(ArrayBuffer),
13182
+ z19.z.custom(
13177
13183
  // Buffer might not be available in some environments such as CloudFlare:
13178
13184
  (value) => {
13179
13185
  var _a172, _b8;
@@ -13182,102 +13188,102 @@ var dataContentSchema3 = zod.z.union([
13182
13188
  { message: "Must be a Buffer" }
13183
13189
  )
13184
13190
  ]);
13185
- var jsonValueSchema3 = zod.z.lazy(
13186
- () => zod.z.union([
13187
- zod.z.null(),
13188
- zod.z.string(),
13189
- zod.z.number(),
13190
- zod.z.boolean(),
13191
- zod.z.record(zod.z.string(), jsonValueSchema3),
13192
- zod.z.array(jsonValueSchema3)
13191
+ var jsonValueSchema3 = z19.z.lazy(
13192
+ () => z19.z.union([
13193
+ z19.z.null(),
13194
+ z19.z.string(),
13195
+ z19.z.number(),
13196
+ z19.z.boolean(),
13197
+ z19.z.record(z19.z.string(), jsonValueSchema3),
13198
+ z19.z.array(jsonValueSchema3)
13193
13199
  ])
13194
13200
  );
13195
- var providerMetadataSchema3 = zod.z.record(
13196
- zod.z.string(),
13197
- zod.z.record(zod.z.string(), jsonValueSchema3)
13201
+ var providerMetadataSchema3 = z19.z.record(
13202
+ z19.z.string(),
13203
+ z19.z.record(z19.z.string(), jsonValueSchema3)
13198
13204
  );
13199
- var toolResultContentSchema2 = zod.z.array(
13200
- zod.z.union([
13201
- zod.z.object({ type: zod.z.literal("text"), text: zod.z.string() }),
13202
- zod.z.object({
13203
- type: zod.z.literal("image"),
13204
- data: zod.z.string(),
13205
- mimeType: zod.z.string().optional()
13205
+ var toolResultContentSchema2 = z19.z.array(
13206
+ z19.z.union([
13207
+ z19.z.object({ type: z19.z.literal("text"), text: z19.z.string() }),
13208
+ z19.z.object({
13209
+ type: z19.z.literal("image"),
13210
+ data: z19.z.string(),
13211
+ mimeType: z19.z.string().optional()
13206
13212
  })
13207
13213
  ])
13208
13214
  );
13209
- var textPartSchema3 = zod.z.object({
13210
- type: zod.z.literal("text"),
13211
- text: zod.z.string(),
13215
+ var textPartSchema3 = z19.z.object({
13216
+ type: z19.z.literal("text"),
13217
+ text: z19.z.string(),
13212
13218
  providerOptions: providerMetadataSchema3.optional(),
13213
13219
  experimental_providerMetadata: providerMetadataSchema3.optional()
13214
13220
  });
13215
- var imagePartSchema3 = zod.z.object({
13216
- type: zod.z.literal("image"),
13217
- image: zod.z.union([dataContentSchema3, zod.z.instanceof(URL)]),
13218
- mimeType: zod.z.string().optional(),
13221
+ var imagePartSchema3 = z19.z.object({
13222
+ type: z19.z.literal("image"),
13223
+ image: z19.z.union([dataContentSchema3, z19.z.instanceof(URL)]),
13224
+ mimeType: z19.z.string().optional(),
13219
13225
  providerOptions: providerMetadataSchema3.optional(),
13220
13226
  experimental_providerMetadata: providerMetadataSchema3.optional()
13221
13227
  });
13222
- var filePartSchema3 = zod.z.object({
13223
- type: zod.z.literal("file"),
13224
- data: zod.z.union([dataContentSchema3, zod.z.instanceof(URL)]),
13225
- filename: zod.z.string().optional(),
13226
- mimeType: zod.z.string(),
13228
+ var filePartSchema3 = z19.z.object({
13229
+ type: z19.z.literal("file"),
13230
+ data: z19.z.union([dataContentSchema3, z19.z.instanceof(URL)]),
13231
+ filename: z19.z.string().optional(),
13232
+ mimeType: z19.z.string(),
13227
13233
  providerOptions: providerMetadataSchema3.optional(),
13228
13234
  experimental_providerMetadata: providerMetadataSchema3.optional()
13229
13235
  });
13230
- var reasoningPartSchema3 = zod.z.object({
13231
- type: zod.z.literal("reasoning"),
13232
- text: zod.z.string(),
13236
+ var reasoningPartSchema3 = z19.z.object({
13237
+ type: z19.z.literal("reasoning"),
13238
+ text: z19.z.string(),
13233
13239
  providerOptions: providerMetadataSchema3.optional(),
13234
13240
  experimental_providerMetadata: providerMetadataSchema3.optional()
13235
13241
  });
13236
- var redactedReasoningPartSchema2 = zod.z.object({
13237
- type: zod.z.literal("redacted-reasoning"),
13238
- data: zod.z.string(),
13242
+ var redactedReasoningPartSchema2 = z19.z.object({
13243
+ type: z19.z.literal("redacted-reasoning"),
13244
+ data: z19.z.string(),
13239
13245
  providerOptions: providerMetadataSchema3.optional(),
13240
13246
  experimental_providerMetadata: providerMetadataSchema3.optional()
13241
13247
  });
13242
- var toolCallPartSchema3 = zod.z.object({
13243
- type: zod.z.literal("tool-call"),
13244
- toolCallId: zod.z.string(),
13245
- toolName: zod.z.string(),
13246
- args: zod.z.unknown(),
13248
+ var toolCallPartSchema3 = z19.z.object({
13249
+ type: z19.z.literal("tool-call"),
13250
+ toolCallId: z19.z.string(),
13251
+ toolName: z19.z.string(),
13252
+ args: z19.z.unknown(),
13247
13253
  providerOptions: providerMetadataSchema3.optional(),
13248
13254
  experimental_providerMetadata: providerMetadataSchema3.optional()
13249
13255
  });
13250
- var toolResultPartSchema3 = zod.z.object({
13251
- type: zod.z.literal("tool-result"),
13252
- toolCallId: zod.z.string(),
13253
- toolName: zod.z.string(),
13254
- result: zod.z.unknown(),
13256
+ var toolResultPartSchema3 = z19.z.object({
13257
+ type: z19.z.literal("tool-result"),
13258
+ toolCallId: z19.z.string(),
13259
+ toolName: z19.z.string(),
13260
+ result: z19.z.unknown(),
13255
13261
  content: toolResultContentSchema2.optional(),
13256
- isError: zod.z.boolean().optional(),
13262
+ isError: z19.z.boolean().optional(),
13257
13263
  providerOptions: providerMetadataSchema3.optional(),
13258
13264
  experimental_providerMetadata: providerMetadataSchema3.optional()
13259
13265
  });
13260
- var coreSystemMessageSchema2 = zod.z.object({
13261
- role: zod.z.literal("system"),
13262
- content: zod.z.string(),
13266
+ var coreSystemMessageSchema2 = z19.z.object({
13267
+ role: z19.z.literal("system"),
13268
+ content: z19.z.string(),
13263
13269
  providerOptions: providerMetadataSchema3.optional(),
13264
13270
  experimental_providerMetadata: providerMetadataSchema3.optional()
13265
13271
  });
13266
- var coreUserMessageSchema2 = zod.z.object({
13267
- role: zod.z.literal("user"),
13268
- content: zod.z.union([
13269
- zod.z.string(),
13270
- zod.z.array(zod.z.union([textPartSchema3, imagePartSchema3, filePartSchema3]))
13272
+ var coreUserMessageSchema2 = z19.z.object({
13273
+ role: z19.z.literal("user"),
13274
+ content: z19.z.union([
13275
+ z19.z.string(),
13276
+ z19.z.array(z19.z.union([textPartSchema3, imagePartSchema3, filePartSchema3]))
13271
13277
  ]),
13272
13278
  providerOptions: providerMetadataSchema3.optional(),
13273
13279
  experimental_providerMetadata: providerMetadataSchema3.optional()
13274
13280
  });
13275
- var coreAssistantMessageSchema2 = zod.z.object({
13276
- role: zod.z.literal("assistant"),
13277
- content: zod.z.union([
13278
- zod.z.string(),
13279
- zod.z.array(
13280
- zod.z.union([
13281
+ var coreAssistantMessageSchema2 = z19.z.object({
13282
+ role: z19.z.literal("assistant"),
13283
+ content: z19.z.union([
13284
+ z19.z.string(),
13285
+ z19.z.array(
13286
+ z19.z.union([
13281
13287
  textPartSchema3,
13282
13288
  filePartSchema3,
13283
13289
  reasoningPartSchema3,
@@ -13289,13 +13295,13 @@ var coreAssistantMessageSchema2 = zod.z.object({
13289
13295
  providerOptions: providerMetadataSchema3.optional(),
13290
13296
  experimental_providerMetadata: providerMetadataSchema3.optional()
13291
13297
  });
13292
- var coreToolMessageSchema2 = zod.z.object({
13293
- role: zod.z.literal("tool"),
13294
- content: zod.z.array(toolResultPartSchema3),
13298
+ var coreToolMessageSchema2 = z19.z.object({
13299
+ role: z19.z.literal("tool"),
13300
+ content: z19.z.array(toolResultPartSchema3),
13295
13301
  providerOptions: providerMetadataSchema3.optional(),
13296
13302
  experimental_providerMetadata: providerMetadataSchema3.optional()
13297
13303
  });
13298
- zod.z.union([
13304
+ z19.z.union([
13299
13305
  coreSystemMessageSchema2,
13300
13306
  coreUserMessageSchema2,
13301
13307
  coreAssistantMessageSchema2,
@@ -13505,125 +13511,125 @@ createIdGenerator3({
13505
13511
  prefix: "msg",
13506
13512
  size: 24
13507
13513
  });
13508
- var ClientOrServerImplementationSchema3 = zod.z.object({
13509
- name: zod.z.string(),
13510
- version: zod.z.string()
13514
+ var ClientOrServerImplementationSchema3 = z19.z.object({
13515
+ name: z19.z.string(),
13516
+ version: z19.z.string()
13511
13517
  }).passthrough();
13512
- var BaseParamsSchema3 = zod.z.object({
13513
- _meta: zod.z.optional(zod.z.object({}).passthrough())
13518
+ var BaseParamsSchema3 = z19.z.object({
13519
+ _meta: z19.z.optional(z19.z.object({}).passthrough())
13514
13520
  }).passthrough();
13515
13521
  var ResultSchema3 = BaseParamsSchema3;
13516
- var RequestSchema3 = zod.z.object({
13517
- method: zod.z.string(),
13518
- params: zod.z.optional(BaseParamsSchema3)
13522
+ var RequestSchema3 = z19.z.object({
13523
+ method: z19.z.string(),
13524
+ params: z19.z.optional(BaseParamsSchema3)
13519
13525
  });
13520
- var ServerCapabilitiesSchema3 = zod.z.object({
13521
- experimental: zod.z.optional(zod.z.object({}).passthrough()),
13522
- logging: zod.z.optional(zod.z.object({}).passthrough()),
13523
- prompts: zod.z.optional(
13524
- zod.z.object({
13525
- listChanged: zod.z.optional(zod.z.boolean())
13526
+ var ServerCapabilitiesSchema3 = z19.z.object({
13527
+ experimental: z19.z.optional(z19.z.object({}).passthrough()),
13528
+ logging: z19.z.optional(z19.z.object({}).passthrough()),
13529
+ prompts: z19.z.optional(
13530
+ z19.z.object({
13531
+ listChanged: z19.z.optional(z19.z.boolean())
13526
13532
  }).passthrough()
13527
13533
  ),
13528
- resources: zod.z.optional(
13529
- zod.z.object({
13530
- subscribe: zod.z.optional(zod.z.boolean()),
13531
- listChanged: zod.z.optional(zod.z.boolean())
13534
+ resources: z19.z.optional(
13535
+ z19.z.object({
13536
+ subscribe: z19.z.optional(z19.z.boolean()),
13537
+ listChanged: z19.z.optional(z19.z.boolean())
13532
13538
  }).passthrough()
13533
13539
  ),
13534
- tools: zod.z.optional(
13535
- zod.z.object({
13536
- listChanged: zod.z.optional(zod.z.boolean())
13540
+ tools: z19.z.optional(
13541
+ z19.z.object({
13542
+ listChanged: z19.z.optional(z19.z.boolean())
13537
13543
  }).passthrough()
13538
13544
  )
13539
13545
  }).passthrough();
13540
13546
  ResultSchema3.extend({
13541
- protocolVersion: zod.z.string(),
13547
+ protocolVersion: z19.z.string(),
13542
13548
  capabilities: ServerCapabilitiesSchema3,
13543
13549
  serverInfo: ClientOrServerImplementationSchema3,
13544
- instructions: zod.z.optional(zod.z.string())
13550
+ instructions: z19.z.optional(z19.z.string())
13545
13551
  });
13546
13552
  var PaginatedResultSchema3 = ResultSchema3.extend({
13547
- nextCursor: zod.z.optional(zod.z.string())
13553
+ nextCursor: z19.z.optional(z19.z.string())
13548
13554
  });
13549
- var ToolSchema3 = zod.z.object({
13550
- name: zod.z.string(),
13551
- description: zod.z.optional(zod.z.string()),
13552
- inputSchema: zod.z.object({
13553
- type: zod.z.literal("object"),
13554
- properties: zod.z.optional(zod.z.object({}).passthrough())
13555
+ var ToolSchema3 = z19.z.object({
13556
+ name: z19.z.string(),
13557
+ description: z19.z.optional(z19.z.string()),
13558
+ inputSchema: z19.z.object({
13559
+ type: z19.z.literal("object"),
13560
+ properties: z19.z.optional(z19.z.object({}).passthrough())
13555
13561
  }).passthrough()
13556
13562
  }).passthrough();
13557
13563
  PaginatedResultSchema3.extend({
13558
- tools: zod.z.array(ToolSchema3)
13564
+ tools: z19.z.array(ToolSchema3)
13559
13565
  });
13560
- var TextContentSchema3 = zod.z.object({
13561
- type: zod.z.literal("text"),
13562
- text: zod.z.string()
13566
+ var TextContentSchema3 = z19.z.object({
13567
+ type: z19.z.literal("text"),
13568
+ text: z19.z.string()
13563
13569
  }).passthrough();
13564
- var ImageContentSchema3 = zod.z.object({
13565
- type: zod.z.literal("image"),
13566
- data: zod.z.string().base64(),
13567
- mimeType: zod.z.string()
13570
+ var ImageContentSchema3 = z19.z.object({
13571
+ type: z19.z.literal("image"),
13572
+ data: z19.z.string().base64(),
13573
+ mimeType: z19.z.string()
13568
13574
  }).passthrough();
13569
- var ResourceContentsSchema3 = zod.z.object({
13575
+ var ResourceContentsSchema3 = z19.z.object({
13570
13576
  /**
13571
13577
  * The URI of this resource.
13572
13578
  */
13573
- uri: zod.z.string(),
13579
+ uri: z19.z.string(),
13574
13580
  /**
13575
13581
  * The MIME type of this resource, if known.
13576
13582
  */
13577
- mimeType: zod.z.optional(zod.z.string())
13583
+ mimeType: z19.z.optional(z19.z.string())
13578
13584
  }).passthrough();
13579
13585
  var TextResourceContentsSchema3 = ResourceContentsSchema3.extend({
13580
- text: zod.z.string()
13586
+ text: z19.z.string()
13581
13587
  });
13582
13588
  var BlobResourceContentsSchema3 = ResourceContentsSchema3.extend({
13583
- blob: zod.z.string().base64()
13589
+ blob: z19.z.string().base64()
13584
13590
  });
13585
- var EmbeddedResourceSchema3 = zod.z.object({
13586
- type: zod.z.literal("resource"),
13587
- resource: zod.z.union([TextResourceContentsSchema3, BlobResourceContentsSchema3])
13591
+ var EmbeddedResourceSchema3 = z19.z.object({
13592
+ type: z19.z.literal("resource"),
13593
+ resource: z19.z.union([TextResourceContentsSchema3, BlobResourceContentsSchema3])
13588
13594
  }).passthrough();
13589
13595
  ResultSchema3.extend({
13590
- content: zod.z.array(
13591
- zod.z.union([TextContentSchema3, ImageContentSchema3, EmbeddedResourceSchema3])
13596
+ content: z19.z.array(
13597
+ z19.z.union([TextContentSchema3, ImageContentSchema3, EmbeddedResourceSchema3])
13592
13598
  ),
13593
- isError: zod.z.boolean().default(false).optional()
13599
+ isError: z19.z.boolean().default(false).optional()
13594
13600
  }).or(
13595
13601
  ResultSchema3.extend({
13596
- toolResult: zod.z.unknown()
13602
+ toolResult: z19.z.unknown()
13597
13603
  })
13598
13604
  );
13599
13605
  var JSONRPC_VERSION3 = "2.0";
13600
- var JSONRPCRequestSchema3 = zod.z.object({
13601
- jsonrpc: zod.z.literal(JSONRPC_VERSION3),
13602
- id: zod.z.union([zod.z.string(), zod.z.number().int()])
13606
+ var JSONRPCRequestSchema3 = z19.z.object({
13607
+ jsonrpc: z19.z.literal(JSONRPC_VERSION3),
13608
+ id: z19.z.union([z19.z.string(), z19.z.number().int()])
13603
13609
  }).merge(RequestSchema3).strict();
13604
- var JSONRPCResponseSchema3 = zod.z.object({
13605
- jsonrpc: zod.z.literal(JSONRPC_VERSION3),
13606
- id: zod.z.union([zod.z.string(), zod.z.number().int()]),
13610
+ var JSONRPCResponseSchema3 = z19.z.object({
13611
+ jsonrpc: z19.z.literal(JSONRPC_VERSION3),
13612
+ id: z19.z.union([z19.z.string(), z19.z.number().int()]),
13607
13613
  result: ResultSchema3
13608
13614
  }).strict();
13609
- var JSONRPCErrorSchema3 = zod.z.object({
13610
- jsonrpc: zod.z.literal(JSONRPC_VERSION3),
13611
- id: zod.z.union([zod.z.string(), zod.z.number().int()]),
13612
- error: zod.z.object({
13613
- code: zod.z.number().int(),
13614
- message: zod.z.string(),
13615
- data: zod.z.optional(zod.z.unknown())
13615
+ var JSONRPCErrorSchema3 = z19.z.object({
13616
+ jsonrpc: z19.z.literal(JSONRPC_VERSION3),
13617
+ id: z19.z.union([z19.z.string(), z19.z.number().int()]),
13618
+ error: z19.z.object({
13619
+ code: z19.z.number().int(),
13620
+ message: z19.z.string(),
13621
+ data: z19.z.optional(z19.z.unknown())
13616
13622
  })
13617
13623
  }).strict();
13618
- var JSONRPCNotificationSchema3 = zod.z.object({
13619
- jsonrpc: zod.z.literal(JSONRPC_VERSION3)
13624
+ var JSONRPCNotificationSchema3 = z19.z.object({
13625
+ jsonrpc: z19.z.literal(JSONRPC_VERSION3)
13620
13626
  }).merge(
13621
- zod.z.object({
13622
- method: zod.z.string(),
13623
- params: zod.z.optional(BaseParamsSchema3)
13627
+ z19.z.object({
13628
+ method: z19.z.string(),
13629
+ params: z19.z.optional(BaseParamsSchema3)
13624
13630
  })
13625
13631
  ).strict();
13626
- zod.z.union([
13632
+ z19.z.union([
13627
13633
  JSONRPCRequestSchema3,
13628
13634
  JSONRPCNotificationSchema3,
13629
13635
  JSONRPCResponseSchema3,
@@ -13795,7 +13801,7 @@ function convertSchemaToZod(schema) {
13795
13801
  } else {
13796
13802
  const jsonSchemaToConvert = "jsonSchema" in schema ? schema.jsonSchema : schema;
13797
13803
  try {
13798
- if ("toJSONSchema" in zod.z) {
13804
+ if ("toJSONSchema" in z19.z) {
13799
13805
  return convertJsonSchemaToZod(jsonSchemaToConvert);
13800
13806
  } else {
13801
13807
  return convertJsonSchemaToZod2(jsonSchemaToConvert);
@@ -13812,12 +13818,12 @@ ${e2.stack}` : "\nUnknown error object"));
13812
13818
  // ../memory/dist/index.js
13813
13819
  var updateWorkingMemoryTool = (memoryConfig) => {
13814
13820
  const schema = memoryConfig?.workingMemory?.schema;
13815
- let inputSchema = zod.z.object({
13816
- memory: zod.z.string().describe(`The Markdown formatted working memory content to store. This MUST be a string. Never pass an object.`)
13821
+ let inputSchema = z19.z.object({
13822
+ memory: z19.z.string().describe(`The Markdown formatted working memory content to store. This MUST be a string. Never pass an object.`)
13817
13823
  });
13818
13824
  if (schema) {
13819
- inputSchema = zod.z.object({
13820
- memory: schema instanceof zod.ZodObject ? schema : convertSchemaToZod({ jsonSchema: schema }).describe(
13825
+ inputSchema = z19.z.object({
13826
+ memory: schema instanceof z19.ZodObject ? schema : convertSchemaToZod({ jsonSchema: schema }).describe(
13821
13827
  `The JSON formatted working memory content to store.`
13822
13828
  )
13823
13829
  });
@@ -13829,7 +13835,7 @@ var updateWorkingMemoryTool = (memoryConfig) => {
13829
13835
  execute: async (inputData, context) => {
13830
13836
  const threadId = context?.agent?.threadId;
13831
13837
  const resourceId = context?.agent?.resourceId;
13832
- const memory = context?.mastra?.memory || context?.memory;
13838
+ const memory = context?.memory;
13833
13839
  if (!threadId || !memory || !resourceId) {
13834
13840
  throw new Error("Thread ID, Memory instance, and resourceId are required for working memory updates");
13835
13841
  }
@@ -13859,21 +13865,21 @@ var __experimental_updateWorkingMemoryToolVNext = (config) => {
13859
13865
  return tools.createTool({
13860
13866
  id: "update-working-memory",
13861
13867
  description: "Update the working memory with new information.",
13862
- inputSchema: zod.z.object({
13863
- newMemory: zod.z.string().optional().describe(
13868
+ inputSchema: z19.z.object({
13869
+ newMemory: z19.z.string().optional().describe(
13864
13870
  `The ${config.workingMemory?.schema ? "JSON" : "Markdown"} formatted working memory content to store`
13865
13871
  ),
13866
- searchString: zod.z.string().optional().describe(
13872
+ searchString: z19.z.string().optional().describe(
13867
13873
  "The working memory string to find. Will be replaced with the newMemory string. If this is omitted or doesn't exist, the newMemory string will be appended to the end of your working memory. Replacing single lines at a time is encouraged for greater accuracy. If updateReason is not 'append-new-memory', this search string must be provided or the tool call will be rejected."
13868
13874
  ),
13869
- updateReason: zod.z.enum(["append-new-memory", "clarify-existing-memory", "replace-irrelevant-memory"]).optional().describe(
13875
+ updateReason: z19.z.enum(["append-new-memory", "clarify-existing-memory", "replace-irrelevant-memory"]).optional().describe(
13870
13876
  "The reason you're updating working memory. Passing any value other than 'append-new-memory' requires a searchString to be provided. Defaults to append-new-memory"
13871
13877
  )
13872
13878
  }),
13873
13879
  execute: async (inputData, context) => {
13874
13880
  const threadId = context?.agent?.threadId;
13875
13881
  const resourceId = context?.agent?.resourceId;
13876
- const memory = context?.mastra?.memory || context?.memory;
13882
+ const memory = context?.memory;
13877
13883
  if (!threadId || !memory || !resourceId) {
13878
13884
  throw new Error("Thread ID, Memory instance, and resourceId are required for working memory updates");
13879
13885
  }
@@ -13919,7 +13925,7 @@ var __experimental_updateWorkingMemoryToolVNext = (config) => {
13919
13925
  var CHARS_PER_TOKEN = 4;
13920
13926
  var DEFAULT_MESSAGE_RANGE = { before: 1, after: 1 };
13921
13927
  var DEFAULT_TOP_K = 4;
13922
- var isZodObject = (v) => v instanceof zod.ZodObject;
13928
+ var isZodObject = (v) => v instanceof z19.ZodObject;
13923
13929
  var Memory = class extends memory.MastraMemory {
13924
13930
  constructor(config = {}) {
13925
13931
  super({ name: "Memory", ...config });
@@ -16873,192 +16879,192 @@ z42.z.union([
16873
16879
 
16874
16880
  // ../agent-builder/dist/index.js
16875
16881
  var UNIT_KINDS = ["mcp-server", "tool", "workflow", "agent", "integration", "network", "other"];
16876
- var TemplateUnitSchema = zod.z.object({
16877
- kind: zod.z.enum(UNIT_KINDS),
16878
- id: zod.z.string(),
16879
- file: zod.z.string()
16882
+ var TemplateUnitSchema = z19.z.object({
16883
+ kind: z19.z.enum(UNIT_KINDS),
16884
+ id: z19.z.string(),
16885
+ file: z19.z.string()
16880
16886
  });
16881
- zod.z.object({
16882
- slug: zod.z.string(),
16883
- ref: zod.z.string().optional(),
16884
- description: zod.z.string().optional(),
16885
- units: zod.z.array(TemplateUnitSchema)
16887
+ z19.z.object({
16888
+ slug: z19.z.string(),
16889
+ ref: z19.z.string().optional(),
16890
+ description: z19.z.string().optional(),
16891
+ units: z19.z.array(TemplateUnitSchema)
16886
16892
  });
16887
- var AgentBuilderInputSchema = zod.z.object({
16888
- repo: zod.z.string().describe("Git URL or local path of the template repo"),
16889
- ref: zod.z.string().optional().describe("Tag/branch/commit to checkout (defaults to main/master)"),
16890
- slug: zod.z.string().optional().describe("Slug for branch/scripts; defaults to inferred from repo"),
16891
- targetPath: zod.z.string().optional().describe("Project path to merge into; defaults to current directory"),
16892
- variables: zod.z.record(zod.z.string()).optional().describe("Environment variables to set in .env file")
16893
+ var AgentBuilderInputSchema = z19.z.object({
16894
+ repo: z19.z.string().describe("Git URL or local path of the template repo"),
16895
+ ref: z19.z.string().optional().describe("Tag/branch/commit to checkout (defaults to main/master)"),
16896
+ slug: z19.z.string().optional().describe("Slug for branch/scripts; defaults to inferred from repo"),
16897
+ targetPath: z19.z.string().optional().describe("Project path to merge into; defaults to current directory"),
16898
+ variables: z19.z.record(z19.z.string()).optional().describe("Environment variables to set in .env file")
16893
16899
  });
16894
- zod.z.object({
16895
- slug: zod.z.string(),
16896
- commitSha: zod.z.string(),
16897
- templateDir: zod.z.string(),
16898
- units: zod.z.array(TemplateUnitSchema)
16900
+ z19.z.object({
16901
+ slug: z19.z.string(),
16902
+ commitSha: z19.z.string(),
16903
+ templateDir: z19.z.string(),
16904
+ units: z19.z.array(TemplateUnitSchema)
16899
16905
  });
16900
- var CopiedFileSchema = zod.z.object({
16901
- source: zod.z.string(),
16902
- destination: zod.z.string(),
16903
- unit: zod.z.object({
16904
- kind: zod.z.enum(UNIT_KINDS),
16905
- id: zod.z.string()
16906
+ var CopiedFileSchema = z19.z.object({
16907
+ source: z19.z.string(),
16908
+ destination: z19.z.string(),
16909
+ unit: z19.z.object({
16910
+ kind: z19.z.enum(UNIT_KINDS),
16911
+ id: z19.z.string()
16906
16912
  })
16907
16913
  });
16908
- var ConflictSchema = zod.z.object({
16909
- unit: zod.z.object({
16910
- kind: zod.z.enum(UNIT_KINDS),
16911
- id: zod.z.string()
16914
+ var ConflictSchema = z19.z.object({
16915
+ unit: z19.z.object({
16916
+ kind: z19.z.enum(UNIT_KINDS),
16917
+ id: z19.z.string()
16912
16918
  }),
16913
- issue: zod.z.string(),
16914
- sourceFile: zod.z.string(),
16915
- targetFile: zod.z.string()
16919
+ issue: z19.z.string(),
16920
+ sourceFile: z19.z.string(),
16921
+ targetFile: z19.z.string()
16916
16922
  });
16917
- var FileCopyInputSchema = zod.z.object({
16918
- orderedUnits: zod.z.array(TemplateUnitSchema),
16919
- templateDir: zod.z.string(),
16920
- commitSha: zod.z.string(),
16921
- slug: zod.z.string(),
16922
- targetPath: zod.z.string().optional(),
16923
- variables: zod.z.record(zod.z.string()).optional()
16923
+ var FileCopyInputSchema = z19.z.object({
16924
+ orderedUnits: z19.z.array(TemplateUnitSchema),
16925
+ templateDir: z19.z.string(),
16926
+ commitSha: z19.z.string(),
16927
+ slug: z19.z.string(),
16928
+ targetPath: z19.z.string().optional(),
16929
+ variables: z19.z.record(z19.z.string()).optional()
16924
16930
  });
16925
- var FileCopyResultSchema = zod.z.object({
16926
- success: zod.z.boolean(),
16927
- copiedFiles: zod.z.array(CopiedFileSchema),
16928
- conflicts: zod.z.array(ConflictSchema),
16929
- message: zod.z.string(),
16930
- error: zod.z.string().optional()
16931
+ var FileCopyResultSchema = z19.z.object({
16932
+ success: z19.z.boolean(),
16933
+ copiedFiles: z19.z.array(CopiedFileSchema),
16934
+ conflicts: z19.z.array(ConflictSchema),
16935
+ message: z19.z.string(),
16936
+ error: z19.z.string().optional()
16931
16937
  });
16932
- var ConflictResolutionSchema = zod.z.object({
16933
- unit: zod.z.object({
16934
- kind: zod.z.enum(UNIT_KINDS),
16935
- id: zod.z.string()
16938
+ var ConflictResolutionSchema = z19.z.object({
16939
+ unit: z19.z.object({
16940
+ kind: z19.z.enum(UNIT_KINDS),
16941
+ id: z19.z.string()
16936
16942
  }),
16937
- issue: zod.z.string(),
16938
- resolution: zod.z.string()
16943
+ issue: z19.z.string(),
16944
+ resolution: z19.z.string()
16939
16945
  });
16940
- var IntelligentMergeInputSchema = zod.z.object({
16941
- conflicts: zod.z.array(ConflictSchema),
16942
- copiedFiles: zod.z.array(CopiedFileSchema),
16943
- templateDir: zod.z.string(),
16944
- commitSha: zod.z.string(),
16945
- slug: zod.z.string(),
16946
- targetPath: zod.z.string().optional(),
16947
- branchName: zod.z.string().optional()
16946
+ var IntelligentMergeInputSchema = z19.z.object({
16947
+ conflicts: z19.z.array(ConflictSchema),
16948
+ copiedFiles: z19.z.array(CopiedFileSchema),
16949
+ templateDir: z19.z.string(),
16950
+ commitSha: z19.z.string(),
16951
+ slug: z19.z.string(),
16952
+ targetPath: z19.z.string().optional(),
16953
+ branchName: z19.z.string().optional()
16948
16954
  });
16949
- var IntelligentMergeResultSchema = zod.z.object({
16950
- success: zod.z.boolean(),
16951
- applied: zod.z.boolean(),
16952
- message: zod.z.string(),
16953
- conflictsResolved: zod.z.array(ConflictResolutionSchema),
16954
- error: zod.z.string().optional()
16955
+ var IntelligentMergeResultSchema = z19.z.object({
16956
+ success: z19.z.boolean(),
16957
+ applied: z19.z.boolean(),
16958
+ message: z19.z.string(),
16959
+ conflictsResolved: z19.z.array(ConflictResolutionSchema),
16960
+ error: z19.z.string().optional()
16955
16961
  });
16956
- var ValidationResultsSchema = zod.z.object({
16957
- valid: zod.z.boolean(),
16958
- errorsFixed: zod.z.number(),
16959
- remainingErrors: zod.z.number(),
16960
- errors: zod.z.array(zod.z.any()).optional()
16962
+ var ValidationResultsSchema = z19.z.object({
16963
+ valid: z19.z.boolean(),
16964
+ errorsFixed: z19.z.number(),
16965
+ remainingErrors: z19.z.number(),
16966
+ errors: z19.z.array(z19.z.any()).optional()
16961
16967
  // Include specific validation errors
16962
16968
  });
16963
- var ValidationFixInputSchema = zod.z.object({
16964
- commitSha: zod.z.string(),
16965
- slug: zod.z.string(),
16966
- targetPath: zod.z.string().optional(),
16967
- templateDir: zod.z.string(),
16968
- orderedUnits: zod.z.array(TemplateUnitSchema),
16969
- copiedFiles: zod.z.array(CopiedFileSchema),
16970
- conflictsResolved: zod.z.array(ConflictResolutionSchema).optional(),
16971
- maxIterations: zod.z.number().optional().default(5)
16969
+ var ValidationFixInputSchema = z19.z.object({
16970
+ commitSha: z19.z.string(),
16971
+ slug: z19.z.string(),
16972
+ targetPath: z19.z.string().optional(),
16973
+ templateDir: z19.z.string(),
16974
+ orderedUnits: z19.z.array(TemplateUnitSchema),
16975
+ copiedFiles: z19.z.array(CopiedFileSchema),
16976
+ conflictsResolved: z19.z.array(ConflictResolutionSchema).optional(),
16977
+ maxIterations: z19.z.number().optional().default(5)
16972
16978
  });
16973
- var ValidationFixResultSchema = zod.z.object({
16974
- success: zod.z.boolean(),
16975
- applied: zod.z.boolean(),
16976
- message: zod.z.string(),
16979
+ var ValidationFixResultSchema = z19.z.object({
16980
+ success: z19.z.boolean(),
16981
+ applied: z19.z.boolean(),
16982
+ message: z19.z.string(),
16977
16983
  validationResults: ValidationResultsSchema,
16978
- error: zod.z.string().optional()
16984
+ error: z19.z.string().optional()
16979
16985
  });
16980
- var ApplyResultSchema = zod.z.object({
16981
- success: zod.z.boolean(),
16982
- applied: zod.z.boolean(),
16983
- branchName: zod.z.string().optional(),
16984
- message: zod.z.string(),
16986
+ var ApplyResultSchema = z19.z.object({
16987
+ success: z19.z.boolean(),
16988
+ applied: z19.z.boolean(),
16989
+ branchName: z19.z.string().optional(),
16990
+ message: z19.z.string(),
16985
16991
  validationResults: ValidationResultsSchema.optional(),
16986
- error: zod.z.string().optional(),
16987
- errors: zod.z.array(zod.z.string()).optional(),
16988
- stepResults: zod.z.object({
16989
- cloneSuccess: zod.z.boolean().optional(),
16990
- analyzeSuccess: zod.z.boolean().optional(),
16991
- discoverSuccess: zod.z.boolean().optional(),
16992
- orderSuccess: zod.z.boolean().optional(),
16993
- prepareBranchSuccess: zod.z.boolean().optional(),
16994
- packageMergeSuccess: zod.z.boolean().optional(),
16995
- installSuccess: zod.z.boolean().optional(),
16996
- copySuccess: zod.z.boolean().optional(),
16997
- mergeSuccess: zod.z.boolean().optional(),
16998
- validationSuccess: zod.z.boolean().optional(),
16999
- filesCopied: zod.z.number(),
17000
- conflictsSkipped: zod.z.number(),
17001
- conflictsResolved: zod.z.number()
16992
+ error: z19.z.string().optional(),
16993
+ errors: z19.z.array(z19.z.string()).optional(),
16994
+ stepResults: z19.z.object({
16995
+ cloneSuccess: z19.z.boolean().optional(),
16996
+ analyzeSuccess: z19.z.boolean().optional(),
16997
+ discoverSuccess: z19.z.boolean().optional(),
16998
+ orderSuccess: z19.z.boolean().optional(),
16999
+ prepareBranchSuccess: z19.z.boolean().optional(),
17000
+ packageMergeSuccess: z19.z.boolean().optional(),
17001
+ installSuccess: z19.z.boolean().optional(),
17002
+ copySuccess: z19.z.boolean().optional(),
17003
+ mergeSuccess: z19.z.boolean().optional(),
17004
+ validationSuccess: z19.z.boolean().optional(),
17005
+ filesCopied: z19.z.number(),
17006
+ conflictsSkipped: z19.z.number(),
17007
+ conflictsResolved: z19.z.number()
17002
17008
  }).optional()
17003
17009
  });
17004
- var CloneTemplateResultSchema = zod.z.object({
17005
- templateDir: zod.z.string(),
17006
- commitSha: zod.z.string(),
17007
- slug: zod.z.string(),
17008
- success: zod.z.boolean().optional(),
17009
- error: zod.z.string().optional(),
17010
- targetPath: zod.z.string().optional()
17010
+ var CloneTemplateResultSchema = z19.z.object({
17011
+ templateDir: z19.z.string(),
17012
+ commitSha: z19.z.string(),
17013
+ slug: z19.z.string(),
17014
+ success: z19.z.boolean().optional(),
17015
+ error: z19.z.string().optional(),
17016
+ targetPath: z19.z.string().optional()
17011
17017
  });
17012
- var PackageAnalysisSchema = zod.z.object({
17013
- name: zod.z.string().optional(),
17014
- version: zod.z.string().optional(),
17015
- description: zod.z.string().optional(),
17016
- dependencies: zod.z.record(zod.z.string()).optional(),
17017
- devDependencies: zod.z.record(zod.z.string()).optional(),
17018
- peerDependencies: zod.z.record(zod.z.string()).optional(),
17019
- scripts: zod.z.record(zod.z.string()).optional(),
17020
- success: zod.z.boolean().optional(),
17021
- error: zod.z.string().optional()
17018
+ var PackageAnalysisSchema = z19.z.object({
17019
+ name: z19.z.string().optional(),
17020
+ version: z19.z.string().optional(),
17021
+ description: z19.z.string().optional(),
17022
+ dependencies: z19.z.record(z19.z.string()).optional(),
17023
+ devDependencies: z19.z.record(z19.z.string()).optional(),
17024
+ peerDependencies: z19.z.record(z19.z.string()).optional(),
17025
+ scripts: z19.z.record(z19.z.string()).optional(),
17026
+ success: z19.z.boolean().optional(),
17027
+ error: z19.z.string().optional()
17022
17028
  });
17023
- var DiscoveryResultSchema = zod.z.object({
17024
- units: zod.z.array(TemplateUnitSchema),
17025
- success: zod.z.boolean().optional(),
17026
- error: zod.z.string().optional()
17029
+ var DiscoveryResultSchema = z19.z.object({
17030
+ units: z19.z.array(TemplateUnitSchema),
17031
+ success: z19.z.boolean().optional(),
17032
+ error: z19.z.string().optional()
17027
17033
  });
17028
- var OrderedUnitsSchema = zod.z.object({
17029
- orderedUnits: zod.z.array(TemplateUnitSchema),
17030
- success: zod.z.boolean().optional(),
17031
- error: zod.z.string().optional()
17034
+ var OrderedUnitsSchema = z19.z.object({
17035
+ orderedUnits: z19.z.array(TemplateUnitSchema),
17036
+ success: z19.z.boolean().optional(),
17037
+ error: z19.z.string().optional()
17032
17038
  });
17033
- var PackageMergeInputSchema = zod.z.object({
17034
- commitSha: zod.z.string(),
17035
- slug: zod.z.string(),
17036
- targetPath: zod.z.string().optional(),
17039
+ var PackageMergeInputSchema = z19.z.object({
17040
+ commitSha: z19.z.string(),
17041
+ slug: z19.z.string(),
17042
+ targetPath: z19.z.string().optional(),
17037
17043
  packageInfo: PackageAnalysisSchema
17038
17044
  });
17039
- var PackageMergeResultSchema = zod.z.object({
17040
- success: zod.z.boolean(),
17041
- applied: zod.z.boolean(),
17042
- message: zod.z.string(),
17043
- error: zod.z.string().optional()
17045
+ var PackageMergeResultSchema = z19.z.object({
17046
+ success: z19.z.boolean(),
17047
+ applied: z19.z.boolean(),
17048
+ message: z19.z.string(),
17049
+ error: z19.z.string().optional()
17044
17050
  });
17045
- var InstallInputSchema = zod.z.object({
17046
- targetPath: zod.z.string().describe("Path to the project to install packages in")
17051
+ var InstallInputSchema = z19.z.object({
17052
+ targetPath: z19.z.string().describe("Path to the project to install packages in")
17047
17053
  });
17048
- var InstallResultSchema = zod.z.object({
17049
- success: zod.z.boolean(),
17050
- error: zod.z.string().optional()
17054
+ var InstallResultSchema = z19.z.object({
17055
+ success: z19.z.boolean(),
17056
+ error: z19.z.string().optional()
17051
17057
  });
17052
- var PrepareBranchInputSchema = zod.z.object({
17053
- slug: zod.z.string(),
17054
- commitSha: zod.z.string().optional(),
17058
+ var PrepareBranchInputSchema = z19.z.object({
17059
+ slug: z19.z.string(),
17060
+ commitSha: z19.z.string().optional(),
17055
17061
  // from clone-template if relevant
17056
- targetPath: zod.z.string().optional()
17062
+ targetPath: z19.z.string().optional()
17057
17063
  });
17058
- var PrepareBranchResultSchema = zod.z.object({
17059
- branchName: zod.z.string(),
17060
- success: zod.z.boolean().optional(),
17061
- error: zod.z.string().optional()
17064
+ var PrepareBranchResultSchema = z19.z.object({
17065
+ branchName: z19.z.string(),
17066
+ success: z19.z.boolean().optional(),
17067
+ error: z19.z.string().optional()
17062
17068
  });
17063
17069
  var exec = util.promisify(child_process.exec);
17064
17070
  var execFile = util.promisify(child_process.execFile);
@@ -17746,6 +17752,7 @@ export const weatherAgent = new Agent({
17746
17752
  tools: { weatherTool },
17747
17753
  memory: new Memory({
17748
17754
  storage: new LibSQLStore({
17755
+ id: 'mastra-memory-storage',
17749
17756
  url: 'file:../mastra.db', // ask user what database to use, use this as the default
17750
17757
  }),
17751
17758
  }),
@@ -17913,6 +17920,7 @@ export const mastra = new Mastra({
17913
17920
  workflows: { weatherWorkflow },
17914
17921
  agents: { weatherAgent },
17915
17922
  storage: new LibSQLStore({
17923
+ id: 'mastra-storage',
17916
17924
  // stores observability, evals, ... into memory storage, if it needs to persist, change to file:../mastra.db
17917
17925
  url: ":memory:",
17918
17926
  }),
@@ -17939,23 +17947,23 @@ export const mastra = new Mastra({
17939
17947
  readFile: tools.createTool({
17940
17948
  id: "read-file",
17941
17949
  description: "Read contents of a file with optional line range selection.",
17942
- inputSchema: zod.z.object({
17943
- filePath: zod.z.string().describe("Path to the file to read"),
17944
- startLine: zod.z.number().optional().describe("Starting line number (1-indexed)"),
17945
- endLine: zod.z.number().optional().describe("Ending line number (1-indexed, inclusive)"),
17946
- encoding: zod.z.string().default("utf-8").describe("File encoding")
17950
+ inputSchema: z19.z.object({
17951
+ filePath: z19.z.string().describe("Path to the file to read"),
17952
+ startLine: z19.z.number().optional().describe("Starting line number (1-indexed)"),
17953
+ endLine: z19.z.number().optional().describe("Ending line number (1-indexed, inclusive)"),
17954
+ encoding: z19.z.string().default("utf-8").describe("File encoding")
17947
17955
  }),
17948
- outputSchema: zod.z.object({
17949
- success: zod.z.boolean(),
17950
- content: zod.z.string().optional(),
17951
- lines: zod.z.array(zod.z.string()).optional(),
17952
- metadata: zod.z.object({
17953
- size: zod.z.number(),
17954
- totalLines: zod.z.number(),
17955
- encoding: zod.z.string(),
17956
- lastModified: zod.z.string()
17956
+ outputSchema: z19.z.object({
17957
+ success: z19.z.boolean(),
17958
+ content: z19.z.string().optional(),
17959
+ lines: z19.z.array(z19.z.string()).optional(),
17960
+ metadata: z19.z.object({
17961
+ size: z19.z.number(),
17962
+ totalLines: z19.z.number(),
17963
+ encoding: z19.z.string(),
17964
+ lastModified: z19.z.string()
17957
17965
  }).optional(),
17958
- error: zod.z.string().optional()
17966
+ error: z19.z.string().optional()
17959
17967
  }),
17960
17968
  execute: async (inputData) => {
17961
17969
  return await _AgentBuilderDefaults.readFile({ ...inputData, projectPath });
@@ -17964,18 +17972,18 @@ export const mastra = new Mastra({
17964
17972
  writeFile: tools.createTool({
17965
17973
  id: "write-file",
17966
17974
  description: "Write content to a file, with options for creating directories.",
17967
- inputSchema: zod.z.object({
17968
- filePath: zod.z.string().describe("Path to the file to write"),
17969
- content: zod.z.string().describe("Content to write to the file"),
17970
- createDirs: zod.z.boolean().default(true).describe("Create parent directories if they don't exist"),
17971
- encoding: zod.z.string().default("utf-8").describe("File encoding")
17975
+ inputSchema: z19.z.object({
17976
+ filePath: z19.z.string().describe("Path to the file to write"),
17977
+ content: z19.z.string().describe("Content to write to the file"),
17978
+ createDirs: z19.z.boolean().default(true).describe("Create parent directories if they don't exist"),
17979
+ encoding: z19.z.string().default("utf-8").describe("File encoding")
17972
17980
  }),
17973
- outputSchema: zod.z.object({
17974
- success: zod.z.boolean(),
17975
- filePath: zod.z.string(),
17976
- bytesWritten: zod.z.number().optional(),
17977
- message: zod.z.string(),
17978
- error: zod.z.string().optional()
17981
+ outputSchema: z19.z.object({
17982
+ success: z19.z.boolean(),
17983
+ filePath: z19.z.string(),
17984
+ bytesWritten: z19.z.number().optional(),
17985
+ message: z19.z.string(),
17986
+ error: z19.z.string().optional()
17979
17987
  }),
17980
17988
  execute: async (inputData) => {
17981
17989
  return await _AgentBuilderDefaults.writeFile({ ...inputData, projectPath });
@@ -17984,30 +17992,30 @@ export const mastra = new Mastra({
17984
17992
  listDirectory: tools.createTool({
17985
17993
  id: "list-directory",
17986
17994
  description: "List contents of a directory with filtering and metadata options.",
17987
- inputSchema: zod.z.object({
17988
- path: zod.z.string().describe("Directory path to list"),
17989
- recursive: zod.z.boolean().default(false).describe("List subdirectories recursively"),
17990
- includeHidden: zod.z.boolean().default(false).describe("Include hidden files and directories"),
17991
- pattern: zod.z.string().default("*").describe("Glob pattern to filter files"),
17992
- maxDepth: zod.z.number().default(10).describe("Maximum recursion depth"),
17993
- includeMetadata: zod.z.boolean().default(true).describe("Include file metadata")
17995
+ inputSchema: z19.z.object({
17996
+ path: z19.z.string().describe("Directory path to list"),
17997
+ recursive: z19.z.boolean().default(false).describe("List subdirectories recursively"),
17998
+ includeHidden: z19.z.boolean().default(false).describe("Include hidden files and directories"),
17999
+ pattern: z19.z.string().default("*").describe("Glob pattern to filter files"),
18000
+ maxDepth: z19.z.number().default(10).describe("Maximum recursion depth"),
18001
+ includeMetadata: z19.z.boolean().default(true).describe("Include file metadata")
17994
18002
  }),
17995
- outputSchema: zod.z.object({
17996
- success: zod.z.boolean(),
17997
- items: zod.z.array(
17998
- zod.z.object({
17999
- name: zod.z.string(),
18000
- path: zod.z.string(),
18001
- type: zod.z.enum(["file", "directory", "symlink"]),
18002
- size: zod.z.number().optional(),
18003
- lastModified: zod.z.string().optional(),
18004
- permissions: zod.z.string().optional()
18003
+ outputSchema: z19.z.object({
18004
+ success: z19.z.boolean(),
18005
+ items: z19.z.array(
18006
+ z19.z.object({
18007
+ name: z19.z.string(),
18008
+ path: z19.z.string(),
18009
+ type: z19.z.enum(["file", "directory", "symlink"]),
18010
+ size: z19.z.number().optional(),
18011
+ lastModified: z19.z.string().optional(),
18012
+ permissions: z19.z.string().optional()
18005
18013
  })
18006
18014
  ),
18007
- totalItems: zod.z.number(),
18008
- path: zod.z.string(),
18009
- message: zod.z.string(),
18010
- error: zod.z.string().optional()
18015
+ totalItems: z19.z.number(),
18016
+ path: z19.z.string(),
18017
+ message: z19.z.string(),
18018
+ error: z19.z.string().optional()
18011
18019
  }),
18012
18020
  execute: async (inputData) => {
18013
18021
  return await _AgentBuilderDefaults.listDirectory({ ...inputData, projectPath });
@@ -18016,23 +18024,23 @@ export const mastra = new Mastra({
18016
18024
  executeCommand: tools.createTool({
18017
18025
  id: "execute-command",
18018
18026
  description: "Execute shell commands with proper error handling and output capture.",
18019
- inputSchema: zod.z.object({
18020
- command: zod.z.string().describe("Shell command to execute"),
18021
- workingDirectory: zod.z.string().optional().describe("Working directory for command execution"),
18022
- timeout: zod.z.number().default(3e4).describe("Timeout in milliseconds"),
18023
- captureOutput: zod.z.boolean().default(true).describe("Capture command output"),
18024
- shell: zod.z.string().optional().describe("Shell to use (defaults to system shell)"),
18025
- env: zod.z.record(zod.z.string()).optional().describe("Environment variables")
18027
+ inputSchema: z19.z.object({
18028
+ command: z19.z.string().describe("Shell command to execute"),
18029
+ workingDirectory: z19.z.string().optional().describe("Working directory for command execution"),
18030
+ timeout: z19.z.number().default(3e4).describe("Timeout in milliseconds"),
18031
+ captureOutput: z19.z.boolean().default(true).describe("Capture command output"),
18032
+ shell: z19.z.string().optional().describe("Shell to use (defaults to system shell)"),
18033
+ env: z19.z.record(z19.z.string()).optional().describe("Environment variables")
18026
18034
  }),
18027
- outputSchema: zod.z.object({
18028
- success: zod.z.boolean(),
18029
- exitCode: zod.z.number().optional(),
18030
- stdout: zod.z.string().optional(),
18031
- stderr: zod.z.string().optional(),
18032
- command: zod.z.string(),
18033
- workingDirectory: zod.z.string().optional(),
18034
- executionTime: zod.z.number().optional(),
18035
- error: zod.z.string().optional()
18035
+ outputSchema: z19.z.object({
18036
+ success: z19.z.boolean(),
18037
+ exitCode: z19.z.number().optional(),
18038
+ stdout: z19.z.string().optional(),
18039
+ stderr: z19.z.string().optional(),
18040
+ command: z19.z.string(),
18041
+ workingDirectory: z19.z.string().optional(),
18042
+ executionTime: z19.z.number().optional(),
18043
+ error: z19.z.string().optional()
18036
18044
  }),
18037
18045
  execute: async (inputData) => {
18038
18046
  return await _AgentBuilderDefaults.executeCommand({
@@ -18045,35 +18053,35 @@ export const mastra = new Mastra({
18045
18053
  taskManager: tools.createTool({
18046
18054
  id: "task-manager",
18047
18055
  description: "Create and manage structured task lists for coding sessions. Use this for complex multi-step tasks to track progress and ensure thoroughness.",
18048
- inputSchema: zod.z.object({
18049
- action: zod.z.enum(["create", "update", "list", "complete", "remove"]).describe("Task management action"),
18050
- tasks: zod.z.array(
18051
- zod.z.object({
18052
- id: zod.z.string().describe("Unique task identifier"),
18053
- content: zod.z.string().describe("Task description, optional if just updating the status").optional(),
18054
- status: zod.z.enum(["pending", "in_progress", "completed", "blocked"]).describe("Task status"),
18055
- priority: zod.z.enum(["high", "medium", "low"]).default("medium").describe("Task priority"),
18056
- dependencies: zod.z.array(zod.z.string()).optional().describe("IDs of tasks this depends on"),
18057
- notes: zod.z.string().optional().describe("Additional notes or context")
18056
+ inputSchema: z19.z.object({
18057
+ action: z19.z.enum(["create", "update", "list", "complete", "remove"]).describe("Task management action"),
18058
+ tasks: z19.z.array(
18059
+ z19.z.object({
18060
+ id: z19.z.string().describe("Unique task identifier"),
18061
+ content: z19.z.string().describe("Task description, optional if just updating the status").optional(),
18062
+ status: z19.z.enum(["pending", "in_progress", "completed", "blocked"]).describe("Task status"),
18063
+ priority: z19.z.enum(["high", "medium", "low"]).default("medium").describe("Task priority"),
18064
+ dependencies: z19.z.array(z19.z.string()).optional().describe("IDs of tasks this depends on"),
18065
+ notes: z19.z.string().optional().describe("Additional notes or context")
18058
18066
  })
18059
18067
  ).optional().describe("Tasks to create or update"),
18060
- taskId: zod.z.string().optional().describe("Specific task ID for single task operations")
18068
+ taskId: z19.z.string().optional().describe("Specific task ID for single task operations")
18061
18069
  }),
18062
- outputSchema: zod.z.object({
18063
- success: zod.z.boolean(),
18064
- tasks: zod.z.array(
18065
- zod.z.object({
18066
- id: zod.z.string(),
18067
- content: zod.z.string(),
18068
- status: zod.z.string(),
18069
- priority: zod.z.string(),
18070
- dependencies: zod.z.array(zod.z.string()).optional(),
18071
- notes: zod.z.string().optional(),
18072
- createdAt: zod.z.string(),
18073
- updatedAt: zod.z.string()
18070
+ outputSchema: z19.z.object({
18071
+ success: z19.z.boolean(),
18072
+ tasks: z19.z.array(
18073
+ z19.z.object({
18074
+ id: z19.z.string(),
18075
+ content: z19.z.string(),
18076
+ status: z19.z.string(),
18077
+ priority: z19.z.string(),
18078
+ dependencies: z19.z.array(z19.z.string()).optional(),
18079
+ notes: z19.z.string().optional(),
18080
+ createdAt: z19.z.string(),
18081
+ updatedAt: z19.z.string()
18074
18082
  })
18075
18083
  ),
18076
- message: zod.z.string()
18084
+ message: z19.z.string()
18077
18085
  }),
18078
18086
  execute: async (inputData) => {
18079
18087
  return await _AgentBuilderDefaults.manageTaskList(inputData);
@@ -18083,32 +18091,32 @@ export const mastra = new Mastra({
18083
18091
  multiEdit: tools.createTool({
18084
18092
  id: "multi-edit",
18085
18093
  description: "Perform multiple search-replace operations on one or more files in a single atomic operation.",
18086
- inputSchema: zod.z.object({
18087
- operations: zod.z.array(
18088
- zod.z.object({
18089
- filePath: zod.z.string().describe("Path to the file to edit"),
18090
- edits: zod.z.array(
18091
- zod.z.object({
18092
- oldString: zod.z.string().describe("Exact text to replace"),
18093
- newString: zod.z.string().describe("Replacement text"),
18094
- replaceAll: zod.z.boolean().default(false).describe("Replace all occurrences")
18094
+ inputSchema: z19.z.object({
18095
+ operations: z19.z.array(
18096
+ z19.z.object({
18097
+ filePath: z19.z.string().describe("Path to the file to edit"),
18098
+ edits: z19.z.array(
18099
+ z19.z.object({
18100
+ oldString: z19.z.string().describe("Exact text to replace"),
18101
+ newString: z19.z.string().describe("Replacement text"),
18102
+ replaceAll: z19.z.boolean().default(false).describe("Replace all occurrences")
18095
18103
  })
18096
18104
  ).describe("List of edit operations for this file")
18097
18105
  })
18098
18106
  ).describe("File edit operations to perform"),
18099
- createBackup: zod.z.boolean().default(false).describe("Create backup files before editing")
18107
+ createBackup: z19.z.boolean().default(false).describe("Create backup files before editing")
18100
18108
  }),
18101
- outputSchema: zod.z.object({
18102
- success: zod.z.boolean(),
18103
- results: zod.z.array(
18104
- zod.z.object({
18105
- filePath: zod.z.string(),
18106
- editsApplied: zod.z.number(),
18107
- errors: zod.z.array(zod.z.string()),
18108
- backup: zod.z.string().optional()
18109
+ outputSchema: z19.z.object({
18110
+ success: z19.z.boolean(),
18111
+ results: z19.z.array(
18112
+ z19.z.object({
18113
+ filePath: z19.z.string(),
18114
+ editsApplied: z19.z.number(),
18115
+ errors: z19.z.array(z19.z.string()),
18116
+ backup: z19.z.string().optional()
18109
18117
  })
18110
18118
  ),
18111
- message: zod.z.string()
18119
+ message: z19.z.string()
18112
18120
  }),
18113
18121
  execute: async (inputData) => {
18114
18122
  return await _AgentBuilderDefaults.performMultiEdit({ ...inputData, projectPath });
@@ -18117,23 +18125,23 @@ export const mastra = new Mastra({
18117
18125
  replaceLines: tools.createTool({
18118
18126
  id: "replace-lines",
18119
18127
  description: "Replace specific line ranges in files with new content. IMPORTANT: This tool replaces ENTIRE lines, not partial content within lines. Lines are 1-indexed.",
18120
- inputSchema: zod.z.object({
18121
- filePath: zod.z.string().describe("Path to the file to edit"),
18122
- startLine: zod.z.number().describe("Starting line number to replace (1-indexed, inclusive). Count from the first line = 1"),
18123
- endLine: zod.z.number().describe(
18128
+ inputSchema: z19.z.object({
18129
+ filePath: z19.z.string().describe("Path to the file to edit"),
18130
+ startLine: z19.z.number().describe("Starting line number to replace (1-indexed, inclusive). Count from the first line = 1"),
18131
+ endLine: z19.z.number().describe(
18124
18132
  "Ending line number to replace (1-indexed, inclusive). To replace single line, use same number as startLine"
18125
18133
  ),
18126
- newContent: zod.z.string().describe(
18134
+ newContent: z19.z.string().describe(
18127
18135
  'New content to replace the lines with. Use empty string "" to delete lines completely. For multiline content, include \\n characters'
18128
18136
  ),
18129
- createBackup: zod.z.boolean().default(false).describe("Create backup file before editing")
18137
+ createBackup: z19.z.boolean().default(false).describe("Create backup file before editing")
18130
18138
  }),
18131
- outputSchema: zod.z.object({
18132
- success: zod.z.boolean(),
18133
- message: zod.z.string(),
18134
- linesReplaced: zod.z.number().optional(),
18135
- backup: zod.z.string().optional(),
18136
- error: zod.z.string().optional()
18139
+ outputSchema: z19.z.object({
18140
+ success: z19.z.boolean(),
18141
+ message: z19.z.string(),
18142
+ linesReplaced: z19.z.number().optional(),
18143
+ backup: z19.z.string().optional(),
18144
+ error: z19.z.string().optional()
18137
18145
  }),
18138
18146
  execute: async (inputData) => {
18139
18147
  return await _AgentBuilderDefaults.replaceLines({ ...inputData, projectPath });
@@ -18143,26 +18151,26 @@ export const mastra = new Mastra({
18143
18151
  showFileLines: tools.createTool({
18144
18152
  id: "show-file-lines",
18145
18153
  description: "Show specific lines from a file with line numbers. Useful for debugging before using replaceLines.",
18146
- inputSchema: zod.z.object({
18147
- filePath: zod.z.string().describe("Path to the file to examine"),
18148
- startLine: zod.z.number().optional().describe("Starting line number to show (1-indexed). If not provided, shows all lines"),
18149
- endLine: zod.z.number().optional().describe(
18154
+ inputSchema: z19.z.object({
18155
+ filePath: z19.z.string().describe("Path to the file to examine"),
18156
+ startLine: z19.z.number().optional().describe("Starting line number to show (1-indexed). If not provided, shows all lines"),
18157
+ endLine: z19.z.number().optional().describe(
18150
18158
  "Ending line number to show (1-indexed, inclusive). If not provided but startLine is, shows only that line"
18151
18159
  ),
18152
- context: zod.z.number().default(2).describe("Number of context lines to show before and after the range")
18160
+ context: z19.z.number().default(2).describe("Number of context lines to show before and after the range")
18153
18161
  }),
18154
- outputSchema: zod.z.object({
18155
- success: zod.z.boolean(),
18156
- lines: zod.z.array(
18157
- zod.z.object({
18158
- lineNumber: zod.z.number(),
18159
- content: zod.z.string(),
18160
- isTarget: zod.z.boolean().describe("Whether this line is in the target range")
18162
+ outputSchema: z19.z.object({
18163
+ success: z19.z.boolean(),
18164
+ lines: z19.z.array(
18165
+ z19.z.object({
18166
+ lineNumber: z19.z.number(),
18167
+ content: z19.z.string(),
18168
+ isTarget: z19.z.boolean().describe("Whether this line is in the target range")
18161
18169
  })
18162
18170
  ),
18163
- totalLines: zod.z.number(),
18164
- message: zod.z.string(),
18165
- error: zod.z.string().optional()
18171
+ totalLines: z19.z.number(),
18172
+ message: z19.z.string(),
18173
+ error: z19.z.string().optional()
18166
18174
  }),
18167
18175
  execute: async (inputData) => {
18168
18176
  return await _AgentBuilderDefaults.showFileLines({ ...inputData, projectPath });
@@ -18172,40 +18180,40 @@ export const mastra = new Mastra({
18172
18180
  smartSearch: tools.createTool({
18173
18181
  id: "smart-search",
18174
18182
  description: "Intelligent search across codebase with context awareness and pattern matching.",
18175
- inputSchema: zod.z.object({
18176
- query: zod.z.string().describe("Search query or pattern"),
18177
- type: zod.z.enum(["text", "regex", "fuzzy", "semantic"]).default("text").describe("Type of search to perform"),
18178
- scope: zod.z.object({
18179
- paths: zod.z.array(zod.z.string()).optional().describe("Specific paths to search"),
18180
- fileTypes: zod.z.array(zod.z.string()).optional().describe("File extensions to include"),
18181
- excludePaths: zod.z.array(zod.z.string()).optional().describe("Paths to exclude"),
18182
- maxResults: zod.z.number().default(50).describe("Maximum number of results")
18183
+ inputSchema: z19.z.object({
18184
+ query: z19.z.string().describe("Search query or pattern"),
18185
+ type: z19.z.enum(["text", "regex", "fuzzy", "semantic"]).default("text").describe("Type of search to perform"),
18186
+ scope: z19.z.object({
18187
+ paths: z19.z.array(z19.z.string()).optional().describe("Specific paths to search"),
18188
+ fileTypes: z19.z.array(z19.z.string()).optional().describe("File extensions to include"),
18189
+ excludePaths: z19.z.array(z19.z.string()).optional().describe("Paths to exclude"),
18190
+ maxResults: z19.z.number().default(50).describe("Maximum number of results")
18183
18191
  }).optional(),
18184
- context: zod.z.object({
18185
- beforeLines: zod.z.number().default(2).describe("Lines of context before match"),
18186
- afterLines: zod.z.number().default(2).describe("Lines of context after match"),
18187
- includeDefinitions: zod.z.boolean().default(false).describe("Include function/class definitions")
18192
+ context: z19.z.object({
18193
+ beforeLines: z19.z.number().default(2).describe("Lines of context before match"),
18194
+ afterLines: z19.z.number().default(2).describe("Lines of context after match"),
18195
+ includeDefinitions: z19.z.boolean().default(false).describe("Include function/class definitions")
18188
18196
  }).optional()
18189
18197
  }),
18190
- outputSchema: zod.z.object({
18191
- success: zod.z.boolean(),
18192
- matches: zod.z.array(
18193
- zod.z.object({
18194
- file: zod.z.string(),
18195
- line: zod.z.number(),
18196
- column: zod.z.number().optional(),
18197
- match: zod.z.string(),
18198
- context: zod.z.object({
18199
- before: zod.z.array(zod.z.string()),
18200
- after: zod.z.array(zod.z.string())
18198
+ outputSchema: z19.z.object({
18199
+ success: z19.z.boolean(),
18200
+ matches: z19.z.array(
18201
+ z19.z.object({
18202
+ file: z19.z.string(),
18203
+ line: z19.z.number(),
18204
+ column: z19.z.number().optional(),
18205
+ match: z19.z.string(),
18206
+ context: z19.z.object({
18207
+ before: z19.z.array(z19.z.string()),
18208
+ after: z19.z.array(z19.z.string())
18201
18209
  }),
18202
- relevance: zod.z.number().optional()
18210
+ relevance: z19.z.number().optional()
18203
18211
  })
18204
18212
  ),
18205
- summary: zod.z.object({
18206
- totalMatches: zod.z.number(),
18207
- filesSearched: zod.z.number(),
18208
- patterns: zod.z.array(zod.z.string())
18213
+ summary: z19.z.object({
18214
+ totalMatches: z19.z.number(),
18215
+ filesSearched: z19.z.number(),
18216
+ patterns: z19.z.array(z19.z.string())
18209
18217
  })
18210
18218
  }),
18211
18219
  execute: async (inputData) => {
@@ -18215,31 +18223,31 @@ export const mastra = new Mastra({
18215
18223
  validateCode: tools.createTool({
18216
18224
  id: "validate-code",
18217
18225
  description: "Validates code using a fast hybrid approach: syntax \u2192 semantic \u2192 lint. RECOMMENDED: Always provide specific files for optimal performance and accuracy.",
18218
- inputSchema: zod.z.object({
18219
- projectPath: zod.z.string().optional().describe("Path to the project to validate (defaults to current project)"),
18220
- validationType: zod.z.array(zod.z.enum(["types", "lint", "schemas", "tests", "build"])).describe('Types of validation to perform. Recommended: ["types", "lint"] for code quality'),
18221
- files: zod.z.array(zod.z.string()).optional().describe(
18226
+ inputSchema: z19.z.object({
18227
+ projectPath: z19.z.string().optional().describe("Path to the project to validate (defaults to current project)"),
18228
+ validationType: z19.z.array(z19.z.enum(["types", "lint", "schemas", "tests", "build"])).describe('Types of validation to perform. Recommended: ["types", "lint"] for code quality'),
18229
+ files: z19.z.array(z19.z.string()).optional().describe(
18222
18230
  "RECOMMENDED: Specific files to validate (e.g., files you created/modified). Uses hybrid validation: fast syntax check \u2192 semantic types \u2192 ESLint. Without files, falls back to slower CLI validation."
18223
18231
  )
18224
18232
  }),
18225
- outputSchema: zod.z.object({
18226
- valid: zod.z.boolean(),
18227
- errors: zod.z.array(
18228
- zod.z.object({
18229
- type: zod.z.enum(["typescript", "eslint", "schema", "test", "build"]),
18230
- severity: zod.z.enum(["error", "warning", "info"]),
18231
- message: zod.z.string(),
18232
- file: zod.z.string().optional(),
18233
- line: zod.z.number().optional(),
18234
- column: zod.z.number().optional(),
18235
- code: zod.z.string().optional()
18233
+ outputSchema: z19.z.object({
18234
+ valid: z19.z.boolean(),
18235
+ errors: z19.z.array(
18236
+ z19.z.object({
18237
+ type: z19.z.enum(["typescript", "eslint", "schema", "test", "build"]),
18238
+ severity: z19.z.enum(["error", "warning", "info"]),
18239
+ message: z19.z.string(),
18240
+ file: z19.z.string().optional(),
18241
+ line: z19.z.number().optional(),
18242
+ column: z19.z.number().optional(),
18243
+ code: z19.z.string().optional()
18236
18244
  })
18237
18245
  ),
18238
- summary: zod.z.object({
18239
- totalErrors: zod.z.number(),
18240
- totalWarnings: zod.z.number(),
18241
- validationsPassed: zod.z.array(zod.z.string()),
18242
- validationsFailed: zod.z.array(zod.z.string())
18246
+ summary: z19.z.object({
18247
+ totalErrors: z19.z.number(),
18248
+ totalWarnings: z19.z.number(),
18249
+ validationsPassed: z19.z.array(z19.z.string()),
18250
+ validationsFailed: z19.z.array(z19.z.string())
18243
18251
  })
18244
18252
  }),
18245
18253
  execute: async (inputData) => {
@@ -18256,31 +18264,31 @@ export const mastra = new Mastra({
18256
18264
  webSearch: tools.createTool({
18257
18265
  id: "web-search",
18258
18266
  description: "Search the web for current information and return structured results.",
18259
- inputSchema: zod.z.object({
18260
- query: zod.z.string().describe("Search query"),
18261
- maxResults: zod.z.number().default(10).describe("Maximum number of results to return"),
18262
- region: zod.z.string().default("us").describe("Search region/country code"),
18263
- language: zod.z.string().default("en").describe("Search language"),
18264
- includeImages: zod.z.boolean().default(false).describe("Include image results"),
18265
- dateRange: zod.z.enum(["day", "week", "month", "year", "all"]).default("all").describe("Date range filter")
18267
+ inputSchema: z19.z.object({
18268
+ query: z19.z.string().describe("Search query"),
18269
+ maxResults: z19.z.number().default(10).describe("Maximum number of results to return"),
18270
+ region: z19.z.string().default("us").describe("Search region/country code"),
18271
+ language: z19.z.string().default("en").describe("Search language"),
18272
+ includeImages: z19.z.boolean().default(false).describe("Include image results"),
18273
+ dateRange: z19.z.enum(["day", "week", "month", "year", "all"]).default("all").describe("Date range filter")
18266
18274
  }),
18267
- outputSchema: zod.z.object({
18268
- success: zod.z.boolean(),
18269
- query: zod.z.string(),
18270
- results: zod.z.array(
18271
- zod.z.object({
18272
- title: zod.z.string(),
18273
- url: zod.z.string(),
18274
- snippet: zod.z.string(),
18275
- domain: zod.z.string(),
18276
- publishDate: zod.z.string().optional(),
18277
- relevanceScore: zod.z.number().optional()
18275
+ outputSchema: z19.z.object({
18276
+ success: z19.z.boolean(),
18277
+ query: z19.z.string(),
18278
+ results: z19.z.array(
18279
+ z19.z.object({
18280
+ title: z19.z.string(),
18281
+ url: z19.z.string(),
18282
+ snippet: z19.z.string(),
18283
+ domain: z19.z.string(),
18284
+ publishDate: z19.z.string().optional(),
18285
+ relevanceScore: z19.z.number().optional()
18278
18286
  })
18279
18287
  ),
18280
- totalResults: zod.z.number(),
18281
- searchTime: zod.z.number(),
18282
- suggestions: zod.z.array(zod.z.string()).optional(),
18283
- error: zod.z.string().optional()
18288
+ totalResults: z19.z.number(),
18289
+ searchTime: z19.z.number(),
18290
+ suggestions: z19.z.array(z19.z.string()).optional(),
18291
+ error: z19.z.string().optional()
18284
18292
  }),
18285
18293
  execute: async (inputData) => {
18286
18294
  return await _AgentBuilderDefaults.webSearch(inputData);
@@ -18290,27 +18298,27 @@ export const mastra = new Mastra({
18290
18298
  attemptCompletion: tools.createTool({
18291
18299
  id: "attempt-completion",
18292
18300
  description: "Signal that you believe the requested task has been completed and provide a summary.",
18293
- inputSchema: zod.z.object({
18294
- summary: zod.z.string().describe("Summary of what was accomplished"),
18295
- changes: zod.z.array(
18296
- zod.z.object({
18297
- type: zod.z.enum(["file_created", "file_modified", "file_deleted", "command_executed", "dependency_added"]),
18298
- description: zod.z.string(),
18299
- path: zod.z.string().optional()
18301
+ inputSchema: z19.z.object({
18302
+ summary: z19.z.string().describe("Summary of what was accomplished"),
18303
+ changes: z19.z.array(
18304
+ z19.z.object({
18305
+ type: z19.z.enum(["file_created", "file_modified", "file_deleted", "command_executed", "dependency_added"]),
18306
+ description: z19.z.string(),
18307
+ path: z19.z.string().optional()
18300
18308
  })
18301
18309
  ).describe("List of changes made"),
18302
- validation: zod.z.object({
18303
- testsRun: zod.z.boolean().default(false),
18304
- buildsSuccessfully: zod.z.boolean().default(false),
18305
- manualTestingRequired: zod.z.boolean().default(false)
18310
+ validation: z19.z.object({
18311
+ testsRun: z19.z.boolean().default(false),
18312
+ buildsSuccessfully: z19.z.boolean().default(false),
18313
+ manualTestingRequired: z19.z.boolean().default(false)
18306
18314
  }).describe("Validation status"),
18307
- nextSteps: zod.z.array(zod.z.string()).optional().describe("Suggested next steps or follow-up actions")
18315
+ nextSteps: z19.z.array(z19.z.string()).optional().describe("Suggested next steps or follow-up actions")
18308
18316
  }),
18309
- outputSchema: zod.z.object({
18310
- completionId: zod.z.string(),
18311
- status: zod.z.enum(["completed", "needs_review", "needs_testing"]),
18312
- summary: zod.z.string(),
18313
- confidence: zod.z.number().min(0).max(100)
18317
+ outputSchema: z19.z.object({
18318
+ completionId: z19.z.string(),
18319
+ status: z19.z.enum(["completed", "needs_review", "needs_testing"]),
18320
+ summary: z19.z.string(),
18321
+ confidence: z19.z.number().min(0).max(100)
18314
18322
  }),
18315
18323
  execute: async (inputData) => {
18316
18324
  return await _AgentBuilderDefaults.signalCompletion(inputData);
@@ -18319,24 +18327,24 @@ export const mastra = new Mastra({
18319
18327
  manageProject: tools.createTool({
18320
18328
  id: "manage-project",
18321
18329
  description: "Handles project management including creating project structures, managing dependencies, and package operations.",
18322
- inputSchema: zod.z.object({
18323
- action: zod.z.enum(["create", "install", "upgrade"]).describe("The action to perform"),
18324
- features: zod.z.array(zod.z.string()).optional().describe('Mastra features to include (e.g., ["agents", "memory", "workflows"])'),
18325
- packages: zod.z.array(
18326
- zod.z.object({
18327
- name: zod.z.string(),
18328
- version: zod.z.string().optional()
18330
+ inputSchema: z19.z.object({
18331
+ action: z19.z.enum(["create", "install", "upgrade"]).describe("The action to perform"),
18332
+ features: z19.z.array(z19.z.string()).optional().describe('Mastra features to include (e.g., ["agents", "memory", "workflows"])'),
18333
+ packages: z19.z.array(
18334
+ z19.z.object({
18335
+ name: z19.z.string(),
18336
+ version: z19.z.string().optional()
18329
18337
  })
18330
18338
  ).optional().describe("Packages to install/upgrade")
18331
18339
  }),
18332
- outputSchema: zod.z.object({
18333
- success: zod.z.boolean(),
18334
- installed: zod.z.array(zod.z.string()).optional(),
18335
- upgraded: zod.z.array(zod.z.string()).optional(),
18336
- warnings: zod.z.array(zod.z.string()).optional(),
18337
- message: zod.z.string().optional(),
18338
- details: zod.z.string().optional(),
18339
- error: zod.z.string().optional()
18340
+ outputSchema: z19.z.object({
18341
+ success: z19.z.boolean(),
18342
+ installed: z19.z.array(z19.z.string()).optional(),
18343
+ upgraded: z19.z.array(z19.z.string()).optional(),
18344
+ warnings: z19.z.array(z19.z.string()).optional(),
18345
+ message: z19.z.string().optional(),
18346
+ details: z19.z.string().optional(),
18347
+ error: z19.z.string().optional()
18340
18348
  }),
18341
18349
  execute: async (inputData) => {
18342
18350
  const { action, features, packages } = inputData;
@@ -18386,19 +18394,19 @@ export const mastra = new Mastra({
18386
18394
  manageServer: tools.createTool({
18387
18395
  id: "manage-server",
18388
18396
  description: "Manages the Mastra server - start, stop, restart, and check status, use the terminal tool to make curl requests to the server. There is an openapi spec for the server at http://localhost:{port}/openapi.json",
18389
- inputSchema: zod.z.object({
18390
- action: zod.z.enum(["start", "stop", "restart", "status"]).describe("Server management action"),
18391
- port: zod.z.number().optional().default(4200).describe("Port to run the server on")
18397
+ inputSchema: z19.z.object({
18398
+ action: z19.z.enum(["start", "stop", "restart", "status"]).describe("Server management action"),
18399
+ port: z19.z.number().optional().default(4200).describe("Port to run the server on")
18392
18400
  }),
18393
- outputSchema: zod.z.object({
18394
- success: zod.z.boolean(),
18395
- status: zod.z.enum(["running", "stopped", "starting", "stopping", "unknown"]),
18396
- pid: zod.z.number().optional(),
18397
- port: zod.z.number().optional(),
18398
- url: zod.z.string().optional(),
18399
- message: zod.z.string().optional(),
18400
- stdout: zod.z.array(zod.z.string()).optional().describe("Server output lines captured during startup"),
18401
- error: zod.z.string().optional()
18401
+ outputSchema: z19.z.object({
18402
+ success: z19.z.boolean(),
18403
+ status: z19.z.enum(["running", "stopped", "starting", "stopping", "unknown"]),
18404
+ pid: z19.z.number().optional(),
18405
+ port: z19.z.number().optional(),
18406
+ url: z19.z.string().optional(),
18407
+ message: z19.z.string().optional(),
18408
+ stdout: z19.z.array(z19.z.string()).optional().describe("Server output lines captured during startup"),
18409
+ error: z19.z.string().optional()
18402
18410
  }),
18403
18411
  execute: async (inputData) => {
18404
18412
  const { action, port } = inputData;
@@ -18468,23 +18476,23 @@ export const mastra = new Mastra({
18468
18476
  httpRequest: tools.createTool({
18469
18477
  id: "http-request",
18470
18478
  description: "Makes HTTP requests to the Mastra server or external APIs for testing and integration",
18471
- inputSchema: zod.z.object({
18472
- method: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).describe("HTTP method"),
18473
- url: zod.z.string().describe("Full URL or path (if baseUrl provided)"),
18474
- baseUrl: zod.z.string().optional().describe("Base URL for the server (e.g., http://localhost:4200)"),
18475
- headers: zod.z.record(zod.z.string()).optional().describe("HTTP headers"),
18476
- body: zod.z.any().optional().describe("Request body (will be JSON stringified if object)"),
18477
- timeout: zod.z.number().optional().default(3e4).describe("Request timeout in milliseconds")
18479
+ inputSchema: z19.z.object({
18480
+ method: z19.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).describe("HTTP method"),
18481
+ url: z19.z.string().describe("Full URL or path (if baseUrl provided)"),
18482
+ baseUrl: z19.z.string().optional().describe("Base URL for the server (e.g., http://localhost:4200)"),
18483
+ headers: z19.z.record(z19.z.string()).optional().describe("HTTP headers"),
18484
+ body: z19.z.any().optional().describe("Request body (will be JSON stringified if object)"),
18485
+ timeout: z19.z.number().optional().default(3e4).describe("Request timeout in milliseconds")
18478
18486
  }),
18479
- outputSchema: zod.z.object({
18480
- success: zod.z.boolean(),
18481
- status: zod.z.number().optional(),
18482
- statusText: zod.z.string().optional(),
18483
- headers: zod.z.record(zod.z.string()).optional(),
18484
- data: zod.z.any().optional(),
18485
- error: zod.z.string().optional(),
18486
- url: zod.z.string(),
18487
- method: zod.z.string()
18487
+ outputSchema: z19.z.object({
18488
+ success: z19.z.boolean(),
18489
+ status: z19.z.number().optional(),
18490
+ statusText: z19.z.string().optional(),
18491
+ headers: z19.z.record(z19.z.string()).optional(),
18492
+ data: z19.z.any().optional(),
18493
+ error: z19.z.string().optional(),
18494
+ url: z19.z.string(),
18495
+ method: z19.z.string()
18488
18496
  }),
18489
18497
  execute: async (inputData) => {
18490
18498
  const { method, url, baseUrl, headers, body, timeout } = inputData;
@@ -20018,6 +20026,7 @@ var AgentBuilder = class extends agent.Agent {
20018
20026
  ${config.instructions}` : "";
20019
20027
  const combinedInstructions = additionalInstructions + AgentBuilderDefaults.DEFAULT_INSTRUCTIONS(config.projectPath);
20020
20028
  const agentConfig = {
20029
+ id: "agent-builder",
20021
20030
  name: "agent-builder",
20022
20031
  description: "An AI agent specialized in generating Mastra agents, tools, and workflows from natural language requirements.",
20023
20032
  instructions: combinedInstructions,
@@ -20296,13 +20305,13 @@ Return the actual exported names of the units, as well as the file names.`,
20296
20305
  - If a directory doesn't exist or has no files, return an empty array
20297
20306
 
20298
20307
  Return the analysis in the exact format specified in the output schema.`;
20299
- const output = zod.z.object({
20300
- agents: zod.z.array(zod.z.object({ name: zod.z.string(), file: zod.z.string() })).optional(),
20301
- workflows: zod.z.array(zod.z.object({ name: zod.z.string(), file: zod.z.string() })).optional(),
20302
- tools: zod.z.array(zod.z.object({ name: zod.z.string(), file: zod.z.string() })).optional(),
20303
- mcp: zod.z.array(zod.z.object({ name: zod.z.string(), file: zod.z.string() })).optional(),
20304
- networks: zod.z.array(zod.z.object({ name: zod.z.string(), file: zod.z.string() })).optional(),
20305
- other: zod.z.array(zod.z.object({ name: zod.z.string(), file: zod.z.string() })).optional()
20308
+ const output = z19.z.object({
20309
+ agents: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
20310
+ workflows: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
20311
+ tools: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
20312
+ mcp: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
20313
+ networks: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
20314
+ other: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional()
20306
20315
  });
20307
20316
  const result = isV2 ? await agent.tryGenerateWithJsonFallback(agent$1, prompt, {
20308
20317
  structuredOutput: {
@@ -20874,14 +20883,14 @@ var intelligentMergeStep = workflows.createStep({
20874
20883
  const copyFileTool = tools.createTool({
20875
20884
  id: "copy-file",
20876
20885
  description: "Copy a file from template to target project (use only for edge cases - most files are already copied programmatically).",
20877
- inputSchema: zod.z.object({
20878
- sourcePath: zod.z.string().describe("Path to the source file relative to template directory"),
20879
- destinationPath: zod.z.string().describe("Path to the destination file relative to target project")
20886
+ inputSchema: z19.z.object({
20887
+ sourcePath: z19.z.string().describe("Path to the source file relative to template directory"),
20888
+ destinationPath: z19.z.string().describe("Path to the destination file relative to target project")
20880
20889
  }),
20881
- outputSchema: zod.z.object({
20882
- success: zod.z.boolean(),
20883
- message: zod.z.string(),
20884
- error: zod.z.string().optional()
20890
+ outputSchema: z19.z.object({
20891
+ success: z19.z.boolean(),
20892
+ message: z19.z.string(),
20893
+ error: z19.z.string().optional()
20885
20894
  }),
20886
20895
  execute: async (input) => {
20887
20896
  try {
@@ -21297,7 +21306,7 @@ Start by running validateCode with all validation types to get a complete pictur
21297
21306
 
21298
21307
  Previous iterations may have fixed some issues, so start by re-running validateCode to see the current state, then fix any remaining issues.`;
21299
21308
  const isV2 = model.specificationVersion === "v2";
21300
- const output = zod.z.object({ success: zod.z.boolean() });
21309
+ const output = z19.z.object({ success: z19.z.boolean() });
21301
21310
  const result = isV2 ? await agent.tryStreamWithJsonFallback(validationAgent, iterationPrompt, {
21302
21311
  structuredOutput: {
21303
21312
  schema: output
@@ -21567,35 +21576,35 @@ var determineConflictStrategy = (_unit, _targetFile) => {
21567
21576
  var shouldAbortWorkflow = (stepResult) => {
21568
21577
  return stepResult?.success === false || stepResult?.error;
21569
21578
  };
21570
- var TaskSchema = zod.z.array(
21571
- zod.z.object({
21572
- id: zod.z.string().describe("Unique task ID using kebab-case"),
21573
- content: zod.z.string().describe("Specific, actionable task description"),
21574
- status: zod.z.enum(["pending", "in_progress", "completed", "blocked"]).default("pending"),
21575
- priority: zod.z.enum(["high", "medium", "low"]).describe("Task priority"),
21576
- dependencies: zod.z.array(zod.z.string()).optional().describe("IDs of tasks this depends on"),
21577
- notes: zod.z.string().describe("Detailed implementation notes and specifics")
21579
+ var TaskSchema = z19.z.array(
21580
+ z19.z.object({
21581
+ id: z19.z.string().describe("Unique task ID using kebab-case"),
21582
+ content: z19.z.string().describe("Specific, actionable task description"),
21583
+ status: z19.z.enum(["pending", "in_progress", "completed", "blocked"]).default("pending"),
21584
+ priority: z19.z.enum(["high", "medium", "low"]).describe("Task priority"),
21585
+ dependencies: z19.z.array(z19.z.string()).optional().describe("IDs of tasks this depends on"),
21586
+ notes: z19.z.string().describe("Detailed implementation notes and specifics")
21578
21587
  })
21579
21588
  );
21580
- var QuestionSchema = zod.z.array(
21581
- zod.z.object({
21582
- id: zod.z.string().describe("Unique question ID"),
21583
- question: zod.z.string().describe("Clear, specific question for the user"),
21584
- type: zod.z.enum(["choice", "text", "boolean"]).describe("Type of answer expected"),
21585
- options: zod.z.array(zod.z.string()).optional().describe("Options for choice questions"),
21586
- context: zod.z.string().optional().describe("Additional context or explanation")
21589
+ var QuestionSchema = z19.z.array(
21590
+ z19.z.object({
21591
+ id: z19.z.string().describe("Unique question ID"),
21592
+ question: z19.z.string().describe("Clear, specific question for the user"),
21593
+ type: z19.z.enum(["choice", "text", "boolean"]).describe("Type of answer expected"),
21594
+ options: z19.z.array(z19.z.string()).optional().describe("Options for choice questions"),
21595
+ context: z19.z.string().optional().describe("Additional context or explanation")
21587
21596
  })
21588
21597
  );
21589
- var PlanningIterationResultSchema = zod.z.object({
21590
- success: zod.z.boolean(),
21598
+ var PlanningIterationResultSchema = z19.z.object({
21599
+ success: z19.z.boolean(),
21591
21600
  tasks: TaskSchema,
21592
21601
  questions: QuestionSchema,
21593
- reasoning: zod.z.string(),
21594
- planComplete: zod.z.boolean(),
21595
- message: zod.z.string(),
21596
- error: zod.z.string().optional(),
21597
- allPreviousQuestions: zod.z.array(zod.z.any()).optional(),
21598
- allPreviousAnswers: zod.z.record(zod.z.string()).optional()
21602
+ reasoning: z19.z.string(),
21603
+ planComplete: z19.z.boolean(),
21604
+ message: z19.z.string(),
21605
+ error: z19.z.string().optional(),
21606
+ allPreviousQuestions: z19.z.array(z19.z.any()).optional(),
21607
+ allPreviousAnswers: z19.z.record(z19.z.string()).optional()
21599
21608
  });
21600
21609
  var taskPlanningPrompts = {
21601
21610
  planningAgent: {
@@ -21671,180 +21680,180 @@ Create specific tasks and identify any questions that need user clarification.`
21671
21680
  approvalMessage: (tasksCount) => `Please review and approve the ${tasksCount} task(s) for execution:`
21672
21681
  }
21673
21682
  };
21674
- var WorkflowBuilderInputSchema = zod.z.object({
21675
- workflowName: zod.z.string().optional().describe("Name of the workflow to create or edit"),
21676
- action: zod.z.enum(["create", "edit"]).describe("Action to perform: create new or edit existing workflow"),
21677
- description: zod.z.string().optional().describe("Description of what the workflow should do"),
21678
- requirements: zod.z.string().optional().describe("Detailed requirements for the workflow"),
21679
- projectPath: zod.z.string().optional().describe("Path to the Mastra project (defaults to current directory)")
21683
+ var WorkflowBuilderInputSchema = z19.z.object({
21684
+ workflowName: z19.z.string().optional().describe("Name of the workflow to create or edit"),
21685
+ action: z19.z.enum(["create", "edit"]).describe("Action to perform: create new or edit existing workflow"),
21686
+ description: z19.z.string().optional().describe("Description of what the workflow should do"),
21687
+ requirements: z19.z.string().optional().describe("Detailed requirements for the workflow"),
21688
+ projectPath: z19.z.string().optional().describe("Path to the Mastra project (defaults to current directory)")
21680
21689
  });
21681
- var DiscoveredWorkflowSchema = zod.z.object({
21682
- name: zod.z.string(),
21683
- file: zod.z.string(),
21684
- description: zod.z.string().optional(),
21685
- inputSchema: zod.z.any().optional(),
21686
- outputSchema: zod.z.any().optional(),
21687
- steps: zod.z.array(zod.z.string()).optional()
21690
+ var DiscoveredWorkflowSchema = z19.z.object({
21691
+ name: z19.z.string(),
21692
+ file: z19.z.string(),
21693
+ description: z19.z.string().optional(),
21694
+ inputSchema: z19.z.any().optional(),
21695
+ outputSchema: z19.z.any().optional(),
21696
+ steps: z19.z.array(z19.z.string()).optional()
21688
21697
  });
21689
- var WorkflowDiscoveryResultSchema = zod.z.object({
21690
- success: zod.z.boolean(),
21691
- workflows: zod.z.array(DiscoveredWorkflowSchema),
21692
- mastraIndexExists: zod.z.boolean(),
21693
- message: zod.z.string(),
21694
- error: zod.z.string().optional()
21698
+ var WorkflowDiscoveryResultSchema = z19.z.object({
21699
+ success: z19.z.boolean(),
21700
+ workflows: z19.z.array(DiscoveredWorkflowSchema),
21701
+ mastraIndexExists: z19.z.boolean(),
21702
+ message: z19.z.string(),
21703
+ error: z19.z.string().optional()
21695
21704
  });
21696
- var ProjectDiscoveryResultSchema = zod.z.object({
21697
- success: zod.z.boolean(),
21698
- structure: zod.z.object({
21699
- hasWorkflowsDir: zod.z.boolean(),
21700
- hasAgentsDir: zod.z.boolean(),
21701
- hasToolsDir: zod.z.boolean(),
21702
- hasMastraIndex: zod.z.boolean(),
21703
- existingWorkflows: zod.z.array(zod.z.string()),
21704
- existingAgents: zod.z.array(zod.z.string()),
21705
- existingTools: zod.z.array(zod.z.string())
21705
+ var ProjectDiscoveryResultSchema = z19.z.object({
21706
+ success: z19.z.boolean(),
21707
+ structure: z19.z.object({
21708
+ hasWorkflowsDir: z19.z.boolean(),
21709
+ hasAgentsDir: z19.z.boolean(),
21710
+ hasToolsDir: z19.z.boolean(),
21711
+ hasMastraIndex: z19.z.boolean(),
21712
+ existingWorkflows: z19.z.array(z19.z.string()),
21713
+ existingAgents: z19.z.array(z19.z.string()),
21714
+ existingTools: z19.z.array(z19.z.string())
21706
21715
  }),
21707
- dependencies: zod.z.record(zod.z.string()),
21708
- message: zod.z.string(),
21709
- error: zod.z.string().optional()
21716
+ dependencies: z19.z.record(z19.z.string()),
21717
+ message: z19.z.string(),
21718
+ error: z19.z.string().optional()
21710
21719
  });
21711
- var WorkflowResearchResultSchema = zod.z.object({
21712
- success: zod.z.boolean(),
21713
- documentation: zod.z.object({
21714
- workflowPatterns: zod.z.array(zod.z.string()),
21715
- stepExamples: zod.z.array(zod.z.string()),
21716
- bestPractices: zod.z.array(zod.z.string())
21720
+ var WorkflowResearchResultSchema = z19.z.object({
21721
+ success: z19.z.boolean(),
21722
+ documentation: z19.z.object({
21723
+ workflowPatterns: z19.z.array(z19.z.string()),
21724
+ stepExamples: z19.z.array(z19.z.string()),
21725
+ bestPractices: z19.z.array(z19.z.string())
21717
21726
  }),
21718
- webResources: zod.z.array(
21719
- zod.z.object({
21720
- title: zod.z.string(),
21721
- url: zod.z.string(),
21722
- snippet: zod.z.string(),
21723
- relevance: zod.z.number()
21727
+ webResources: z19.z.array(
21728
+ z19.z.object({
21729
+ title: z19.z.string(),
21730
+ url: z19.z.string(),
21731
+ snippet: z19.z.string(),
21732
+ relevance: z19.z.number()
21724
21733
  })
21725
21734
  ),
21726
- message: zod.z.string(),
21727
- error: zod.z.string().optional()
21735
+ message: z19.z.string(),
21736
+ error: z19.z.string().optional()
21728
21737
  });
21729
- var TaskManagementResultSchema = zod.z.object({
21730
- success: zod.z.boolean(),
21738
+ var TaskManagementResultSchema = z19.z.object({
21739
+ success: z19.z.boolean(),
21731
21740
  tasks: TaskSchema,
21732
- message: zod.z.string(),
21733
- error: zod.z.string().optional()
21741
+ message: z19.z.string(),
21742
+ error: z19.z.string().optional()
21734
21743
  });
21735
- var TaskExecutionInputSchema = zod.z.object({
21736
- action: zod.z.enum(["create", "edit"]),
21737
- workflowName: zod.z.string().optional(),
21738
- description: zod.z.string().optional(),
21739
- requirements: zod.z.string().optional(),
21744
+ var TaskExecutionInputSchema = z19.z.object({
21745
+ action: z19.z.enum(["create", "edit"]),
21746
+ workflowName: z19.z.string().optional(),
21747
+ description: z19.z.string().optional(),
21748
+ requirements: z19.z.string().optional(),
21740
21749
  tasks: TaskSchema,
21741
- discoveredWorkflows: zod.z.array(zod.z.any()),
21742
- projectStructure: zod.z.any(),
21743
- research: zod.z.any(),
21744
- projectPath: zod.z.string().optional()
21750
+ discoveredWorkflows: z19.z.array(z19.z.any()),
21751
+ projectStructure: z19.z.any(),
21752
+ research: z19.z.any(),
21753
+ projectPath: z19.z.string().optional()
21745
21754
  });
21746
- var TaskExecutionSuspendSchema = zod.z.object({
21755
+ var TaskExecutionSuspendSchema = z19.z.object({
21747
21756
  questions: QuestionSchema,
21748
- currentProgress: zod.z.string(),
21749
- completedTasks: zod.z.array(zod.z.string()),
21750
- message: zod.z.string()
21757
+ currentProgress: z19.z.string(),
21758
+ completedTasks: z19.z.array(z19.z.string()),
21759
+ message: z19.z.string()
21751
21760
  });
21752
- var TaskExecutionResumeSchema = zod.z.object({
21753
- answers: zod.z.array(
21754
- zod.z.object({
21755
- questionId: zod.z.string(),
21756
- answer: zod.z.string()
21761
+ var TaskExecutionResumeSchema = z19.z.object({
21762
+ answers: z19.z.array(
21763
+ z19.z.object({
21764
+ questionId: z19.z.string(),
21765
+ answer: z19.z.string()
21757
21766
  })
21758
21767
  )
21759
21768
  });
21760
- var TaskExecutionResultSchema = zod.z.object({
21761
- success: zod.z.boolean(),
21762
- filesModified: zod.z.array(zod.z.string()),
21763
- validationResults: zod.z.object({
21764
- passed: zod.z.boolean(),
21765
- errors: zod.z.array(zod.z.string()),
21766
- warnings: zod.z.array(zod.z.string())
21769
+ var TaskExecutionResultSchema = z19.z.object({
21770
+ success: z19.z.boolean(),
21771
+ filesModified: z19.z.array(z19.z.string()),
21772
+ validationResults: z19.z.object({
21773
+ passed: z19.z.boolean(),
21774
+ errors: z19.z.array(z19.z.string()),
21775
+ warnings: z19.z.array(z19.z.string())
21767
21776
  }),
21768
- completedTasks: zod.z.array(zod.z.string()),
21769
- message: zod.z.string(),
21770
- error: zod.z.string().optional()
21777
+ completedTasks: z19.z.array(z19.z.string()),
21778
+ message: z19.z.string(),
21779
+ error: z19.z.string().optional()
21771
21780
  });
21772
- zod.z.object({
21781
+ z19.z.object({
21773
21782
  questions: QuestionSchema
21774
21783
  });
21775
- zod.z.object({
21776
- answers: zod.z.record(zod.z.string()),
21777
- hasAnswers: zod.z.boolean()
21784
+ z19.z.object({
21785
+ answers: z19.z.record(z19.z.string()),
21786
+ hasAnswers: z19.z.boolean()
21778
21787
  });
21779
- var WorkflowBuilderResultSchema = zod.z.object({
21780
- success: zod.z.boolean(),
21781
- action: zod.z.enum(["create", "edit"]),
21782
- workflowName: zod.z.string().optional(),
21783
- workflowFile: zod.z.string().optional(),
21788
+ var WorkflowBuilderResultSchema = z19.z.object({
21789
+ success: z19.z.boolean(),
21790
+ action: z19.z.enum(["create", "edit"]),
21791
+ workflowName: z19.z.string().optional(),
21792
+ workflowFile: z19.z.string().optional(),
21784
21793
  discovery: WorkflowDiscoveryResultSchema.optional(),
21785
21794
  projectStructure: ProjectDiscoveryResultSchema.optional(),
21786
21795
  research: WorkflowResearchResultSchema.optional(),
21787
21796
  planning: PlanningIterationResultSchema.optional(),
21788
21797
  taskManagement: TaskManagementResultSchema.optional(),
21789
21798
  execution: TaskExecutionResultSchema.optional(),
21790
- needsUserInput: zod.z.boolean().optional(),
21799
+ needsUserInput: z19.z.boolean().optional(),
21791
21800
  questions: QuestionSchema.optional(),
21792
- message: zod.z.string(),
21793
- nextSteps: zod.z.array(zod.z.string()).optional(),
21794
- error: zod.z.string().optional()
21801
+ message: z19.z.string(),
21802
+ nextSteps: z19.z.array(z19.z.string()).optional(),
21803
+ error: z19.z.string().optional()
21795
21804
  });
21796
- var TaskExecutionIterationInputSchema = (taskLength) => zod.z.object({
21797
- status: zod.z.enum(["in_progress", "completed", "needs_clarification"]).describe('Status - only use "completed" when ALL remaining tasks are finished'),
21798
- progress: zod.z.string().describe("Current progress description"),
21799
- completedTasks: zod.z.array(zod.z.string()).describe("List of ALL completed task IDs (including previously completed ones)"),
21800
- totalTasksRequired: zod.z.number().describe(`Total number of tasks that must be completed (should be ${taskLength})`),
21801
- tasksRemaining: zod.z.array(zod.z.string()).describe("List of task IDs that still need to be completed"),
21802
- filesModified: zod.z.array(zod.z.string()).describe("List of files that were created or modified - use these exact paths for validateCode tool"),
21805
+ var TaskExecutionIterationInputSchema = (taskLength) => z19.z.object({
21806
+ status: z19.z.enum(["in_progress", "completed", "needs_clarification"]).describe('Status - only use "completed" when ALL remaining tasks are finished'),
21807
+ progress: z19.z.string().describe("Current progress description"),
21808
+ completedTasks: z19.z.array(z19.z.string()).describe("List of ALL completed task IDs (including previously completed ones)"),
21809
+ totalTasksRequired: z19.z.number().describe(`Total number of tasks that must be completed (should be ${taskLength})`),
21810
+ tasksRemaining: z19.z.array(z19.z.string()).describe("List of task IDs that still need to be completed"),
21811
+ filesModified: z19.z.array(z19.z.string()).describe("List of files that were created or modified - use these exact paths for validateCode tool"),
21803
21812
  questions: QuestionSchema.optional().describe("Questions for user if clarification is needed"),
21804
- message: zod.z.string().describe("Summary of work completed or current status"),
21805
- error: zod.z.string().optional().describe("Any errors encountered")
21813
+ message: z19.z.string().describe("Summary of work completed or current status"),
21814
+ error: z19.z.string().optional().describe("Any errors encountered")
21806
21815
  });
21807
- var PlanningIterationInputSchema = zod.z.object({
21808
- action: zod.z.enum(["create", "edit"]),
21809
- workflowName: zod.z.string().optional(),
21810
- description: zod.z.string().optional(),
21811
- requirements: zod.z.string().optional(),
21812
- discoveredWorkflows: zod.z.array(DiscoveredWorkflowSchema),
21816
+ var PlanningIterationInputSchema = z19.z.object({
21817
+ action: z19.z.enum(["create", "edit"]),
21818
+ workflowName: z19.z.string().optional(),
21819
+ description: z19.z.string().optional(),
21820
+ requirements: z19.z.string().optional(),
21821
+ discoveredWorkflows: z19.z.array(DiscoveredWorkflowSchema),
21813
21822
  projectStructure: ProjectDiscoveryResultSchema,
21814
21823
  research: WorkflowResearchResultSchema,
21815
- userAnswers: zod.z.record(zod.z.string()).optional()
21824
+ userAnswers: z19.z.record(z19.z.string()).optional()
21816
21825
  });
21817
- var PlanningIterationSuspendSchema = zod.z.object({
21826
+ var PlanningIterationSuspendSchema = z19.z.object({
21818
21827
  questions: QuestionSchema,
21819
- message: zod.z.string(),
21820
- currentPlan: zod.z.object({
21828
+ message: z19.z.string(),
21829
+ currentPlan: z19.z.object({
21821
21830
  tasks: TaskSchema,
21822
- reasoning: zod.z.string()
21831
+ reasoning: z19.z.string()
21823
21832
  })
21824
21833
  });
21825
- var PlanningIterationResumeSchema = zod.z.object({
21826
- answers: zod.z.record(zod.z.string())
21834
+ var PlanningIterationResumeSchema = z19.z.object({
21835
+ answers: z19.z.record(z19.z.string())
21827
21836
  });
21828
- var PlanningAgentOutputSchema = zod.z.object({
21837
+ var PlanningAgentOutputSchema = z19.z.object({
21829
21838
  tasks: TaskSchema,
21830
21839
  questions: QuestionSchema.optional(),
21831
- reasoning: zod.z.string().describe("Explanation of the plan and any questions"),
21832
- planComplete: zod.z.boolean().describe("Whether the plan is ready for execution (no more questions)")
21840
+ reasoning: z19.z.string().describe("Explanation of the plan and any questions"),
21841
+ planComplete: z19.z.boolean().describe("Whether the plan is ready for execution (no more questions)")
21833
21842
  });
21834
- var TaskApprovalOutputSchema = zod.z.object({
21835
- approved: zod.z.boolean(),
21843
+ var TaskApprovalOutputSchema = z19.z.object({
21844
+ approved: z19.z.boolean(),
21836
21845
  tasks: TaskSchema,
21837
- message: zod.z.string(),
21838
- userFeedback: zod.z.string().optional()
21846
+ message: z19.z.string(),
21847
+ userFeedback: z19.z.string().optional()
21839
21848
  });
21840
- var TaskApprovalSuspendSchema = zod.z.object({
21849
+ var TaskApprovalSuspendSchema = z19.z.object({
21841
21850
  taskList: TaskSchema,
21842
- summary: zod.z.string(),
21843
- message: zod.z.string()
21851
+ summary: z19.z.string(),
21852
+ message: z19.z.string()
21844
21853
  });
21845
- var TaskApprovalResumeSchema = zod.z.object({
21846
- approved: zod.z.boolean(),
21847
- modifications: zod.z.string().optional()
21854
+ var TaskApprovalResumeSchema = z19.z.object({
21855
+ approved: z19.z.boolean(),
21856
+ modifications: z19.z.string().optional()
21848
21857
  });
21849
21858
  var planningIterationStep = workflows.createStep({
21850
21859
  id: "planning-iteration",
@@ -21884,6 +21893,7 @@ var planningIterationStep = workflows.createStep({
21884
21893
  try {
21885
21894
  const model = await resolveModel({ requestContext });
21886
21895
  const planningAgent = new agent.Agent({
21896
+ id: "workflow-planning-agent",
21887
21897
  model,
21888
21898
  instructions: taskPlanningPrompts.planningAgent.instructions({
21889
21899
  storedQAPairs
@@ -22222,7 +22232,7 @@ export const mastra = new Mastra({
22222
22232
  sendEmailWorkflow, // Use camelCase for keys
22223
22233
  dataProcessingWorkflow
22224
22234
  },
22225
- storage: new LibSQLStore({ url: 'file:./mastra.db' }), // Required for suspend/resume
22235
+ storage: new LibSQLStore({ id: 'mastra-storage', url: 'file:./mastra.db' }), // Required for suspend/resume
22226
22236
  });
22227
22237
  \`\`\`
22228
22238
 
@@ -22437,35 +22447,35 @@ ${context.resumeData ? `USER PROVIDED ANSWERS: ${JSON.stringify(context.resumeDa
22437
22447
  var restrictedTaskManager = tools.createTool({
22438
22448
  id: "task-manager",
22439
22449
  description: "View and update your pre-loaded task list. You can only mark tasks as in_progress or completed, not create new tasks.",
22440
- inputSchema: zod.z.object({
22441
- action: zod.z.enum(["list", "update", "complete"]).describe("List tasks, update status, or mark complete - tasks are pre-loaded"),
22442
- tasks: zod.z.array(
22443
- zod.z.object({
22444
- id: zod.z.string().describe("Task ID - must match existing task"),
22445
- content: zod.z.string().optional().describe("Task content (read-only)"),
22446
- status: zod.z.enum(["pending", "in_progress", "completed", "blocked"]).describe("Task status"),
22447
- priority: zod.z.enum(["high", "medium", "low"]).optional().describe("Task priority (read-only)"),
22448
- dependencies: zod.z.array(zod.z.string()).optional().describe("Task dependencies (read-only)"),
22449
- notes: zod.z.string().optional().describe("Additional notes or progress updates")
22450
+ inputSchema: z19.z.object({
22451
+ action: z19.z.enum(["list", "update", "complete"]).describe("List tasks, update status, or mark complete - tasks are pre-loaded"),
22452
+ tasks: z19.z.array(
22453
+ z19.z.object({
22454
+ id: z19.z.string().describe("Task ID - must match existing task"),
22455
+ content: z19.z.string().optional().describe("Task content (read-only)"),
22456
+ status: z19.z.enum(["pending", "in_progress", "completed", "blocked"]).describe("Task status"),
22457
+ priority: z19.z.enum(["high", "medium", "low"]).optional().describe("Task priority (read-only)"),
22458
+ dependencies: z19.z.array(z19.z.string()).optional().describe("Task dependencies (read-only)"),
22459
+ notes: z19.z.string().optional().describe("Additional notes or progress updates")
22450
22460
  })
22451
22461
  ).optional().describe("Tasks to update (status and notes only)"),
22452
- taskId: zod.z.string().optional().describe("Specific task ID for single task operations")
22462
+ taskId: z19.z.string().optional().describe("Specific task ID for single task operations")
22453
22463
  }),
22454
- outputSchema: zod.z.object({
22455
- success: zod.z.boolean(),
22456
- tasks: zod.z.array(
22457
- zod.z.object({
22458
- id: zod.z.string(),
22459
- content: zod.z.string(),
22460
- status: zod.z.string(),
22461
- priority: zod.z.string(),
22462
- dependencies: zod.z.array(zod.z.string()).optional(),
22463
- notes: zod.z.string().optional(),
22464
- createdAt: zod.z.string(),
22465
- updatedAt: zod.z.string()
22464
+ outputSchema: z19.z.object({
22465
+ success: z19.z.boolean(),
22466
+ tasks: z19.z.array(
22467
+ z19.z.object({
22468
+ id: z19.z.string(),
22469
+ content: z19.z.string(),
22470
+ status: z19.z.string(),
22471
+ priority: z19.z.string(),
22472
+ dependencies: z19.z.array(z19.z.string()).optional(),
22473
+ notes: z19.z.string().optional(),
22474
+ createdAt: z19.z.string(),
22475
+ updatedAt: z19.z.string()
22466
22476
  })
22467
22477
  ),
22468
- message: zod.z.string()
22478
+ message: z19.z.string()
22469
22479
  }),
22470
22480
  execute: async (input) => {
22471
22481
  const adaptedContext = {
@@ -22610,6 +22620,7 @@ var workflowResearchStep = workflows.createStep({
22610
22620
  try {
22611
22621
  const model = await resolveModel({ requestContext });
22612
22622
  const researchAgent = new agent.Agent({
22623
+ id: "workflow-research-agent",
22613
22624
  model,
22614
22625
  instructions: workflowBuilderPrompts.researchAgent.instructions,
22615
22626
  name: "Workflow Research Agent"
@@ -22930,144 +22941,599 @@ var agentBuilderWorkflows = {
22930
22941
  "merge-template": agentBuilderTemplateWorkflow,
22931
22942
  "workflow-builder": workflowBuilderWorkflow
22932
22943
  };
22944
+ var actionIdPathParams = z19__default.default.object({
22945
+ actionId: z19__default.default.string().describe("Unique identifier for the agent-builder action")
22946
+ });
22947
+ var actionRunPathParams = z19__default.default.object({
22948
+ actionId: z19__default.default.string().describe("Unique identifier for the agent-builder action"),
22949
+ runId: z19__default.default.string().describe("Unique identifier for the action run")
22950
+ });
22951
+ var streamAgentBuilderBodySchema = chunk7WTETKRM_cjs.streamWorkflowBodySchema;
22952
+ var streamLegacyAgentBuilderBodySchema = chunk7WTETKRM_cjs.streamLegacyWorkflowBodySchema;
22953
+ var resumeAgentBuilderBodySchema = chunk7WTETKRM_cjs.resumeBodySchema;
22954
+ var startAsyncAgentBuilderBodySchema = chunk7WTETKRM_cjs.startAsyncWorkflowBodySchema;
22933
22955
 
22934
22956
  // src/server/handlers/agent-builder.ts
22935
- function createAgentBuilderWorkflowHandler(workflowHandlerFn, logMessage) {
22936
- return async (builderArgs) => {
22937
- const { actionId, ...actionArgs } = builderArgs;
22938
- const mastra = actionArgs.mastra;
22957
+ var LIST_AGENT_BUILDER_ACTIONS_ROUTE = chunkUJNHKFBR_cjs.createRoute({
22958
+ method: "GET",
22959
+ path: "/api/agent-builder",
22960
+ responseType: "json",
22961
+ responseSchema: chunk7WTETKRM_cjs.listWorkflowsResponseSchema,
22962
+ summary: "List agent-builder actions",
22963
+ description: "Returns a list of all available agent-builder actions",
22964
+ tags: ["Agent Builder"],
22965
+ handler: async (ctx) => {
22966
+ const { mastra } = ctx;
22939
22967
  const logger = mastra.getLogger();
22940
22968
  try {
22941
- chunkLWLSQ2W4_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
22942
- if (actionId && !chunkLWLSQ2W4_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
22969
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
22970
+ logger.info("Listing agent builder actions");
22971
+ return await chunk7WTETKRM_cjs.LIST_WORKFLOWS_ROUTE.handler(ctx);
22972
+ } catch (error) {
22973
+ logger.error("Error listing agent builder actions", { error });
22974
+ return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder workflows");
22975
+ } finally {
22976
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
22977
+ }
22978
+ }
22979
+ });
22980
+ var GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = chunkUJNHKFBR_cjs.createRoute({
22981
+ method: "GET",
22982
+ path: "/api/agent-builder/:actionId",
22983
+ responseType: "json",
22984
+ pathParamSchema: actionIdPathParams,
22985
+ responseSchema: chunk7WTETKRM_cjs.workflowInfoSchema,
22986
+ summary: "Get action by ID",
22987
+ description: "Returns details for a specific agent-builder action",
22988
+ tags: ["Agent Builder"],
22989
+ handler: async (ctx) => {
22990
+ const { mastra, actionId } = ctx;
22991
+ const logger = mastra.getLogger();
22992
+ try {
22993
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
22994
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
22943
22995
  throw new chunk64ITUOXI_cjs.HTTPException(400, {
22944
22996
  message: `Invalid agent-builder action: ${actionId}. Valid actions are: ${Object.keys(agentBuilderWorkflows).join(", ")}`
22945
22997
  });
22946
22998
  }
22947
- logger.info(logMessage, { actionId, ...actionArgs });
22948
- try {
22949
- const handlerArgs = {
22950
- ...actionArgs,
22951
- workflowId: actionId
22952
- // Map actionId to workflowId
22953
- };
22954
- const result = await workflowHandlerFn(handlerArgs);
22955
- return result;
22956
- } finally {
22957
- chunkLWLSQ2W4_cjs.WorkflowRegistry.cleanup();
22958
- }
22999
+ logger.info("Getting agent builder action by ID", { actionId });
23000
+ return await chunk7WTETKRM_cjs.GET_WORKFLOW_BY_ID_ROUTE.handler({ ...ctx, workflowId: actionId });
22959
23001
  } catch (error) {
22960
- const errorMessage = error instanceof Error ? error.message : String(error);
22961
- logger.error(`${logMessage} failed`, {
22962
- error: errorMessage,
22963
- stack: error instanceof Error ? error.stack : void 0
23002
+ logger.error("Error getting agent builder action by ID", { error, actionId });
23003
+ return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action");
23004
+ } finally {
23005
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23006
+ }
23007
+ }
23008
+ });
23009
+ var LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23010
+ method: "GET",
23011
+ path: "/api/agent-builder/:actionId/runs",
23012
+ responseType: "json",
23013
+ pathParamSchema: actionIdPathParams,
23014
+ queryParamSchema: chunk7WTETKRM_cjs.listWorkflowRunsQuerySchema,
23015
+ responseSchema: chunk7WTETKRM_cjs.workflowRunsResponseSchema,
23016
+ summary: "List action runs",
23017
+ description: "Returns a paginated list of execution runs for the specified action",
23018
+ tags: ["Agent Builder"],
23019
+ handler: async (ctx) => {
23020
+ const { mastra, actionId } = ctx;
23021
+ const logger = mastra.getLogger();
23022
+ try {
23023
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23024
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23025
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23026
+ }
23027
+ logger.info("Listing agent builder action runs", { actionId });
23028
+ return await chunk7WTETKRM_cjs.LIST_WORKFLOW_RUNS_ROUTE.handler({
23029
+ ...ctx,
23030
+ workflowId: actionId
22964
23031
  });
22965
- throw error;
23032
+ } catch (error) {
23033
+ logger.error("Error listing agent builder action runs", { error, actionId });
23034
+ return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action runs");
23035
+ } finally {
23036
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
22966
23037
  }
22967
- };
22968
- }
22969
- var getAgentBuilderActionsHandler = createAgentBuilderWorkflowHandler(async () => {
22970
- try {
22971
- const registryWorkflows = chunkLWLSQ2W4_cjs.WorkflowRegistry.getAllWorkflows();
22972
- const _workflows = Object.entries(registryWorkflows).reduce(
22973
- (acc, [key, workflow]) => {
22974
- acc[key] = chunkLWLSQ2W4_cjs.getWorkflowInfo(workflow);
22975
- return acc;
22976
- },
22977
- {}
22978
- );
22979
- return _workflows;
22980
- } catch (error) {
22981
- return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder workflows");
22982
23038
  }
22983
- }, "Getting agent builder actions");
22984
- var getAgentBuilderActionByIdHandler = createAgentBuilderWorkflowHandler(
22985
- chunkSRAPUMPM_cjs.getWorkflowByIdHandler,
22986
- "Getting agent builder action by ID"
22987
- );
22988
- var getAgentBuilderActionRunByIdHandler = createAgentBuilderWorkflowHandler(
22989
- chunkSRAPUMPM_cjs.getWorkflowRunByIdHandler,
22990
- "Getting agent builder action run by ID"
22991
- );
22992
- var getAgentBuilderActionRunExecutionResultHandler = createAgentBuilderWorkflowHandler(
22993
- chunkSRAPUMPM_cjs.getWorkflowRunExecutionResultHandler,
22994
- "Getting agent builder action run execution result"
22995
- );
22996
- var createAgentBuilderActionRunHandler = createAgentBuilderWorkflowHandler(
22997
- chunkSRAPUMPM_cjs.createWorkflowRunHandler,
22998
- "Creating agent builder action run"
22999
- );
23000
- var startAsyncAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23001
- chunkSRAPUMPM_cjs.startAsyncWorkflowHandler,
23002
- "Starting async agent builder action"
23003
- );
23004
- var startAgentBuilderActionRunHandler = createAgentBuilderWorkflowHandler(
23005
- chunkSRAPUMPM_cjs.startWorkflowRunHandler,
23006
- "Starting agent builder action run"
23007
- );
23008
- var streamAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23009
- chunkSRAPUMPM_cjs.streamWorkflowHandler,
23010
- "Streaming agent builder action"
23011
- );
23012
- var streamLegacyAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23013
- chunkSRAPUMPM_cjs.streamLegacyWorkflowHandler,
23014
- "Streaming legacy agent builder action"
23015
- );
23016
- var streamVNextAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23017
- chunkSRAPUMPM_cjs.streamVNextWorkflowHandler,
23018
- "Streaming VNext agent builder action"
23019
- );
23020
- var observeStreamLegacyAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23021
- chunkSRAPUMPM_cjs.observeStreamLegacyWorkflowHandler,
23022
- "Observing legacy stream for agent builder action"
23023
- );
23024
- var observeStreamAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23025
- chunkSRAPUMPM_cjs.observeStreamWorkflowHandler,
23026
- "Observing stream for agent builder action"
23027
- );
23028
- var observeStreamVNextAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23029
- chunkSRAPUMPM_cjs.observeStreamVNextWorkflowHandler,
23030
- "Observing VNext stream for agent builder action"
23031
- );
23032
- var resumeAsyncAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23033
- chunkSRAPUMPM_cjs.resumeAsyncWorkflowHandler,
23034
- "Resuming async agent builder action"
23035
- );
23036
- var resumeAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23037
- chunkSRAPUMPM_cjs.resumeWorkflowHandler,
23038
- "Resuming agent builder action"
23039
- );
23040
- var resumeStreamAgentBuilderActionHandler = createAgentBuilderWorkflowHandler(
23041
- chunkSRAPUMPM_cjs.resumeStreamWorkflowHandler,
23042
- "Resuming stream for agent builder action"
23043
- );
23044
- var getAgentBuilderActionRunsHandler = createAgentBuilderWorkflowHandler(
23045
- chunkSRAPUMPM_cjs.listWorkflowRunsHandler,
23046
- "Getting agent builder action runs"
23047
- );
23048
- var cancelAgentBuilderActionRunHandler = createAgentBuilderWorkflowHandler(
23049
- chunkSRAPUMPM_cjs.cancelWorkflowRunHandler,
23050
- "Cancelling agent builder action run"
23051
- );
23039
+ });
23040
+ var GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23041
+ method: "GET",
23042
+ path: "/api/agent-builder/:actionId/runs/:runId",
23043
+ responseType: "json",
23044
+ pathParamSchema: actionRunPathParams,
23045
+ responseSchema: chunk7WTETKRM_cjs.workflowRunResponseSchema,
23046
+ summary: "Get action run by ID",
23047
+ description: "Returns details for a specific action run",
23048
+ tags: ["Agent Builder"],
23049
+ handler: async (ctx) => {
23050
+ const { mastra, actionId, runId } = ctx;
23051
+ const logger = mastra.getLogger();
23052
+ try {
23053
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23054
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23055
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23056
+ }
23057
+ logger.info("Getting agent builder action run by ID", { actionId, runId });
23058
+ return await chunk7WTETKRM_cjs.GET_WORKFLOW_RUN_BY_ID_ROUTE.handler({
23059
+ ...ctx,
23060
+ workflowId: actionId
23061
+ });
23062
+ } catch (error) {
23063
+ logger.error("Error getting agent builder action run", { error, actionId, runId });
23064
+ return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action run");
23065
+ } finally {
23066
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23067
+ }
23068
+ }
23069
+ });
23070
+ var GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23071
+ method: "GET",
23072
+ path: "/api/agent-builder/:actionId/runs/:runId/execution-result",
23073
+ responseType: "json",
23074
+ pathParamSchema: actionRunPathParams,
23075
+ responseSchema: chunk7WTETKRM_cjs.workflowExecutionResultSchema,
23076
+ summary: "Get action execution result",
23077
+ description: "Returns the final execution result of a completed action run",
23078
+ tags: ["Agent Builder"],
23079
+ handler: async (ctx) => {
23080
+ const { mastra, actionId, runId } = ctx;
23081
+ const logger = mastra.getLogger();
23082
+ try {
23083
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23084
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23085
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23086
+ }
23087
+ logger.info("Getting agent builder action run execution result", { actionId, runId });
23088
+ return await chunk7WTETKRM_cjs.GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE.handler({
23089
+ ...ctx,
23090
+ workflowId: actionId
23091
+ });
23092
+ } catch (error) {
23093
+ logger.error("Error getting execution result", { error, actionId, runId });
23094
+ return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action execution result");
23095
+ } finally {
23096
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23097
+ }
23098
+ }
23099
+ });
23100
+ var CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23101
+ method: "POST",
23102
+ path: "/api/agent-builder/:actionId/create-run",
23103
+ responseType: "json",
23104
+ pathParamSchema: actionIdPathParams,
23105
+ queryParamSchema: chunk2NW6POYK_cjs.optionalRunIdSchema,
23106
+ responseSchema: chunk7WTETKRM_cjs.createWorkflowRunResponseSchema,
23107
+ summary: "Create action run",
23108
+ description: "Creates a new action execution instance with an optional custom run ID",
23109
+ tags: ["Agent Builder"],
23110
+ handler: async (ctx) => {
23111
+ const { mastra, actionId, runId } = ctx;
23112
+ const logger = mastra.getLogger();
23113
+ try {
23114
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23115
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23116
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23117
+ }
23118
+ logger.info("Creating agent builder action run", { actionId, runId });
23119
+ return await chunk7WTETKRM_cjs.CREATE_WORKFLOW_RUN_ROUTE.handler({
23120
+ ...ctx,
23121
+ workflowId: actionId
23122
+ });
23123
+ } catch (error) {
23124
+ logger.error("Error creating agent builder action run", { error, actionId });
23125
+ return chunkV5WWQN7P_cjs.handleError(error, "Error creating agent builder action run");
23126
+ } finally {
23127
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23128
+ }
23129
+ }
23130
+ });
23131
+ var STREAM_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23132
+ method: "POST",
23133
+ path: "/api/agent-builder/:actionId/stream",
23134
+ responseType: "stream",
23135
+ pathParamSchema: actionIdPathParams,
23136
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23137
+ bodySchema: streamAgentBuilderBodySchema,
23138
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23139
+ summary: "Stream action execution",
23140
+ description: "Executes an action and streams the results in real-time",
23141
+ tags: ["Agent Builder"],
23142
+ handler: async (ctx) => {
23143
+ const { mastra, actionId, runId, requestContext } = ctx;
23144
+ const logger = mastra.getLogger();
23145
+ try {
23146
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23147
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23148
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23149
+ }
23150
+ logger.info("Streaming agent builder action", { actionId, runId });
23151
+ return await chunk7WTETKRM_cjs.STREAM_WORKFLOW_ROUTE.handler({
23152
+ ...ctx,
23153
+ workflowId: actionId,
23154
+ requestContext
23155
+ });
23156
+ } catch (error) {
23157
+ logger.error("Error streaming agent builder action", { error, actionId });
23158
+ return chunkV5WWQN7P_cjs.handleError(error, "Error streaming agent builder action");
23159
+ } finally {
23160
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23161
+ }
23162
+ }
23163
+ });
23164
+ var STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23165
+ method: "POST",
23166
+ path: "/api/agent-builder/:actionId/streamVNext",
23167
+ responseType: "stream",
23168
+ pathParamSchema: actionIdPathParams,
23169
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23170
+ bodySchema: streamAgentBuilderBodySchema,
23171
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23172
+ summary: "Stream action execution (v2)",
23173
+ description: "Executes an action using the v2 streaming API and streams the results in real-time",
23174
+ tags: ["Agent Builder"],
23175
+ handler: async (ctx) => {
23176
+ const { mastra, actionId, runId, requestContext } = ctx;
23177
+ const logger = mastra.getLogger();
23178
+ try {
23179
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23180
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23181
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23182
+ }
23183
+ logger.info("Streaming agent builder action (v2)", { actionId, runId });
23184
+ return await chunk7WTETKRM_cjs.STREAM_VNEXT_WORKFLOW_ROUTE.handler({
23185
+ ...ctx,
23186
+ workflowId: actionId,
23187
+ requestContext
23188
+ });
23189
+ } catch (error) {
23190
+ logger.error("Error streaming agent builder action (v2)", { error, actionId });
23191
+ return chunkV5WWQN7P_cjs.handleError(error, "Error streaming agent builder action");
23192
+ } finally {
23193
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23194
+ }
23195
+ }
23196
+ });
23197
+ var START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23198
+ method: "POST",
23199
+ path: "/api/agent-builder/:actionId/start-async",
23200
+ responseType: "json",
23201
+ pathParamSchema: actionIdPathParams,
23202
+ queryParamSchema: chunk2NW6POYK_cjs.optionalRunIdSchema,
23203
+ bodySchema: startAsyncAgentBuilderBodySchema,
23204
+ responseSchema: chunk7WTETKRM_cjs.workflowExecutionResultSchema,
23205
+ summary: "Start action asynchronously",
23206
+ description: "Starts an action execution asynchronously without streaming results",
23207
+ tags: ["Agent Builder"],
23208
+ handler: async (ctx) => {
23209
+ const { mastra, actionId, runId, requestContext } = ctx;
23210
+ const logger = mastra.getLogger();
23211
+ try {
23212
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23213
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23214
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23215
+ }
23216
+ logger.info("Starting agent builder action asynchronously", { actionId, runId });
23217
+ return await chunk7WTETKRM_cjs.START_ASYNC_WORKFLOW_ROUTE.handler({
23218
+ ...ctx,
23219
+ workflowId: actionId,
23220
+ requestContext
23221
+ });
23222
+ } catch (error) {
23223
+ logger.error("Error starting agent builder action asynchronously", { error, actionId });
23224
+ return chunkV5WWQN7P_cjs.handleError(error, "Error starting agent builder action");
23225
+ } finally {
23226
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23227
+ }
23228
+ }
23229
+ });
23230
+ var START_AGENT_BUILDER_ACTION_RUN_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23231
+ method: "POST",
23232
+ path: "/api/agent-builder/:actionId/start",
23233
+ responseType: "json",
23234
+ pathParamSchema: actionIdPathParams,
23235
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23236
+ bodySchema: startAsyncAgentBuilderBodySchema,
23237
+ responseSchema: chunk7WTETKRM_cjs.workflowControlResponseSchema,
23238
+ summary: "Start specific action run",
23239
+ description: "Starts execution of a specific action run by ID",
23240
+ tags: ["Agent Builder"],
23241
+ handler: async (ctx) => {
23242
+ const { mastra, actionId, runId, requestContext } = ctx;
23243
+ const logger = mastra.getLogger();
23244
+ try {
23245
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23246
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23247
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23248
+ }
23249
+ logger.info("Starting specific agent builder action run", { actionId, runId });
23250
+ return await chunk7WTETKRM_cjs.START_WORKFLOW_RUN_ROUTE.handler({
23251
+ ...ctx,
23252
+ workflowId: actionId,
23253
+ requestContext
23254
+ });
23255
+ } catch (error) {
23256
+ logger.error("Error starting agent builder action run", { error, actionId });
23257
+ return chunkV5WWQN7P_cjs.handleError(error, "Error starting agent builder action run");
23258
+ } finally {
23259
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23260
+ }
23261
+ }
23262
+ });
23263
+ var OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23264
+ method: "POST",
23265
+ path: "/api/agent-builder/:actionId/observe",
23266
+ responseType: "stream",
23267
+ pathParamSchema: actionIdPathParams,
23268
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23269
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23270
+ summary: "Observe action stream",
23271
+ description: "Observes and streams updates from an already running action execution",
23272
+ tags: ["Agent Builder"],
23273
+ handler: async (ctx) => {
23274
+ const { mastra, actionId, runId } = ctx;
23275
+ const logger = mastra.getLogger();
23276
+ try {
23277
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23278
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23279
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23280
+ }
23281
+ logger.info("Observing agent builder action stream", { actionId, runId });
23282
+ return await chunk7WTETKRM_cjs.OBSERVE_STREAM_WORKFLOW_ROUTE.handler({
23283
+ ...ctx,
23284
+ workflowId: actionId
23285
+ });
23286
+ } catch (error) {
23287
+ logger.error("Error observing agent builder action stream", { error, actionId });
23288
+ return chunkV5WWQN7P_cjs.handleError(error, "Error observing agent builder action stream");
23289
+ } finally {
23290
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23291
+ }
23292
+ }
23293
+ });
23294
+ var OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23295
+ method: "POST",
23296
+ path: "/api/agent-builder/:actionId/observe-streamVNext",
23297
+ responseType: "stream",
23298
+ pathParamSchema: actionIdPathParams,
23299
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23300
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23301
+ summary: "Observe action stream (v2)",
23302
+ description: "Observes and streams updates from an already running action execution using v2 streaming API",
23303
+ tags: ["Agent Builder"],
23304
+ handler: async (ctx) => {
23305
+ const { mastra, actionId, runId } = ctx;
23306
+ const logger = mastra.getLogger();
23307
+ try {
23308
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23309
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23310
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23311
+ }
23312
+ logger.info("Observing agent builder action stream (v2)", { actionId, runId });
23313
+ return await chunk7WTETKRM_cjs.OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE.handler({
23314
+ ...ctx,
23315
+ workflowId: actionId
23316
+ });
23317
+ } catch (error) {
23318
+ logger.error("Error observing agent builder action stream (v2)", { error, actionId });
23319
+ return chunkV5WWQN7P_cjs.handleError(error, "Error observing agent builder action stream");
23320
+ } finally {
23321
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23322
+ }
23323
+ }
23324
+ });
23325
+ var RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23326
+ method: "POST",
23327
+ path: "/api/agent-builder/:actionId/resume-async",
23328
+ responseType: "json",
23329
+ pathParamSchema: actionIdPathParams,
23330
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23331
+ bodySchema: resumeAgentBuilderBodySchema,
23332
+ responseSchema: chunk7WTETKRM_cjs.workflowExecutionResultSchema,
23333
+ summary: "Resume action asynchronously",
23334
+ description: "Resumes a suspended action execution asynchronously without streaming",
23335
+ tags: ["Agent Builder"],
23336
+ handler: async (ctx) => {
23337
+ const { mastra, actionId, runId, step, requestContext } = ctx;
23338
+ const logger = mastra.getLogger();
23339
+ try {
23340
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23341
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23342
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23343
+ }
23344
+ logger.info("Resuming agent builder action asynchronously", { actionId, runId, step });
23345
+ return await chunk7WTETKRM_cjs.RESUME_ASYNC_WORKFLOW_ROUTE.handler({
23346
+ ...ctx,
23347
+ workflowId: actionId,
23348
+ requestContext
23349
+ });
23350
+ } catch (error) {
23351
+ logger.error("Error resuming agent builder action asynchronously", { error, actionId });
23352
+ return chunkV5WWQN7P_cjs.handleError(error, "Error resuming agent builder action");
23353
+ } finally {
23354
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23355
+ }
23356
+ }
23357
+ });
23358
+ var RESUME_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23359
+ method: "POST",
23360
+ path: "/api/agent-builder/:actionId/resume",
23361
+ responseType: "json",
23362
+ pathParamSchema: actionIdPathParams,
23363
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23364
+ bodySchema: resumeAgentBuilderBodySchema,
23365
+ responseSchema: chunk7WTETKRM_cjs.workflowControlResponseSchema,
23366
+ summary: "Resume action",
23367
+ description: "Resumes a suspended action execution from a specific step",
23368
+ tags: ["Agent Builder"],
23369
+ handler: async (ctx) => {
23370
+ const { mastra, actionId, runId, step, requestContext } = ctx;
23371
+ const logger = mastra.getLogger();
23372
+ try {
23373
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23374
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23375
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23376
+ }
23377
+ logger.info("Resuming agent builder action", { actionId, runId, step });
23378
+ return await chunk7WTETKRM_cjs.RESUME_WORKFLOW_ROUTE.handler({
23379
+ ...ctx,
23380
+ workflowId: actionId,
23381
+ requestContext
23382
+ });
23383
+ } catch (error) {
23384
+ logger.error("Error resuming agent builder action", { error, actionId });
23385
+ return chunkV5WWQN7P_cjs.handleError(error, "Error resuming agent builder action");
23386
+ } finally {
23387
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23388
+ }
23389
+ }
23390
+ });
23391
+ var RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23392
+ method: "POST",
23393
+ path: "/api/agent-builder/:actionId/resume-stream",
23394
+ responseType: "stream",
23395
+ pathParamSchema: actionIdPathParams,
23396
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23397
+ bodySchema: resumeAgentBuilderBodySchema,
23398
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23399
+ summary: "Resume action stream",
23400
+ description: "Resumes a suspended action execution and continues streaming results",
23401
+ tags: ["Agent Builder"],
23402
+ handler: async (ctx) => {
23403
+ const { mastra, actionId, runId, step, requestContext } = ctx;
23404
+ const logger = mastra.getLogger();
23405
+ try {
23406
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23407
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23408
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23409
+ }
23410
+ logger.info("Resuming agent builder action stream", { actionId, runId, step });
23411
+ return await chunk7WTETKRM_cjs.RESUME_STREAM_WORKFLOW_ROUTE.handler({
23412
+ ...ctx,
23413
+ workflowId: actionId,
23414
+ requestContext
23415
+ });
23416
+ } catch (error) {
23417
+ logger.error("Error resuming agent builder action stream", { error, actionId });
23418
+ return chunkV5WWQN7P_cjs.handleError(error, "Error resuming agent builder action stream");
23419
+ } finally {
23420
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23421
+ }
23422
+ }
23423
+ });
23424
+ var CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23425
+ method: "POST",
23426
+ path: "/api/agent-builder/:actionId/runs/:runId/cancel",
23427
+ responseType: "json",
23428
+ pathParamSchema: actionRunPathParams,
23429
+ responseSchema: chunk7WTETKRM_cjs.workflowControlResponseSchema,
23430
+ summary: "Cancel action run",
23431
+ description: "Cancels an in-progress action execution",
23432
+ tags: ["Agent Builder"],
23433
+ handler: async (ctx) => {
23434
+ const { mastra, actionId, runId } = ctx;
23435
+ const logger = mastra.getLogger();
23436
+ try {
23437
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23438
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23439
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23440
+ }
23441
+ logger.info("Cancelling agent builder action run", { actionId, runId });
23442
+ return await chunk7WTETKRM_cjs.CANCEL_WORKFLOW_RUN_ROUTE.handler({
23443
+ ...ctx,
23444
+ workflowId: actionId
23445
+ });
23446
+ } catch (error) {
23447
+ logger.error("Error cancelling agent builder action run", { error, actionId });
23448
+ return chunkV5WWQN7P_cjs.handleError(error, "Error cancelling agent builder action run");
23449
+ } finally {
23450
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23451
+ }
23452
+ }
23453
+ });
23454
+ var STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23455
+ method: "POST",
23456
+ path: "/api/agent-builder/:actionId/stream-legacy",
23457
+ responseType: "stream",
23458
+ pathParamSchema: actionIdPathParams,
23459
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23460
+ bodySchema: streamLegacyAgentBuilderBodySchema,
23461
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23462
+ summary: "[DEPRECATED] Stream agent-builder action with legacy format",
23463
+ description: "Legacy endpoint for streaming agent-builder action execution. Use /api/agent-builder/:actionId/stream instead.",
23464
+ tags: ["Agent Builder", "Legacy"],
23465
+ handler: async (ctx) => {
23466
+ const { mastra, actionId, runId, requestContext } = ctx;
23467
+ const logger = mastra.getLogger();
23468
+ try {
23469
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23470
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23471
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23472
+ }
23473
+ logger.info("Streaming agent builder action (legacy)", { actionId, runId });
23474
+ return await chunk7WTETKRM_cjs.STREAM_LEGACY_WORKFLOW_ROUTE.handler({
23475
+ ...ctx,
23476
+ workflowId: actionId,
23477
+ requestContext
23478
+ });
23479
+ } catch (error) {
23480
+ logger.error("Error streaming agent builder action (legacy)", { error, actionId });
23481
+ return chunkV5WWQN7P_cjs.handleError(error, "Error streaming agent builder action");
23482
+ } finally {
23483
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23484
+ }
23485
+ }
23486
+ });
23487
+ var OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = chunkUJNHKFBR_cjs.createRoute({
23488
+ method: "POST",
23489
+ path: "/api/agent-builder/:actionId/observe-stream-legacy",
23490
+ responseType: "stream",
23491
+ pathParamSchema: actionIdPathParams,
23492
+ queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
23493
+ responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
23494
+ summary: "[DEPRECATED] Observe agent-builder action stream with legacy format",
23495
+ description: "Legacy endpoint for observing agent-builder action stream. Use /api/agent-builder/:actionId/observe instead.",
23496
+ tags: ["Agent Builder", "Legacy"],
23497
+ handler: async (ctx) => {
23498
+ const { mastra, actionId, runId } = ctx;
23499
+ const logger = mastra.getLogger();
23500
+ try {
23501
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
23502
+ if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
23503
+ throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
23504
+ }
23505
+ logger.info("Observing agent builder action stream (legacy)", { actionId, runId });
23506
+ return await chunk7WTETKRM_cjs.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE.handler({
23507
+ ...ctx,
23508
+ workflowId: actionId
23509
+ });
23510
+ } catch (error) {
23511
+ logger.error("Error observing agent builder action stream (legacy)", { error, actionId });
23512
+ return chunkV5WWQN7P_cjs.handleError(error, "Error observing agent builder action stream");
23513
+ } finally {
23514
+ chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
23515
+ }
23516
+ }
23517
+ });
23052
23518
 
23519
+ exports.CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE;
23520
+ exports.CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE;
23521
+ exports.GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE;
23522
+ exports.GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE;
23523
+ exports.GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE = GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE;
23524
+ exports.LIST_AGENT_BUILDER_ACTIONS_ROUTE = LIST_AGENT_BUILDER_ACTIONS_ROUTE;
23525
+ exports.LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE;
23526
+ exports.OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE;
23527
+ exports.OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
23528
+ exports.OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE;
23529
+ exports.RESUME_AGENT_BUILDER_ACTION_ROUTE = RESUME_AGENT_BUILDER_ACTION_ROUTE;
23530
+ exports.RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE;
23531
+ exports.RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE;
23532
+ exports.START_AGENT_BUILDER_ACTION_RUN_ROUTE = START_AGENT_BUILDER_ACTION_RUN_ROUTE;
23533
+ exports.START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = START_ASYNC_AGENT_BUILDER_ACTION_ROUTE;
23534
+ exports.STREAM_AGENT_BUILDER_ACTION_ROUTE = STREAM_AGENT_BUILDER_ACTION_ROUTE;
23535
+ exports.STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
23536
+ exports.STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE;
23053
23537
  exports.agent_builder_exports = agent_builder_exports;
23054
- exports.cancelAgentBuilderActionRunHandler = cancelAgentBuilderActionRunHandler;
23055
- exports.createAgentBuilderActionRunHandler = createAgentBuilderActionRunHandler;
23056
- exports.getAgentBuilderActionByIdHandler = getAgentBuilderActionByIdHandler;
23057
- exports.getAgentBuilderActionRunByIdHandler = getAgentBuilderActionRunByIdHandler;
23058
- exports.getAgentBuilderActionRunExecutionResultHandler = getAgentBuilderActionRunExecutionResultHandler;
23059
- exports.getAgentBuilderActionRunsHandler = getAgentBuilderActionRunsHandler;
23060
- exports.getAgentBuilderActionsHandler = getAgentBuilderActionsHandler;
23061
- exports.observeStreamAgentBuilderActionHandler = observeStreamAgentBuilderActionHandler;
23062
- exports.observeStreamLegacyAgentBuilderActionHandler = observeStreamLegacyAgentBuilderActionHandler;
23063
- exports.observeStreamVNextAgentBuilderActionHandler = observeStreamVNextAgentBuilderActionHandler;
23064
- exports.resumeAgentBuilderActionHandler = resumeAgentBuilderActionHandler;
23065
- exports.resumeAsyncAgentBuilderActionHandler = resumeAsyncAgentBuilderActionHandler;
23066
- exports.resumeStreamAgentBuilderActionHandler = resumeStreamAgentBuilderActionHandler;
23067
- exports.startAgentBuilderActionRunHandler = startAgentBuilderActionRunHandler;
23068
- exports.startAsyncAgentBuilderActionHandler = startAsyncAgentBuilderActionHandler;
23069
- exports.streamAgentBuilderActionHandler = streamAgentBuilderActionHandler;
23070
- exports.streamLegacyAgentBuilderActionHandler = streamLegacyAgentBuilderActionHandler;
23071
- exports.streamVNextAgentBuilderActionHandler = streamVNextAgentBuilderActionHandler;
23072
- //# sourceMappingURL=chunk-M6KNPIZZ.cjs.map
23073
- //# sourceMappingURL=chunk-M6KNPIZZ.cjs.map
23538
+ //# sourceMappingURL=chunk-BM7RP6NK.cjs.map
23539
+ //# sourceMappingURL=chunk-BM7RP6NK.cjs.map