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