@mastra/server 0.0.0-fix-9244-clickhouse-metadata-20251105010900 → 0.0.0-fix-ai-sdk-dependency-20251124104209

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