@mastra/server 0.0.0-expose-more-playground-ui-20250502141824 → 0.0.0-feat-tool-input-validation-20250731232758
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/LICENSE.md +11 -42
- package/README.md +48 -135
- package/dist/_tsup-dts-rollup.d.cts +715 -109
- package/dist/_tsup-dts-rollup.d.ts +715 -109
- package/dist/{chunk-FV45V6WC.cjs → chunk-2KZFMI6P.cjs} +1 -7
- package/dist/{chunk-5YGDYMRB.cjs → chunk-2SLFAFTR.cjs} +14 -13
- package/dist/chunk-36BLNJHS.js +2039 -0
- package/dist/chunk-424T5F2J.cjs +157 -0
- package/dist/chunk-4D66QEKC.js +81 -0
- package/dist/chunk-6KP2OBYA.cjs +544 -0
- package/dist/chunk-6T5JUKOQ.js +149 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/{chunk-M56ECCHK.cjs → chunk-7TP2LX5L.cjs} +20 -19
- package/dist/{chunk-QN4KF3BH.cjs → chunk-CCGRCYWJ.cjs} +2 -2
- package/dist/{chunk-QJ3AHN64.js → chunk-CRCR3ZUK.js} +4 -3
- package/dist/{chunk-7IWQE76Z.cjs → chunk-G7KH752Y.cjs} +16 -10
- package/dist/chunk-GHC4YV6R.js +504 -0
- package/dist/chunk-HISYIDYH.cjs +2042 -0
- package/dist/{chunk-D3G23FP3.cjs → chunk-HRSAZUIK.cjs} +24 -22
- package/dist/chunk-I5JKUCGE.cjs +308 -0
- package/dist/{chunk-Q6SHQECN.js → chunk-KHZKYUNR.js} +34 -10
- package/dist/{chunk-TRDNDNGQ.js → chunk-LCM566I4.js} +2 -7
- package/dist/chunk-LF7P5PLR.js +14 -0
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-PIAJQ75M.js +539 -0
- package/dist/chunk-PZQDCRPV.cjs +16 -0
- package/dist/chunk-QGX47B5D.cjs +86 -0
- package/dist/{chunk-WTHDCRMY.js → chunk-RG473F6Y.js} +12 -6
- package/dist/chunk-RHSWAXKB.cjs +118 -0
- package/dist/{chunk-L7XE5QTW.js → chunk-RSEO4XPX.js} +1 -1
- package/dist/chunk-SDPGVWQJ.cjs +512 -0
- package/dist/chunk-T7HAZC2E.js +527 -0
- package/dist/chunk-UCV4247U.cjs +332 -0
- package/dist/chunk-UEVYOKAH.cjs +555 -0
- package/dist/{chunk-Y3SV5XK4.js → chunk-VTTN2FW3.js} +136 -18
- package/dist/{chunk-5JNVY6DU.js → chunk-WBRFIHSF.js} +7 -5
- package/dist/{chunk-4JINXASC.js → chunk-WNVFNNWN.js} +5 -4
- package/dist/{chunk-M3YJLWTU.js → chunk-ZYAFP2AV.js} +68 -57
- package/dist/server/handlers/a2a.cjs +30 -0
- package/dist/server/handlers/a2a.d.cts +6 -0
- package/dist/server/handlers/a2a.d.ts +6 -0
- package/dist/server/handlers/a2a.js +1 -0
- package/dist/server/handlers/agents.cjs +11 -7
- package/dist/server/handlers/agents.d.cts +1 -0
- package/dist/server/handlers/agents.d.ts +1 -0
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/error.cjs +2 -2
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/legacyWorkflows.cjs +46 -0
- package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
- package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
- package/dist/server/handlers/legacyWorkflows.js +1 -0
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +33 -9
- package/dist/server/handlers/memory.d.cts +6 -0
- package/dist/server/handlers/memory.d.ts +6 -0
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/scores.cjs +30 -0
- package/dist/server/handlers/scores.d.cts +6 -0
- package/dist/server/handlers/scores.d.ts +6 -0
- package/dist/server/handlers/scores.js +1 -0
- package/dist/server/handlers/telemetry.cjs +3 -3
- package/dist/server/handlers/telemetry.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +2 -2
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vNextNetwork.cjs +218 -0
- package/dist/server/handlers/vNextNetwork.d.cts +6 -0
- package/dist/server/handlers/vNextNetwork.d.ts +6 -0
- package/dist/server/handlers/vNextNetwork.js +211 -0
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -4
- package/dist/server/handlers/voice.d.cts +1 -0
- package/dist/server/handlers/voice.d.ts +1 -0
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +33 -13
- package/dist/server/handlers/workflows.d.cts +7 -2
- package/dist/server/handlers/workflows.d.ts +7 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +39 -29
- package/dist/server/handlers.d.cts +4 -2
- package/dist/server/handlers.d.ts +4 -2
- package/dist/server/handlers.js +12 -10
- package/package.json +17 -15
- package/dist/chunk-2FJURXCL.cjs +0 -213
- package/dist/chunk-3AHQ5RGN.js +0 -11
- package/dist/chunk-3EJZQ6TQ.js +0 -49
- package/dist/chunk-4BIX6GMY.cjs +0 -189
- package/dist/chunk-55HTWX4C.cjs +0 -93
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-AELYAUEE.cjs +0 -316
- package/dist/chunk-EVCC233P.cjs +0 -321
- package/dist/chunk-JPB6RPGB.js +0 -304
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-RBQASTUP.js +0 -203
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/chunk-ZLBRQFDD.cjs +0 -13
- package/dist/server/handlers/vNextWorkflows.cjs +0 -46
- package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
- package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
- package/dist/server/handlers/vNextWorkflows.js +0 -1
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __export = (target, all) => {
|
|
5
|
-
for (var name in all)
|
|
6
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
7
|
-
};
|
|
8
|
-
|
|
9
3
|
// src/server/http-exception.ts
|
|
10
4
|
var HTTPException = class extends Error {
|
|
11
5
|
res;
|
|
@@ -19,6 +13,7 @@ var HTTPException = class extends Error {
|
|
|
19
13
|
super(options?.message, { cause: options?.cause });
|
|
20
14
|
this.res = options?.res;
|
|
21
15
|
this.status = status;
|
|
16
|
+
this.stack = options?.stack || this.stack;
|
|
22
17
|
}
|
|
23
18
|
/**
|
|
24
19
|
* Returns the response object associated with the exception.
|
|
@@ -40,4 +35,3 @@ var HTTPException = class extends Error {
|
|
|
40
35
|
};
|
|
41
36
|
|
|
42
37
|
exports.HTTPException = HTTPException;
|
|
43
|
-
exports.__export = __export;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkCCGRCYWJ_cjs = require('./chunk-CCGRCYWJ.cjs');
|
|
4
|
+
var chunkPZQDCRPV_cjs = require('./chunk-PZQDCRPV.cjs');
|
|
5
|
+
var chunk2KZFMI6P_cjs = require('./chunk-2KZFMI6P.cjs');
|
|
6
|
+
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
6
7
|
|
|
7
8
|
// src/server/handlers/network.ts
|
|
8
9
|
var network_exports = {};
|
|
9
|
-
|
|
10
|
+
chunk75ZPJI57_cjs.__export(network_exports, {
|
|
10
11
|
generateHandler: () => generateHandler,
|
|
11
12
|
getNetworkByIdHandler: () => getNetworkByIdHandler,
|
|
12
13
|
getNetworksHandler: () => getNetworksHandler,
|
|
@@ -46,7 +47,7 @@ async function getNetworksHandler({
|
|
|
46
47
|
);
|
|
47
48
|
return serializedNetworks;
|
|
48
49
|
} catch (error) {
|
|
49
|
-
return
|
|
50
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error getting networks");
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
async function getNetworkByIdHandler({
|
|
@@ -61,7 +62,7 @@ async function getNetworkByIdHandler({
|
|
|
61
62
|
return network2.formatAgentId(routingAgent2.name) === networkId;
|
|
62
63
|
});
|
|
63
64
|
if (!network) {
|
|
64
|
-
throw new
|
|
65
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(404, { message: "Network not found" });
|
|
65
66
|
}
|
|
66
67
|
const routingAgent = network.getRoutingAgent();
|
|
67
68
|
const routingLLM = await routingAgent.getLLM({ runtimeContext });
|
|
@@ -87,7 +88,7 @@ async function getNetworkByIdHandler({
|
|
|
87
88
|
};
|
|
88
89
|
return serializedNetwork;
|
|
89
90
|
} catch (error) {
|
|
90
|
-
return
|
|
91
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error getting network by ID");
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
async function generateHandler({
|
|
@@ -99,14 +100,14 @@ async function generateHandler({
|
|
|
99
100
|
try {
|
|
100
101
|
const network = mastra.getNetwork(networkId);
|
|
101
102
|
if (!network) {
|
|
102
|
-
throw new
|
|
103
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(404, { message: "Network not found" });
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
+
chunkCCGRCYWJ_cjs.validateBody({ messages: body.messages });
|
|
105
106
|
const { messages, ...rest } = body;
|
|
106
107
|
const result = await network.generate(messages, { ...rest, runtimeContext });
|
|
107
108
|
return result;
|
|
108
109
|
} catch (error) {
|
|
109
|
-
return
|
|
110
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error generating from network");
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
async function streamGenerateHandler({
|
|
@@ -118,9 +119,9 @@ async function streamGenerateHandler({
|
|
|
118
119
|
try {
|
|
119
120
|
const network = mastra.getNetwork(networkId);
|
|
120
121
|
if (!network) {
|
|
121
|
-
throw new
|
|
122
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(404, { message: "Network not found" });
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
+
chunkCCGRCYWJ_cjs.validateBody({ messages: body.messages });
|
|
124
125
|
const { messages, output, ...rest } = body;
|
|
125
126
|
const streamResult = await network.stream(messages, {
|
|
126
127
|
output,
|
|
@@ -136,7 +137,7 @@ async function streamGenerateHandler({
|
|
|
136
137
|
});
|
|
137
138
|
return streamResponse;
|
|
138
139
|
} catch (error) {
|
|
139
|
-
return
|
|
140
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error streaming from network");
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
|