@mastra/server 1.0.0-beta.3 → 1.0.0-beta.5
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.
- package/CHANGELOG.md +28 -0
- package/dist/chunk-2NW6POYK.cjs +89 -0
- package/dist/chunk-2NW6POYK.cjs.map +1 -0
- package/dist/chunk-4JMHKKV3.cjs +201 -0
- package/dist/chunk-4JMHKKV3.cjs.map +1 -0
- package/dist/chunk-4O2QGUW3.js +354 -0
- package/dist/chunk-4O2QGUW3.js.map +1 -0
- package/dist/chunk-4W2SM6CG.js +294 -0
- package/dist/chunk-4W2SM6CG.js.map +1 -0
- package/dist/chunk-5W4RPVTK.cjs +49 -0
- package/dist/chunk-5W4RPVTK.cjs.map +1 -0
- package/dist/chunk-65Q7HO3Q.cjs +907 -0
- package/dist/chunk-65Q7HO3Q.cjs.map +1 -0
- package/dist/chunk-6KNI7VIX.js +1021 -0
- package/dist/chunk-6KNI7VIX.js.map +1 -0
- package/dist/chunk-A6MQQTHN.js +310 -0
- package/dist/chunk-A6MQQTHN.js.map +1 -0
- package/dist/chunk-AUQBEMDP.cjs +322 -0
- package/dist/chunk-AUQBEMDP.cjs.map +1 -0
- package/dist/chunk-CBDUTSTI.js +192 -0
- package/dist/chunk-CBDUTSTI.js.map +1 -0
- package/dist/{chunk-VEVU6EUO.js → chunk-EI2GXZE2.js} +735 -154
- package/dist/chunk-EI2GXZE2.js.map +1 -0
- package/dist/{chunk-TOCYBDP2.js → chunk-ER3QM7DD.js} +4 -4
- package/dist/{chunk-TOCYBDP2.js.map → chunk-ER3QM7DD.js.map} +1 -1
- package/dist/chunk-FCHN5M25.js +878 -0
- package/dist/chunk-FCHN5M25.js.map +1 -0
- package/dist/chunk-FPCGLPLJ.cjs +297 -0
- package/dist/chunk-FPCGLPLJ.cjs.map +1 -0
- package/dist/{chunk-D7T74TVR.js → chunk-G7BPNX2V.js} +4 -3
- package/dist/chunk-G7BPNX2V.js.map +1 -0
- package/dist/chunk-IMK7366C.cjs +346 -0
- package/dist/chunk-IMK7366C.cjs.map +1 -0
- package/dist/chunk-LGG3N3AV.js +116 -0
- package/dist/chunk-LGG3N3AV.js.map +1 -0
- package/dist/chunk-LZDCXQMX.js +164 -0
- package/dist/chunk-LZDCXQMX.js.map +1 -0
- package/dist/chunk-MH3A7RDQ.cjs +1064 -0
- package/dist/chunk-MH3A7RDQ.cjs.map +1 -0
- package/dist/chunk-MWQQRVQC.cjs +259 -0
- package/dist/chunk-MWQQRVQC.cjs.map +1 -0
- package/dist/{chunk-7HVY3D64.cjs → chunk-P6BEEW5J.cjs} +1767 -1183
- package/dist/chunk-P6BEEW5J.cjs.map +1 -0
- package/dist/{chunk-KJIDZQRA.cjs → chunk-PDVJ2TTM.cjs} +216 -23
- package/dist/chunk-PDVJ2TTM.cjs.map +1 -0
- package/dist/chunk-PKRHEXX7.js +74 -0
- package/dist/chunk-PKRHEXX7.js.map +1 -0
- package/dist/chunk-QVHQZUGJ.cjs +368 -0
- package/dist/chunk-QVHQZUGJ.cjs.map +1 -0
- package/dist/chunk-R4M3BSUG.js +226 -0
- package/dist/chunk-R4M3BSUG.js.map +1 -0
- package/dist/chunk-R6ZTXNN2.cjs +797 -0
- package/dist/chunk-R6ZTXNN2.cjs.map +1 -0
- package/dist/{chunk-FPBYKMIS.js → chunk-RCCWKKI3.js} +210 -23
- package/dist/chunk-RCCWKKI3.js.map +1 -0
- package/dist/chunk-S6DFGBDD.cjs +211 -0
- package/dist/chunk-S6DFGBDD.cjs.map +1 -0
- package/dist/chunk-SAQSK4AG.cjs +167 -0
- package/dist/chunk-SAQSK4AG.cjs.map +1 -0
- package/dist/chunk-UCRV7PD3.js +773 -0
- package/dist/chunk-UCRV7PD3.js.map +1 -0
- package/dist/{chunk-W2KMU354.cjs → chunk-UZ6CYAOG.cjs} +4 -3
- package/dist/chunk-UZ6CYAOG.cjs.map +1 -0
- package/dist/{chunk-QU6N55W6.cjs → chunk-V272B7RM.cjs} +11 -12
- package/dist/chunk-V272B7RM.cjs.map +1 -0
- package/dist/{chunk-X6C7BUWN.cjs → chunk-XQPJ63ZD.cjs} +4 -4
- package/dist/{chunk-X6C7BUWN.cjs.map → chunk-XQPJ63ZD.cjs.map} +1 -1
- package/dist/chunk-XWGAT2DA.js +44 -0
- package/dist/chunk-XWGAT2DA.js.map +1 -0
- package/dist/chunk-YLQHE2S5.js +204 -0
- package/dist/chunk-YLQHE2S5.js.map +1 -0
- package/dist/{chunk-SHWNNZBL.js → chunk-YP34EWWK.js} +9 -10
- package/dist/chunk-YP34EWWK.js.map +1 -0
- package/dist/chunk-Z7R7CFVF.cjs +125 -0
- package/dist/chunk-Z7R7CFVF.cjs.map +1 -0
- package/dist/chunk-ZPZSAJAR.js +328 -0
- package/dist/chunk-ZPZSAJAR.js.map +1 -0
- package/dist/server/handlers/a2a.cjs +15 -7
- package/dist/server/handlers/a2a.d.ts +482 -0
- package/dist/server/handlers/a2a.d.ts.map +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +37 -37
- package/dist/server/handlers/agent-builder.d.ts +600 -77
- package/dist/server/handlers/agent-builder.d.ts.map +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agents.cjs +53 -37
- package/dist/server/handlers/agents.d.ts +3271 -128
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/logs.cjs +7 -7
- package/dist/server/handlers/logs.d.ts +135 -27
- package/dist/server/handlers/logs.d.ts.map +1 -1
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +65 -29
- package/dist/server/handlers/memory.d.ts +932 -96
- package/dist/server/handlers/memory.d.ts.map +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/observability.cjs +21 -5
- package/dist/server/handlers/observability.d.ts +119 -12
- package/dist/server/handlers/observability.d.ts.map +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/scores.cjs +13 -13
- package/dist/server/handlers/scores.d.ts +110 -141
- package/dist/server/handlers/scores.d.ts.map +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/test-utils.cjs +15 -0
- package/dist/server/handlers/test-utils.cjs.map +1 -0
- package/dist/server/handlers/test-utils.d.ts +6 -0
- package/dist/server/handlers/test-utils.d.ts.map +1 -0
- package/dist/server/handlers/test-utils.js +13 -0
- package/dist/server/handlers/test-utils.js.map +1 -0
- package/dist/server/handlers/tools.cjs +11 -11
- package/dist/server/handlers/tools.d.ts +69 -23
- package/dist/server/handlers/tools.d.ts.map +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +11 -3
- package/dist/server/handlers/utils.d.ts +5 -0
- package/dist/server/handlers/utils.d.ts.map +1 -1
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vector.cjs +31 -7
- package/dist/server/handlers/vector.d.ts +93 -9
- package/dist/server/handlers/vector.d.ts.map +1 -1
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +21 -9
- package/dist/server/handlers/voice.d.ts +81 -40
- package/dist/server/handlers/voice.d.ts.map +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +65 -37
- package/dist/server/handlers/workflows.d.ts +919 -79
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +22 -22
- package/dist/server/handlers.js +11 -11
- package/dist/server/schemas/a2a.d.ts +786 -0
- package/dist/server/schemas/a2a.d.ts.map +1 -0
- package/dist/server/schemas/agent-builder.d.ts +195 -0
- package/dist/server/schemas/agent-builder.d.ts.map +1 -0
- package/dist/server/schemas/agents.d.ts +1375 -0
- package/dist/server/schemas/agents.d.ts.map +1 -0
- package/dist/server/schemas/common.d.ts +165 -0
- package/dist/server/schemas/common.d.ts.map +1 -0
- package/dist/server/schemas/logs.d.ts +124 -0
- package/dist/server/schemas/logs.d.ts.map +1 -0
- package/dist/server/schemas/memory.d.ts +998 -0
- package/dist/server/schemas/memory.d.ts.map +1 -0
- package/dist/server/schemas/observability.d.ts +402 -0
- package/dist/server/schemas/observability.d.ts.map +1 -0
- package/dist/server/schemas/scores.d.ts +259 -0
- package/dist/server/schemas/scores.d.ts.map +1 -0
- package/dist/server/schemas/vectors.d.ts +107 -0
- package/dist/server/schemas/vectors.d.ts.map +1 -0
- package/dist/server/schemas/workflows.d.ts +608 -0
- package/dist/server/schemas/workflows.d.ts.map +1 -0
- package/dist/server/server-adapter/index.cjs +330 -0
- package/dist/server/server-adapter/index.cjs.map +1 -0
- package/dist/server/server-adapter/index.d.ts +52 -0
- package/dist/server/server-adapter/index.d.ts.map +1 -0
- package/dist/server/server-adapter/index.js +316 -0
- package/dist/server/server-adapter/index.js.map +1 -0
- package/dist/server/server-adapter/openapi-utils.d.ts +59 -0
- package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/a2a.d.ts +3 -0
- package/dist/server/server-adapter/routes/a2a.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/agent-builder.d.ts +3 -0
- package/dist/server/server-adapter/routes/agent-builder.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/agents.d.ts +3 -0
- package/dist/server/server-adapter/routes/agents.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/index.d.ts +41 -0
- package/dist/server/server-adapter/routes/index.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/legacy.d.ts +7 -0
- package/dist/server/server-adapter/routes/legacy.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/logs.d.ts +3 -0
- package/dist/server/server-adapter/routes/logs.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/memory.d.ts +3 -0
- package/dist/server/server-adapter/routes/memory.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/observability.d.ts +3 -0
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/route-builder.d.ts +52 -0
- package/dist/server/server-adapter/routes/route-builder.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/scorers.d.ts +3 -0
- package/dist/server/server-adapter/routes/scorers.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/stream-types.d.ts +10 -0
- package/dist/server/server-adapter/routes/stream-types.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/tools.d.ts +3 -0
- package/dist/server/server-adapter/routes/tools.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/vectors.d.ts +3 -0
- package/dist/server/server-adapter/routes/vectors.d.ts.map +1 -0
- package/dist/server/server-adapter/routes/workflows.d.ts +3 -0
- package/dist/server/server-adapter/routes/workflows.d.ts.map +1 -0
- package/dist/server/utils.d.ts.map +1 -1
- package/dist/token-GVZ7HRD7.js +62 -0
- package/dist/{token-C3IMNCC4.js.map → token-GVZ7HRD7.js.map} +1 -1
- package/dist/{token-C3IMNCC4.js → token-JGA3ZWAN.js} +5 -6
- package/dist/token-JGA3ZWAN.js.map +1 -0
- package/dist/token-VFONFWVS.cjs +64 -0
- package/dist/{token-375W3LEI.cjs.map → token-VFONFWVS.cjs.map} +1 -1
- package/dist/{token-375W3LEI.cjs → token-ZOD6YIQ3.cjs} +7 -8
- package/dist/token-ZOD6YIQ3.cjs.map +1 -0
- package/dist/token-util-7R2ZFIXO.js +7 -0
- package/dist/{token-util-E5QO2RCL.js.map → token-util-7R2ZFIXO.js.map} +1 -1
- package/dist/token-util-BLJZJDBZ.cjs +9 -0
- package/dist/{token-util-CV3RRG6K.cjs.map → token-util-BLJZJDBZ.cjs.map} +1 -1
- package/dist/token-util-VGZUWSNR.cjs +9 -0
- package/dist/token-util-VGZUWSNR.cjs.map +1 -0
- package/dist/token-util-VKTPZLSE.js +7 -0
- package/dist/token-util-VKTPZLSE.js.map +1 -0
- package/package.json +20 -7
- package/dist/chunk-2YZH5PH6.cjs +0 -200
- package/dist/chunk-2YZH5PH6.cjs.map +0 -1
- package/dist/chunk-3AMNUUZF.js +0 -124
- package/dist/chunk-3AMNUUZF.js.map +0 -1
- package/dist/chunk-3F52QCI4.js +0 -192
- package/dist/chunk-3F52QCI4.js.map +0 -1
- package/dist/chunk-73PAWDM5.js +0 -83
- package/dist/chunk-73PAWDM5.js.map +0 -1
- package/dist/chunk-7HVY3D64.cjs.map +0 -1
- package/dist/chunk-A24TSVEZ.cjs +0 -130
- package/dist/chunk-A24TSVEZ.cjs.map +0 -1
- package/dist/chunk-B3Z6J745.js +0 -122
- package/dist/chunk-B3Z6J745.js.map +0 -1
- package/dist/chunk-BTWIR2B7.cjs +0 -28
- package/dist/chunk-BTWIR2B7.cjs.map +0 -1
- package/dist/chunk-D7T74TVR.js.map +0 -1
- package/dist/chunk-EHACNWDL.cjs +0 -681
- package/dist/chunk-EHACNWDL.cjs.map +0 -1
- package/dist/chunk-FPBYKMIS.js.map +0 -1
- package/dist/chunk-GLAZTMX3.cjs +0 -128
- package/dist/chunk-GLAZTMX3.cjs.map +0 -1
- package/dist/chunk-KF3RI45U.cjs +0 -172
- package/dist/chunk-KF3RI45U.cjs.map +0 -1
- package/dist/chunk-KJIDZQRA.cjs.map +0 -1
- package/dist/chunk-KWH5QBXP.js +0 -123
- package/dist/chunk-KWH5QBXP.js.map +0 -1
- package/dist/chunk-ND5OKOMT.js +0 -165
- package/dist/chunk-ND5OKOMT.js.map +0 -1
- package/dist/chunk-PPMIB3FQ.cjs +0 -88
- package/dist/chunk-PPMIB3FQ.cjs.map +0 -1
- package/dist/chunk-QU6N55W6.cjs.map +0 -1
- package/dist/chunk-S54HNARD.cjs +0 -131
- package/dist/chunk-S54HNARD.cjs.map +0 -1
- package/dist/chunk-SHWNNZBL.js.map +0 -1
- package/dist/chunk-SZIFSF4T.js +0 -25
- package/dist/chunk-SZIFSF4T.js.map +0 -1
- package/dist/chunk-U7GLIXYO.cjs +0 -534
- package/dist/chunk-U7GLIXYO.cjs.map +0 -1
- package/dist/chunk-V6JYJS7O.js +0 -518
- package/dist/chunk-V6JYJS7O.js.map +0 -1
- package/dist/chunk-VEVU6EUO.js.map +0 -1
- package/dist/chunk-W2KMU354.cjs.map +0 -1
- package/dist/chunk-X3MICMI2.cjs +0 -620
- package/dist/chunk-X3MICMI2.cjs.map +0 -1
- package/dist/chunk-Z2O5YVHY.js +0 -661
- package/dist/chunk-Z2O5YVHY.js.map +0 -1
- package/dist/chunk-ZJ6KEY6H.js +0 -600
- package/dist/chunk-ZJ6KEY6H.js.map +0 -1
- package/dist/token-util-CV3RRG6K.cjs +0 -9
- package/dist/token-util-E5QO2RCL.js +0 -7
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMH3A7RDQ_cjs = require('./chunk-MH3A7RDQ.cjs');
|
|
4
|
+
var chunkXQPJ63ZD_cjs = require('./chunk-XQPJ63ZD.cjs');
|
|
4
5
|
var chunk2PLXW4ZX_cjs = require('./chunk-2PLXW4ZX.cjs');
|
|
5
6
|
var chunkLPM6BBAX_cjs = require('./chunk-LPM6BBAX.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
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 chunkSAQSK4AG_cjs = require('./chunk-SAQSK4AG.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
|
|
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,11 +48,12 @@ 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
|
-
// ../../node_modules/.pnpm/@vercel+oidc@3.0.
|
|
54
|
+
// ../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js
|
|
49
55
|
var require_get_context = chunkO7I5CWRX_cjs.__commonJS({
|
|
50
|
-
"../../node_modules/.pnpm/@vercel+oidc@3.0.
|
|
56
|
+
"../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports, module) {
|
|
51
57
|
var __defProp6 = Object.defineProperty;
|
|
52
58
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
53
59
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -79,9 +85,9 @@ var require_get_context = chunkO7I5CWRX_cjs.__commonJS({
|
|
|
79
85
|
}
|
|
80
86
|
});
|
|
81
87
|
|
|
82
|
-
// ../../node_modules/.pnpm/@vercel+oidc@3.0.
|
|
88
|
+
// ../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js
|
|
83
89
|
var require_get_vercel_oidc_token = chunkO7I5CWRX_cjs.__commonJS({
|
|
84
|
-
"../../node_modules/.pnpm/@vercel+oidc@3.0.
|
|
90
|
+
"../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports, module) {
|
|
85
91
|
var __defProp6 = Object.defineProperty;
|
|
86
92
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
87
93
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -106,7 +112,7 @@ var require_get_vercel_oidc_token = chunkO7I5CWRX_cjs.__commonJS({
|
|
|
106
112
|
});
|
|
107
113
|
module.exports = __toCommonJS(get_vercel_oidc_token_exports);
|
|
108
114
|
var import_get_context = require_get_context();
|
|
109
|
-
var import_token_error =
|
|
115
|
+
var import_token_error = chunkXQPJ63ZD_cjs.require_token_error();
|
|
110
116
|
async function getVercelOidcToken3() {
|
|
111
117
|
let token = "";
|
|
112
118
|
let err;
|
|
@@ -117,8 +123,8 @@ var require_get_vercel_oidc_token = chunkO7I5CWRX_cjs.__commonJS({
|
|
|
117
123
|
}
|
|
118
124
|
try {
|
|
119
125
|
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
|
|
120
|
-
await import('./token-util-
|
|
121
|
-
await import('./token-
|
|
126
|
+
await import('./token-util-VGZUWSNR.cjs'),
|
|
127
|
+
await import('./token-VFONFWVS.cjs')
|
|
122
128
|
]);
|
|
123
129
|
if (!token || isExpired(getTokenPayload(token))) {
|
|
124
130
|
await refreshToken();
|
|
@@ -145,9 +151,9 @@ ${error.message}`;
|
|
|
145
151
|
}
|
|
146
152
|
});
|
|
147
153
|
|
|
148
|
-
// ../../node_modules/.pnpm/@vercel+oidc@3.0.
|
|
154
|
+
// ../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js
|
|
149
155
|
var require_dist = chunkO7I5CWRX_cjs.__commonJS({
|
|
150
|
-
"../../node_modules/.pnpm/@vercel+oidc@3.0.
|
|
156
|
+
"../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(exports, module) {
|
|
151
157
|
var __defProp6 = Object.defineProperty;
|
|
152
158
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
153
159
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
@@ -737,24 +743,24 @@ var require_ignore = chunkO7I5CWRX_cjs.__commonJS({
|
|
|
737
743
|
// src/server/handlers/agent-builder.ts
|
|
738
744
|
var agent_builder_exports = {};
|
|
739
745
|
chunkO7I5CWRX_cjs.__export(agent_builder_exports, {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
746
|
+
CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE,
|
|
747
|
+
CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE: () => CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE,
|
|
748
|
+
GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE: () => GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE,
|
|
749
|
+
GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE: () => GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE,
|
|
750
|
+
GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE: () => GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE,
|
|
751
|
+
LIST_AGENT_BUILDER_ACTIONS_ROUTE: () => LIST_AGENT_BUILDER_ACTIONS_ROUTE,
|
|
752
|
+
LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE: () => LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE,
|
|
753
|
+
OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE: () => OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE,
|
|
754
|
+
OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE: () => OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE,
|
|
755
|
+
OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE: () => OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE,
|
|
756
|
+
RESUME_AGENT_BUILDER_ACTION_ROUTE: () => RESUME_AGENT_BUILDER_ACTION_ROUTE,
|
|
757
|
+
RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE: () => RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE,
|
|
758
|
+
RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE: () => RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE,
|
|
759
|
+
START_AGENT_BUILDER_ACTION_RUN_ROUTE: () => START_AGENT_BUILDER_ACTION_RUN_ROUTE,
|
|
760
|
+
START_ASYNC_AGENT_BUILDER_ACTION_ROUTE: () => START_ASYNC_AGENT_BUILDER_ACTION_ROUTE,
|
|
761
|
+
STREAM_AGENT_BUILDER_ACTION_ROUTE: () => STREAM_AGENT_BUILDER_ACTION_ROUTE,
|
|
762
|
+
STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE: () => STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE,
|
|
763
|
+
STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE: () => STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE
|
|
758
764
|
});
|
|
759
765
|
|
|
760
766
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
@@ -857,7 +863,7 @@ function parseArrayDef(def, refs) {
|
|
|
857
863
|
const res = {
|
|
858
864
|
type: "array"
|
|
859
865
|
};
|
|
860
|
-
if (def.type?._def && def.type?._def?.typeName !==
|
|
866
|
+
if (def.type?._def && def.type?._def?.typeName !== z19.ZodFirstPartyTypeKind.ZodAny) {
|
|
861
867
|
res.items = parseDef(def.type._def, {
|
|
862
868
|
...refs,
|
|
863
869
|
currentPath: [...refs.currentPath, "items"]
|
|
@@ -1398,7 +1404,7 @@ function parseRecordDef(def, refs) {
|
|
|
1398
1404
|
if (refs.target === "openAi") {
|
|
1399
1405
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
1400
1406
|
}
|
|
1401
|
-
if (refs.target === "openApi3" && def.keyType?._def.typeName ===
|
|
1407
|
+
if (refs.target === "openApi3" && def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
|
|
1402
1408
|
return {
|
|
1403
1409
|
type: "object",
|
|
1404
1410
|
required: def.keyType._def.values,
|
|
@@ -1422,20 +1428,20 @@ function parseRecordDef(def, refs) {
|
|
|
1422
1428
|
if (refs.target === "openApi3") {
|
|
1423
1429
|
return schema;
|
|
1424
1430
|
}
|
|
1425
|
-
if (def.keyType?._def.typeName ===
|
|
1431
|
+
if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
1426
1432
|
const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
|
|
1427
1433
|
return {
|
|
1428
1434
|
...schema,
|
|
1429
1435
|
propertyNames: keyType
|
|
1430
1436
|
};
|
|
1431
|
-
} else if (def.keyType?._def.typeName ===
|
|
1437
|
+
} else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
|
|
1432
1438
|
return {
|
|
1433
1439
|
...schema,
|
|
1434
1440
|
propertyNames: {
|
|
1435
1441
|
enum: def.keyType._def.values
|
|
1436
1442
|
}
|
|
1437
1443
|
};
|
|
1438
|
-
} else if (def.keyType?._def.typeName ===
|
|
1444
|
+
} else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
|
|
1439
1445
|
const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
|
|
1440
1446
|
return {
|
|
1441
1447
|
...schema,
|
|
@@ -1835,73 +1841,73 @@ var parseReadonlyDef = (def, refs) => {
|
|
|
1835
1841
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
1836
1842
|
var selectParser = (def, typeName, refs) => {
|
|
1837
1843
|
switch (typeName) {
|
|
1838
|
-
case
|
|
1844
|
+
case z19.ZodFirstPartyTypeKind.ZodString:
|
|
1839
1845
|
return parseStringDef(def, refs);
|
|
1840
|
-
case
|
|
1846
|
+
case z19.ZodFirstPartyTypeKind.ZodNumber:
|
|
1841
1847
|
return parseNumberDef(def, refs);
|
|
1842
|
-
case
|
|
1848
|
+
case z19.ZodFirstPartyTypeKind.ZodObject:
|
|
1843
1849
|
return parseObjectDef(def, refs);
|
|
1844
|
-
case
|
|
1850
|
+
case z19.ZodFirstPartyTypeKind.ZodBigInt:
|
|
1845
1851
|
return parseBigintDef(def, refs);
|
|
1846
|
-
case
|
|
1852
|
+
case z19.ZodFirstPartyTypeKind.ZodBoolean:
|
|
1847
1853
|
return parseBooleanDef();
|
|
1848
|
-
case
|
|
1854
|
+
case z19.ZodFirstPartyTypeKind.ZodDate:
|
|
1849
1855
|
return parseDateDef(def, refs);
|
|
1850
|
-
case
|
|
1856
|
+
case z19.ZodFirstPartyTypeKind.ZodUndefined:
|
|
1851
1857
|
return parseUndefinedDef(refs);
|
|
1852
|
-
case
|
|
1858
|
+
case z19.ZodFirstPartyTypeKind.ZodNull:
|
|
1853
1859
|
return parseNullDef(refs);
|
|
1854
|
-
case
|
|
1860
|
+
case z19.ZodFirstPartyTypeKind.ZodArray:
|
|
1855
1861
|
return parseArrayDef(def, refs);
|
|
1856
|
-
case
|
|
1857
|
-
case
|
|
1862
|
+
case z19.ZodFirstPartyTypeKind.ZodUnion:
|
|
1863
|
+
case z19.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
|
1858
1864
|
return parseUnionDef(def, refs);
|
|
1859
|
-
case
|
|
1865
|
+
case z19.ZodFirstPartyTypeKind.ZodIntersection:
|
|
1860
1866
|
return parseIntersectionDef(def, refs);
|
|
1861
|
-
case
|
|
1867
|
+
case z19.ZodFirstPartyTypeKind.ZodTuple:
|
|
1862
1868
|
return parseTupleDef(def, refs);
|
|
1863
|
-
case
|
|
1869
|
+
case z19.ZodFirstPartyTypeKind.ZodRecord:
|
|
1864
1870
|
return parseRecordDef(def, refs);
|
|
1865
|
-
case
|
|
1871
|
+
case z19.ZodFirstPartyTypeKind.ZodLiteral:
|
|
1866
1872
|
return parseLiteralDef(def, refs);
|
|
1867
|
-
case
|
|
1873
|
+
case z19.ZodFirstPartyTypeKind.ZodEnum:
|
|
1868
1874
|
return parseEnumDef(def);
|
|
1869
|
-
case
|
|
1875
|
+
case z19.ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
1870
1876
|
return parseNativeEnumDef(def);
|
|
1871
|
-
case
|
|
1877
|
+
case z19.ZodFirstPartyTypeKind.ZodNullable:
|
|
1872
1878
|
return parseNullableDef(def, refs);
|
|
1873
|
-
case
|
|
1879
|
+
case z19.ZodFirstPartyTypeKind.ZodOptional:
|
|
1874
1880
|
return parseOptionalDef(def, refs);
|
|
1875
|
-
case
|
|
1881
|
+
case z19.ZodFirstPartyTypeKind.ZodMap:
|
|
1876
1882
|
return parseMapDef(def, refs);
|
|
1877
|
-
case
|
|
1883
|
+
case z19.ZodFirstPartyTypeKind.ZodSet:
|
|
1878
1884
|
return parseSetDef(def, refs);
|
|
1879
|
-
case
|
|
1885
|
+
case z19.ZodFirstPartyTypeKind.ZodLazy:
|
|
1880
1886
|
return () => def.getter()._def;
|
|
1881
|
-
case
|
|
1887
|
+
case z19.ZodFirstPartyTypeKind.ZodPromise:
|
|
1882
1888
|
return parsePromiseDef(def, refs);
|
|
1883
|
-
case
|
|
1884
|
-
case
|
|
1889
|
+
case z19.ZodFirstPartyTypeKind.ZodNaN:
|
|
1890
|
+
case z19.ZodFirstPartyTypeKind.ZodNever:
|
|
1885
1891
|
return parseNeverDef(refs);
|
|
1886
|
-
case
|
|
1892
|
+
case z19.ZodFirstPartyTypeKind.ZodEffects:
|
|
1887
1893
|
return parseEffectsDef(def, refs);
|
|
1888
|
-
case
|
|
1894
|
+
case z19.ZodFirstPartyTypeKind.ZodAny:
|
|
1889
1895
|
return parseAnyDef(refs);
|
|
1890
|
-
case
|
|
1896
|
+
case z19.ZodFirstPartyTypeKind.ZodUnknown:
|
|
1891
1897
|
return parseUnknownDef(refs);
|
|
1892
|
-
case
|
|
1898
|
+
case z19.ZodFirstPartyTypeKind.ZodDefault:
|
|
1893
1899
|
return parseDefaultDef(def, refs);
|
|
1894
|
-
case
|
|
1900
|
+
case z19.ZodFirstPartyTypeKind.ZodBranded:
|
|
1895
1901
|
return parseBrandedDef(def, refs);
|
|
1896
|
-
case
|
|
1902
|
+
case z19.ZodFirstPartyTypeKind.ZodReadonly:
|
|
1897
1903
|
return parseReadonlyDef(def, refs);
|
|
1898
|
-
case
|
|
1904
|
+
case z19.ZodFirstPartyTypeKind.ZodCatch:
|
|
1899
1905
|
return parseCatchDef(def, refs);
|
|
1900
|
-
case
|
|
1906
|
+
case z19.ZodFirstPartyTypeKind.ZodPipeline:
|
|
1901
1907
|
return parsePipelineDef(def, refs);
|
|
1902
|
-
case
|
|
1903
|
-
case
|
|
1904
|
-
case
|
|
1908
|
+
case z19.ZodFirstPartyTypeKind.ZodFunction:
|
|
1909
|
+
case z19.ZodFirstPartyTypeKind.ZodVoid:
|
|
1910
|
+
case z19.ZodFirstPartyTypeKind.ZodSymbol:
|
|
1905
1911
|
return void 0;
|
|
1906
1912
|
default:
|
|
1907
1913
|
return /* @__PURE__ */ ((_) => void 0)();
|
|
@@ -2038,7 +2044,7 @@ function patchRecordSchemas(schema) {
|
|
|
2038
2044
|
const def = schema._zod?.def;
|
|
2039
2045
|
if (def?.type === "record" && def.keyType && !def.valueType) {
|
|
2040
2046
|
def.valueType = def.keyType;
|
|
2041
|
-
def.keyType =
|
|
2047
|
+
def.keyType = z19.z.string();
|
|
2042
2048
|
}
|
|
2043
2049
|
if (!def) return schema;
|
|
2044
2050
|
if (def.type === "object" && def.shape) {
|
|
@@ -2080,9 +2086,9 @@ function patchRecordSchemas(schema) {
|
|
|
2080
2086
|
}
|
|
2081
2087
|
function zodToJsonSchema2(zodSchema5, target = "jsonSchema7", strategy = "relative") {
|
|
2082
2088
|
const fn = "toJSONSchema";
|
|
2083
|
-
if (fn in
|
|
2089
|
+
if (fn in z19.z) {
|
|
2084
2090
|
patchRecordSchemas(zodSchema5);
|
|
2085
|
-
return
|
|
2091
|
+
return z19.z[fn](zodSchema5, {
|
|
2086
2092
|
unrepresentable: "any",
|
|
2087
2093
|
override: (ctx) => {
|
|
2088
2094
|
const def = ctx.zodSchema?._def || ctx.zodSchema?._zod?.def;
|
|
@@ -4006,11 +4012,11 @@ var NoObjectGeneratedError = class extends chunkLPM6BBAX_cjs.AISDKError {
|
|
|
4006
4012
|
}
|
|
4007
4013
|
};
|
|
4008
4014
|
_a4 = symbol4;
|
|
4009
|
-
var dataContentSchema =
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4015
|
+
var dataContentSchema = z19.z.union([
|
|
4016
|
+
z19.z.string(),
|
|
4017
|
+
z19.z.instanceof(Uint8Array),
|
|
4018
|
+
z19.z.instanceof(ArrayBuffer),
|
|
4019
|
+
z19.z.custom(
|
|
4014
4020
|
// Buffer might not be available in some environments such as CloudFlare:
|
|
4015
4021
|
(value) => {
|
|
4016
4022
|
var _a172, _b8;
|
|
@@ -4019,102 +4025,102 @@ var dataContentSchema = zod.z.union([
|
|
|
4019
4025
|
{ message: "Must be a Buffer" }
|
|
4020
4026
|
)
|
|
4021
4027
|
]);
|
|
4022
|
-
var jsonValueSchema =
|
|
4023
|
-
() =>
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4028
|
+
var jsonValueSchema = z19.z.lazy(
|
|
4029
|
+
() => z19.z.union([
|
|
4030
|
+
z19.z.null(),
|
|
4031
|
+
z19.z.string(),
|
|
4032
|
+
z19.z.number(),
|
|
4033
|
+
z19.z.boolean(),
|
|
4034
|
+
z19.z.record(z19.z.string(), jsonValueSchema),
|
|
4035
|
+
z19.z.array(jsonValueSchema)
|
|
4030
4036
|
])
|
|
4031
4037
|
);
|
|
4032
|
-
var providerMetadataSchema =
|
|
4033
|
-
|
|
4034
|
-
|
|
4038
|
+
var providerMetadataSchema = z19.z.record(
|
|
4039
|
+
z19.z.string(),
|
|
4040
|
+
z19.z.record(z19.z.string(), jsonValueSchema)
|
|
4035
4041
|
);
|
|
4036
|
-
var toolResultContentSchema =
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
type:
|
|
4041
|
-
data:
|
|
4042
|
-
mimeType:
|
|
4042
|
+
var toolResultContentSchema = z19.z.array(
|
|
4043
|
+
z19.z.union([
|
|
4044
|
+
z19.z.object({ type: z19.z.literal("text"), text: z19.z.string() }),
|
|
4045
|
+
z19.z.object({
|
|
4046
|
+
type: z19.z.literal("image"),
|
|
4047
|
+
data: z19.z.string(),
|
|
4048
|
+
mimeType: z19.z.string().optional()
|
|
4043
4049
|
})
|
|
4044
4050
|
])
|
|
4045
4051
|
);
|
|
4046
|
-
var textPartSchema =
|
|
4047
|
-
type:
|
|
4048
|
-
text:
|
|
4052
|
+
var textPartSchema = z19.z.object({
|
|
4053
|
+
type: z19.z.literal("text"),
|
|
4054
|
+
text: z19.z.string(),
|
|
4049
4055
|
providerOptions: providerMetadataSchema.optional(),
|
|
4050
4056
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4051
4057
|
});
|
|
4052
|
-
var imagePartSchema =
|
|
4053
|
-
type:
|
|
4054
|
-
image:
|
|
4055
|
-
mimeType:
|
|
4058
|
+
var imagePartSchema = z19.z.object({
|
|
4059
|
+
type: z19.z.literal("image"),
|
|
4060
|
+
image: z19.z.union([dataContentSchema, z19.z.instanceof(URL)]),
|
|
4061
|
+
mimeType: z19.z.string().optional(),
|
|
4056
4062
|
providerOptions: providerMetadataSchema.optional(),
|
|
4057
4063
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4058
4064
|
});
|
|
4059
|
-
var filePartSchema =
|
|
4060
|
-
type:
|
|
4061
|
-
data:
|
|
4062
|
-
filename:
|
|
4063
|
-
mimeType:
|
|
4065
|
+
var filePartSchema = z19.z.object({
|
|
4066
|
+
type: z19.z.literal("file"),
|
|
4067
|
+
data: z19.z.union([dataContentSchema, z19.z.instanceof(URL)]),
|
|
4068
|
+
filename: z19.z.string().optional(),
|
|
4069
|
+
mimeType: z19.z.string(),
|
|
4064
4070
|
providerOptions: providerMetadataSchema.optional(),
|
|
4065
4071
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4066
4072
|
});
|
|
4067
|
-
var reasoningPartSchema =
|
|
4068
|
-
type:
|
|
4069
|
-
text:
|
|
4073
|
+
var reasoningPartSchema = z19.z.object({
|
|
4074
|
+
type: z19.z.literal("reasoning"),
|
|
4075
|
+
text: z19.z.string(),
|
|
4070
4076
|
providerOptions: providerMetadataSchema.optional(),
|
|
4071
4077
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4072
4078
|
});
|
|
4073
|
-
var redactedReasoningPartSchema =
|
|
4074
|
-
type:
|
|
4075
|
-
data:
|
|
4079
|
+
var redactedReasoningPartSchema = z19.z.object({
|
|
4080
|
+
type: z19.z.literal("redacted-reasoning"),
|
|
4081
|
+
data: z19.z.string(),
|
|
4076
4082
|
providerOptions: providerMetadataSchema.optional(),
|
|
4077
4083
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4078
4084
|
});
|
|
4079
|
-
var toolCallPartSchema =
|
|
4080
|
-
type:
|
|
4081
|
-
toolCallId:
|
|
4082
|
-
toolName:
|
|
4083
|
-
args:
|
|
4085
|
+
var toolCallPartSchema = z19.z.object({
|
|
4086
|
+
type: z19.z.literal("tool-call"),
|
|
4087
|
+
toolCallId: z19.z.string(),
|
|
4088
|
+
toolName: z19.z.string(),
|
|
4089
|
+
args: z19.z.unknown(),
|
|
4084
4090
|
providerOptions: providerMetadataSchema.optional(),
|
|
4085
4091
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4086
4092
|
});
|
|
4087
|
-
var toolResultPartSchema =
|
|
4088
|
-
type:
|
|
4089
|
-
toolCallId:
|
|
4090
|
-
toolName:
|
|
4091
|
-
result:
|
|
4093
|
+
var toolResultPartSchema = z19.z.object({
|
|
4094
|
+
type: z19.z.literal("tool-result"),
|
|
4095
|
+
toolCallId: z19.z.string(),
|
|
4096
|
+
toolName: z19.z.string(),
|
|
4097
|
+
result: z19.z.unknown(),
|
|
4092
4098
|
content: toolResultContentSchema.optional(),
|
|
4093
|
-
isError:
|
|
4099
|
+
isError: z19.z.boolean().optional(),
|
|
4094
4100
|
providerOptions: providerMetadataSchema.optional(),
|
|
4095
4101
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4096
4102
|
});
|
|
4097
|
-
var coreSystemMessageSchema =
|
|
4098
|
-
role:
|
|
4099
|
-
content:
|
|
4103
|
+
var coreSystemMessageSchema = z19.z.object({
|
|
4104
|
+
role: z19.z.literal("system"),
|
|
4105
|
+
content: z19.z.string(),
|
|
4100
4106
|
providerOptions: providerMetadataSchema.optional(),
|
|
4101
4107
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4102
4108
|
});
|
|
4103
|
-
var coreUserMessageSchema =
|
|
4104
|
-
role:
|
|
4105
|
-
content:
|
|
4106
|
-
|
|
4107
|
-
|
|
4109
|
+
var coreUserMessageSchema = z19.z.object({
|
|
4110
|
+
role: z19.z.literal("user"),
|
|
4111
|
+
content: z19.z.union([
|
|
4112
|
+
z19.z.string(),
|
|
4113
|
+
z19.z.array(z19.z.union([textPartSchema, imagePartSchema, filePartSchema]))
|
|
4108
4114
|
]),
|
|
4109
4115
|
providerOptions: providerMetadataSchema.optional(),
|
|
4110
4116
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4111
4117
|
});
|
|
4112
|
-
var coreAssistantMessageSchema =
|
|
4113
|
-
role:
|
|
4114
|
-
content:
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
+
var coreAssistantMessageSchema = z19.z.object({
|
|
4119
|
+
role: z19.z.literal("assistant"),
|
|
4120
|
+
content: z19.z.union([
|
|
4121
|
+
z19.z.string(),
|
|
4122
|
+
z19.z.array(
|
|
4123
|
+
z19.z.union([
|
|
4118
4124
|
textPartSchema,
|
|
4119
4125
|
filePartSchema,
|
|
4120
4126
|
reasoningPartSchema,
|
|
@@ -4126,13 +4132,13 @@ var coreAssistantMessageSchema = zod.z.object({
|
|
|
4126
4132
|
providerOptions: providerMetadataSchema.optional(),
|
|
4127
4133
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4128
4134
|
});
|
|
4129
|
-
var coreToolMessageSchema =
|
|
4130
|
-
role:
|
|
4131
|
-
content:
|
|
4135
|
+
var coreToolMessageSchema = z19.z.object({
|
|
4136
|
+
role: z19.z.literal("tool"),
|
|
4137
|
+
content: z19.z.array(toolResultPartSchema),
|
|
4132
4138
|
providerOptions: providerMetadataSchema.optional(),
|
|
4133
4139
|
experimental_providerMetadata: providerMetadataSchema.optional()
|
|
4134
4140
|
});
|
|
4135
|
-
|
|
4141
|
+
z19.z.union([
|
|
4136
4142
|
coreSystemMessageSchema,
|
|
4137
4143
|
coreUserMessageSchema,
|
|
4138
4144
|
coreAssistantMessageSchema,
|
|
@@ -4342,125 +4348,125 @@ chunkLPM6BBAX_cjs.createIdGenerator({
|
|
|
4342
4348
|
prefix: "msg",
|
|
4343
4349
|
size: 24
|
|
4344
4350
|
});
|
|
4345
|
-
var ClientOrServerImplementationSchema =
|
|
4346
|
-
name:
|
|
4347
|
-
version:
|
|
4351
|
+
var ClientOrServerImplementationSchema = z19.z.object({
|
|
4352
|
+
name: z19.z.string(),
|
|
4353
|
+
version: z19.z.string()
|
|
4348
4354
|
}).passthrough();
|
|
4349
|
-
var BaseParamsSchema =
|
|
4350
|
-
_meta:
|
|
4355
|
+
var BaseParamsSchema = z19.z.object({
|
|
4356
|
+
_meta: z19.z.optional(z19.z.object({}).passthrough())
|
|
4351
4357
|
}).passthrough();
|
|
4352
4358
|
var ResultSchema = BaseParamsSchema;
|
|
4353
|
-
var RequestSchema =
|
|
4354
|
-
method:
|
|
4355
|
-
params:
|
|
4359
|
+
var RequestSchema = z19.z.object({
|
|
4360
|
+
method: z19.z.string(),
|
|
4361
|
+
params: z19.z.optional(BaseParamsSchema)
|
|
4356
4362
|
});
|
|
4357
|
-
var ServerCapabilitiesSchema =
|
|
4358
|
-
experimental:
|
|
4359
|
-
logging:
|
|
4360
|
-
prompts:
|
|
4361
|
-
|
|
4362
|
-
listChanged:
|
|
4363
|
+
var ServerCapabilitiesSchema = z19.z.object({
|
|
4364
|
+
experimental: z19.z.optional(z19.z.object({}).passthrough()),
|
|
4365
|
+
logging: z19.z.optional(z19.z.object({}).passthrough()),
|
|
4366
|
+
prompts: z19.z.optional(
|
|
4367
|
+
z19.z.object({
|
|
4368
|
+
listChanged: z19.z.optional(z19.z.boolean())
|
|
4363
4369
|
}).passthrough()
|
|
4364
4370
|
),
|
|
4365
|
-
resources:
|
|
4366
|
-
|
|
4367
|
-
subscribe:
|
|
4368
|
-
listChanged:
|
|
4371
|
+
resources: z19.z.optional(
|
|
4372
|
+
z19.z.object({
|
|
4373
|
+
subscribe: z19.z.optional(z19.z.boolean()),
|
|
4374
|
+
listChanged: z19.z.optional(z19.z.boolean())
|
|
4369
4375
|
}).passthrough()
|
|
4370
4376
|
),
|
|
4371
|
-
tools:
|
|
4372
|
-
|
|
4373
|
-
listChanged:
|
|
4377
|
+
tools: z19.z.optional(
|
|
4378
|
+
z19.z.object({
|
|
4379
|
+
listChanged: z19.z.optional(z19.z.boolean())
|
|
4374
4380
|
}).passthrough()
|
|
4375
4381
|
)
|
|
4376
4382
|
}).passthrough();
|
|
4377
4383
|
ResultSchema.extend({
|
|
4378
|
-
protocolVersion:
|
|
4384
|
+
protocolVersion: z19.z.string(),
|
|
4379
4385
|
capabilities: ServerCapabilitiesSchema,
|
|
4380
4386
|
serverInfo: ClientOrServerImplementationSchema,
|
|
4381
|
-
instructions:
|
|
4387
|
+
instructions: z19.z.optional(z19.z.string())
|
|
4382
4388
|
});
|
|
4383
4389
|
var PaginatedResultSchema = ResultSchema.extend({
|
|
4384
|
-
nextCursor:
|
|
4390
|
+
nextCursor: z19.z.optional(z19.z.string())
|
|
4385
4391
|
});
|
|
4386
|
-
var ToolSchema =
|
|
4387
|
-
name:
|
|
4388
|
-
description:
|
|
4389
|
-
inputSchema:
|
|
4390
|
-
type:
|
|
4391
|
-
properties:
|
|
4392
|
+
var ToolSchema = z19.z.object({
|
|
4393
|
+
name: z19.z.string(),
|
|
4394
|
+
description: z19.z.optional(z19.z.string()),
|
|
4395
|
+
inputSchema: z19.z.object({
|
|
4396
|
+
type: z19.z.literal("object"),
|
|
4397
|
+
properties: z19.z.optional(z19.z.object({}).passthrough())
|
|
4392
4398
|
}).passthrough()
|
|
4393
4399
|
}).passthrough();
|
|
4394
4400
|
PaginatedResultSchema.extend({
|
|
4395
|
-
tools:
|
|
4401
|
+
tools: z19.z.array(ToolSchema)
|
|
4396
4402
|
});
|
|
4397
|
-
var TextContentSchema =
|
|
4398
|
-
type:
|
|
4399
|
-
text:
|
|
4403
|
+
var TextContentSchema = z19.z.object({
|
|
4404
|
+
type: z19.z.literal("text"),
|
|
4405
|
+
text: z19.z.string()
|
|
4400
4406
|
}).passthrough();
|
|
4401
|
-
var ImageContentSchema =
|
|
4402
|
-
type:
|
|
4403
|
-
data:
|
|
4404
|
-
mimeType:
|
|
4407
|
+
var ImageContentSchema = z19.z.object({
|
|
4408
|
+
type: z19.z.literal("image"),
|
|
4409
|
+
data: z19.z.string().base64(),
|
|
4410
|
+
mimeType: z19.z.string()
|
|
4405
4411
|
}).passthrough();
|
|
4406
|
-
var ResourceContentsSchema =
|
|
4412
|
+
var ResourceContentsSchema = z19.z.object({
|
|
4407
4413
|
/**
|
|
4408
4414
|
* The URI of this resource.
|
|
4409
4415
|
*/
|
|
4410
|
-
uri:
|
|
4416
|
+
uri: z19.z.string(),
|
|
4411
4417
|
/**
|
|
4412
4418
|
* The MIME type of this resource, if known.
|
|
4413
4419
|
*/
|
|
4414
|
-
mimeType:
|
|
4420
|
+
mimeType: z19.z.optional(z19.z.string())
|
|
4415
4421
|
}).passthrough();
|
|
4416
4422
|
var TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
4417
|
-
text:
|
|
4423
|
+
text: z19.z.string()
|
|
4418
4424
|
});
|
|
4419
4425
|
var BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
4420
|
-
blob:
|
|
4426
|
+
blob: z19.z.string().base64()
|
|
4421
4427
|
});
|
|
4422
|
-
var EmbeddedResourceSchema =
|
|
4423
|
-
type:
|
|
4424
|
-
resource:
|
|
4428
|
+
var EmbeddedResourceSchema = z19.z.object({
|
|
4429
|
+
type: z19.z.literal("resource"),
|
|
4430
|
+
resource: z19.z.union([TextResourceContentsSchema, BlobResourceContentsSchema])
|
|
4425
4431
|
}).passthrough();
|
|
4426
4432
|
ResultSchema.extend({
|
|
4427
|
-
content:
|
|
4428
|
-
|
|
4433
|
+
content: z19.z.array(
|
|
4434
|
+
z19.z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])
|
|
4429
4435
|
),
|
|
4430
|
-
isError:
|
|
4436
|
+
isError: z19.z.boolean().default(false).optional()
|
|
4431
4437
|
}).or(
|
|
4432
4438
|
ResultSchema.extend({
|
|
4433
|
-
toolResult:
|
|
4439
|
+
toolResult: z19.z.unknown()
|
|
4434
4440
|
})
|
|
4435
4441
|
);
|
|
4436
4442
|
var JSONRPC_VERSION = "2.0";
|
|
4437
|
-
var JSONRPCRequestSchema =
|
|
4438
|
-
jsonrpc:
|
|
4439
|
-
id:
|
|
4443
|
+
var JSONRPCRequestSchema = z19.z.object({
|
|
4444
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION),
|
|
4445
|
+
id: z19.z.union([z19.z.string(), z19.z.number().int()])
|
|
4440
4446
|
}).merge(RequestSchema).strict();
|
|
4441
|
-
var JSONRPCResponseSchema =
|
|
4442
|
-
jsonrpc:
|
|
4443
|
-
id:
|
|
4447
|
+
var JSONRPCResponseSchema = z19.z.object({
|
|
4448
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION),
|
|
4449
|
+
id: z19.z.union([z19.z.string(), z19.z.number().int()]),
|
|
4444
4450
|
result: ResultSchema
|
|
4445
4451
|
}).strict();
|
|
4446
|
-
var JSONRPCErrorSchema =
|
|
4447
|
-
jsonrpc:
|
|
4448
|
-
id:
|
|
4449
|
-
error:
|
|
4450
|
-
code:
|
|
4451
|
-
message:
|
|
4452
|
-
data:
|
|
4452
|
+
var JSONRPCErrorSchema = z19.z.object({
|
|
4453
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION),
|
|
4454
|
+
id: z19.z.union([z19.z.string(), z19.z.number().int()]),
|
|
4455
|
+
error: z19.z.object({
|
|
4456
|
+
code: z19.z.number().int(),
|
|
4457
|
+
message: z19.z.string(),
|
|
4458
|
+
data: z19.z.optional(z19.z.unknown())
|
|
4453
4459
|
})
|
|
4454
4460
|
}).strict();
|
|
4455
|
-
var JSONRPCNotificationSchema =
|
|
4456
|
-
jsonrpc:
|
|
4461
|
+
var JSONRPCNotificationSchema = z19.z.object({
|
|
4462
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION)
|
|
4457
4463
|
}).merge(
|
|
4458
|
-
|
|
4459
|
-
method:
|
|
4460
|
-
params:
|
|
4464
|
+
z19.z.object({
|
|
4465
|
+
method: z19.z.string(),
|
|
4466
|
+
params: z19.z.optional(BaseParamsSchema)
|
|
4461
4467
|
})
|
|
4462
4468
|
).strict();
|
|
4463
|
-
|
|
4469
|
+
z19.z.union([
|
|
4464
4470
|
JSONRPCRequestSchema,
|
|
4465
4471
|
JSONRPCNotificationSchema,
|
|
4466
4472
|
JSONRPCResponseSchema,
|
|
@@ -10038,26 +10044,26 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10038
10044
|
}
|
|
10039
10045
|
if (schema.const !== void 0) {
|
|
10040
10046
|
if (typeof schema.const === "string") {
|
|
10041
|
-
return addMetadata(
|
|
10047
|
+
return addMetadata(z19.z.literal(schema.const), schema);
|
|
10042
10048
|
} else if (typeof schema.const === "number") {
|
|
10043
|
-
return addMetadata(
|
|
10049
|
+
return addMetadata(z19.z.literal(schema.const), schema);
|
|
10044
10050
|
} else if (typeof schema.const === "boolean") {
|
|
10045
|
-
return addMetadata(
|
|
10051
|
+
return addMetadata(z19.z.literal(schema.const), schema);
|
|
10046
10052
|
} else if (schema.const === null) {
|
|
10047
|
-
return addMetadata(
|
|
10053
|
+
return addMetadata(z19.z.null(), schema);
|
|
10048
10054
|
}
|
|
10049
|
-
return addMetadata(
|
|
10055
|
+
return addMetadata(z19.z.literal(schema.const), schema);
|
|
10050
10056
|
}
|
|
10051
10057
|
if (schema.type) {
|
|
10052
10058
|
switch (schema.type) {
|
|
10053
10059
|
case "string": {
|
|
10054
10060
|
if (schema.enum) {
|
|
10055
10061
|
if (schema.enum.length === 0) {
|
|
10056
|
-
return addMetadata(
|
|
10062
|
+
return addMetadata(z19.z.string(), schema);
|
|
10057
10063
|
}
|
|
10058
|
-
return addMetadata(
|
|
10064
|
+
return addMetadata(z19.z.enum(schema.enum), schema);
|
|
10059
10065
|
}
|
|
10060
|
-
let stringSchema =
|
|
10066
|
+
let stringSchema = z19.z.string();
|
|
10061
10067
|
if (schema.minLength !== void 0) {
|
|
10062
10068
|
stringSchema = stringSchema.min(schema.minLength);
|
|
10063
10069
|
}
|
|
@@ -10074,18 +10080,18 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10074
10080
|
case "integer": {
|
|
10075
10081
|
if (schema.enum) {
|
|
10076
10082
|
if (schema.enum.length === 0) {
|
|
10077
|
-
return addMetadata(
|
|
10083
|
+
return addMetadata(z19.z.number(), schema);
|
|
10078
10084
|
}
|
|
10079
|
-
const options = schema.enum.map((val) =>
|
|
10085
|
+
const options = schema.enum.map((val) => z19.z.literal(val));
|
|
10080
10086
|
if (options.length === 1) {
|
|
10081
10087
|
return addMetadata(options[0], schema);
|
|
10082
10088
|
}
|
|
10083
10089
|
if (options.length >= 2) {
|
|
10084
|
-
const unionSchema =
|
|
10090
|
+
const unionSchema = z19.z.union([options[0], options[1], ...options.slice(2)]);
|
|
10085
10091
|
return addMetadata(unionSchema, schema);
|
|
10086
10092
|
}
|
|
10087
10093
|
}
|
|
10088
|
-
let numberSchema = schema.type === "integer" ?
|
|
10094
|
+
let numberSchema = schema.type === "integer" ? z19.z.number().int() : z19.z.number();
|
|
10089
10095
|
if (schema.minimum !== void 0) {
|
|
10090
10096
|
numberSchema = numberSchema.min(schema.minimum);
|
|
10091
10097
|
}
|
|
@@ -10106,20 +10112,20 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10106
10112
|
case "boolean":
|
|
10107
10113
|
if (schema.enum) {
|
|
10108
10114
|
if (schema.enum.length === 0) {
|
|
10109
|
-
return addMetadata(
|
|
10115
|
+
return addMetadata(z19.z.boolean(), schema);
|
|
10110
10116
|
}
|
|
10111
|
-
const options = schema.enum.map((val) =>
|
|
10117
|
+
const options = schema.enum.map((val) => z19.z.literal(val));
|
|
10112
10118
|
if (options.length === 1) {
|
|
10113
10119
|
return addMetadata(options[0], schema);
|
|
10114
10120
|
}
|
|
10115
10121
|
if (options.length >= 2) {
|
|
10116
|
-
const unionSchema =
|
|
10122
|
+
const unionSchema = z19.z.union([options[0], options[1], ...options.slice(2)]);
|
|
10117
10123
|
return addMetadata(unionSchema, schema);
|
|
10118
10124
|
}
|
|
10119
10125
|
}
|
|
10120
|
-
return addMetadata(
|
|
10126
|
+
return addMetadata(z19.z.boolean(), schema);
|
|
10121
10127
|
case "null":
|
|
10122
|
-
return addMetadata(
|
|
10128
|
+
return addMetadata(z19.z.null(), schema);
|
|
10123
10129
|
case "object":
|
|
10124
10130
|
if (schema.properties) {
|
|
10125
10131
|
const shape = {};
|
|
@@ -10142,19 +10148,19 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10142
10148
|
}
|
|
10143
10149
|
let zodSchema5;
|
|
10144
10150
|
if (schema.additionalProperties !== false) {
|
|
10145
|
-
zodSchema5 =
|
|
10151
|
+
zodSchema5 = z19.z.object(shape).passthrough();
|
|
10146
10152
|
} else {
|
|
10147
|
-
zodSchema5 =
|
|
10153
|
+
zodSchema5 = z19.z.object(shape);
|
|
10148
10154
|
}
|
|
10149
10155
|
return addMetadata(zodSchema5, schema);
|
|
10150
10156
|
}
|
|
10151
|
-
return addMetadata(
|
|
10157
|
+
return addMetadata(z19.z.object({}), schema);
|
|
10152
10158
|
case "array": {
|
|
10153
10159
|
let arraySchema;
|
|
10154
10160
|
if (schema.items) {
|
|
10155
|
-
arraySchema =
|
|
10161
|
+
arraySchema = z19.z.array(convertJsonSchemaToZod2(schema.items));
|
|
10156
10162
|
} else {
|
|
10157
|
-
arraySchema =
|
|
10163
|
+
arraySchema = z19.z.array(z19.z.any());
|
|
10158
10164
|
}
|
|
10159
10165
|
if (schema.minItems !== void 0) {
|
|
10160
10166
|
arraySchema = arraySchema.min(schema.minItems);
|
|
@@ -10187,18 +10193,18 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10187
10193
|
}
|
|
10188
10194
|
if (schema.enum) {
|
|
10189
10195
|
if (schema.enum.length === 0) {
|
|
10190
|
-
return addMetadata(
|
|
10196
|
+
return addMetadata(z19.z.never(), schema);
|
|
10191
10197
|
}
|
|
10192
10198
|
const allStrings = schema.enum.every((val) => typeof val === "string");
|
|
10193
10199
|
if (allStrings) {
|
|
10194
|
-
return addMetadata(
|
|
10200
|
+
return addMetadata(z19.z.enum(schema.enum), schema);
|
|
10195
10201
|
} else {
|
|
10196
|
-
const options = schema.enum.map((val) =>
|
|
10202
|
+
const options = schema.enum.map((val) => z19.z.literal(val));
|
|
10197
10203
|
if (options.length === 1) {
|
|
10198
10204
|
return addMetadata(options[0], schema);
|
|
10199
10205
|
}
|
|
10200
10206
|
if (options.length >= 2) {
|
|
10201
|
-
const unionSchema =
|
|
10207
|
+
const unionSchema = z19.z.union([options[0], options[1], ...options.slice(2)]);
|
|
10202
10208
|
return addMetadata(unionSchema, schema);
|
|
10203
10209
|
}
|
|
10204
10210
|
}
|
|
@@ -10206,15 +10212,15 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10206
10212
|
if (schema.anyOf && schema.anyOf.length >= 2) {
|
|
10207
10213
|
const schemas = schema.anyOf.map(convertJsonSchemaToZod2);
|
|
10208
10214
|
return addMetadata(
|
|
10209
|
-
|
|
10215
|
+
z19.z.union([schemas[0], schemas[1], ...schemas.slice(2)]),
|
|
10210
10216
|
schema
|
|
10211
10217
|
);
|
|
10212
10218
|
}
|
|
10213
10219
|
if (schema.allOf) {
|
|
10214
10220
|
return addMetadata(
|
|
10215
10221
|
schema.allOf.reduce(
|
|
10216
|
-
(acc, s) =>
|
|
10217
|
-
|
|
10222
|
+
(acc, s) => z19.z.intersection(acc, convertJsonSchemaToZod2(s)),
|
|
10223
|
+
z19.z.object({})
|
|
10218
10224
|
),
|
|
10219
10225
|
schema
|
|
10220
10226
|
);
|
|
@@ -10222,11 +10228,11 @@ function convertJsonSchemaToZod2(schema) {
|
|
|
10222
10228
|
if (schema.oneOf && schema.oneOf.length >= 2) {
|
|
10223
10229
|
const schemas = schema.oneOf.map(convertJsonSchemaToZod2);
|
|
10224
10230
|
return addMetadata(
|
|
10225
|
-
|
|
10231
|
+
z19.z.union([schemas[0], schemas[1], ...schemas.slice(2)]),
|
|
10226
10232
|
schema
|
|
10227
10233
|
);
|
|
10228
10234
|
}
|
|
10229
|
-
return addMetadata(
|
|
10235
|
+
return addMetadata(z19.z.any(), schema);
|
|
10230
10236
|
}
|
|
10231
10237
|
var __create = Object.create;
|
|
10232
10238
|
var __defProp3 = Object.defineProperty;
|
|
@@ -10685,7 +10691,7 @@ function parseArrayDef3(def, refs) {
|
|
|
10685
10691
|
const res = {
|
|
10686
10692
|
type: "array"
|
|
10687
10693
|
};
|
|
10688
|
-
if (def.type?._def && def.type?._def?.typeName !==
|
|
10694
|
+
if (def.type?._def && def.type?._def?.typeName !== z19.ZodFirstPartyTypeKind.ZodAny) {
|
|
10689
10695
|
res.items = parseDef3(def.type._def, {
|
|
10690
10696
|
...refs,
|
|
10691
10697
|
currentPath: [...refs.currentPath, "items"]
|
|
@@ -11202,7 +11208,7 @@ function parseRecordDef3(def, refs) {
|
|
|
11202
11208
|
if (refs.target === "openAi") {
|
|
11203
11209
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
11204
11210
|
}
|
|
11205
|
-
if (refs.target === "openApi3" && def.keyType?._def.typeName ===
|
|
11211
|
+
if (refs.target === "openApi3" && def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
|
|
11206
11212
|
return {
|
|
11207
11213
|
type: "object",
|
|
11208
11214
|
required: def.keyType._def.values,
|
|
@@ -11226,20 +11232,20 @@ function parseRecordDef3(def, refs) {
|
|
|
11226
11232
|
if (refs.target === "openApi3") {
|
|
11227
11233
|
return schema;
|
|
11228
11234
|
}
|
|
11229
|
-
if (def.keyType?._def.typeName ===
|
|
11235
|
+
if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
11230
11236
|
const { type, ...keyType } = parseStringDef3(def.keyType._def, refs);
|
|
11231
11237
|
return {
|
|
11232
11238
|
...schema,
|
|
11233
11239
|
propertyNames: keyType
|
|
11234
11240
|
};
|
|
11235
|
-
} else if (def.keyType?._def.typeName ===
|
|
11241
|
+
} else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodEnum) {
|
|
11236
11242
|
return {
|
|
11237
11243
|
...schema,
|
|
11238
11244
|
propertyNames: {
|
|
11239
11245
|
enum: def.keyType._def.values
|
|
11240
11246
|
}
|
|
11241
11247
|
};
|
|
11242
|
-
} else if (def.keyType?._def.typeName ===
|
|
11248
|
+
} else if (def.keyType?._def.typeName === z19.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === z19.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
|
|
11243
11249
|
const { type, ...keyType } = parseBrandedDef3(def.keyType._def, refs);
|
|
11244
11250
|
return {
|
|
11245
11251
|
...schema,
|
|
@@ -11605,73 +11611,73 @@ var parseReadonlyDef3 = (def, refs) => {
|
|
|
11605
11611
|
};
|
|
11606
11612
|
var selectParser3 = (def, typeName, refs) => {
|
|
11607
11613
|
switch (typeName) {
|
|
11608
|
-
case
|
|
11614
|
+
case z19.ZodFirstPartyTypeKind.ZodString:
|
|
11609
11615
|
return parseStringDef3(def, refs);
|
|
11610
|
-
case
|
|
11616
|
+
case z19.ZodFirstPartyTypeKind.ZodNumber:
|
|
11611
11617
|
return parseNumberDef3(def, refs);
|
|
11612
|
-
case
|
|
11618
|
+
case z19.ZodFirstPartyTypeKind.ZodObject:
|
|
11613
11619
|
return parseObjectDef3(def, refs);
|
|
11614
|
-
case
|
|
11620
|
+
case z19.ZodFirstPartyTypeKind.ZodBigInt:
|
|
11615
11621
|
return parseBigintDef3(def, refs);
|
|
11616
|
-
case
|
|
11622
|
+
case z19.ZodFirstPartyTypeKind.ZodBoolean:
|
|
11617
11623
|
return parseBooleanDef3();
|
|
11618
|
-
case
|
|
11624
|
+
case z19.ZodFirstPartyTypeKind.ZodDate:
|
|
11619
11625
|
return parseDateDef3(def, refs);
|
|
11620
|
-
case
|
|
11626
|
+
case z19.ZodFirstPartyTypeKind.ZodUndefined:
|
|
11621
11627
|
return parseUndefinedDef3(refs);
|
|
11622
|
-
case
|
|
11628
|
+
case z19.ZodFirstPartyTypeKind.ZodNull:
|
|
11623
11629
|
return parseNullDef3(refs);
|
|
11624
|
-
case
|
|
11630
|
+
case z19.ZodFirstPartyTypeKind.ZodArray:
|
|
11625
11631
|
return parseArrayDef3(def, refs);
|
|
11626
|
-
case
|
|
11627
|
-
case
|
|
11632
|
+
case z19.ZodFirstPartyTypeKind.ZodUnion:
|
|
11633
|
+
case z19.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
|
11628
11634
|
return parseUnionDef3(def, refs);
|
|
11629
|
-
case
|
|
11635
|
+
case z19.ZodFirstPartyTypeKind.ZodIntersection:
|
|
11630
11636
|
return parseIntersectionDef3(def, refs);
|
|
11631
|
-
case
|
|
11637
|
+
case z19.ZodFirstPartyTypeKind.ZodTuple:
|
|
11632
11638
|
return parseTupleDef3(def, refs);
|
|
11633
|
-
case
|
|
11639
|
+
case z19.ZodFirstPartyTypeKind.ZodRecord:
|
|
11634
11640
|
return parseRecordDef3(def, refs);
|
|
11635
|
-
case
|
|
11641
|
+
case z19.ZodFirstPartyTypeKind.ZodLiteral:
|
|
11636
11642
|
return parseLiteralDef3(def, refs);
|
|
11637
|
-
case
|
|
11643
|
+
case z19.ZodFirstPartyTypeKind.ZodEnum:
|
|
11638
11644
|
return parseEnumDef3(def);
|
|
11639
|
-
case
|
|
11645
|
+
case z19.ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
11640
11646
|
return parseNativeEnumDef3(def);
|
|
11641
|
-
case
|
|
11647
|
+
case z19.ZodFirstPartyTypeKind.ZodNullable:
|
|
11642
11648
|
return parseNullableDef3(def, refs);
|
|
11643
|
-
case
|
|
11649
|
+
case z19.ZodFirstPartyTypeKind.ZodOptional:
|
|
11644
11650
|
return parseOptionalDef3(def, refs);
|
|
11645
|
-
case
|
|
11651
|
+
case z19.ZodFirstPartyTypeKind.ZodMap:
|
|
11646
11652
|
return parseMapDef3(def, refs);
|
|
11647
|
-
case
|
|
11653
|
+
case z19.ZodFirstPartyTypeKind.ZodSet:
|
|
11648
11654
|
return parseSetDef3(def, refs);
|
|
11649
|
-
case
|
|
11655
|
+
case z19.ZodFirstPartyTypeKind.ZodLazy:
|
|
11650
11656
|
return () => def.getter()._def;
|
|
11651
|
-
case
|
|
11657
|
+
case z19.ZodFirstPartyTypeKind.ZodPromise:
|
|
11652
11658
|
return parsePromiseDef3(def, refs);
|
|
11653
|
-
case
|
|
11654
|
-
case
|
|
11659
|
+
case z19.ZodFirstPartyTypeKind.ZodNaN:
|
|
11660
|
+
case z19.ZodFirstPartyTypeKind.ZodNever:
|
|
11655
11661
|
return parseNeverDef3(refs);
|
|
11656
|
-
case
|
|
11662
|
+
case z19.ZodFirstPartyTypeKind.ZodEffects:
|
|
11657
11663
|
return parseEffectsDef3(def, refs);
|
|
11658
|
-
case
|
|
11664
|
+
case z19.ZodFirstPartyTypeKind.ZodAny:
|
|
11659
11665
|
return parseAnyDef3(refs);
|
|
11660
|
-
case
|
|
11666
|
+
case z19.ZodFirstPartyTypeKind.ZodUnknown:
|
|
11661
11667
|
return parseUnknownDef3(refs);
|
|
11662
|
-
case
|
|
11668
|
+
case z19.ZodFirstPartyTypeKind.ZodDefault:
|
|
11663
11669
|
return parseDefaultDef3(def, refs);
|
|
11664
|
-
case
|
|
11670
|
+
case z19.ZodFirstPartyTypeKind.ZodBranded:
|
|
11665
11671
|
return parseBrandedDef3(def, refs);
|
|
11666
|
-
case
|
|
11672
|
+
case z19.ZodFirstPartyTypeKind.ZodReadonly:
|
|
11667
11673
|
return parseReadonlyDef3(def, refs);
|
|
11668
|
-
case
|
|
11674
|
+
case z19.ZodFirstPartyTypeKind.ZodCatch:
|
|
11669
11675
|
return parseCatchDef3(def, refs);
|
|
11670
|
-
case
|
|
11676
|
+
case z19.ZodFirstPartyTypeKind.ZodPipeline:
|
|
11671
11677
|
return parsePipelineDef3(def, refs);
|
|
11672
|
-
case
|
|
11673
|
-
case
|
|
11674
|
-
case
|
|
11678
|
+
case z19.ZodFirstPartyTypeKind.ZodFunction:
|
|
11679
|
+
case z19.ZodFirstPartyTypeKind.ZodVoid:
|
|
11680
|
+
case z19.ZodFirstPartyTypeKind.ZodSymbol:
|
|
11675
11681
|
return void 0;
|
|
11676
11682
|
default:
|
|
11677
11683
|
return /* @__PURE__ */ ((_) => void 0)();
|
|
@@ -13169,11 +13175,11 @@ var NoObjectGeneratedError3 = class extends AISDKError3 {
|
|
|
13169
13175
|
}
|
|
13170
13176
|
};
|
|
13171
13177
|
_a422 = symbol422;
|
|
13172
|
-
var dataContentSchema3 =
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13178
|
+
var dataContentSchema3 = z19.z.union([
|
|
13179
|
+
z19.z.string(),
|
|
13180
|
+
z19.z.instanceof(Uint8Array),
|
|
13181
|
+
z19.z.instanceof(ArrayBuffer),
|
|
13182
|
+
z19.z.custom(
|
|
13177
13183
|
// Buffer might not be available in some environments such as CloudFlare:
|
|
13178
13184
|
(value) => {
|
|
13179
13185
|
var _a172, _b8;
|
|
@@ -13182,102 +13188,102 @@ var dataContentSchema3 = zod.z.union([
|
|
|
13182
13188
|
{ message: "Must be a Buffer" }
|
|
13183
13189
|
)
|
|
13184
13190
|
]);
|
|
13185
|
-
var jsonValueSchema3 =
|
|
13186
|
-
() =>
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13191
|
+
var jsonValueSchema3 = z19.z.lazy(
|
|
13192
|
+
() => z19.z.union([
|
|
13193
|
+
z19.z.null(),
|
|
13194
|
+
z19.z.string(),
|
|
13195
|
+
z19.z.number(),
|
|
13196
|
+
z19.z.boolean(),
|
|
13197
|
+
z19.z.record(z19.z.string(), jsonValueSchema3),
|
|
13198
|
+
z19.z.array(jsonValueSchema3)
|
|
13193
13199
|
])
|
|
13194
13200
|
);
|
|
13195
|
-
var providerMetadataSchema3 =
|
|
13196
|
-
|
|
13197
|
-
|
|
13201
|
+
var providerMetadataSchema3 = z19.z.record(
|
|
13202
|
+
z19.z.string(),
|
|
13203
|
+
z19.z.record(z19.z.string(), jsonValueSchema3)
|
|
13198
13204
|
);
|
|
13199
|
-
var toolResultContentSchema2 =
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
type:
|
|
13204
|
-
data:
|
|
13205
|
-
mimeType:
|
|
13205
|
+
var toolResultContentSchema2 = z19.z.array(
|
|
13206
|
+
z19.z.union([
|
|
13207
|
+
z19.z.object({ type: z19.z.literal("text"), text: z19.z.string() }),
|
|
13208
|
+
z19.z.object({
|
|
13209
|
+
type: z19.z.literal("image"),
|
|
13210
|
+
data: z19.z.string(),
|
|
13211
|
+
mimeType: z19.z.string().optional()
|
|
13206
13212
|
})
|
|
13207
13213
|
])
|
|
13208
13214
|
);
|
|
13209
|
-
var textPartSchema3 =
|
|
13210
|
-
type:
|
|
13211
|
-
text:
|
|
13215
|
+
var textPartSchema3 = z19.z.object({
|
|
13216
|
+
type: z19.z.literal("text"),
|
|
13217
|
+
text: z19.z.string(),
|
|
13212
13218
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13213
13219
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13214
13220
|
});
|
|
13215
|
-
var imagePartSchema3 =
|
|
13216
|
-
type:
|
|
13217
|
-
image:
|
|
13218
|
-
mimeType:
|
|
13221
|
+
var imagePartSchema3 = z19.z.object({
|
|
13222
|
+
type: z19.z.literal("image"),
|
|
13223
|
+
image: z19.z.union([dataContentSchema3, z19.z.instanceof(URL)]),
|
|
13224
|
+
mimeType: z19.z.string().optional(),
|
|
13219
13225
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13220
13226
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13221
13227
|
});
|
|
13222
|
-
var filePartSchema3 =
|
|
13223
|
-
type:
|
|
13224
|
-
data:
|
|
13225
|
-
filename:
|
|
13226
|
-
mimeType:
|
|
13228
|
+
var filePartSchema3 = z19.z.object({
|
|
13229
|
+
type: z19.z.literal("file"),
|
|
13230
|
+
data: z19.z.union([dataContentSchema3, z19.z.instanceof(URL)]),
|
|
13231
|
+
filename: z19.z.string().optional(),
|
|
13232
|
+
mimeType: z19.z.string(),
|
|
13227
13233
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13228
13234
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13229
13235
|
});
|
|
13230
|
-
var reasoningPartSchema3 =
|
|
13231
|
-
type:
|
|
13232
|
-
text:
|
|
13236
|
+
var reasoningPartSchema3 = z19.z.object({
|
|
13237
|
+
type: z19.z.literal("reasoning"),
|
|
13238
|
+
text: z19.z.string(),
|
|
13233
13239
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13234
13240
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13235
13241
|
});
|
|
13236
|
-
var redactedReasoningPartSchema2 =
|
|
13237
|
-
type:
|
|
13238
|
-
data:
|
|
13242
|
+
var redactedReasoningPartSchema2 = z19.z.object({
|
|
13243
|
+
type: z19.z.literal("redacted-reasoning"),
|
|
13244
|
+
data: z19.z.string(),
|
|
13239
13245
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13240
13246
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13241
13247
|
});
|
|
13242
|
-
var toolCallPartSchema3 =
|
|
13243
|
-
type:
|
|
13244
|
-
toolCallId:
|
|
13245
|
-
toolName:
|
|
13246
|
-
args:
|
|
13248
|
+
var toolCallPartSchema3 = z19.z.object({
|
|
13249
|
+
type: z19.z.literal("tool-call"),
|
|
13250
|
+
toolCallId: z19.z.string(),
|
|
13251
|
+
toolName: z19.z.string(),
|
|
13252
|
+
args: z19.z.unknown(),
|
|
13247
13253
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13248
13254
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13249
13255
|
});
|
|
13250
|
-
var toolResultPartSchema3 =
|
|
13251
|
-
type:
|
|
13252
|
-
toolCallId:
|
|
13253
|
-
toolName:
|
|
13254
|
-
result:
|
|
13256
|
+
var toolResultPartSchema3 = z19.z.object({
|
|
13257
|
+
type: z19.z.literal("tool-result"),
|
|
13258
|
+
toolCallId: z19.z.string(),
|
|
13259
|
+
toolName: z19.z.string(),
|
|
13260
|
+
result: z19.z.unknown(),
|
|
13255
13261
|
content: toolResultContentSchema2.optional(),
|
|
13256
|
-
isError:
|
|
13262
|
+
isError: z19.z.boolean().optional(),
|
|
13257
13263
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13258
13264
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13259
13265
|
});
|
|
13260
|
-
var coreSystemMessageSchema2 =
|
|
13261
|
-
role:
|
|
13262
|
-
content:
|
|
13266
|
+
var coreSystemMessageSchema2 = z19.z.object({
|
|
13267
|
+
role: z19.z.literal("system"),
|
|
13268
|
+
content: z19.z.string(),
|
|
13263
13269
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13264
13270
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13265
13271
|
});
|
|
13266
|
-
var coreUserMessageSchema2 =
|
|
13267
|
-
role:
|
|
13268
|
-
content:
|
|
13269
|
-
|
|
13270
|
-
|
|
13272
|
+
var coreUserMessageSchema2 = z19.z.object({
|
|
13273
|
+
role: z19.z.literal("user"),
|
|
13274
|
+
content: z19.z.union([
|
|
13275
|
+
z19.z.string(),
|
|
13276
|
+
z19.z.array(z19.z.union([textPartSchema3, imagePartSchema3, filePartSchema3]))
|
|
13271
13277
|
]),
|
|
13272
13278
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13273
13279
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13274
13280
|
});
|
|
13275
|
-
var coreAssistantMessageSchema2 =
|
|
13276
|
-
role:
|
|
13277
|
-
content:
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
+
var coreAssistantMessageSchema2 = z19.z.object({
|
|
13282
|
+
role: z19.z.literal("assistant"),
|
|
13283
|
+
content: z19.z.union([
|
|
13284
|
+
z19.z.string(),
|
|
13285
|
+
z19.z.array(
|
|
13286
|
+
z19.z.union([
|
|
13281
13287
|
textPartSchema3,
|
|
13282
13288
|
filePartSchema3,
|
|
13283
13289
|
reasoningPartSchema3,
|
|
@@ -13289,13 +13295,13 @@ var coreAssistantMessageSchema2 = zod.z.object({
|
|
|
13289
13295
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13290
13296
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13291
13297
|
});
|
|
13292
|
-
var coreToolMessageSchema2 =
|
|
13293
|
-
role:
|
|
13294
|
-
content:
|
|
13298
|
+
var coreToolMessageSchema2 = z19.z.object({
|
|
13299
|
+
role: z19.z.literal("tool"),
|
|
13300
|
+
content: z19.z.array(toolResultPartSchema3),
|
|
13295
13301
|
providerOptions: providerMetadataSchema3.optional(),
|
|
13296
13302
|
experimental_providerMetadata: providerMetadataSchema3.optional()
|
|
13297
13303
|
});
|
|
13298
|
-
|
|
13304
|
+
z19.z.union([
|
|
13299
13305
|
coreSystemMessageSchema2,
|
|
13300
13306
|
coreUserMessageSchema2,
|
|
13301
13307
|
coreAssistantMessageSchema2,
|
|
@@ -13505,125 +13511,125 @@ createIdGenerator3({
|
|
|
13505
13511
|
prefix: "msg",
|
|
13506
13512
|
size: 24
|
|
13507
13513
|
});
|
|
13508
|
-
var ClientOrServerImplementationSchema3 =
|
|
13509
|
-
name:
|
|
13510
|
-
version:
|
|
13514
|
+
var ClientOrServerImplementationSchema3 = z19.z.object({
|
|
13515
|
+
name: z19.z.string(),
|
|
13516
|
+
version: z19.z.string()
|
|
13511
13517
|
}).passthrough();
|
|
13512
|
-
var BaseParamsSchema3 =
|
|
13513
|
-
_meta:
|
|
13518
|
+
var BaseParamsSchema3 = z19.z.object({
|
|
13519
|
+
_meta: z19.z.optional(z19.z.object({}).passthrough())
|
|
13514
13520
|
}).passthrough();
|
|
13515
13521
|
var ResultSchema3 = BaseParamsSchema3;
|
|
13516
|
-
var RequestSchema3 =
|
|
13517
|
-
method:
|
|
13518
|
-
params:
|
|
13522
|
+
var RequestSchema3 = z19.z.object({
|
|
13523
|
+
method: z19.z.string(),
|
|
13524
|
+
params: z19.z.optional(BaseParamsSchema3)
|
|
13519
13525
|
});
|
|
13520
|
-
var ServerCapabilitiesSchema3 =
|
|
13521
|
-
experimental:
|
|
13522
|
-
logging:
|
|
13523
|
-
prompts:
|
|
13524
|
-
|
|
13525
|
-
listChanged:
|
|
13526
|
+
var ServerCapabilitiesSchema3 = z19.z.object({
|
|
13527
|
+
experimental: z19.z.optional(z19.z.object({}).passthrough()),
|
|
13528
|
+
logging: z19.z.optional(z19.z.object({}).passthrough()),
|
|
13529
|
+
prompts: z19.z.optional(
|
|
13530
|
+
z19.z.object({
|
|
13531
|
+
listChanged: z19.z.optional(z19.z.boolean())
|
|
13526
13532
|
}).passthrough()
|
|
13527
13533
|
),
|
|
13528
|
-
resources:
|
|
13529
|
-
|
|
13530
|
-
subscribe:
|
|
13531
|
-
listChanged:
|
|
13534
|
+
resources: z19.z.optional(
|
|
13535
|
+
z19.z.object({
|
|
13536
|
+
subscribe: z19.z.optional(z19.z.boolean()),
|
|
13537
|
+
listChanged: z19.z.optional(z19.z.boolean())
|
|
13532
13538
|
}).passthrough()
|
|
13533
13539
|
),
|
|
13534
|
-
tools:
|
|
13535
|
-
|
|
13536
|
-
listChanged:
|
|
13540
|
+
tools: z19.z.optional(
|
|
13541
|
+
z19.z.object({
|
|
13542
|
+
listChanged: z19.z.optional(z19.z.boolean())
|
|
13537
13543
|
}).passthrough()
|
|
13538
13544
|
)
|
|
13539
13545
|
}).passthrough();
|
|
13540
13546
|
ResultSchema3.extend({
|
|
13541
|
-
protocolVersion:
|
|
13547
|
+
protocolVersion: z19.z.string(),
|
|
13542
13548
|
capabilities: ServerCapabilitiesSchema3,
|
|
13543
13549
|
serverInfo: ClientOrServerImplementationSchema3,
|
|
13544
|
-
instructions:
|
|
13550
|
+
instructions: z19.z.optional(z19.z.string())
|
|
13545
13551
|
});
|
|
13546
13552
|
var PaginatedResultSchema3 = ResultSchema3.extend({
|
|
13547
|
-
nextCursor:
|
|
13553
|
+
nextCursor: z19.z.optional(z19.z.string())
|
|
13548
13554
|
});
|
|
13549
|
-
var ToolSchema3 =
|
|
13550
|
-
name:
|
|
13551
|
-
description:
|
|
13552
|
-
inputSchema:
|
|
13553
|
-
type:
|
|
13554
|
-
properties:
|
|
13555
|
+
var ToolSchema3 = z19.z.object({
|
|
13556
|
+
name: z19.z.string(),
|
|
13557
|
+
description: z19.z.optional(z19.z.string()),
|
|
13558
|
+
inputSchema: z19.z.object({
|
|
13559
|
+
type: z19.z.literal("object"),
|
|
13560
|
+
properties: z19.z.optional(z19.z.object({}).passthrough())
|
|
13555
13561
|
}).passthrough()
|
|
13556
13562
|
}).passthrough();
|
|
13557
13563
|
PaginatedResultSchema3.extend({
|
|
13558
|
-
tools:
|
|
13564
|
+
tools: z19.z.array(ToolSchema3)
|
|
13559
13565
|
});
|
|
13560
|
-
var TextContentSchema3 =
|
|
13561
|
-
type:
|
|
13562
|
-
text:
|
|
13566
|
+
var TextContentSchema3 = z19.z.object({
|
|
13567
|
+
type: z19.z.literal("text"),
|
|
13568
|
+
text: z19.z.string()
|
|
13563
13569
|
}).passthrough();
|
|
13564
|
-
var ImageContentSchema3 =
|
|
13565
|
-
type:
|
|
13566
|
-
data:
|
|
13567
|
-
mimeType:
|
|
13570
|
+
var ImageContentSchema3 = z19.z.object({
|
|
13571
|
+
type: z19.z.literal("image"),
|
|
13572
|
+
data: z19.z.string().base64(),
|
|
13573
|
+
mimeType: z19.z.string()
|
|
13568
13574
|
}).passthrough();
|
|
13569
|
-
var ResourceContentsSchema3 =
|
|
13575
|
+
var ResourceContentsSchema3 = z19.z.object({
|
|
13570
13576
|
/**
|
|
13571
13577
|
* The URI of this resource.
|
|
13572
13578
|
*/
|
|
13573
|
-
uri:
|
|
13579
|
+
uri: z19.z.string(),
|
|
13574
13580
|
/**
|
|
13575
13581
|
* The MIME type of this resource, if known.
|
|
13576
13582
|
*/
|
|
13577
|
-
mimeType:
|
|
13583
|
+
mimeType: z19.z.optional(z19.z.string())
|
|
13578
13584
|
}).passthrough();
|
|
13579
13585
|
var TextResourceContentsSchema3 = ResourceContentsSchema3.extend({
|
|
13580
|
-
text:
|
|
13586
|
+
text: z19.z.string()
|
|
13581
13587
|
});
|
|
13582
13588
|
var BlobResourceContentsSchema3 = ResourceContentsSchema3.extend({
|
|
13583
|
-
blob:
|
|
13589
|
+
blob: z19.z.string().base64()
|
|
13584
13590
|
});
|
|
13585
|
-
var EmbeddedResourceSchema3 =
|
|
13586
|
-
type:
|
|
13587
|
-
resource:
|
|
13591
|
+
var EmbeddedResourceSchema3 = z19.z.object({
|
|
13592
|
+
type: z19.z.literal("resource"),
|
|
13593
|
+
resource: z19.z.union([TextResourceContentsSchema3, BlobResourceContentsSchema3])
|
|
13588
13594
|
}).passthrough();
|
|
13589
13595
|
ResultSchema3.extend({
|
|
13590
|
-
content:
|
|
13591
|
-
|
|
13596
|
+
content: z19.z.array(
|
|
13597
|
+
z19.z.union([TextContentSchema3, ImageContentSchema3, EmbeddedResourceSchema3])
|
|
13592
13598
|
),
|
|
13593
|
-
isError:
|
|
13599
|
+
isError: z19.z.boolean().default(false).optional()
|
|
13594
13600
|
}).or(
|
|
13595
13601
|
ResultSchema3.extend({
|
|
13596
|
-
toolResult:
|
|
13602
|
+
toolResult: z19.z.unknown()
|
|
13597
13603
|
})
|
|
13598
13604
|
);
|
|
13599
13605
|
var JSONRPC_VERSION3 = "2.0";
|
|
13600
|
-
var JSONRPCRequestSchema3 =
|
|
13601
|
-
jsonrpc:
|
|
13602
|
-
id:
|
|
13606
|
+
var JSONRPCRequestSchema3 = z19.z.object({
|
|
13607
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION3),
|
|
13608
|
+
id: z19.z.union([z19.z.string(), z19.z.number().int()])
|
|
13603
13609
|
}).merge(RequestSchema3).strict();
|
|
13604
|
-
var JSONRPCResponseSchema3 =
|
|
13605
|
-
jsonrpc:
|
|
13606
|
-
id:
|
|
13610
|
+
var JSONRPCResponseSchema3 = z19.z.object({
|
|
13611
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION3),
|
|
13612
|
+
id: z19.z.union([z19.z.string(), z19.z.number().int()]),
|
|
13607
13613
|
result: ResultSchema3
|
|
13608
13614
|
}).strict();
|
|
13609
|
-
var JSONRPCErrorSchema3 =
|
|
13610
|
-
jsonrpc:
|
|
13611
|
-
id:
|
|
13612
|
-
error:
|
|
13613
|
-
code:
|
|
13614
|
-
message:
|
|
13615
|
-
data:
|
|
13615
|
+
var JSONRPCErrorSchema3 = z19.z.object({
|
|
13616
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION3),
|
|
13617
|
+
id: z19.z.union([z19.z.string(), z19.z.number().int()]),
|
|
13618
|
+
error: z19.z.object({
|
|
13619
|
+
code: z19.z.number().int(),
|
|
13620
|
+
message: z19.z.string(),
|
|
13621
|
+
data: z19.z.optional(z19.z.unknown())
|
|
13616
13622
|
})
|
|
13617
13623
|
}).strict();
|
|
13618
|
-
var JSONRPCNotificationSchema3 =
|
|
13619
|
-
jsonrpc:
|
|
13624
|
+
var JSONRPCNotificationSchema3 = z19.z.object({
|
|
13625
|
+
jsonrpc: z19.z.literal(JSONRPC_VERSION3)
|
|
13620
13626
|
}).merge(
|
|
13621
|
-
|
|
13622
|
-
method:
|
|
13623
|
-
params:
|
|
13627
|
+
z19.z.object({
|
|
13628
|
+
method: z19.z.string(),
|
|
13629
|
+
params: z19.z.optional(BaseParamsSchema3)
|
|
13624
13630
|
})
|
|
13625
13631
|
).strict();
|
|
13626
|
-
|
|
13632
|
+
z19.z.union([
|
|
13627
13633
|
JSONRPCRequestSchema3,
|
|
13628
13634
|
JSONRPCNotificationSchema3,
|
|
13629
13635
|
JSONRPCResponseSchema3,
|
|
@@ -13795,7 +13801,7 @@ function convertSchemaToZod(schema) {
|
|
|
13795
13801
|
} else {
|
|
13796
13802
|
const jsonSchemaToConvert = "jsonSchema" in schema ? schema.jsonSchema : schema;
|
|
13797
13803
|
try {
|
|
13798
|
-
if ("toJSONSchema" in
|
|
13804
|
+
if ("toJSONSchema" in z19.z) {
|
|
13799
13805
|
return convertJsonSchemaToZod(jsonSchemaToConvert);
|
|
13800
13806
|
} else {
|
|
13801
13807
|
return convertJsonSchemaToZod2(jsonSchemaToConvert);
|
|
@@ -13812,12 +13818,12 @@ ${e2.stack}` : "\nUnknown error object"));
|
|
|
13812
13818
|
// ../memory/dist/index.js
|
|
13813
13819
|
var updateWorkingMemoryTool = (memoryConfig) => {
|
|
13814
13820
|
const schema = memoryConfig?.workingMemory?.schema;
|
|
13815
|
-
let inputSchema =
|
|
13816
|
-
memory:
|
|
13821
|
+
let inputSchema = z19.z.object({
|
|
13822
|
+
memory: z19.z.string().describe(`The Markdown formatted working memory content to store. This MUST be a string. Never pass an object.`)
|
|
13817
13823
|
});
|
|
13818
13824
|
if (schema) {
|
|
13819
|
-
inputSchema =
|
|
13820
|
-
memory: schema instanceof
|
|
13825
|
+
inputSchema = z19.z.object({
|
|
13826
|
+
memory: schema instanceof z19.ZodObject ? schema : convertSchemaToZod({ jsonSchema: schema }).describe(
|
|
13821
13827
|
`The JSON formatted working memory content to store.`
|
|
13822
13828
|
)
|
|
13823
13829
|
});
|
|
@@ -13859,14 +13865,14 @@ var __experimental_updateWorkingMemoryToolVNext = (config) => {
|
|
|
13859
13865
|
return tools.createTool({
|
|
13860
13866
|
id: "update-working-memory",
|
|
13861
13867
|
description: "Update the working memory with new information.",
|
|
13862
|
-
inputSchema:
|
|
13863
|
-
newMemory:
|
|
13868
|
+
inputSchema: z19.z.object({
|
|
13869
|
+
newMemory: z19.z.string().optional().describe(
|
|
13864
13870
|
`The ${config.workingMemory?.schema ? "JSON" : "Markdown"} formatted working memory content to store`
|
|
13865
13871
|
),
|
|
13866
|
-
searchString:
|
|
13872
|
+
searchString: z19.z.string().optional().describe(
|
|
13867
13873
|
"The working memory string to find. Will be replaced with the newMemory string. If this is omitted or doesn't exist, the newMemory string will be appended to the end of your working memory. Replacing single lines at a time is encouraged for greater accuracy. If updateReason is not 'append-new-memory', this search string must be provided or the tool call will be rejected."
|
|
13868
13874
|
),
|
|
13869
|
-
updateReason:
|
|
13875
|
+
updateReason: z19.z.enum(["append-new-memory", "clarify-existing-memory", "replace-irrelevant-memory"]).optional().describe(
|
|
13870
13876
|
"The reason you're updating working memory. Passing any value other than 'append-new-memory' requires a searchString to be provided. Defaults to append-new-memory"
|
|
13871
13877
|
)
|
|
13872
13878
|
}),
|
|
@@ -13919,7 +13925,7 @@ var __experimental_updateWorkingMemoryToolVNext = (config) => {
|
|
|
13919
13925
|
var CHARS_PER_TOKEN = 4;
|
|
13920
13926
|
var DEFAULT_MESSAGE_RANGE = { before: 1, after: 1 };
|
|
13921
13927
|
var DEFAULT_TOP_K = 4;
|
|
13922
|
-
var isZodObject = (v) => v instanceof
|
|
13928
|
+
var isZodObject = (v) => v instanceof z19.ZodObject;
|
|
13923
13929
|
var Memory = class extends memory.MastraMemory {
|
|
13924
13930
|
constructor(config = {}) {
|
|
13925
13931
|
super({ name: "Memory", ...config });
|
|
@@ -14932,11 +14938,7 @@ function filter2(obj) {
|
|
|
14932
14938
|
}
|
|
14933
14939
|
function secureJsonParse2(text5) {
|
|
14934
14940
|
const { stackTraceLimit } = Error;
|
|
14935
|
-
|
|
14936
|
-
Error.stackTraceLimit = 0;
|
|
14937
|
-
} catch (e2) {
|
|
14938
|
-
return _parse2(text5);
|
|
14939
|
-
}
|
|
14941
|
+
Error.stackTraceLimit = 0;
|
|
14940
14942
|
try {
|
|
14941
14943
|
return _parse2(text5);
|
|
14942
14944
|
} finally {
|
|
@@ -16165,13 +16167,13 @@ function asSchema4(schema) {
|
|
|
16165
16167
|
}
|
|
16166
16168
|
var __defProp5 = Object.defineProperty;
|
|
16167
16169
|
var __export5 = (target, all) => {
|
|
16168
|
-
for (var
|
|
16169
|
-
__defProp5(target,
|
|
16170
|
+
for (var name172 in all)
|
|
16171
|
+
__defProp5(target, name172, { get: all[name172], enumerable: true });
|
|
16170
16172
|
};
|
|
16171
|
-
var
|
|
16172
|
-
var
|
|
16173
|
-
var
|
|
16174
|
-
var
|
|
16173
|
+
var name74 = "AI_NoObjectGeneratedError";
|
|
16174
|
+
var marker76 = `vercel.ai.error.${name74}`;
|
|
16175
|
+
var symbol76 = Symbol.for(marker76);
|
|
16176
|
+
var _a76;
|
|
16175
16177
|
var NoObjectGeneratedError4 = class extends AISDKError2 {
|
|
16176
16178
|
constructor({
|
|
16177
16179
|
message = "No object generated.",
|
|
@@ -16181,18 +16183,18 @@ var NoObjectGeneratedError4 = class extends AISDKError2 {
|
|
|
16181
16183
|
usage,
|
|
16182
16184
|
finishReason
|
|
16183
16185
|
}) {
|
|
16184
|
-
super({ name:
|
|
16185
|
-
this[
|
|
16186
|
+
super({ name: name74, message, cause });
|
|
16187
|
+
this[_a76] = true;
|
|
16186
16188
|
this.text = text22;
|
|
16187
16189
|
this.response = response;
|
|
16188
16190
|
this.usage = usage;
|
|
16189
16191
|
this.finishReason = finishReason;
|
|
16190
16192
|
}
|
|
16191
16193
|
static isInstance(error) {
|
|
16192
|
-
return AISDKError2.hasMarker(error,
|
|
16194
|
+
return AISDKError2.hasMarker(error, marker76);
|
|
16193
16195
|
}
|
|
16194
16196
|
};
|
|
16195
|
-
|
|
16197
|
+
_a76 = symbol76;
|
|
16196
16198
|
var dataContentSchema4 = z42.z.union([
|
|
16197
16199
|
z42.z.string(),
|
|
16198
16200
|
z42.z.instanceof(Uint8Array),
|
|
@@ -16200,8 +16202,8 @@ var dataContentSchema4 = z42.z.union([
|
|
|
16200
16202
|
z42.z.custom(
|
|
16201
16203
|
// Buffer might not be available in some environments such as CloudFlare:
|
|
16202
16204
|
(value) => {
|
|
16203
|
-
var
|
|
16204
|
-
return (_b8 = (
|
|
16205
|
+
var _a172, _b8;
|
|
16206
|
+
return (_b8 = (_a172 = globalThis.Buffer) == null ? void 0 : _a172.isBuffer(value)) != null ? _b8 : false;
|
|
16205
16207
|
},
|
|
16206
16208
|
{ message: "Must be a Buffer" }
|
|
16207
16209
|
)
|
|
@@ -16750,195 +16752,319 @@ var object4 = ({
|
|
|
16750
16752
|
}
|
|
16751
16753
|
};
|
|
16752
16754
|
};
|
|
16755
|
+
var ClientOrServerImplementationSchema4 = z42.z.looseObject({
|
|
16756
|
+
name: z42.z.string(),
|
|
16757
|
+
version: z42.z.string()
|
|
16758
|
+
});
|
|
16759
|
+
var BaseParamsSchema4 = z42.z.looseObject({
|
|
16760
|
+
_meta: z42.z.optional(z42.z.object({}).loose())
|
|
16761
|
+
});
|
|
16762
|
+
var ResultSchema4 = BaseParamsSchema4;
|
|
16763
|
+
var RequestSchema4 = z42.z.object({
|
|
16764
|
+
method: z42.z.string(),
|
|
16765
|
+
params: z42.z.optional(BaseParamsSchema4)
|
|
16766
|
+
});
|
|
16767
|
+
var ServerCapabilitiesSchema4 = z42.z.looseObject({
|
|
16768
|
+
experimental: z42.z.optional(z42.z.object({}).loose()),
|
|
16769
|
+
logging: z42.z.optional(z42.z.object({}).loose()),
|
|
16770
|
+
prompts: z42.z.optional(
|
|
16771
|
+
z42.z.looseObject({
|
|
16772
|
+
listChanged: z42.z.optional(z42.z.boolean())
|
|
16773
|
+
})
|
|
16774
|
+
),
|
|
16775
|
+
resources: z42.z.optional(
|
|
16776
|
+
z42.z.looseObject({
|
|
16777
|
+
subscribe: z42.z.optional(z42.z.boolean()),
|
|
16778
|
+
listChanged: z42.z.optional(z42.z.boolean())
|
|
16779
|
+
})
|
|
16780
|
+
),
|
|
16781
|
+
tools: z42.z.optional(
|
|
16782
|
+
z42.z.looseObject({
|
|
16783
|
+
listChanged: z42.z.optional(z42.z.boolean())
|
|
16784
|
+
})
|
|
16785
|
+
)
|
|
16786
|
+
});
|
|
16787
|
+
ResultSchema4.extend({
|
|
16788
|
+
protocolVersion: z42.z.string(),
|
|
16789
|
+
capabilities: ServerCapabilitiesSchema4,
|
|
16790
|
+
serverInfo: ClientOrServerImplementationSchema4,
|
|
16791
|
+
instructions: z42.z.optional(z42.z.string())
|
|
16792
|
+
});
|
|
16793
|
+
var PaginatedResultSchema4 = ResultSchema4.extend({
|
|
16794
|
+
nextCursor: z42.z.optional(z42.z.string())
|
|
16795
|
+
});
|
|
16796
|
+
var ToolSchema4 = z42.z.object({
|
|
16797
|
+
name: z42.z.string(),
|
|
16798
|
+
description: z42.z.optional(z42.z.string()),
|
|
16799
|
+
inputSchema: z42.z.object({
|
|
16800
|
+
type: z42.z.literal("object"),
|
|
16801
|
+
properties: z42.z.optional(z42.z.object({}).loose())
|
|
16802
|
+
}).loose()
|
|
16803
|
+
}).loose();
|
|
16804
|
+
PaginatedResultSchema4.extend({
|
|
16805
|
+
tools: z42.z.array(ToolSchema4)
|
|
16806
|
+
});
|
|
16807
|
+
var TextContentSchema4 = z42.z.object({
|
|
16808
|
+
type: z42.z.literal("text"),
|
|
16809
|
+
text: z42.z.string()
|
|
16810
|
+
}).loose();
|
|
16811
|
+
var ImageContentSchema4 = z42.z.object({
|
|
16812
|
+
type: z42.z.literal("image"),
|
|
16813
|
+
data: z42.z.base64(),
|
|
16814
|
+
mimeType: z42.z.string()
|
|
16815
|
+
}).loose();
|
|
16816
|
+
var ResourceContentsSchema4 = z42.z.object({
|
|
16817
|
+
/**
|
|
16818
|
+
* The URI of this resource.
|
|
16819
|
+
*/
|
|
16820
|
+
uri: z42.z.string(),
|
|
16821
|
+
/**
|
|
16822
|
+
* The MIME type of this resource, if known.
|
|
16823
|
+
*/
|
|
16824
|
+
mimeType: z42.z.optional(z42.z.string())
|
|
16825
|
+
}).loose();
|
|
16826
|
+
var TextResourceContentsSchema4 = ResourceContentsSchema4.extend({
|
|
16827
|
+
text: z42.z.string()
|
|
16828
|
+
});
|
|
16829
|
+
var BlobResourceContentsSchema4 = ResourceContentsSchema4.extend({
|
|
16830
|
+
blob: z42.z.base64()
|
|
16831
|
+
});
|
|
16832
|
+
var EmbeddedResourceSchema4 = z42.z.object({
|
|
16833
|
+
type: z42.z.literal("resource"),
|
|
16834
|
+
resource: z42.z.union([TextResourceContentsSchema4, BlobResourceContentsSchema4])
|
|
16835
|
+
}).loose();
|
|
16836
|
+
ResultSchema4.extend({
|
|
16837
|
+
content: z42.z.array(
|
|
16838
|
+
z42.z.union([TextContentSchema4, ImageContentSchema4, EmbeddedResourceSchema4])
|
|
16839
|
+
),
|
|
16840
|
+
isError: z42.z.boolean().default(false).optional()
|
|
16841
|
+
}).or(
|
|
16842
|
+
ResultSchema4.extend({
|
|
16843
|
+
toolResult: z42.z.unknown()
|
|
16844
|
+
})
|
|
16845
|
+
);
|
|
16846
|
+
var JSONRPC_VERSION4 = "2.0";
|
|
16847
|
+
var JSONRPCRequestSchema4 = z42.z.object({
|
|
16848
|
+
jsonrpc: z42.z.literal(JSONRPC_VERSION4),
|
|
16849
|
+
id: z42.z.union([z42.z.string(), z42.z.number().int()])
|
|
16850
|
+
}).merge(RequestSchema4).strict();
|
|
16851
|
+
var JSONRPCResponseSchema4 = z42.z.object({
|
|
16852
|
+
jsonrpc: z42.z.literal(JSONRPC_VERSION4),
|
|
16853
|
+
id: z42.z.union([z42.z.string(), z42.z.number().int()]),
|
|
16854
|
+
result: ResultSchema4
|
|
16855
|
+
}).strict();
|
|
16856
|
+
var JSONRPCErrorSchema4 = z42.z.object({
|
|
16857
|
+
jsonrpc: z42.z.literal(JSONRPC_VERSION4),
|
|
16858
|
+
id: z42.z.union([z42.z.string(), z42.z.number().int()]),
|
|
16859
|
+
error: z42.z.object({
|
|
16860
|
+
code: z42.z.number().int(),
|
|
16861
|
+
message: z42.z.string(),
|
|
16862
|
+
data: z42.z.optional(z42.z.unknown())
|
|
16863
|
+
})
|
|
16864
|
+
}).strict();
|
|
16865
|
+
var JSONRPCNotificationSchema4 = z42.z.object({
|
|
16866
|
+
jsonrpc: z42.z.literal(JSONRPC_VERSION4)
|
|
16867
|
+
}).merge(
|
|
16868
|
+
z42.z.object({
|
|
16869
|
+
method: z42.z.string(),
|
|
16870
|
+
params: z42.z.optional(BaseParamsSchema4)
|
|
16871
|
+
})
|
|
16872
|
+
).strict();
|
|
16873
|
+
z42.z.union([
|
|
16874
|
+
JSONRPCRequestSchema4,
|
|
16875
|
+
JSONRPCNotificationSchema4,
|
|
16876
|
+
JSONRPCResponseSchema4,
|
|
16877
|
+
JSONRPCErrorSchema4
|
|
16878
|
+
]);
|
|
16753
16879
|
|
|
16754
16880
|
// ../agent-builder/dist/index.js
|
|
16755
16881
|
var UNIT_KINDS = ["mcp-server", "tool", "workflow", "agent", "integration", "network", "other"];
|
|
16756
|
-
var TemplateUnitSchema =
|
|
16757
|
-
kind:
|
|
16758
|
-
id:
|
|
16759
|
-
file:
|
|
16882
|
+
var TemplateUnitSchema = z19.z.object({
|
|
16883
|
+
kind: z19.z.enum(UNIT_KINDS),
|
|
16884
|
+
id: z19.z.string(),
|
|
16885
|
+
file: z19.z.string()
|
|
16760
16886
|
});
|
|
16761
|
-
|
|
16762
|
-
slug:
|
|
16763
|
-
ref:
|
|
16764
|
-
description:
|
|
16765
|
-
units:
|
|
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)
|
|
16766
16892
|
});
|
|
16767
|
-
var AgentBuilderInputSchema =
|
|
16768
|
-
repo:
|
|
16769
|
-
ref:
|
|
16770
|
-
slug:
|
|
16771
|
-
targetPath:
|
|
16772
|
-
variables:
|
|
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")
|
|
16773
16899
|
});
|
|
16774
|
-
|
|
16775
|
-
slug:
|
|
16776
|
-
commitSha:
|
|
16777
|
-
templateDir:
|
|
16778
|
-
units:
|
|
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)
|
|
16779
16905
|
});
|
|
16780
|
-
var CopiedFileSchema =
|
|
16781
|
-
source:
|
|
16782
|
-
destination:
|
|
16783
|
-
unit:
|
|
16784
|
-
kind:
|
|
16785
|
-
id:
|
|
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()
|
|
16786
16912
|
})
|
|
16787
16913
|
});
|
|
16788
|
-
var ConflictSchema =
|
|
16789
|
-
unit:
|
|
16790
|
-
kind:
|
|
16791
|
-
id:
|
|
16914
|
+
var ConflictSchema = z19.z.object({
|
|
16915
|
+
unit: z19.z.object({
|
|
16916
|
+
kind: z19.z.enum(UNIT_KINDS),
|
|
16917
|
+
id: z19.z.string()
|
|
16792
16918
|
}),
|
|
16793
|
-
issue:
|
|
16794
|
-
sourceFile:
|
|
16795
|
-
targetFile:
|
|
16919
|
+
issue: z19.z.string(),
|
|
16920
|
+
sourceFile: z19.z.string(),
|
|
16921
|
+
targetFile: z19.z.string()
|
|
16796
16922
|
});
|
|
16797
|
-
var FileCopyInputSchema =
|
|
16798
|
-
orderedUnits:
|
|
16799
|
-
templateDir:
|
|
16800
|
-
commitSha:
|
|
16801
|
-
slug:
|
|
16802
|
-
targetPath:
|
|
16803
|
-
variables:
|
|
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()
|
|
16804
16930
|
});
|
|
16805
|
-
var FileCopyResultSchema =
|
|
16806
|
-
success:
|
|
16807
|
-
copiedFiles:
|
|
16808
|
-
conflicts:
|
|
16809
|
-
message:
|
|
16810
|
-
error:
|
|
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()
|
|
16811
16937
|
});
|
|
16812
|
-
var ConflictResolutionSchema =
|
|
16813
|
-
unit:
|
|
16814
|
-
kind:
|
|
16815
|
-
id:
|
|
16938
|
+
var ConflictResolutionSchema = z19.z.object({
|
|
16939
|
+
unit: z19.z.object({
|
|
16940
|
+
kind: z19.z.enum(UNIT_KINDS),
|
|
16941
|
+
id: z19.z.string()
|
|
16816
16942
|
}),
|
|
16817
|
-
issue:
|
|
16818
|
-
resolution:
|
|
16943
|
+
issue: z19.z.string(),
|
|
16944
|
+
resolution: z19.z.string()
|
|
16819
16945
|
});
|
|
16820
|
-
var IntelligentMergeInputSchema =
|
|
16821
|
-
conflicts:
|
|
16822
|
-
copiedFiles:
|
|
16823
|
-
templateDir:
|
|
16824
|
-
commitSha:
|
|
16825
|
-
slug:
|
|
16826
|
-
targetPath:
|
|
16827
|
-
branchName:
|
|
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()
|
|
16828
16954
|
});
|
|
16829
|
-
var IntelligentMergeResultSchema =
|
|
16830
|
-
success:
|
|
16831
|
-
applied:
|
|
16832
|
-
message:
|
|
16833
|
-
conflictsResolved:
|
|
16834
|
-
error:
|
|
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()
|
|
16835
16961
|
});
|
|
16836
|
-
var ValidationResultsSchema =
|
|
16837
|
-
valid:
|
|
16838
|
-
errorsFixed:
|
|
16839
|
-
remainingErrors:
|
|
16840
|
-
errors:
|
|
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()
|
|
16841
16967
|
// Include specific validation errors
|
|
16842
16968
|
});
|
|
16843
|
-
var ValidationFixInputSchema =
|
|
16844
|
-
commitSha:
|
|
16845
|
-
slug:
|
|
16846
|
-
targetPath:
|
|
16847
|
-
templateDir:
|
|
16848
|
-
orderedUnits:
|
|
16849
|
-
copiedFiles:
|
|
16850
|
-
conflictsResolved:
|
|
16851
|
-
maxIterations:
|
|
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)
|
|
16852
16978
|
});
|
|
16853
|
-
var ValidationFixResultSchema =
|
|
16854
|
-
success:
|
|
16855
|
-
applied:
|
|
16856
|
-
message:
|
|
16979
|
+
var ValidationFixResultSchema = z19.z.object({
|
|
16980
|
+
success: z19.z.boolean(),
|
|
16981
|
+
applied: z19.z.boolean(),
|
|
16982
|
+
message: z19.z.string(),
|
|
16857
16983
|
validationResults: ValidationResultsSchema,
|
|
16858
|
-
error:
|
|
16984
|
+
error: z19.z.string().optional()
|
|
16859
16985
|
});
|
|
16860
|
-
var ApplyResultSchema =
|
|
16861
|
-
success:
|
|
16862
|
-
applied:
|
|
16863
|
-
branchName:
|
|
16864
|
-
message:
|
|
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(),
|
|
16865
16991
|
validationResults: ValidationResultsSchema.optional(),
|
|
16866
|
-
error:
|
|
16867
|
-
errors:
|
|
16868
|
-
stepResults:
|
|
16869
|
-
cloneSuccess:
|
|
16870
|
-
analyzeSuccess:
|
|
16871
|
-
discoverSuccess:
|
|
16872
|
-
orderSuccess:
|
|
16873
|
-
prepareBranchSuccess:
|
|
16874
|
-
packageMergeSuccess:
|
|
16875
|
-
installSuccess:
|
|
16876
|
-
copySuccess:
|
|
16877
|
-
mergeSuccess:
|
|
16878
|
-
validationSuccess:
|
|
16879
|
-
filesCopied:
|
|
16880
|
-
conflictsSkipped:
|
|
16881
|
-
conflictsResolved:
|
|
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()
|
|
16882
17008
|
}).optional()
|
|
16883
17009
|
});
|
|
16884
|
-
var CloneTemplateResultSchema =
|
|
16885
|
-
templateDir:
|
|
16886
|
-
commitSha:
|
|
16887
|
-
slug:
|
|
16888
|
-
success:
|
|
16889
|
-
error:
|
|
16890
|
-
targetPath:
|
|
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()
|
|
16891
17017
|
});
|
|
16892
|
-
var PackageAnalysisSchema =
|
|
16893
|
-
name:
|
|
16894
|
-
version:
|
|
16895
|
-
description:
|
|
16896
|
-
dependencies:
|
|
16897
|
-
devDependencies:
|
|
16898
|
-
peerDependencies:
|
|
16899
|
-
scripts:
|
|
16900
|
-
success:
|
|
16901
|
-
error:
|
|
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()
|
|
16902
17028
|
});
|
|
16903
|
-
var DiscoveryResultSchema =
|
|
16904
|
-
units:
|
|
16905
|
-
success:
|
|
16906
|
-
error:
|
|
17029
|
+
var DiscoveryResultSchema = z19.z.object({
|
|
17030
|
+
units: z19.z.array(TemplateUnitSchema),
|
|
17031
|
+
success: z19.z.boolean().optional(),
|
|
17032
|
+
error: z19.z.string().optional()
|
|
16907
17033
|
});
|
|
16908
|
-
var OrderedUnitsSchema =
|
|
16909
|
-
orderedUnits:
|
|
16910
|
-
success:
|
|
16911
|
-
error:
|
|
17034
|
+
var OrderedUnitsSchema = z19.z.object({
|
|
17035
|
+
orderedUnits: z19.z.array(TemplateUnitSchema),
|
|
17036
|
+
success: z19.z.boolean().optional(),
|
|
17037
|
+
error: z19.z.string().optional()
|
|
16912
17038
|
});
|
|
16913
|
-
var PackageMergeInputSchema =
|
|
16914
|
-
commitSha:
|
|
16915
|
-
slug:
|
|
16916
|
-
targetPath:
|
|
17039
|
+
var PackageMergeInputSchema = z19.z.object({
|
|
17040
|
+
commitSha: z19.z.string(),
|
|
17041
|
+
slug: z19.z.string(),
|
|
17042
|
+
targetPath: z19.z.string().optional(),
|
|
16917
17043
|
packageInfo: PackageAnalysisSchema
|
|
16918
17044
|
});
|
|
16919
|
-
var PackageMergeResultSchema =
|
|
16920
|
-
success:
|
|
16921
|
-
applied:
|
|
16922
|
-
message:
|
|
16923
|
-
error:
|
|
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()
|
|
16924
17050
|
});
|
|
16925
|
-
var InstallInputSchema =
|
|
16926
|
-
targetPath:
|
|
17051
|
+
var InstallInputSchema = z19.z.object({
|
|
17052
|
+
targetPath: z19.z.string().describe("Path to the project to install packages in")
|
|
16927
17053
|
});
|
|
16928
|
-
var InstallResultSchema =
|
|
16929
|
-
success:
|
|
16930
|
-
error:
|
|
17054
|
+
var InstallResultSchema = z19.z.object({
|
|
17055
|
+
success: z19.z.boolean(),
|
|
17056
|
+
error: z19.z.string().optional()
|
|
16931
17057
|
});
|
|
16932
|
-
var PrepareBranchInputSchema =
|
|
16933
|
-
slug:
|
|
16934
|
-
commitSha:
|
|
17058
|
+
var PrepareBranchInputSchema = z19.z.object({
|
|
17059
|
+
slug: z19.z.string(),
|
|
17060
|
+
commitSha: z19.z.string().optional(),
|
|
16935
17061
|
// from clone-template if relevant
|
|
16936
|
-
targetPath:
|
|
17062
|
+
targetPath: z19.z.string().optional()
|
|
16937
17063
|
});
|
|
16938
|
-
var PrepareBranchResultSchema =
|
|
16939
|
-
branchName:
|
|
16940
|
-
success:
|
|
16941
|
-
error:
|
|
17064
|
+
var PrepareBranchResultSchema = z19.z.object({
|
|
17065
|
+
branchName: z19.z.string(),
|
|
17066
|
+
success: z19.z.boolean().optional(),
|
|
17067
|
+
error: z19.z.string().optional()
|
|
16942
17068
|
});
|
|
16943
17069
|
var exec = util.promisify(child_process.exec);
|
|
16944
17070
|
var execFile = util.promisify(child_process.execFile);
|
|
@@ -17821,23 +17947,23 @@ export const mastra = new Mastra({
|
|
|
17821
17947
|
readFile: tools.createTool({
|
|
17822
17948
|
id: "read-file",
|
|
17823
17949
|
description: "Read contents of a file with optional line range selection.",
|
|
17824
|
-
inputSchema:
|
|
17825
|
-
filePath:
|
|
17826
|
-
startLine:
|
|
17827
|
-
endLine:
|
|
17828
|
-
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")
|
|
17829
17955
|
}),
|
|
17830
|
-
outputSchema:
|
|
17831
|
-
success:
|
|
17832
|
-
content:
|
|
17833
|
-
lines:
|
|
17834
|
-
metadata:
|
|
17835
|
-
size:
|
|
17836
|
-
totalLines:
|
|
17837
|
-
encoding:
|
|
17838
|
-
lastModified:
|
|
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()
|
|
17839
17965
|
}).optional(),
|
|
17840
|
-
error:
|
|
17966
|
+
error: z19.z.string().optional()
|
|
17841
17967
|
}),
|
|
17842
17968
|
execute: async (inputData) => {
|
|
17843
17969
|
return await _AgentBuilderDefaults.readFile({ ...inputData, projectPath });
|
|
@@ -17846,18 +17972,18 @@ export const mastra = new Mastra({
|
|
|
17846
17972
|
writeFile: tools.createTool({
|
|
17847
17973
|
id: "write-file",
|
|
17848
17974
|
description: "Write content to a file, with options for creating directories.",
|
|
17849
|
-
inputSchema:
|
|
17850
|
-
filePath:
|
|
17851
|
-
content:
|
|
17852
|
-
createDirs:
|
|
17853
|
-
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")
|
|
17854
17980
|
}),
|
|
17855
|
-
outputSchema:
|
|
17856
|
-
success:
|
|
17857
|
-
filePath:
|
|
17858
|
-
bytesWritten:
|
|
17859
|
-
message:
|
|
17860
|
-
error:
|
|
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()
|
|
17861
17987
|
}),
|
|
17862
17988
|
execute: async (inputData) => {
|
|
17863
17989
|
return await _AgentBuilderDefaults.writeFile({ ...inputData, projectPath });
|
|
@@ -17866,30 +17992,30 @@ export const mastra = new Mastra({
|
|
|
17866
17992
|
listDirectory: tools.createTool({
|
|
17867
17993
|
id: "list-directory",
|
|
17868
17994
|
description: "List contents of a directory with filtering and metadata options.",
|
|
17869
|
-
inputSchema:
|
|
17870
|
-
path:
|
|
17871
|
-
recursive:
|
|
17872
|
-
includeHidden:
|
|
17873
|
-
pattern:
|
|
17874
|
-
maxDepth:
|
|
17875
|
-
includeMetadata:
|
|
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")
|
|
17876
18002
|
}),
|
|
17877
|
-
outputSchema:
|
|
17878
|
-
success:
|
|
17879
|
-
items:
|
|
17880
|
-
|
|
17881
|
-
name:
|
|
17882
|
-
path:
|
|
17883
|
-
type:
|
|
17884
|
-
size:
|
|
17885
|
-
lastModified:
|
|
17886
|
-
permissions:
|
|
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()
|
|
17887
18013
|
})
|
|
17888
18014
|
),
|
|
17889
|
-
totalItems:
|
|
17890
|
-
path:
|
|
17891
|
-
message:
|
|
17892
|
-
error:
|
|
18015
|
+
totalItems: z19.z.number(),
|
|
18016
|
+
path: z19.z.string(),
|
|
18017
|
+
message: z19.z.string(),
|
|
18018
|
+
error: z19.z.string().optional()
|
|
17893
18019
|
}),
|
|
17894
18020
|
execute: async (inputData) => {
|
|
17895
18021
|
return await _AgentBuilderDefaults.listDirectory({ ...inputData, projectPath });
|
|
@@ -17898,23 +18024,23 @@ export const mastra = new Mastra({
|
|
|
17898
18024
|
executeCommand: tools.createTool({
|
|
17899
18025
|
id: "execute-command",
|
|
17900
18026
|
description: "Execute shell commands with proper error handling and output capture.",
|
|
17901
|
-
inputSchema:
|
|
17902
|
-
command:
|
|
17903
|
-
workingDirectory:
|
|
17904
|
-
timeout:
|
|
17905
|
-
captureOutput:
|
|
17906
|
-
shell:
|
|
17907
|
-
env:
|
|
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")
|
|
17908
18034
|
}),
|
|
17909
|
-
outputSchema:
|
|
17910
|
-
success:
|
|
17911
|
-
exitCode:
|
|
17912
|
-
stdout:
|
|
17913
|
-
stderr:
|
|
17914
|
-
command:
|
|
17915
|
-
workingDirectory:
|
|
17916
|
-
executionTime:
|
|
17917
|
-
error:
|
|
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()
|
|
17918
18044
|
}),
|
|
17919
18045
|
execute: async (inputData) => {
|
|
17920
18046
|
return await _AgentBuilderDefaults.executeCommand({
|
|
@@ -17927,35 +18053,35 @@ export const mastra = new Mastra({
|
|
|
17927
18053
|
taskManager: tools.createTool({
|
|
17928
18054
|
id: "task-manager",
|
|
17929
18055
|
description: "Create and manage structured task lists for coding sessions. Use this for complex multi-step tasks to track progress and ensure thoroughness.",
|
|
17930
|
-
inputSchema:
|
|
17931
|
-
action:
|
|
17932
|
-
tasks:
|
|
17933
|
-
|
|
17934
|
-
id:
|
|
17935
|
-
content:
|
|
17936
|
-
status:
|
|
17937
|
-
priority:
|
|
17938
|
-
dependencies:
|
|
17939
|
-
notes:
|
|
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")
|
|
17940
18066
|
})
|
|
17941
18067
|
).optional().describe("Tasks to create or update"),
|
|
17942
|
-
taskId:
|
|
18068
|
+
taskId: z19.z.string().optional().describe("Specific task ID for single task operations")
|
|
17943
18069
|
}),
|
|
17944
|
-
outputSchema:
|
|
17945
|
-
success:
|
|
17946
|
-
tasks:
|
|
17947
|
-
|
|
17948
|
-
id:
|
|
17949
|
-
content:
|
|
17950
|
-
status:
|
|
17951
|
-
priority:
|
|
17952
|
-
dependencies:
|
|
17953
|
-
notes:
|
|
17954
|
-
createdAt:
|
|
17955
|
-
updatedAt:
|
|
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()
|
|
17956
18082
|
})
|
|
17957
18083
|
),
|
|
17958
|
-
message:
|
|
18084
|
+
message: z19.z.string()
|
|
17959
18085
|
}),
|
|
17960
18086
|
execute: async (inputData) => {
|
|
17961
18087
|
return await _AgentBuilderDefaults.manageTaskList(inputData);
|
|
@@ -17965,32 +18091,32 @@ export const mastra = new Mastra({
|
|
|
17965
18091
|
multiEdit: tools.createTool({
|
|
17966
18092
|
id: "multi-edit",
|
|
17967
18093
|
description: "Perform multiple search-replace operations on one or more files in a single atomic operation.",
|
|
17968
|
-
inputSchema:
|
|
17969
|
-
operations:
|
|
17970
|
-
|
|
17971
|
-
filePath:
|
|
17972
|
-
edits:
|
|
17973
|
-
|
|
17974
|
-
oldString:
|
|
17975
|
-
newString:
|
|
17976
|
-
replaceAll:
|
|
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")
|
|
17977
18103
|
})
|
|
17978
18104
|
).describe("List of edit operations for this file")
|
|
17979
18105
|
})
|
|
17980
18106
|
).describe("File edit operations to perform"),
|
|
17981
|
-
createBackup:
|
|
18107
|
+
createBackup: z19.z.boolean().default(false).describe("Create backup files before editing")
|
|
17982
18108
|
}),
|
|
17983
|
-
outputSchema:
|
|
17984
|
-
success:
|
|
17985
|
-
results:
|
|
17986
|
-
|
|
17987
|
-
filePath:
|
|
17988
|
-
editsApplied:
|
|
17989
|
-
errors:
|
|
17990
|
-
backup:
|
|
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()
|
|
17991
18117
|
})
|
|
17992
18118
|
),
|
|
17993
|
-
message:
|
|
18119
|
+
message: z19.z.string()
|
|
17994
18120
|
}),
|
|
17995
18121
|
execute: async (inputData) => {
|
|
17996
18122
|
return await _AgentBuilderDefaults.performMultiEdit({ ...inputData, projectPath });
|
|
@@ -17999,23 +18125,23 @@ export const mastra = new Mastra({
|
|
|
17999
18125
|
replaceLines: tools.createTool({
|
|
18000
18126
|
id: "replace-lines",
|
|
18001
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.",
|
|
18002
|
-
inputSchema:
|
|
18003
|
-
filePath:
|
|
18004
|
-
startLine:
|
|
18005
|
-
endLine:
|
|
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(
|
|
18006
18132
|
"Ending line number to replace (1-indexed, inclusive). To replace single line, use same number as startLine"
|
|
18007
18133
|
),
|
|
18008
|
-
newContent:
|
|
18134
|
+
newContent: z19.z.string().describe(
|
|
18009
18135
|
'New content to replace the lines with. Use empty string "" to delete lines completely. For multiline content, include \\n characters'
|
|
18010
18136
|
),
|
|
18011
|
-
createBackup:
|
|
18137
|
+
createBackup: z19.z.boolean().default(false).describe("Create backup file before editing")
|
|
18012
18138
|
}),
|
|
18013
|
-
outputSchema:
|
|
18014
|
-
success:
|
|
18015
|
-
message:
|
|
18016
|
-
linesReplaced:
|
|
18017
|
-
backup:
|
|
18018
|
-
error:
|
|
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()
|
|
18019
18145
|
}),
|
|
18020
18146
|
execute: async (inputData) => {
|
|
18021
18147
|
return await _AgentBuilderDefaults.replaceLines({ ...inputData, projectPath });
|
|
@@ -18025,26 +18151,26 @@ export const mastra = new Mastra({
|
|
|
18025
18151
|
showFileLines: tools.createTool({
|
|
18026
18152
|
id: "show-file-lines",
|
|
18027
18153
|
description: "Show specific lines from a file with line numbers. Useful for debugging before using replaceLines.",
|
|
18028
|
-
inputSchema:
|
|
18029
|
-
filePath:
|
|
18030
|
-
startLine:
|
|
18031
|
-
endLine:
|
|
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(
|
|
18032
18158
|
"Ending line number to show (1-indexed, inclusive). If not provided but startLine is, shows only that line"
|
|
18033
18159
|
),
|
|
18034
|
-
context:
|
|
18160
|
+
context: z19.z.number().default(2).describe("Number of context lines to show before and after the range")
|
|
18035
18161
|
}),
|
|
18036
|
-
outputSchema:
|
|
18037
|
-
success:
|
|
18038
|
-
lines:
|
|
18039
|
-
|
|
18040
|
-
lineNumber:
|
|
18041
|
-
content:
|
|
18042
|
-
isTarget:
|
|
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")
|
|
18043
18169
|
})
|
|
18044
18170
|
),
|
|
18045
|
-
totalLines:
|
|
18046
|
-
message:
|
|
18047
|
-
error:
|
|
18171
|
+
totalLines: z19.z.number(),
|
|
18172
|
+
message: z19.z.string(),
|
|
18173
|
+
error: z19.z.string().optional()
|
|
18048
18174
|
}),
|
|
18049
18175
|
execute: async (inputData) => {
|
|
18050
18176
|
return await _AgentBuilderDefaults.showFileLines({ ...inputData, projectPath });
|
|
@@ -18054,40 +18180,40 @@ export const mastra = new Mastra({
|
|
|
18054
18180
|
smartSearch: tools.createTool({
|
|
18055
18181
|
id: "smart-search",
|
|
18056
18182
|
description: "Intelligent search across codebase with context awareness and pattern matching.",
|
|
18057
|
-
inputSchema:
|
|
18058
|
-
query:
|
|
18059
|
-
type:
|
|
18060
|
-
scope:
|
|
18061
|
-
paths:
|
|
18062
|
-
fileTypes:
|
|
18063
|
-
excludePaths:
|
|
18064
|
-
maxResults:
|
|
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")
|
|
18065
18191
|
}).optional(),
|
|
18066
|
-
context:
|
|
18067
|
-
beforeLines:
|
|
18068
|
-
afterLines:
|
|
18069
|
-
includeDefinitions:
|
|
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")
|
|
18070
18196
|
}).optional()
|
|
18071
18197
|
}),
|
|
18072
|
-
outputSchema:
|
|
18073
|
-
success:
|
|
18074
|
-
matches:
|
|
18075
|
-
|
|
18076
|
-
file:
|
|
18077
|
-
line:
|
|
18078
|
-
column:
|
|
18079
|
-
match:
|
|
18080
|
-
context:
|
|
18081
|
-
before:
|
|
18082
|
-
after:
|
|
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())
|
|
18083
18209
|
}),
|
|
18084
|
-
relevance:
|
|
18210
|
+
relevance: z19.z.number().optional()
|
|
18085
18211
|
})
|
|
18086
18212
|
),
|
|
18087
|
-
summary:
|
|
18088
|
-
totalMatches:
|
|
18089
|
-
filesSearched:
|
|
18090
|
-
patterns:
|
|
18213
|
+
summary: z19.z.object({
|
|
18214
|
+
totalMatches: z19.z.number(),
|
|
18215
|
+
filesSearched: z19.z.number(),
|
|
18216
|
+
patterns: z19.z.array(z19.z.string())
|
|
18091
18217
|
})
|
|
18092
18218
|
}),
|
|
18093
18219
|
execute: async (inputData) => {
|
|
@@ -18097,31 +18223,31 @@ export const mastra = new Mastra({
|
|
|
18097
18223
|
validateCode: tools.createTool({
|
|
18098
18224
|
id: "validate-code",
|
|
18099
18225
|
description: "Validates code using a fast hybrid approach: syntax \u2192 semantic \u2192 lint. RECOMMENDED: Always provide specific files for optimal performance and accuracy.",
|
|
18100
|
-
inputSchema:
|
|
18101
|
-
projectPath:
|
|
18102
|
-
validationType:
|
|
18103
|
-
files:
|
|
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(
|
|
18104
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."
|
|
18105
18231
|
)
|
|
18106
18232
|
}),
|
|
18107
|
-
outputSchema:
|
|
18108
|
-
valid:
|
|
18109
|
-
errors:
|
|
18110
|
-
|
|
18111
|
-
type:
|
|
18112
|
-
severity:
|
|
18113
|
-
message:
|
|
18114
|
-
file:
|
|
18115
|
-
line:
|
|
18116
|
-
column:
|
|
18117
|
-
code:
|
|
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()
|
|
18118
18244
|
})
|
|
18119
18245
|
),
|
|
18120
|
-
summary:
|
|
18121
|
-
totalErrors:
|
|
18122
|
-
totalWarnings:
|
|
18123
|
-
validationsPassed:
|
|
18124
|
-
validationsFailed:
|
|
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())
|
|
18125
18251
|
})
|
|
18126
18252
|
}),
|
|
18127
18253
|
execute: async (inputData) => {
|
|
@@ -18138,31 +18264,31 @@ export const mastra = new Mastra({
|
|
|
18138
18264
|
webSearch: tools.createTool({
|
|
18139
18265
|
id: "web-search",
|
|
18140
18266
|
description: "Search the web for current information and return structured results.",
|
|
18141
|
-
inputSchema:
|
|
18142
|
-
query:
|
|
18143
|
-
maxResults:
|
|
18144
|
-
region:
|
|
18145
|
-
language:
|
|
18146
|
-
includeImages:
|
|
18147
|
-
dateRange:
|
|
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")
|
|
18148
18274
|
}),
|
|
18149
|
-
outputSchema:
|
|
18150
|
-
success:
|
|
18151
|
-
query:
|
|
18152
|
-
results:
|
|
18153
|
-
|
|
18154
|
-
title:
|
|
18155
|
-
url:
|
|
18156
|
-
snippet:
|
|
18157
|
-
domain:
|
|
18158
|
-
publishDate:
|
|
18159
|
-
relevanceScore:
|
|
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()
|
|
18160
18286
|
})
|
|
18161
18287
|
),
|
|
18162
|
-
totalResults:
|
|
18163
|
-
searchTime:
|
|
18164
|
-
suggestions:
|
|
18165
|
-
error:
|
|
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()
|
|
18166
18292
|
}),
|
|
18167
18293
|
execute: async (inputData) => {
|
|
18168
18294
|
return await _AgentBuilderDefaults.webSearch(inputData);
|
|
@@ -18172,27 +18298,27 @@ export const mastra = new Mastra({
|
|
|
18172
18298
|
attemptCompletion: tools.createTool({
|
|
18173
18299
|
id: "attempt-completion",
|
|
18174
18300
|
description: "Signal that you believe the requested task has been completed and provide a summary.",
|
|
18175
|
-
inputSchema:
|
|
18176
|
-
summary:
|
|
18177
|
-
changes:
|
|
18178
|
-
|
|
18179
|
-
type:
|
|
18180
|
-
description:
|
|
18181
|
-
path:
|
|
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()
|
|
18182
18308
|
})
|
|
18183
18309
|
).describe("List of changes made"),
|
|
18184
|
-
validation:
|
|
18185
|
-
testsRun:
|
|
18186
|
-
buildsSuccessfully:
|
|
18187
|
-
manualTestingRequired:
|
|
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)
|
|
18188
18314
|
}).describe("Validation status"),
|
|
18189
|
-
nextSteps:
|
|
18315
|
+
nextSteps: z19.z.array(z19.z.string()).optional().describe("Suggested next steps or follow-up actions")
|
|
18190
18316
|
}),
|
|
18191
|
-
outputSchema:
|
|
18192
|
-
completionId:
|
|
18193
|
-
status:
|
|
18194
|
-
summary:
|
|
18195
|
-
confidence:
|
|
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)
|
|
18196
18322
|
}),
|
|
18197
18323
|
execute: async (inputData) => {
|
|
18198
18324
|
return await _AgentBuilderDefaults.signalCompletion(inputData);
|
|
@@ -18201,24 +18327,24 @@ export const mastra = new Mastra({
|
|
|
18201
18327
|
manageProject: tools.createTool({
|
|
18202
18328
|
id: "manage-project",
|
|
18203
18329
|
description: "Handles project management including creating project structures, managing dependencies, and package operations.",
|
|
18204
|
-
inputSchema:
|
|
18205
|
-
action:
|
|
18206
|
-
features:
|
|
18207
|
-
packages:
|
|
18208
|
-
|
|
18209
|
-
name:
|
|
18210
|
-
version:
|
|
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()
|
|
18211
18337
|
})
|
|
18212
18338
|
).optional().describe("Packages to install/upgrade")
|
|
18213
18339
|
}),
|
|
18214
|
-
outputSchema:
|
|
18215
|
-
success:
|
|
18216
|
-
installed:
|
|
18217
|
-
upgraded:
|
|
18218
|
-
warnings:
|
|
18219
|
-
message:
|
|
18220
|
-
details:
|
|
18221
|
-
error:
|
|
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()
|
|
18222
18348
|
}),
|
|
18223
18349
|
execute: async (inputData) => {
|
|
18224
18350
|
const { action, features, packages } = inputData;
|
|
@@ -18268,19 +18394,19 @@ export const mastra = new Mastra({
|
|
|
18268
18394
|
manageServer: tools.createTool({
|
|
18269
18395
|
id: "manage-server",
|
|
18270
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",
|
|
18271
|
-
inputSchema:
|
|
18272
|
-
action:
|
|
18273
|
-
port:
|
|
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")
|
|
18274
18400
|
}),
|
|
18275
|
-
outputSchema:
|
|
18276
|
-
success:
|
|
18277
|
-
status:
|
|
18278
|
-
pid:
|
|
18279
|
-
port:
|
|
18280
|
-
url:
|
|
18281
|
-
message:
|
|
18282
|
-
stdout:
|
|
18283
|
-
error:
|
|
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()
|
|
18284
18410
|
}),
|
|
18285
18411
|
execute: async (inputData) => {
|
|
18286
18412
|
const { action, port } = inputData;
|
|
@@ -18350,23 +18476,23 @@ export const mastra = new Mastra({
|
|
|
18350
18476
|
httpRequest: tools.createTool({
|
|
18351
18477
|
id: "http-request",
|
|
18352
18478
|
description: "Makes HTTP requests to the Mastra server or external APIs for testing and integration",
|
|
18353
|
-
inputSchema:
|
|
18354
|
-
method:
|
|
18355
|
-
url:
|
|
18356
|
-
baseUrl:
|
|
18357
|
-
headers:
|
|
18358
|
-
body:
|
|
18359
|
-
timeout:
|
|
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")
|
|
18360
18486
|
}),
|
|
18361
|
-
outputSchema:
|
|
18362
|
-
success:
|
|
18363
|
-
status:
|
|
18364
|
-
statusText:
|
|
18365
|
-
headers:
|
|
18366
|
-
data:
|
|
18367
|
-
error:
|
|
18368
|
-
url:
|
|
18369
|
-
method:
|
|
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()
|
|
18370
18496
|
}),
|
|
18371
18497
|
execute: async (inputData) => {
|
|
18372
18498
|
const { method, url, baseUrl, headers, body, timeout } = inputData;
|
|
@@ -19900,6 +20026,7 @@ var AgentBuilder = class extends agent.Agent {
|
|
|
19900
20026
|
${config.instructions}` : "";
|
|
19901
20027
|
const combinedInstructions = additionalInstructions + AgentBuilderDefaults.DEFAULT_INSTRUCTIONS(config.projectPath);
|
|
19902
20028
|
const agentConfig = {
|
|
20029
|
+
id: "agent-builder",
|
|
19903
20030
|
name: "agent-builder",
|
|
19904
20031
|
description: "An AI agent specialized in generating Mastra agents, tools, and workflows from natural language requirements.",
|
|
19905
20032
|
instructions: combinedInstructions,
|
|
@@ -20178,13 +20305,13 @@ Return the actual exported names of the units, as well as the file names.`,
|
|
|
20178
20305
|
- If a directory doesn't exist or has no files, return an empty array
|
|
20179
20306
|
|
|
20180
20307
|
Return the analysis in the exact format specified in the output schema.`;
|
|
20181
|
-
const output =
|
|
20182
|
-
agents:
|
|
20183
|
-
workflows:
|
|
20184
|
-
tools:
|
|
20185
|
-
mcp:
|
|
20186
|
-
networks:
|
|
20187
|
-
other:
|
|
20308
|
+
const output = z19.z.object({
|
|
20309
|
+
agents: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
|
|
20310
|
+
workflows: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
|
|
20311
|
+
tools: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
|
|
20312
|
+
mcp: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
|
|
20313
|
+
networks: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional(),
|
|
20314
|
+
other: z19.z.array(z19.z.object({ name: z19.z.string(), file: z19.z.string() })).optional()
|
|
20188
20315
|
});
|
|
20189
20316
|
const result = isV2 ? await agent.tryGenerateWithJsonFallback(agent$1, prompt, {
|
|
20190
20317
|
structuredOutput: {
|
|
@@ -20756,14 +20883,14 @@ var intelligentMergeStep = workflows.createStep({
|
|
|
20756
20883
|
const copyFileTool = tools.createTool({
|
|
20757
20884
|
id: "copy-file",
|
|
20758
20885
|
description: "Copy a file from template to target project (use only for edge cases - most files are already copied programmatically).",
|
|
20759
|
-
inputSchema:
|
|
20760
|
-
sourcePath:
|
|
20761
|
-
destinationPath:
|
|
20886
|
+
inputSchema: z19.z.object({
|
|
20887
|
+
sourcePath: z19.z.string().describe("Path to the source file relative to template directory"),
|
|
20888
|
+
destinationPath: z19.z.string().describe("Path to the destination file relative to target project")
|
|
20762
20889
|
}),
|
|
20763
|
-
outputSchema:
|
|
20764
|
-
success:
|
|
20765
|
-
message:
|
|
20766
|
-
error:
|
|
20890
|
+
outputSchema: z19.z.object({
|
|
20891
|
+
success: z19.z.boolean(),
|
|
20892
|
+
message: z19.z.string(),
|
|
20893
|
+
error: z19.z.string().optional()
|
|
20767
20894
|
}),
|
|
20768
20895
|
execute: async (input) => {
|
|
20769
20896
|
try {
|
|
@@ -21179,7 +21306,7 @@ Start by running validateCode with all validation types to get a complete pictur
|
|
|
21179
21306
|
|
|
21180
21307
|
Previous iterations may have fixed some issues, so start by re-running validateCode to see the current state, then fix any remaining issues.`;
|
|
21181
21308
|
const isV2 = model.specificationVersion === "v2";
|
|
21182
|
-
const output =
|
|
21309
|
+
const output = z19.z.object({ success: z19.z.boolean() });
|
|
21183
21310
|
const result = isV2 ? await agent.tryStreamWithJsonFallback(validationAgent, iterationPrompt, {
|
|
21184
21311
|
structuredOutput: {
|
|
21185
21312
|
schema: output
|
|
@@ -21449,35 +21576,35 @@ var determineConflictStrategy = (_unit, _targetFile) => {
|
|
|
21449
21576
|
var shouldAbortWorkflow = (stepResult) => {
|
|
21450
21577
|
return stepResult?.success === false || stepResult?.error;
|
|
21451
21578
|
};
|
|
21452
|
-
var TaskSchema =
|
|
21453
|
-
|
|
21454
|
-
id:
|
|
21455
|
-
content:
|
|
21456
|
-
status:
|
|
21457
|
-
priority:
|
|
21458
|
-
dependencies:
|
|
21459
|
-
notes:
|
|
21579
|
+
var TaskSchema = z19.z.array(
|
|
21580
|
+
z19.z.object({
|
|
21581
|
+
id: z19.z.string().describe("Unique task ID using kebab-case"),
|
|
21582
|
+
content: z19.z.string().describe("Specific, actionable task description"),
|
|
21583
|
+
status: z19.z.enum(["pending", "in_progress", "completed", "blocked"]).default("pending"),
|
|
21584
|
+
priority: z19.z.enum(["high", "medium", "low"]).describe("Task priority"),
|
|
21585
|
+
dependencies: z19.z.array(z19.z.string()).optional().describe("IDs of tasks this depends on"),
|
|
21586
|
+
notes: z19.z.string().describe("Detailed implementation notes and specifics")
|
|
21460
21587
|
})
|
|
21461
21588
|
);
|
|
21462
|
-
var QuestionSchema =
|
|
21463
|
-
|
|
21464
|
-
id:
|
|
21465
|
-
question:
|
|
21466
|
-
type:
|
|
21467
|
-
options:
|
|
21468
|
-
context:
|
|
21589
|
+
var QuestionSchema = z19.z.array(
|
|
21590
|
+
z19.z.object({
|
|
21591
|
+
id: z19.z.string().describe("Unique question ID"),
|
|
21592
|
+
question: z19.z.string().describe("Clear, specific question for the user"),
|
|
21593
|
+
type: z19.z.enum(["choice", "text", "boolean"]).describe("Type of answer expected"),
|
|
21594
|
+
options: z19.z.array(z19.z.string()).optional().describe("Options for choice questions"),
|
|
21595
|
+
context: z19.z.string().optional().describe("Additional context or explanation")
|
|
21469
21596
|
})
|
|
21470
21597
|
);
|
|
21471
|
-
var PlanningIterationResultSchema =
|
|
21472
|
-
success:
|
|
21598
|
+
var PlanningIterationResultSchema = z19.z.object({
|
|
21599
|
+
success: z19.z.boolean(),
|
|
21473
21600
|
tasks: TaskSchema,
|
|
21474
21601
|
questions: QuestionSchema,
|
|
21475
|
-
reasoning:
|
|
21476
|
-
planComplete:
|
|
21477
|
-
message:
|
|
21478
|
-
error:
|
|
21479
|
-
allPreviousQuestions:
|
|
21480
|
-
allPreviousAnswers:
|
|
21602
|
+
reasoning: z19.z.string(),
|
|
21603
|
+
planComplete: z19.z.boolean(),
|
|
21604
|
+
message: z19.z.string(),
|
|
21605
|
+
error: z19.z.string().optional(),
|
|
21606
|
+
allPreviousQuestions: z19.z.array(z19.z.any()).optional(),
|
|
21607
|
+
allPreviousAnswers: z19.z.record(z19.z.string()).optional()
|
|
21481
21608
|
});
|
|
21482
21609
|
var taskPlanningPrompts = {
|
|
21483
21610
|
planningAgent: {
|
|
@@ -21553,180 +21680,180 @@ Create specific tasks and identify any questions that need user clarification.`
|
|
|
21553
21680
|
approvalMessage: (tasksCount) => `Please review and approve the ${tasksCount} task(s) for execution:`
|
|
21554
21681
|
}
|
|
21555
21682
|
};
|
|
21556
|
-
var WorkflowBuilderInputSchema =
|
|
21557
|
-
workflowName:
|
|
21558
|
-
action:
|
|
21559
|
-
description:
|
|
21560
|
-
requirements:
|
|
21561
|
-
projectPath:
|
|
21683
|
+
var WorkflowBuilderInputSchema = z19.z.object({
|
|
21684
|
+
workflowName: z19.z.string().optional().describe("Name of the workflow to create or edit"),
|
|
21685
|
+
action: z19.z.enum(["create", "edit"]).describe("Action to perform: create new or edit existing workflow"),
|
|
21686
|
+
description: z19.z.string().optional().describe("Description of what the workflow should do"),
|
|
21687
|
+
requirements: z19.z.string().optional().describe("Detailed requirements for the workflow"),
|
|
21688
|
+
projectPath: z19.z.string().optional().describe("Path to the Mastra project (defaults to current directory)")
|
|
21562
21689
|
});
|
|
21563
|
-
var DiscoveredWorkflowSchema =
|
|
21564
|
-
name:
|
|
21565
|
-
file:
|
|
21566
|
-
description:
|
|
21567
|
-
inputSchema:
|
|
21568
|
-
outputSchema:
|
|
21569
|
-
steps:
|
|
21690
|
+
var DiscoveredWorkflowSchema = z19.z.object({
|
|
21691
|
+
name: z19.z.string(),
|
|
21692
|
+
file: z19.z.string(),
|
|
21693
|
+
description: z19.z.string().optional(),
|
|
21694
|
+
inputSchema: z19.z.any().optional(),
|
|
21695
|
+
outputSchema: z19.z.any().optional(),
|
|
21696
|
+
steps: z19.z.array(z19.z.string()).optional()
|
|
21570
21697
|
});
|
|
21571
|
-
var WorkflowDiscoveryResultSchema =
|
|
21572
|
-
success:
|
|
21573
|
-
workflows:
|
|
21574
|
-
mastraIndexExists:
|
|
21575
|
-
message:
|
|
21576
|
-
error:
|
|
21698
|
+
var WorkflowDiscoveryResultSchema = z19.z.object({
|
|
21699
|
+
success: z19.z.boolean(),
|
|
21700
|
+
workflows: z19.z.array(DiscoveredWorkflowSchema),
|
|
21701
|
+
mastraIndexExists: z19.z.boolean(),
|
|
21702
|
+
message: z19.z.string(),
|
|
21703
|
+
error: z19.z.string().optional()
|
|
21577
21704
|
});
|
|
21578
|
-
var ProjectDiscoveryResultSchema =
|
|
21579
|
-
success:
|
|
21580
|
-
structure:
|
|
21581
|
-
hasWorkflowsDir:
|
|
21582
|
-
hasAgentsDir:
|
|
21583
|
-
hasToolsDir:
|
|
21584
|
-
hasMastraIndex:
|
|
21585
|
-
existingWorkflows:
|
|
21586
|
-
existingAgents:
|
|
21587
|
-
existingTools:
|
|
21705
|
+
var ProjectDiscoveryResultSchema = z19.z.object({
|
|
21706
|
+
success: z19.z.boolean(),
|
|
21707
|
+
structure: z19.z.object({
|
|
21708
|
+
hasWorkflowsDir: z19.z.boolean(),
|
|
21709
|
+
hasAgentsDir: z19.z.boolean(),
|
|
21710
|
+
hasToolsDir: z19.z.boolean(),
|
|
21711
|
+
hasMastraIndex: z19.z.boolean(),
|
|
21712
|
+
existingWorkflows: z19.z.array(z19.z.string()),
|
|
21713
|
+
existingAgents: z19.z.array(z19.z.string()),
|
|
21714
|
+
existingTools: z19.z.array(z19.z.string())
|
|
21588
21715
|
}),
|
|
21589
|
-
dependencies:
|
|
21590
|
-
message:
|
|
21591
|
-
error:
|
|
21716
|
+
dependencies: z19.z.record(z19.z.string()),
|
|
21717
|
+
message: z19.z.string(),
|
|
21718
|
+
error: z19.z.string().optional()
|
|
21592
21719
|
});
|
|
21593
|
-
var WorkflowResearchResultSchema =
|
|
21594
|
-
success:
|
|
21595
|
-
documentation:
|
|
21596
|
-
workflowPatterns:
|
|
21597
|
-
stepExamples:
|
|
21598
|
-
bestPractices:
|
|
21720
|
+
var WorkflowResearchResultSchema = z19.z.object({
|
|
21721
|
+
success: z19.z.boolean(),
|
|
21722
|
+
documentation: z19.z.object({
|
|
21723
|
+
workflowPatterns: z19.z.array(z19.z.string()),
|
|
21724
|
+
stepExamples: z19.z.array(z19.z.string()),
|
|
21725
|
+
bestPractices: z19.z.array(z19.z.string())
|
|
21599
21726
|
}),
|
|
21600
|
-
webResources:
|
|
21601
|
-
|
|
21602
|
-
title:
|
|
21603
|
-
url:
|
|
21604
|
-
snippet:
|
|
21605
|
-
relevance:
|
|
21727
|
+
webResources: z19.z.array(
|
|
21728
|
+
z19.z.object({
|
|
21729
|
+
title: z19.z.string(),
|
|
21730
|
+
url: z19.z.string(),
|
|
21731
|
+
snippet: z19.z.string(),
|
|
21732
|
+
relevance: z19.z.number()
|
|
21606
21733
|
})
|
|
21607
21734
|
),
|
|
21608
|
-
message:
|
|
21609
|
-
error:
|
|
21735
|
+
message: z19.z.string(),
|
|
21736
|
+
error: z19.z.string().optional()
|
|
21610
21737
|
});
|
|
21611
|
-
var TaskManagementResultSchema =
|
|
21612
|
-
success:
|
|
21738
|
+
var TaskManagementResultSchema = z19.z.object({
|
|
21739
|
+
success: z19.z.boolean(),
|
|
21613
21740
|
tasks: TaskSchema,
|
|
21614
|
-
message:
|
|
21615
|
-
error:
|
|
21741
|
+
message: z19.z.string(),
|
|
21742
|
+
error: z19.z.string().optional()
|
|
21616
21743
|
});
|
|
21617
|
-
var TaskExecutionInputSchema =
|
|
21618
|
-
action:
|
|
21619
|
-
workflowName:
|
|
21620
|
-
description:
|
|
21621
|
-
requirements:
|
|
21744
|
+
var TaskExecutionInputSchema = z19.z.object({
|
|
21745
|
+
action: z19.z.enum(["create", "edit"]),
|
|
21746
|
+
workflowName: z19.z.string().optional(),
|
|
21747
|
+
description: z19.z.string().optional(),
|
|
21748
|
+
requirements: z19.z.string().optional(),
|
|
21622
21749
|
tasks: TaskSchema,
|
|
21623
|
-
discoveredWorkflows:
|
|
21624
|
-
projectStructure:
|
|
21625
|
-
research:
|
|
21626
|
-
projectPath:
|
|
21750
|
+
discoveredWorkflows: z19.z.array(z19.z.any()),
|
|
21751
|
+
projectStructure: z19.z.any(),
|
|
21752
|
+
research: z19.z.any(),
|
|
21753
|
+
projectPath: z19.z.string().optional()
|
|
21627
21754
|
});
|
|
21628
|
-
var TaskExecutionSuspendSchema =
|
|
21755
|
+
var TaskExecutionSuspendSchema = z19.z.object({
|
|
21629
21756
|
questions: QuestionSchema,
|
|
21630
|
-
currentProgress:
|
|
21631
|
-
completedTasks:
|
|
21632
|
-
message:
|
|
21757
|
+
currentProgress: z19.z.string(),
|
|
21758
|
+
completedTasks: z19.z.array(z19.z.string()),
|
|
21759
|
+
message: z19.z.string()
|
|
21633
21760
|
});
|
|
21634
|
-
var TaskExecutionResumeSchema =
|
|
21635
|
-
answers:
|
|
21636
|
-
|
|
21637
|
-
questionId:
|
|
21638
|
-
answer:
|
|
21761
|
+
var TaskExecutionResumeSchema = z19.z.object({
|
|
21762
|
+
answers: z19.z.array(
|
|
21763
|
+
z19.z.object({
|
|
21764
|
+
questionId: z19.z.string(),
|
|
21765
|
+
answer: z19.z.string()
|
|
21639
21766
|
})
|
|
21640
21767
|
)
|
|
21641
21768
|
});
|
|
21642
|
-
var TaskExecutionResultSchema =
|
|
21643
|
-
success:
|
|
21644
|
-
filesModified:
|
|
21645
|
-
validationResults:
|
|
21646
|
-
passed:
|
|
21647
|
-
errors:
|
|
21648
|
-
warnings:
|
|
21769
|
+
var TaskExecutionResultSchema = z19.z.object({
|
|
21770
|
+
success: z19.z.boolean(),
|
|
21771
|
+
filesModified: z19.z.array(z19.z.string()),
|
|
21772
|
+
validationResults: z19.z.object({
|
|
21773
|
+
passed: z19.z.boolean(),
|
|
21774
|
+
errors: z19.z.array(z19.z.string()),
|
|
21775
|
+
warnings: z19.z.array(z19.z.string())
|
|
21649
21776
|
}),
|
|
21650
|
-
completedTasks:
|
|
21651
|
-
message:
|
|
21652
|
-
error:
|
|
21777
|
+
completedTasks: z19.z.array(z19.z.string()),
|
|
21778
|
+
message: z19.z.string(),
|
|
21779
|
+
error: z19.z.string().optional()
|
|
21653
21780
|
});
|
|
21654
|
-
|
|
21781
|
+
z19.z.object({
|
|
21655
21782
|
questions: QuestionSchema
|
|
21656
21783
|
});
|
|
21657
|
-
|
|
21658
|
-
answers:
|
|
21659
|
-
hasAnswers:
|
|
21784
|
+
z19.z.object({
|
|
21785
|
+
answers: z19.z.record(z19.z.string()),
|
|
21786
|
+
hasAnswers: z19.z.boolean()
|
|
21660
21787
|
});
|
|
21661
|
-
var WorkflowBuilderResultSchema =
|
|
21662
|
-
success:
|
|
21663
|
-
action:
|
|
21664
|
-
workflowName:
|
|
21665
|
-
workflowFile:
|
|
21788
|
+
var WorkflowBuilderResultSchema = z19.z.object({
|
|
21789
|
+
success: z19.z.boolean(),
|
|
21790
|
+
action: z19.z.enum(["create", "edit"]),
|
|
21791
|
+
workflowName: z19.z.string().optional(),
|
|
21792
|
+
workflowFile: z19.z.string().optional(),
|
|
21666
21793
|
discovery: WorkflowDiscoveryResultSchema.optional(),
|
|
21667
21794
|
projectStructure: ProjectDiscoveryResultSchema.optional(),
|
|
21668
21795
|
research: WorkflowResearchResultSchema.optional(),
|
|
21669
21796
|
planning: PlanningIterationResultSchema.optional(),
|
|
21670
21797
|
taskManagement: TaskManagementResultSchema.optional(),
|
|
21671
21798
|
execution: TaskExecutionResultSchema.optional(),
|
|
21672
|
-
needsUserInput:
|
|
21799
|
+
needsUserInput: z19.z.boolean().optional(),
|
|
21673
21800
|
questions: QuestionSchema.optional(),
|
|
21674
|
-
message:
|
|
21675
|
-
nextSteps:
|
|
21676
|
-
error:
|
|
21801
|
+
message: z19.z.string(),
|
|
21802
|
+
nextSteps: z19.z.array(z19.z.string()).optional(),
|
|
21803
|
+
error: z19.z.string().optional()
|
|
21677
21804
|
});
|
|
21678
|
-
var TaskExecutionIterationInputSchema = (taskLength) =>
|
|
21679
|
-
status:
|
|
21680
|
-
progress:
|
|
21681
|
-
completedTasks:
|
|
21682
|
-
totalTasksRequired:
|
|
21683
|
-
tasksRemaining:
|
|
21684
|
-
filesModified:
|
|
21805
|
+
var TaskExecutionIterationInputSchema = (taskLength) => z19.z.object({
|
|
21806
|
+
status: z19.z.enum(["in_progress", "completed", "needs_clarification"]).describe('Status - only use "completed" when ALL remaining tasks are finished'),
|
|
21807
|
+
progress: z19.z.string().describe("Current progress description"),
|
|
21808
|
+
completedTasks: z19.z.array(z19.z.string()).describe("List of ALL completed task IDs (including previously completed ones)"),
|
|
21809
|
+
totalTasksRequired: z19.z.number().describe(`Total number of tasks that must be completed (should be ${taskLength})`),
|
|
21810
|
+
tasksRemaining: z19.z.array(z19.z.string()).describe("List of task IDs that still need to be completed"),
|
|
21811
|
+
filesModified: z19.z.array(z19.z.string()).describe("List of files that were created or modified - use these exact paths for validateCode tool"),
|
|
21685
21812
|
questions: QuestionSchema.optional().describe("Questions for user if clarification is needed"),
|
|
21686
|
-
message:
|
|
21687
|
-
error:
|
|
21813
|
+
message: z19.z.string().describe("Summary of work completed or current status"),
|
|
21814
|
+
error: z19.z.string().optional().describe("Any errors encountered")
|
|
21688
21815
|
});
|
|
21689
|
-
var PlanningIterationInputSchema =
|
|
21690
|
-
action:
|
|
21691
|
-
workflowName:
|
|
21692
|
-
description:
|
|
21693
|
-
requirements:
|
|
21694
|
-
discoveredWorkflows:
|
|
21816
|
+
var PlanningIterationInputSchema = z19.z.object({
|
|
21817
|
+
action: z19.z.enum(["create", "edit"]),
|
|
21818
|
+
workflowName: z19.z.string().optional(),
|
|
21819
|
+
description: z19.z.string().optional(),
|
|
21820
|
+
requirements: z19.z.string().optional(),
|
|
21821
|
+
discoveredWorkflows: z19.z.array(DiscoveredWorkflowSchema),
|
|
21695
21822
|
projectStructure: ProjectDiscoveryResultSchema,
|
|
21696
21823
|
research: WorkflowResearchResultSchema,
|
|
21697
|
-
userAnswers:
|
|
21824
|
+
userAnswers: z19.z.record(z19.z.string()).optional()
|
|
21698
21825
|
});
|
|
21699
|
-
var PlanningIterationSuspendSchema =
|
|
21826
|
+
var PlanningIterationSuspendSchema = z19.z.object({
|
|
21700
21827
|
questions: QuestionSchema,
|
|
21701
|
-
message:
|
|
21702
|
-
currentPlan:
|
|
21828
|
+
message: z19.z.string(),
|
|
21829
|
+
currentPlan: z19.z.object({
|
|
21703
21830
|
tasks: TaskSchema,
|
|
21704
|
-
reasoning:
|
|
21831
|
+
reasoning: z19.z.string()
|
|
21705
21832
|
})
|
|
21706
21833
|
});
|
|
21707
|
-
var PlanningIterationResumeSchema =
|
|
21708
|
-
answers:
|
|
21834
|
+
var PlanningIterationResumeSchema = z19.z.object({
|
|
21835
|
+
answers: z19.z.record(z19.z.string())
|
|
21709
21836
|
});
|
|
21710
|
-
var PlanningAgentOutputSchema =
|
|
21837
|
+
var PlanningAgentOutputSchema = z19.z.object({
|
|
21711
21838
|
tasks: TaskSchema,
|
|
21712
21839
|
questions: QuestionSchema.optional(),
|
|
21713
|
-
reasoning:
|
|
21714
|
-
planComplete:
|
|
21840
|
+
reasoning: z19.z.string().describe("Explanation of the plan and any questions"),
|
|
21841
|
+
planComplete: z19.z.boolean().describe("Whether the plan is ready for execution (no more questions)")
|
|
21715
21842
|
});
|
|
21716
|
-
var TaskApprovalOutputSchema =
|
|
21717
|
-
approved:
|
|
21843
|
+
var TaskApprovalOutputSchema = z19.z.object({
|
|
21844
|
+
approved: z19.z.boolean(),
|
|
21718
21845
|
tasks: TaskSchema,
|
|
21719
|
-
message:
|
|
21720
|
-
userFeedback:
|
|
21846
|
+
message: z19.z.string(),
|
|
21847
|
+
userFeedback: z19.z.string().optional()
|
|
21721
21848
|
});
|
|
21722
|
-
var TaskApprovalSuspendSchema =
|
|
21849
|
+
var TaskApprovalSuspendSchema = z19.z.object({
|
|
21723
21850
|
taskList: TaskSchema,
|
|
21724
|
-
summary:
|
|
21725
|
-
message:
|
|
21851
|
+
summary: z19.z.string(),
|
|
21852
|
+
message: z19.z.string()
|
|
21726
21853
|
});
|
|
21727
|
-
var TaskApprovalResumeSchema =
|
|
21728
|
-
approved:
|
|
21729
|
-
modifications:
|
|
21854
|
+
var TaskApprovalResumeSchema = z19.z.object({
|
|
21855
|
+
approved: z19.z.boolean(),
|
|
21856
|
+
modifications: z19.z.string().optional()
|
|
21730
21857
|
});
|
|
21731
21858
|
var planningIterationStep = workflows.createStep({
|
|
21732
21859
|
id: "planning-iteration",
|
|
@@ -21766,6 +21893,7 @@ var planningIterationStep = workflows.createStep({
|
|
|
21766
21893
|
try {
|
|
21767
21894
|
const model = await resolveModel({ requestContext });
|
|
21768
21895
|
const planningAgent = new agent.Agent({
|
|
21896
|
+
id: "workflow-planning-agent",
|
|
21769
21897
|
model,
|
|
21770
21898
|
instructions: taskPlanningPrompts.planningAgent.instructions({
|
|
21771
21899
|
storedQAPairs
|
|
@@ -22319,35 +22447,35 @@ ${context.resumeData ? `USER PROVIDED ANSWERS: ${JSON.stringify(context.resumeDa
|
|
|
22319
22447
|
var restrictedTaskManager = tools.createTool({
|
|
22320
22448
|
id: "task-manager",
|
|
22321
22449
|
description: "View and update your pre-loaded task list. You can only mark tasks as in_progress or completed, not create new tasks.",
|
|
22322
|
-
inputSchema:
|
|
22323
|
-
action:
|
|
22324
|
-
tasks:
|
|
22325
|
-
|
|
22326
|
-
id:
|
|
22327
|
-
content:
|
|
22328
|
-
status:
|
|
22329
|
-
priority:
|
|
22330
|
-
dependencies:
|
|
22331
|
-
notes:
|
|
22450
|
+
inputSchema: z19.z.object({
|
|
22451
|
+
action: z19.z.enum(["list", "update", "complete"]).describe("List tasks, update status, or mark complete - tasks are pre-loaded"),
|
|
22452
|
+
tasks: z19.z.array(
|
|
22453
|
+
z19.z.object({
|
|
22454
|
+
id: z19.z.string().describe("Task ID - must match existing task"),
|
|
22455
|
+
content: z19.z.string().optional().describe("Task content (read-only)"),
|
|
22456
|
+
status: z19.z.enum(["pending", "in_progress", "completed", "blocked"]).describe("Task status"),
|
|
22457
|
+
priority: z19.z.enum(["high", "medium", "low"]).optional().describe("Task priority (read-only)"),
|
|
22458
|
+
dependencies: z19.z.array(z19.z.string()).optional().describe("Task dependencies (read-only)"),
|
|
22459
|
+
notes: z19.z.string().optional().describe("Additional notes or progress updates")
|
|
22332
22460
|
})
|
|
22333
22461
|
).optional().describe("Tasks to update (status and notes only)"),
|
|
22334
|
-
taskId:
|
|
22462
|
+
taskId: z19.z.string().optional().describe("Specific task ID for single task operations")
|
|
22335
22463
|
}),
|
|
22336
|
-
outputSchema:
|
|
22337
|
-
success:
|
|
22338
|
-
tasks:
|
|
22339
|
-
|
|
22340
|
-
id:
|
|
22341
|
-
content:
|
|
22342
|
-
status:
|
|
22343
|
-
priority:
|
|
22344
|
-
dependencies:
|
|
22345
|
-
notes:
|
|
22346
|
-
createdAt:
|
|
22347
|
-
updatedAt:
|
|
22464
|
+
outputSchema: z19.z.object({
|
|
22465
|
+
success: z19.z.boolean(),
|
|
22466
|
+
tasks: z19.z.array(
|
|
22467
|
+
z19.z.object({
|
|
22468
|
+
id: z19.z.string(),
|
|
22469
|
+
content: z19.z.string(),
|
|
22470
|
+
status: z19.z.string(),
|
|
22471
|
+
priority: z19.z.string(),
|
|
22472
|
+
dependencies: z19.z.array(z19.z.string()).optional(),
|
|
22473
|
+
notes: z19.z.string().optional(),
|
|
22474
|
+
createdAt: z19.z.string(),
|
|
22475
|
+
updatedAt: z19.z.string()
|
|
22348
22476
|
})
|
|
22349
22477
|
),
|
|
22350
|
-
message:
|
|
22478
|
+
message: z19.z.string()
|
|
22351
22479
|
}),
|
|
22352
22480
|
execute: async (input) => {
|
|
22353
22481
|
const adaptedContext = {
|
|
@@ -22492,6 +22620,7 @@ var workflowResearchStep = workflows.createStep({
|
|
|
22492
22620
|
try {
|
|
22493
22621
|
const model = await resolveModel({ requestContext });
|
|
22494
22622
|
const researchAgent = new agent.Agent({
|
|
22623
|
+
id: "workflow-research-agent",
|
|
22495
22624
|
model,
|
|
22496
22625
|
instructions: workflowBuilderPrompts.researchAgent.instructions,
|
|
22497
22626
|
name: "Workflow Research Agent"
|
|
@@ -22812,144 +22941,599 @@ var agentBuilderWorkflows = {
|
|
|
22812
22941
|
"merge-template": agentBuilderTemplateWorkflow,
|
|
22813
22942
|
"workflow-builder": workflowBuilderWorkflow
|
|
22814
22943
|
};
|
|
22944
|
+
var actionIdPathParams = z19__default.default.object({
|
|
22945
|
+
actionId: z19__default.default.string().describe("Unique identifier for the agent-builder action")
|
|
22946
|
+
});
|
|
22947
|
+
var actionRunPathParams = z19__default.default.object({
|
|
22948
|
+
actionId: z19__default.default.string().describe("Unique identifier for the agent-builder action"),
|
|
22949
|
+
runId: z19__default.default.string().describe("Unique identifier for the action run")
|
|
22950
|
+
});
|
|
22951
|
+
var streamAgentBuilderBodySchema = chunkMH3A7RDQ_cjs.streamWorkflowBodySchema;
|
|
22952
|
+
var streamLegacyAgentBuilderBodySchema = chunkMH3A7RDQ_cjs.streamLegacyWorkflowBodySchema;
|
|
22953
|
+
var resumeAgentBuilderBodySchema = chunkMH3A7RDQ_cjs.resumeBodySchema;
|
|
22954
|
+
var startAsyncAgentBuilderBodySchema = chunkMH3A7RDQ_cjs.startAsyncWorkflowBodySchema;
|
|
22815
22955
|
|
|
22816
22956
|
// src/server/handlers/agent-builder.ts
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
|
|
22957
|
+
var LIST_AGENT_BUILDER_ACTIONS_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
22958
|
+
method: "GET",
|
|
22959
|
+
path: "/api/agent-builder",
|
|
22960
|
+
responseType: "json",
|
|
22961
|
+
responseSchema: chunkMH3A7RDQ_cjs.listWorkflowsResponseSchema,
|
|
22962
|
+
summary: "List agent-builder actions",
|
|
22963
|
+
description: "Returns a list of all available agent-builder actions",
|
|
22964
|
+
tags: ["Agent Builder"],
|
|
22965
|
+
handler: async (ctx) => {
|
|
22966
|
+
const { mastra } = ctx;
|
|
22967
|
+
const logger = mastra.getLogger();
|
|
22968
|
+
try {
|
|
22969
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
22970
|
+
logger.info("Listing agent builder actions");
|
|
22971
|
+
return await chunkMH3A7RDQ_cjs.LIST_WORKFLOWS_ROUTE.handler(ctx);
|
|
22972
|
+
} catch (error) {
|
|
22973
|
+
logger.error("Error listing agent builder actions", { error });
|
|
22974
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder workflows");
|
|
22975
|
+
} finally {
|
|
22976
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
22977
|
+
}
|
|
22978
|
+
}
|
|
22979
|
+
});
|
|
22980
|
+
var GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
22981
|
+
method: "GET",
|
|
22982
|
+
path: "/api/agent-builder/:actionId",
|
|
22983
|
+
responseType: "json",
|
|
22984
|
+
pathParamSchema: actionIdPathParams,
|
|
22985
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowInfoSchema,
|
|
22986
|
+
summary: "Get action by ID",
|
|
22987
|
+
description: "Returns details for a specific agent-builder action",
|
|
22988
|
+
tags: ["Agent Builder"],
|
|
22989
|
+
handler: async (ctx) => {
|
|
22990
|
+
const { mastra, actionId } = ctx;
|
|
22821
22991
|
const logger = mastra.getLogger();
|
|
22822
22992
|
try {
|
|
22823
|
-
|
|
22824
|
-
if (actionId && !
|
|
22993
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
22994
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
22825
22995
|
throw new chunk64ITUOXI_cjs.HTTPException(400, {
|
|
22826
22996
|
message: `Invalid agent-builder action: ${actionId}. Valid actions are: ${Object.keys(agentBuilderWorkflows).join(", ")}`
|
|
22827
22997
|
});
|
|
22828
22998
|
}
|
|
22829
|
-
logger.info(
|
|
22830
|
-
|
|
22831
|
-
const handlerArgs = {
|
|
22832
|
-
...actionArgs,
|
|
22833
|
-
workflowId: actionId
|
|
22834
|
-
// Map actionId to workflowId
|
|
22835
|
-
};
|
|
22836
|
-
const result = await workflowHandlerFn(handlerArgs);
|
|
22837
|
-
return result;
|
|
22838
|
-
} finally {
|
|
22839
|
-
chunkW2KMU354_cjs.WorkflowRegistry.cleanup();
|
|
22840
|
-
}
|
|
22999
|
+
logger.info("Getting agent builder action by ID", { actionId });
|
|
23000
|
+
return await chunkMH3A7RDQ_cjs.GET_WORKFLOW_BY_ID_ROUTE.handler({ ...ctx, workflowId: actionId });
|
|
22841
23001
|
} catch (error) {
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22845
|
-
|
|
23002
|
+
logger.error("Error getting agent builder action by ID", { error, actionId });
|
|
23003
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action");
|
|
23004
|
+
} finally {
|
|
23005
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23006
|
+
}
|
|
23007
|
+
}
|
|
23008
|
+
});
|
|
23009
|
+
var LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23010
|
+
method: "GET",
|
|
23011
|
+
path: "/api/agent-builder/:actionId/runs",
|
|
23012
|
+
responseType: "json",
|
|
23013
|
+
pathParamSchema: actionIdPathParams,
|
|
23014
|
+
queryParamSchema: chunkMH3A7RDQ_cjs.listWorkflowRunsQuerySchema,
|
|
23015
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowRunsResponseSchema,
|
|
23016
|
+
summary: "List action runs",
|
|
23017
|
+
description: "Returns a paginated list of execution runs for the specified action",
|
|
23018
|
+
tags: ["Agent Builder"],
|
|
23019
|
+
handler: async (ctx) => {
|
|
23020
|
+
const { mastra, actionId } = ctx;
|
|
23021
|
+
const logger = mastra.getLogger();
|
|
23022
|
+
try {
|
|
23023
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23024
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23025
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23026
|
+
}
|
|
23027
|
+
logger.info("Listing agent builder action runs", { actionId });
|
|
23028
|
+
return await chunkMH3A7RDQ_cjs.LIST_WORKFLOW_RUNS_ROUTE.handler({
|
|
23029
|
+
...ctx,
|
|
23030
|
+
workflowId: actionId
|
|
22846
23031
|
});
|
|
22847
|
-
|
|
23032
|
+
} catch (error) {
|
|
23033
|
+
logger.error("Error listing agent builder action runs", { error, actionId });
|
|
23034
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action runs");
|
|
23035
|
+
} finally {
|
|
23036
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
22848
23037
|
}
|
|
22849
|
-
};
|
|
22850
|
-
}
|
|
22851
|
-
var getAgentBuilderActionsHandler = createAgentBuilderWorkflowHandler(async () => {
|
|
22852
|
-
try {
|
|
22853
|
-
const registryWorkflows = chunkW2KMU354_cjs.WorkflowRegistry.getAllWorkflows();
|
|
22854
|
-
const _workflows = Object.entries(registryWorkflows).reduce(
|
|
22855
|
-
(acc, [key, workflow]) => {
|
|
22856
|
-
acc[key] = chunkW2KMU354_cjs.getWorkflowInfo(workflow);
|
|
22857
|
-
return acc;
|
|
22858
|
-
},
|
|
22859
|
-
{}
|
|
22860
|
-
);
|
|
22861
|
-
return _workflows;
|
|
22862
|
-
} catch (error) {
|
|
22863
|
-
return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder workflows");
|
|
22864
23038
|
}
|
|
22865
|
-
}
|
|
22866
|
-
var
|
|
22867
|
-
|
|
22868
|
-
"
|
|
22869
|
-
|
|
22870
|
-
|
|
22871
|
-
|
|
22872
|
-
"
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
);
|
|
22878
|
-
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
);
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
);
|
|
22890
|
-
|
|
22891
|
-
|
|
22892
|
-
|
|
22893
|
-
|
|
22894
|
-
|
|
22895
|
-
|
|
22896
|
-
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
"
|
|
22905
|
-
)
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
);
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
);
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
);
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
);
|
|
22926
|
-
var
|
|
22927
|
-
|
|
22928
|
-
"
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
23039
|
+
});
|
|
23040
|
+
var GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23041
|
+
method: "GET",
|
|
23042
|
+
path: "/api/agent-builder/:actionId/runs/:runId",
|
|
23043
|
+
responseType: "json",
|
|
23044
|
+
pathParamSchema: actionRunPathParams,
|
|
23045
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowRunResponseSchema,
|
|
23046
|
+
summary: "Get action run by ID",
|
|
23047
|
+
description: "Returns details for a specific action run",
|
|
23048
|
+
tags: ["Agent Builder"],
|
|
23049
|
+
handler: async (ctx) => {
|
|
23050
|
+
const { mastra, actionId, runId } = ctx;
|
|
23051
|
+
const logger = mastra.getLogger();
|
|
23052
|
+
try {
|
|
23053
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23054
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23055
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23056
|
+
}
|
|
23057
|
+
logger.info("Getting agent builder action run by ID", { actionId, runId });
|
|
23058
|
+
return await chunkMH3A7RDQ_cjs.GET_WORKFLOW_RUN_BY_ID_ROUTE.handler({
|
|
23059
|
+
...ctx,
|
|
23060
|
+
workflowId: actionId
|
|
23061
|
+
});
|
|
23062
|
+
} catch (error) {
|
|
23063
|
+
logger.error("Error getting agent builder action run", { error, actionId, runId });
|
|
23064
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action run");
|
|
23065
|
+
} finally {
|
|
23066
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23067
|
+
}
|
|
23068
|
+
}
|
|
23069
|
+
});
|
|
23070
|
+
var GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23071
|
+
method: "GET",
|
|
23072
|
+
path: "/api/agent-builder/:actionId/runs/:runId/execution-result",
|
|
23073
|
+
responseType: "json",
|
|
23074
|
+
pathParamSchema: actionRunPathParams,
|
|
23075
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowExecutionResultSchema,
|
|
23076
|
+
summary: "Get action execution result",
|
|
23077
|
+
description: "Returns the final execution result of a completed action run",
|
|
23078
|
+
tags: ["Agent Builder"],
|
|
23079
|
+
handler: async (ctx) => {
|
|
23080
|
+
const { mastra, actionId, runId } = ctx;
|
|
23081
|
+
const logger = mastra.getLogger();
|
|
23082
|
+
try {
|
|
23083
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23084
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23085
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23086
|
+
}
|
|
23087
|
+
logger.info("Getting agent builder action run execution result", { actionId, runId });
|
|
23088
|
+
return await chunkMH3A7RDQ_cjs.GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE.handler({
|
|
23089
|
+
...ctx,
|
|
23090
|
+
workflowId: actionId
|
|
23091
|
+
});
|
|
23092
|
+
} catch (error) {
|
|
23093
|
+
logger.error("Error getting execution result", { error, actionId, runId });
|
|
23094
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error getting agent builder action execution result");
|
|
23095
|
+
} finally {
|
|
23096
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23097
|
+
}
|
|
23098
|
+
}
|
|
23099
|
+
});
|
|
23100
|
+
var CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23101
|
+
method: "POST",
|
|
23102
|
+
path: "/api/agent-builder/:actionId/create-run",
|
|
23103
|
+
responseType: "json",
|
|
23104
|
+
pathParamSchema: actionIdPathParams,
|
|
23105
|
+
queryParamSchema: chunk2NW6POYK_cjs.optionalRunIdSchema,
|
|
23106
|
+
responseSchema: chunkMH3A7RDQ_cjs.createWorkflowRunResponseSchema,
|
|
23107
|
+
summary: "Create action run",
|
|
23108
|
+
description: "Creates a new action execution instance with an optional custom run ID",
|
|
23109
|
+
tags: ["Agent Builder"],
|
|
23110
|
+
handler: async (ctx) => {
|
|
23111
|
+
const { mastra, actionId, runId } = ctx;
|
|
23112
|
+
const logger = mastra.getLogger();
|
|
23113
|
+
try {
|
|
23114
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23115
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23116
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23117
|
+
}
|
|
23118
|
+
logger.info("Creating agent builder action run", { actionId, runId });
|
|
23119
|
+
return await chunkMH3A7RDQ_cjs.CREATE_WORKFLOW_RUN_ROUTE.handler({
|
|
23120
|
+
...ctx,
|
|
23121
|
+
workflowId: actionId
|
|
23122
|
+
});
|
|
23123
|
+
} catch (error) {
|
|
23124
|
+
logger.error("Error creating agent builder action run", { error, actionId });
|
|
23125
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error creating agent builder action run");
|
|
23126
|
+
} finally {
|
|
23127
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23128
|
+
}
|
|
23129
|
+
}
|
|
23130
|
+
});
|
|
23131
|
+
var STREAM_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23132
|
+
method: "POST",
|
|
23133
|
+
path: "/api/agent-builder/:actionId/stream",
|
|
23134
|
+
responseType: "stream",
|
|
23135
|
+
pathParamSchema: actionIdPathParams,
|
|
23136
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23137
|
+
bodySchema: streamAgentBuilderBodySchema,
|
|
23138
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23139
|
+
summary: "Stream action execution",
|
|
23140
|
+
description: "Executes an action and streams the results in real-time",
|
|
23141
|
+
tags: ["Agent Builder"],
|
|
23142
|
+
handler: async (ctx) => {
|
|
23143
|
+
const { mastra, actionId, runId, requestContext } = ctx;
|
|
23144
|
+
const logger = mastra.getLogger();
|
|
23145
|
+
try {
|
|
23146
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23147
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23148
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23149
|
+
}
|
|
23150
|
+
logger.info("Streaming agent builder action", { actionId, runId });
|
|
23151
|
+
return await chunkMH3A7RDQ_cjs.STREAM_WORKFLOW_ROUTE.handler({
|
|
23152
|
+
...ctx,
|
|
23153
|
+
workflowId: actionId,
|
|
23154
|
+
requestContext
|
|
23155
|
+
});
|
|
23156
|
+
} catch (error) {
|
|
23157
|
+
logger.error("Error streaming agent builder action", { error, actionId });
|
|
23158
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error streaming agent builder action");
|
|
23159
|
+
} finally {
|
|
23160
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23161
|
+
}
|
|
23162
|
+
}
|
|
23163
|
+
});
|
|
23164
|
+
var STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23165
|
+
method: "POST",
|
|
23166
|
+
path: "/api/agent-builder/:actionId/streamVNext",
|
|
23167
|
+
responseType: "stream",
|
|
23168
|
+
pathParamSchema: actionIdPathParams,
|
|
23169
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23170
|
+
bodySchema: streamAgentBuilderBodySchema,
|
|
23171
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23172
|
+
summary: "Stream action execution (v2)",
|
|
23173
|
+
description: "Executes an action using the v2 streaming API and streams the results in real-time",
|
|
23174
|
+
tags: ["Agent Builder"],
|
|
23175
|
+
handler: async (ctx) => {
|
|
23176
|
+
const { mastra, actionId, runId, requestContext } = ctx;
|
|
23177
|
+
const logger = mastra.getLogger();
|
|
23178
|
+
try {
|
|
23179
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23180
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23181
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23182
|
+
}
|
|
23183
|
+
logger.info("Streaming agent builder action (v2)", { actionId, runId });
|
|
23184
|
+
return await chunkMH3A7RDQ_cjs.STREAM_VNEXT_WORKFLOW_ROUTE.handler({
|
|
23185
|
+
...ctx,
|
|
23186
|
+
workflowId: actionId,
|
|
23187
|
+
requestContext
|
|
23188
|
+
});
|
|
23189
|
+
} catch (error) {
|
|
23190
|
+
logger.error("Error streaming agent builder action (v2)", { error, actionId });
|
|
23191
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error streaming agent builder action");
|
|
23192
|
+
} finally {
|
|
23193
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23194
|
+
}
|
|
23195
|
+
}
|
|
23196
|
+
});
|
|
23197
|
+
var START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23198
|
+
method: "POST",
|
|
23199
|
+
path: "/api/agent-builder/:actionId/start-async",
|
|
23200
|
+
responseType: "json",
|
|
23201
|
+
pathParamSchema: actionIdPathParams,
|
|
23202
|
+
queryParamSchema: chunk2NW6POYK_cjs.optionalRunIdSchema,
|
|
23203
|
+
bodySchema: startAsyncAgentBuilderBodySchema,
|
|
23204
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowExecutionResultSchema,
|
|
23205
|
+
summary: "Start action asynchronously",
|
|
23206
|
+
description: "Starts an action execution asynchronously without streaming results",
|
|
23207
|
+
tags: ["Agent Builder"],
|
|
23208
|
+
handler: async (ctx) => {
|
|
23209
|
+
const { mastra, actionId, runId, requestContext } = ctx;
|
|
23210
|
+
const logger = mastra.getLogger();
|
|
23211
|
+
try {
|
|
23212
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23213
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23214
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23215
|
+
}
|
|
23216
|
+
logger.info("Starting agent builder action asynchronously", { actionId, runId });
|
|
23217
|
+
return await chunkMH3A7RDQ_cjs.START_ASYNC_WORKFLOW_ROUTE.handler({
|
|
23218
|
+
...ctx,
|
|
23219
|
+
workflowId: actionId,
|
|
23220
|
+
requestContext
|
|
23221
|
+
});
|
|
23222
|
+
} catch (error) {
|
|
23223
|
+
logger.error("Error starting agent builder action asynchronously", { error, actionId });
|
|
23224
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error starting agent builder action");
|
|
23225
|
+
} finally {
|
|
23226
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23227
|
+
}
|
|
23228
|
+
}
|
|
23229
|
+
});
|
|
23230
|
+
var START_AGENT_BUILDER_ACTION_RUN_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23231
|
+
method: "POST",
|
|
23232
|
+
path: "/api/agent-builder/:actionId/start",
|
|
23233
|
+
responseType: "json",
|
|
23234
|
+
pathParamSchema: actionIdPathParams,
|
|
23235
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23236
|
+
bodySchema: startAsyncAgentBuilderBodySchema,
|
|
23237
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowControlResponseSchema,
|
|
23238
|
+
summary: "Start specific action run",
|
|
23239
|
+
description: "Starts execution of a specific action run by ID",
|
|
23240
|
+
tags: ["Agent Builder"],
|
|
23241
|
+
handler: async (ctx) => {
|
|
23242
|
+
const { mastra, actionId, runId, requestContext } = ctx;
|
|
23243
|
+
const logger = mastra.getLogger();
|
|
23244
|
+
try {
|
|
23245
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23246
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23247
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23248
|
+
}
|
|
23249
|
+
logger.info("Starting specific agent builder action run", { actionId, runId });
|
|
23250
|
+
return await chunkMH3A7RDQ_cjs.START_WORKFLOW_RUN_ROUTE.handler({
|
|
23251
|
+
...ctx,
|
|
23252
|
+
workflowId: actionId,
|
|
23253
|
+
requestContext
|
|
23254
|
+
});
|
|
23255
|
+
} catch (error) {
|
|
23256
|
+
logger.error("Error starting agent builder action run", { error, actionId });
|
|
23257
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error starting agent builder action run");
|
|
23258
|
+
} finally {
|
|
23259
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23260
|
+
}
|
|
23261
|
+
}
|
|
23262
|
+
});
|
|
23263
|
+
var OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23264
|
+
method: "POST",
|
|
23265
|
+
path: "/api/agent-builder/:actionId/observe",
|
|
23266
|
+
responseType: "stream",
|
|
23267
|
+
pathParamSchema: actionIdPathParams,
|
|
23268
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23269
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23270
|
+
summary: "Observe action stream",
|
|
23271
|
+
description: "Observes and streams updates from an already running action execution",
|
|
23272
|
+
tags: ["Agent Builder"],
|
|
23273
|
+
handler: async (ctx) => {
|
|
23274
|
+
const { mastra, actionId, runId } = ctx;
|
|
23275
|
+
const logger = mastra.getLogger();
|
|
23276
|
+
try {
|
|
23277
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23278
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23279
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23280
|
+
}
|
|
23281
|
+
logger.info("Observing agent builder action stream", { actionId, runId });
|
|
23282
|
+
return await chunkMH3A7RDQ_cjs.OBSERVE_STREAM_WORKFLOW_ROUTE.handler({
|
|
23283
|
+
...ctx,
|
|
23284
|
+
workflowId: actionId
|
|
23285
|
+
});
|
|
23286
|
+
} catch (error) {
|
|
23287
|
+
logger.error("Error observing agent builder action stream", { error, actionId });
|
|
23288
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error observing agent builder action stream");
|
|
23289
|
+
} finally {
|
|
23290
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23291
|
+
}
|
|
23292
|
+
}
|
|
23293
|
+
});
|
|
23294
|
+
var OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23295
|
+
method: "POST",
|
|
23296
|
+
path: "/api/agent-builder/:actionId/observe-streamVNext",
|
|
23297
|
+
responseType: "stream",
|
|
23298
|
+
pathParamSchema: actionIdPathParams,
|
|
23299
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23300
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23301
|
+
summary: "Observe action stream (v2)",
|
|
23302
|
+
description: "Observes and streams updates from an already running action execution using v2 streaming API",
|
|
23303
|
+
tags: ["Agent Builder"],
|
|
23304
|
+
handler: async (ctx) => {
|
|
23305
|
+
const { mastra, actionId, runId } = ctx;
|
|
23306
|
+
const logger = mastra.getLogger();
|
|
23307
|
+
try {
|
|
23308
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23309
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23310
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23311
|
+
}
|
|
23312
|
+
logger.info("Observing agent builder action stream (v2)", { actionId, runId });
|
|
23313
|
+
return await chunkMH3A7RDQ_cjs.OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE.handler({
|
|
23314
|
+
...ctx,
|
|
23315
|
+
workflowId: actionId
|
|
23316
|
+
});
|
|
23317
|
+
} catch (error) {
|
|
23318
|
+
logger.error("Error observing agent builder action stream (v2)", { error, actionId });
|
|
23319
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error observing agent builder action stream");
|
|
23320
|
+
} finally {
|
|
23321
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23322
|
+
}
|
|
23323
|
+
}
|
|
23324
|
+
});
|
|
23325
|
+
var RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23326
|
+
method: "POST",
|
|
23327
|
+
path: "/api/agent-builder/:actionId/resume-async",
|
|
23328
|
+
responseType: "json",
|
|
23329
|
+
pathParamSchema: actionIdPathParams,
|
|
23330
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23331
|
+
bodySchema: resumeAgentBuilderBodySchema,
|
|
23332
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowExecutionResultSchema,
|
|
23333
|
+
summary: "Resume action asynchronously",
|
|
23334
|
+
description: "Resumes a suspended action execution asynchronously without streaming",
|
|
23335
|
+
tags: ["Agent Builder"],
|
|
23336
|
+
handler: async (ctx) => {
|
|
23337
|
+
const { mastra, actionId, runId, step, requestContext } = ctx;
|
|
23338
|
+
const logger = mastra.getLogger();
|
|
23339
|
+
try {
|
|
23340
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23341
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23342
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23343
|
+
}
|
|
23344
|
+
logger.info("Resuming agent builder action asynchronously", { actionId, runId, step });
|
|
23345
|
+
return await chunkMH3A7RDQ_cjs.RESUME_ASYNC_WORKFLOW_ROUTE.handler({
|
|
23346
|
+
...ctx,
|
|
23347
|
+
workflowId: actionId,
|
|
23348
|
+
requestContext
|
|
23349
|
+
});
|
|
23350
|
+
} catch (error) {
|
|
23351
|
+
logger.error("Error resuming agent builder action asynchronously", { error, actionId });
|
|
23352
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error resuming agent builder action");
|
|
23353
|
+
} finally {
|
|
23354
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23355
|
+
}
|
|
23356
|
+
}
|
|
23357
|
+
});
|
|
23358
|
+
var RESUME_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23359
|
+
method: "POST",
|
|
23360
|
+
path: "/api/agent-builder/:actionId/resume",
|
|
23361
|
+
responseType: "json",
|
|
23362
|
+
pathParamSchema: actionIdPathParams,
|
|
23363
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23364
|
+
bodySchema: resumeAgentBuilderBodySchema,
|
|
23365
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowControlResponseSchema,
|
|
23366
|
+
summary: "Resume action",
|
|
23367
|
+
description: "Resumes a suspended action execution from a specific step",
|
|
23368
|
+
tags: ["Agent Builder"],
|
|
23369
|
+
handler: async (ctx) => {
|
|
23370
|
+
const { mastra, actionId, runId, step, requestContext } = ctx;
|
|
23371
|
+
const logger = mastra.getLogger();
|
|
23372
|
+
try {
|
|
23373
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23374
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23375
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23376
|
+
}
|
|
23377
|
+
logger.info("Resuming agent builder action", { actionId, runId, step });
|
|
23378
|
+
return await chunkMH3A7RDQ_cjs.RESUME_WORKFLOW_ROUTE.handler({
|
|
23379
|
+
...ctx,
|
|
23380
|
+
workflowId: actionId,
|
|
23381
|
+
requestContext
|
|
23382
|
+
});
|
|
23383
|
+
} catch (error) {
|
|
23384
|
+
logger.error("Error resuming agent builder action", { error, actionId });
|
|
23385
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error resuming agent builder action");
|
|
23386
|
+
} finally {
|
|
23387
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23388
|
+
}
|
|
23389
|
+
}
|
|
23390
|
+
});
|
|
23391
|
+
var RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23392
|
+
method: "POST",
|
|
23393
|
+
path: "/api/agent-builder/:actionId/resume-stream",
|
|
23394
|
+
responseType: "stream",
|
|
23395
|
+
pathParamSchema: actionIdPathParams,
|
|
23396
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23397
|
+
bodySchema: resumeAgentBuilderBodySchema,
|
|
23398
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23399
|
+
summary: "Resume action stream",
|
|
23400
|
+
description: "Resumes a suspended action execution and continues streaming results",
|
|
23401
|
+
tags: ["Agent Builder"],
|
|
23402
|
+
handler: async (ctx) => {
|
|
23403
|
+
const { mastra, actionId, runId, step, requestContext } = ctx;
|
|
23404
|
+
const logger = mastra.getLogger();
|
|
23405
|
+
try {
|
|
23406
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23407
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23408
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23409
|
+
}
|
|
23410
|
+
logger.info("Resuming agent builder action stream", { actionId, runId, step });
|
|
23411
|
+
return await chunkMH3A7RDQ_cjs.RESUME_STREAM_WORKFLOW_ROUTE.handler({
|
|
23412
|
+
...ctx,
|
|
23413
|
+
workflowId: actionId,
|
|
23414
|
+
requestContext
|
|
23415
|
+
});
|
|
23416
|
+
} catch (error) {
|
|
23417
|
+
logger.error("Error resuming agent builder action stream", { error, actionId });
|
|
23418
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error resuming agent builder action stream");
|
|
23419
|
+
} finally {
|
|
23420
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23421
|
+
}
|
|
23422
|
+
}
|
|
23423
|
+
});
|
|
23424
|
+
var CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23425
|
+
method: "POST",
|
|
23426
|
+
path: "/api/agent-builder/:actionId/runs/:runId/cancel",
|
|
23427
|
+
responseType: "json",
|
|
23428
|
+
pathParamSchema: actionRunPathParams,
|
|
23429
|
+
responseSchema: chunkMH3A7RDQ_cjs.workflowControlResponseSchema,
|
|
23430
|
+
summary: "Cancel action run",
|
|
23431
|
+
description: "Cancels an in-progress action execution",
|
|
23432
|
+
tags: ["Agent Builder"],
|
|
23433
|
+
handler: async (ctx) => {
|
|
23434
|
+
const { mastra, actionId, runId } = ctx;
|
|
23435
|
+
const logger = mastra.getLogger();
|
|
23436
|
+
try {
|
|
23437
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23438
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23439
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23440
|
+
}
|
|
23441
|
+
logger.info("Cancelling agent builder action run", { actionId, runId });
|
|
23442
|
+
return await chunkMH3A7RDQ_cjs.CANCEL_WORKFLOW_RUN_ROUTE.handler({
|
|
23443
|
+
...ctx,
|
|
23444
|
+
workflowId: actionId
|
|
23445
|
+
});
|
|
23446
|
+
} catch (error) {
|
|
23447
|
+
logger.error("Error cancelling agent builder action run", { error, actionId });
|
|
23448
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error cancelling agent builder action run");
|
|
23449
|
+
} finally {
|
|
23450
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23451
|
+
}
|
|
23452
|
+
}
|
|
23453
|
+
});
|
|
23454
|
+
var STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23455
|
+
method: "POST",
|
|
23456
|
+
path: "/api/agent-builder/:actionId/stream-legacy",
|
|
23457
|
+
responseType: "stream",
|
|
23458
|
+
pathParamSchema: actionIdPathParams,
|
|
23459
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23460
|
+
bodySchema: streamLegacyAgentBuilderBodySchema,
|
|
23461
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23462
|
+
summary: "[DEPRECATED] Stream agent-builder action with legacy format",
|
|
23463
|
+
description: "Legacy endpoint for streaming agent-builder action execution. Use /api/agent-builder/:actionId/stream instead.",
|
|
23464
|
+
tags: ["Agent Builder", "Legacy"],
|
|
23465
|
+
handler: async (ctx) => {
|
|
23466
|
+
const { mastra, actionId, runId, requestContext } = ctx;
|
|
23467
|
+
const logger = mastra.getLogger();
|
|
23468
|
+
try {
|
|
23469
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23470
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23471
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23472
|
+
}
|
|
23473
|
+
logger.info("Streaming agent builder action (legacy)", { actionId, runId });
|
|
23474
|
+
return await chunkMH3A7RDQ_cjs.STREAM_LEGACY_WORKFLOW_ROUTE.handler({
|
|
23475
|
+
...ctx,
|
|
23476
|
+
workflowId: actionId,
|
|
23477
|
+
requestContext
|
|
23478
|
+
});
|
|
23479
|
+
} catch (error) {
|
|
23480
|
+
logger.error("Error streaming agent builder action (legacy)", { error, actionId });
|
|
23481
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error streaming agent builder action");
|
|
23482
|
+
} finally {
|
|
23483
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23484
|
+
}
|
|
23485
|
+
}
|
|
23486
|
+
});
|
|
23487
|
+
var OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = chunkSAQSK4AG_cjs.createRoute({
|
|
23488
|
+
method: "POST",
|
|
23489
|
+
path: "/api/agent-builder/:actionId/observe-stream-legacy",
|
|
23490
|
+
responseType: "stream",
|
|
23491
|
+
pathParamSchema: actionIdPathParams,
|
|
23492
|
+
queryParamSchema: chunk2NW6POYK_cjs.runIdSchema,
|
|
23493
|
+
responseSchema: chunkMWQQRVQC_cjs.streamResponseSchema,
|
|
23494
|
+
summary: "[DEPRECATED] Observe agent-builder action stream with legacy format",
|
|
23495
|
+
description: "Legacy endpoint for observing agent-builder action stream. Use /api/agent-builder/:actionId/observe instead.",
|
|
23496
|
+
tags: ["Agent Builder", "Legacy"],
|
|
23497
|
+
handler: async (ctx) => {
|
|
23498
|
+
const { mastra, actionId, runId } = ctx;
|
|
23499
|
+
const logger = mastra.getLogger();
|
|
23500
|
+
try {
|
|
23501
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.registerTemporaryWorkflows(agentBuilderWorkflows, mastra);
|
|
23502
|
+
if (actionId && !chunkUZ6CYAOG_cjs.WorkflowRegistry.isAgentBuilderWorkflow(actionId)) {
|
|
23503
|
+
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: `Invalid agent-builder action: ${actionId}` });
|
|
23504
|
+
}
|
|
23505
|
+
logger.info("Observing agent builder action stream (legacy)", { actionId, runId });
|
|
23506
|
+
return await chunkMH3A7RDQ_cjs.OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE.handler({
|
|
23507
|
+
...ctx,
|
|
23508
|
+
workflowId: actionId
|
|
23509
|
+
});
|
|
23510
|
+
} catch (error) {
|
|
23511
|
+
logger.error("Error observing agent builder action stream (legacy)", { error, actionId });
|
|
23512
|
+
return chunkV5WWQN7P_cjs.handleError(error, "Error observing agent builder action stream");
|
|
23513
|
+
} finally {
|
|
23514
|
+
chunkUZ6CYAOG_cjs.WorkflowRegistry.cleanup();
|
|
23515
|
+
}
|
|
23516
|
+
}
|
|
23517
|
+
});
|
|
22934
23518
|
|
|
23519
|
+
exports.CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE = CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE;
|
|
23520
|
+
exports.CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE = CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE;
|
|
23521
|
+
exports.GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE = GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE;
|
|
23522
|
+
exports.GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE = GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE;
|
|
23523
|
+
exports.GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE = GET_AGENT_BUILDER_ACTION_RUN_EXECUTION_RESULT_ROUTE;
|
|
23524
|
+
exports.LIST_AGENT_BUILDER_ACTIONS_ROUTE = LIST_AGENT_BUILDER_ACTIONS_ROUTE;
|
|
23525
|
+
exports.LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE = LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE;
|
|
23526
|
+
exports.OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE = OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE;
|
|
23527
|
+
exports.OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
|
|
23528
|
+
exports.OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = OBSERVE_STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE;
|
|
23529
|
+
exports.RESUME_AGENT_BUILDER_ACTION_ROUTE = RESUME_AGENT_BUILDER_ACTION_ROUTE;
|
|
23530
|
+
exports.RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE = RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE;
|
|
23531
|
+
exports.RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE = RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE;
|
|
23532
|
+
exports.START_AGENT_BUILDER_ACTION_RUN_ROUTE = START_AGENT_BUILDER_ACTION_RUN_ROUTE;
|
|
23533
|
+
exports.START_ASYNC_AGENT_BUILDER_ACTION_ROUTE = START_ASYNC_AGENT_BUILDER_ACTION_ROUTE;
|
|
23534
|
+
exports.STREAM_AGENT_BUILDER_ACTION_ROUTE = STREAM_AGENT_BUILDER_ACTION_ROUTE;
|
|
23535
|
+
exports.STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE;
|
|
23536
|
+
exports.STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE = STREAM_VNEXT_AGENT_BUILDER_ACTION_ROUTE;
|
|
22935
23537
|
exports.agent_builder_exports = agent_builder_exports;
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
exports.getAgentBuilderActionByIdHandler = getAgentBuilderActionByIdHandler;
|
|
22939
|
-
exports.getAgentBuilderActionRunByIdHandler = getAgentBuilderActionRunByIdHandler;
|
|
22940
|
-
exports.getAgentBuilderActionRunExecutionResultHandler = getAgentBuilderActionRunExecutionResultHandler;
|
|
22941
|
-
exports.getAgentBuilderActionRunsHandler = getAgentBuilderActionRunsHandler;
|
|
22942
|
-
exports.getAgentBuilderActionsHandler = getAgentBuilderActionsHandler;
|
|
22943
|
-
exports.observeStreamAgentBuilderActionHandler = observeStreamAgentBuilderActionHandler;
|
|
22944
|
-
exports.observeStreamLegacyAgentBuilderActionHandler = observeStreamLegacyAgentBuilderActionHandler;
|
|
22945
|
-
exports.observeStreamVNextAgentBuilderActionHandler = observeStreamVNextAgentBuilderActionHandler;
|
|
22946
|
-
exports.resumeAgentBuilderActionHandler = resumeAgentBuilderActionHandler;
|
|
22947
|
-
exports.resumeAsyncAgentBuilderActionHandler = resumeAsyncAgentBuilderActionHandler;
|
|
22948
|
-
exports.resumeStreamAgentBuilderActionHandler = resumeStreamAgentBuilderActionHandler;
|
|
22949
|
-
exports.startAgentBuilderActionRunHandler = startAgentBuilderActionRunHandler;
|
|
22950
|
-
exports.startAsyncAgentBuilderActionHandler = startAsyncAgentBuilderActionHandler;
|
|
22951
|
-
exports.streamAgentBuilderActionHandler = streamAgentBuilderActionHandler;
|
|
22952
|
-
exports.streamLegacyAgentBuilderActionHandler = streamLegacyAgentBuilderActionHandler;
|
|
22953
|
-
exports.streamVNextAgentBuilderActionHandler = streamVNextAgentBuilderActionHandler;
|
|
22954
|
-
//# sourceMappingURL=chunk-7HVY3D64.cjs.map
|
|
22955
|
-
//# sourceMappingURL=chunk-7HVY3D64.cjs.map
|
|
23538
|
+
//# sourceMappingURL=chunk-P6BEEW5J.cjs.map
|
|
23539
|
+
//# sourceMappingURL=chunk-P6BEEW5J.cjs.map
|