@mastra/server 0.0.0-extend-clickhouse-20250418135620 → 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 +763 -76
- package/dist/_tsup-dts-rollup.d.ts +763 -76
- package/dist/{chunk-FV45V6WC.cjs → chunk-2KZFMI6P.cjs} +1 -7
- package/dist/chunk-2SLFAFTR.cjs +148 -0
- 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-YANVFOYA.js → chunk-CRCR3ZUK.js} +56 -34
- 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-HABV7TZK.cjs → chunk-HRSAZUIK.cjs} +28 -26
- package/dist/chunk-I5JKUCGE.cjs +308 -0
- package/dist/{chunk-3RVHWGWO.js → chunk-KHZKYUNR.js} +36 -19
- 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-VTTN2FW3.js +299 -0
- package/dist/{chunk-XISBMH56.js → chunk-WBRFIHSF.js} +11 -9
- package/dist/{chunk-4JINXASC.js → chunk-WNVFNNWN.js} +5 -4
- package/dist/{chunk-4B7OUZXW.js → chunk-ZYAFP2AV.js} +83 -68
- 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 +40 -25
- package/dist/server/handlers.d.cts +4 -1
- package/dist/server/handlers.d.ts +4 -1
- package/dist/server/handlers.js +12 -9
- 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-4WJ5GHRG.cjs +0 -164
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-A7DF4ETD.cjs +0 -100
- package/dist/chunk-JLDXUWK7.cjs +0 -126
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-RBQASTUP.js +0 -203
- package/dist/chunk-RNU4JMLM.cjs +0 -317
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/chunk-TFFNX7FI.js +0 -156
- package/dist/chunk-ZLBRQFDD.cjs +0 -13
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPZQDCRPV_cjs = require('./chunk-PZQDCRPV.cjs');
|
|
4
|
+
var chunk2KZFMI6P_cjs = require('./chunk-2KZFMI6P.cjs');
|
|
5
|
+
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
5
6
|
|
|
6
7
|
// src/server/handlers/vector.ts
|
|
7
8
|
var vector_exports = {};
|
|
8
|
-
|
|
9
|
+
chunk75ZPJI57_cjs.__export(vector_exports, {
|
|
9
10
|
createIndex: () => createIndex,
|
|
10
11
|
deleteIndex: () => deleteIndex,
|
|
11
12
|
describeIndex: () => describeIndex,
|
|
@@ -15,24 +16,24 @@ chunkFV45V6WC_cjs.__export(vector_exports, {
|
|
|
15
16
|
});
|
|
16
17
|
function getVector(mastra, vectorName) {
|
|
17
18
|
if (!vectorName) {
|
|
18
|
-
throw new
|
|
19
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Vector name is required" });
|
|
19
20
|
}
|
|
20
21
|
const vector = mastra.getVector(vectorName);
|
|
21
22
|
if (!vector) {
|
|
22
|
-
throw new
|
|
23
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(404, { message: `Vector store ${vectorName} not found` });
|
|
23
24
|
}
|
|
24
25
|
return vector;
|
|
25
26
|
}
|
|
26
27
|
async function upsertVectors({ mastra, vectorName, index }) {
|
|
27
28
|
try {
|
|
28
29
|
if (!index?.indexName || !index?.vectors || !Array.isArray(index.vectors)) {
|
|
29
|
-
throw new
|
|
30
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Invalid request index. indexName and vectors array are required." });
|
|
30
31
|
}
|
|
31
32
|
const vector = getVector(mastra, vectorName);
|
|
32
33
|
const result = await vector.upsert(index);
|
|
33
34
|
return { ids: result };
|
|
34
35
|
} catch (error) {
|
|
35
|
-
return
|
|
36
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error upserting vectors");
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
async function createIndex({
|
|
@@ -43,18 +44,18 @@ async function createIndex({
|
|
|
43
44
|
try {
|
|
44
45
|
const { indexName, dimension, metric } = index;
|
|
45
46
|
if (!indexName || typeof dimension !== "number" || dimension <= 0) {
|
|
46
|
-
throw new
|
|
47
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, {
|
|
47
48
|
message: "Invalid request index, indexName and positive dimension number are required."
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
if (metric && !["cosine", "euclidean", "dotproduct"].includes(metric)) {
|
|
51
|
-
throw new
|
|
52
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Invalid metric. Must be one of: cosine, euclidean, dotproduct" });
|
|
52
53
|
}
|
|
53
54
|
const vector = getVector(mastra, vectorName);
|
|
54
55
|
await vector.createIndex({ indexName, dimension, metric });
|
|
55
56
|
return { success: true };
|
|
56
57
|
} catch (error) {
|
|
57
|
-
return
|
|
58
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error creating index");
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
async function queryVectors({
|
|
@@ -64,13 +65,13 @@ async function queryVectors({
|
|
|
64
65
|
}) {
|
|
65
66
|
try {
|
|
66
67
|
if (!query?.indexName || !query?.queryVector || !Array.isArray(query.queryVector)) {
|
|
67
|
-
throw new
|
|
68
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Invalid request query. indexName and queryVector array are required." });
|
|
68
69
|
}
|
|
69
70
|
const vector = getVector(mastra, vectorName);
|
|
70
71
|
const results = await vector.query(query);
|
|
71
72
|
return results;
|
|
72
73
|
} catch (error) {
|
|
73
|
-
return
|
|
74
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error querying vectors");
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
async function listIndexes({ mastra, vectorName }) {
|
|
@@ -79,7 +80,7 @@ async function listIndexes({ mastra, vectorName }) {
|
|
|
79
80
|
const indexes = await vector.listIndexes();
|
|
80
81
|
return indexes.filter(Boolean);
|
|
81
82
|
} catch (error) {
|
|
82
|
-
return
|
|
83
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error listing indexes");
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
async function describeIndex({
|
|
@@ -89,17 +90,17 @@ async function describeIndex({
|
|
|
89
90
|
}) {
|
|
90
91
|
try {
|
|
91
92
|
if (!indexName) {
|
|
92
|
-
throw new
|
|
93
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Index name is required" });
|
|
93
94
|
}
|
|
94
95
|
const vector = getVector(mastra, vectorName);
|
|
95
|
-
const stats = await vector.describeIndex(indexName);
|
|
96
|
+
const stats = await vector.describeIndex({ indexName });
|
|
96
97
|
return {
|
|
97
98
|
dimension: stats.dimension,
|
|
98
99
|
count: stats.count,
|
|
99
100
|
metric: stats.metric?.toLowerCase()
|
|
100
101
|
};
|
|
101
102
|
} catch (error) {
|
|
102
|
-
return
|
|
103
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error describing index");
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
async function deleteIndex({
|
|
@@ -109,13 +110,13 @@ async function deleteIndex({
|
|
|
109
110
|
}) {
|
|
110
111
|
try {
|
|
111
112
|
if (!indexName) {
|
|
112
|
-
throw new
|
|
113
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Index name is required" });
|
|
113
114
|
}
|
|
114
115
|
const vector = getVector(mastra, vectorName);
|
|
115
|
-
await vector.deleteIndex(indexName);
|
|
116
|
+
await vector.deleteIndex({ indexName });
|
|
116
117
|
return { success: true };
|
|
117
118
|
} catch (error) {
|
|
118
|
-
return
|
|
119
|
+
return chunkPZQDCRPV_cjs.handleError(error, "Error deleting index");
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2KZFMI6P_cjs = require('./chunk-2KZFMI6P.cjs');
|
|
4
4
|
|
|
5
5
|
// src/server/handlers/utils.ts
|
|
6
6
|
function validateBody(body) {
|
|
@@ -11,7 +11,7 @@ function validateBody(body) {
|
|
|
11
11
|
return acc;
|
|
12
12
|
}, {});
|
|
13
13
|
if (Object.keys(errorResponse).length > 0) {
|
|
14
|
-
throw new
|
|
14
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: Object.values(errorResponse)[0] });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { validateBody } from './chunk-
|
|
2
|
-
import { handleError } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { validateBody } from './chunk-RSEO4XPX.js';
|
|
2
|
+
import { handleError } from './chunk-LF7P5PLR.js';
|
|
3
|
+
import { HTTPException } from './chunk-LCM566I4.js';
|
|
4
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
4
5
|
|
|
5
6
|
// src/server/handlers/network.ts
|
|
6
7
|
var network_exports = {};
|
|
@@ -10,33 +11,48 @@ __export(network_exports, {
|
|
|
10
11
|
getNetworksHandler: () => getNetworksHandler,
|
|
11
12
|
streamGenerateHandler: () => streamGenerateHandler
|
|
12
13
|
});
|
|
13
|
-
async function getNetworksHandler({
|
|
14
|
+
async function getNetworksHandler({
|
|
15
|
+
mastra,
|
|
16
|
+
runtimeContext
|
|
17
|
+
}) {
|
|
14
18
|
try {
|
|
15
19
|
const networks = mastra.getNetworks();
|
|
16
|
-
const serializedNetworks =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
const serializedNetworks = await Promise.all(
|
|
21
|
+
networks.map(async (network) => {
|
|
22
|
+
const routingAgent = network.getRoutingAgent();
|
|
23
|
+
const routingLLM = await routingAgent.getLLM({ runtimeContext });
|
|
24
|
+
const agents = network.getAgents();
|
|
25
|
+
return {
|
|
26
|
+
id: network.formatAgentId(routingAgent.name),
|
|
27
|
+
name: routingAgent.name,
|
|
28
|
+
instructions: routingAgent.instructions,
|
|
29
|
+
agents: await Promise.all(
|
|
30
|
+
agents.map(async (agent) => {
|
|
31
|
+
const llm = await agent.getLLM({ runtimeContext });
|
|
32
|
+
return {
|
|
33
|
+
name: agent.name,
|
|
34
|
+
provider: llm?.getProvider(),
|
|
35
|
+
modelId: llm?.getModelId()
|
|
36
|
+
};
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
routingModel: {
|
|
40
|
+
provider: routingLLM?.getProvider(),
|
|
41
|
+
modelId: routingLLM?.getModelId()
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
})
|
|
45
|
+
);
|
|
34
46
|
return serializedNetworks;
|
|
35
47
|
} catch (error) {
|
|
36
48
|
return handleError(error, "Error getting networks");
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
|
-
async function getNetworkByIdHandler({
|
|
51
|
+
async function getNetworkByIdHandler({
|
|
52
|
+
mastra,
|
|
53
|
+
networkId,
|
|
54
|
+
runtimeContext
|
|
55
|
+
}) {
|
|
40
56
|
try {
|
|
41
57
|
const networks = mastra.getNetworks();
|
|
42
58
|
const network = networks.find((network2) => {
|
|
@@ -47,19 +63,25 @@ async function getNetworkByIdHandler({ mastra, networkId }) {
|
|
|
47
63
|
throw new HTTPException(404, { message: "Network not found" });
|
|
48
64
|
}
|
|
49
65
|
const routingAgent = network.getRoutingAgent();
|
|
66
|
+
const routingLLM = await routingAgent.getLLM({ runtimeContext });
|
|
50
67
|
const agents = network.getAgents();
|
|
51
68
|
const serializedNetwork = {
|
|
52
69
|
id: network.formatAgentId(routingAgent.name),
|
|
53
70
|
name: routingAgent.name,
|
|
54
71
|
instructions: routingAgent.instructions,
|
|
55
|
-
agents:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
agents: await Promise.all(
|
|
73
|
+
agents.map(async (agent) => {
|
|
74
|
+
const llm = await agent.getLLM({ runtimeContext });
|
|
75
|
+
return {
|
|
76
|
+
name: agent.name,
|
|
77
|
+
provider: llm?.getProvider(),
|
|
78
|
+
modelId: llm?.getModelId()
|
|
79
|
+
};
|
|
80
|
+
})
|
|
81
|
+
),
|
|
60
82
|
routingModel: {
|
|
61
|
-
provider:
|
|
62
|
-
modelId:
|
|
83
|
+
provider: routingLLM?.getProvider(),
|
|
84
|
+
modelId: routingLLM?.getModelId()
|
|
63
85
|
}
|
|
64
86
|
};
|
|
65
87
|
return serializedNetwork;
|
|
@@ -69,7 +91,7 @@ async function getNetworkByIdHandler({ mastra, networkId }) {
|
|
|
69
91
|
}
|
|
70
92
|
async function generateHandler({
|
|
71
93
|
mastra,
|
|
72
|
-
|
|
94
|
+
runtimeContext,
|
|
73
95
|
networkId,
|
|
74
96
|
body
|
|
75
97
|
}) {
|
|
@@ -80,7 +102,7 @@ async function generateHandler({
|
|
|
80
102
|
}
|
|
81
103
|
validateBody({ messages: body.messages });
|
|
82
104
|
const { messages, ...rest } = body;
|
|
83
|
-
const result = await network.generate(messages, { ...rest,
|
|
105
|
+
const result = await network.generate(messages, { ...rest, runtimeContext });
|
|
84
106
|
return result;
|
|
85
107
|
} catch (error) {
|
|
86
108
|
return handleError(error, "Error generating from network");
|
|
@@ -90,7 +112,7 @@ async function streamGenerateHandler({
|
|
|
90
112
|
mastra,
|
|
91
113
|
networkId,
|
|
92
114
|
body,
|
|
93
|
-
|
|
115
|
+
runtimeContext
|
|
94
116
|
}) {
|
|
95
117
|
try {
|
|
96
118
|
const network = mastra.getNetwork(networkId);
|
|
@@ -102,7 +124,7 @@ async function streamGenerateHandler({
|
|
|
102
124
|
const streamResult = await network.stream(messages, {
|
|
103
125
|
output,
|
|
104
126
|
...rest,
|
|
105
|
-
|
|
127
|
+
runtimeContext
|
|
106
128
|
});
|
|
107
129
|
const streamResponse = output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
|
|
108
130
|
sendUsage: true,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPZQDCRPV_cjs = require('./chunk-PZQDCRPV.cjs');
|
|
4
|
+
var chunk2KZFMI6P_cjs = require('./chunk-2KZFMI6P.cjs');
|
|
5
|
+
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
5
6
|
|
|
6
7
|
// src/server/handlers/telemetry.ts
|
|
7
8
|
var telemetry_exports = {};
|
|
8
|
-
|
|
9
|
+
chunk75ZPJI57_cjs.__export(telemetry_exports, {
|
|
9
10
|
getTelemetryHandler: () => getTelemetryHandler,
|
|
10
11
|
storeTelemetryHandler: () => storeTelemetryHandler
|
|
11
12
|
});
|
|
@@ -14,15 +15,15 @@ async function getTelemetryHandler({ mastra, body }) {
|
|
|
14
15
|
const telemetry = mastra.getTelemetry();
|
|
15
16
|
const storage = mastra.getStorage();
|
|
16
17
|
if (!telemetry) {
|
|
17
|
-
throw new
|
|
18
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Telemetry is not initialized" });
|
|
18
19
|
}
|
|
19
20
|
if (!storage) {
|
|
20
|
-
|
|
21
|
+
return [];
|
|
21
22
|
}
|
|
22
23
|
if (!body) {
|
|
23
|
-
throw new
|
|
24
|
+
throw new chunk2KZFMI6P_cjs.HTTPException(400, { message: "Body is required" });
|
|
24
25
|
}
|
|
25
|
-
const { name, scope, page, perPage, attribute } = body;
|
|
26
|
+
const { name, scope, page, perPage, attribute, fromDate, toDate } = body;
|
|
26
27
|
const attributes = attribute ? Object.fromEntries(
|
|
27
28
|
(Array.isArray(attribute) ? attribute : [attribute]).map((attr) => {
|
|
28
29
|
const [key, value] = attr.split(":");
|
|
@@ -34,11 +35,13 @@ async function getTelemetryHandler({ mastra, body }) {
|
|
|
34
35
|
scope,
|
|
35
36
|
page: Number(page ?? 0),
|
|
36
37
|
perPage: Number(perPage ?? 100),
|
|
37
|
-
attributes
|
|
38
|
+
attributes,
|
|
39
|
+
fromDate: fromDate ? new Date(fromDate) : void 0,
|
|
40
|
+
toDate: toDate ? new Date(toDate) : void 0
|
|
38
41
|
});
|
|
39
42
|
return traces;
|
|
40
43
|
} catch (error2) {
|
|
41
|
-
return
|
|
44
|
+
return chunkPZQDCRPV_cjs.handleError(error2, "Error getting telemetry");
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
async function storeTelemetryHandler({ mastra, body }) {
|
|
@@ -46,7 +49,10 @@ async function storeTelemetryHandler({ mastra, body }) {
|
|
|
46
49
|
const storage = mastra.getStorage();
|
|
47
50
|
const logger = mastra.getLogger();
|
|
48
51
|
if (!storage) {
|
|
49
|
-
|
|
52
|
+
return {
|
|
53
|
+
status: "error",
|
|
54
|
+
message: "Storage is not initialized"
|
|
55
|
+
};
|
|
50
56
|
}
|
|
51
57
|
const now = /* @__PURE__ */ new Date();
|
|
52
58
|
const items = body?.resourceSpans?.[0]?.scopeSpans;
|