@mastra/server 0.0.0-trigger-playground-ui-package-20250506151043 → 0.0.0-vector-query-sources-20250516172905
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/README.md +48 -135
- package/dist/_tsup-dts-rollup.d.cts +161 -13
- package/dist/_tsup-dts-rollup.d.ts +161 -13
- package/dist/{chunk-4JINXASC.js → chunk-55DOQLP6.js} +5 -4
- package/dist/{chunk-QN4KF3BH.cjs → chunk-57CJTIPW.cjs} +2 -2
- package/dist/chunk-5SN4U5AC.cjs +508 -0
- package/dist/{chunk-ZLBRQFDD.cjs → chunk-64U3UDTH.cjs} +2 -2
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/{chunk-M56ECCHK.cjs → chunk-BNEY4P4P.cjs} +20 -19
- package/dist/{chunk-QJ3AHN64.js → chunk-C7564HUT.js} +4 -3
- package/dist/{chunk-4BIX6GMY.cjs → chunk-D4IRYCUI.cjs} +72 -26
- package/dist/{chunk-RBQASTUP.js → chunk-DJJIUEL2.js} +13 -5
- package/dist/{chunk-3XTEV33Q.js → chunk-EJO45KYT.js} +19 -16
- package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
- package/dist/{chunk-Q6SHQECN.js → chunk-HFWCEP5S.js} +4 -3
- package/dist/{chunk-3EJZQ6TQ.js → chunk-HWZVAG3H.js} +3 -3
- package/dist/{chunk-CHFORQ7J.cjs → chunk-I2B73Y4I.cjs} +60 -57
- package/dist/chunk-LIVAK2DM.js +2001 -0
- package/dist/{chunk-3AHQ5RGN.js → chunk-M5ABIP7D.js} +1 -1
- package/dist/{chunk-AMVOS7YB.cjs → chunk-MHKNLNAN.cjs} +9 -8
- package/dist/{chunk-OWNA6I2H.js → chunk-MIQYDLLM.js} +28 -11
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
- package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
- package/dist/{chunk-SKBVVI24.cjs → chunk-OGCNNUHF.cjs} +9 -9
- package/dist/{chunk-BPL2CBLV.js → chunk-OR3CIE2H.js} +3 -2
- package/dist/chunk-P6SCPDYW.js +500 -0
- package/dist/{chunk-5JNVY6DU.js → chunk-TJKLBTFB.js} +20 -8
- package/dist/{chunk-M2RXDCPV.cjs → chunk-UCTEMO2Q.cjs} +76 -59
- package/dist/{chunk-5YGDYMRB.cjs → chunk-VPNDC2DI.cjs} +14 -13
- package/dist/{chunk-Y3SV5XK4.js → chunk-WUC6LSTW.js} +54 -8
- package/dist/{chunk-2FJURXCL.cjs → chunk-Y7UWRW5X.cjs} +43 -35
- package/dist/{chunk-55HTWX4C.cjs → chunk-YBVOQN4M.cjs} +20 -19
- package/dist/chunk-YWLUOY3D.cjs +2004 -0
- package/dist/{chunk-D3G23FP3.cjs → chunk-ZE5AAC4I.cjs} +37 -25
- 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 +7 -7
- 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/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +9 -9
- 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/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/vNextWorkflows.cjs +11 -11
- package/dist/server/handlers/vNextWorkflows.js +1 -1
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +4 -4
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +11 -11
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +28 -23
- package/dist/server/handlers.d.cts +1 -0
- package/dist/server/handlers.d.ts +1 -0
- package/dist/server/handlers.js +11 -10
- package/package.json +7 -5
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-OMN3UI6X.js +0 -5576
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
|
|
4
|
+
var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.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,13 +15,13 @@ 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 chunkOCWPVYNI_cjs.HTTPException(400, { message: "Telemetry is not initialized" });
|
|
18
19
|
}
|
|
19
20
|
if (!storage) {
|
|
20
|
-
throw new
|
|
21
|
+
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Storage is not initialized" });
|
|
21
22
|
}
|
|
22
23
|
if (!body) {
|
|
23
|
-
throw new
|
|
24
|
+
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Body is required" });
|
|
24
25
|
}
|
|
25
26
|
const { name, scope, page, perPage, attribute, fromDate, toDate } = body;
|
|
26
27
|
const attributes = attribute ? Object.fromEntries(
|
|
@@ -40,7 +41,7 @@ async function getTelemetryHandler({ mastra, body }) {
|
|
|
40
41
|
});
|
|
41
42
|
return traces;
|
|
42
43
|
} catch (error2) {
|
|
43
|
-
return
|
|
44
|
+
return chunk64U3UDTH_cjs.handleError(error2, "Error getting telemetry");
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
async function storeTelemetryHandler({ mastra, body }) {
|
|
@@ -48,7 +49,7 @@ async function storeTelemetryHandler({ mastra, body }) {
|
|
|
48
49
|
const storage = mastra.getStorage();
|
|
49
50
|
const logger = mastra.getLogger();
|
|
50
51
|
if (!storage) {
|
|
51
|
-
throw new
|
|
52
|
+
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Storage is not initialized" });
|
|
52
53
|
}
|
|
53
54
|
const now = /* @__PURE__ */ new Date();
|
|
54
55
|
const items = body?.resourceSpans?.[0]?.scopeSpans;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { stringify, esm_default } from './chunk-
|
|
2
|
-
import { handleError } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { stringify, esm_default } from './chunk-LIVAK2DM.js';
|
|
2
|
+
import { handleError } from './chunk-M5ABIP7D.js';
|
|
3
|
+
import { HTTPException } from './chunk-NYN7KFXL.js';
|
|
4
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
4
5
|
import { ReadableStream } from 'node:stream/web';
|
|
6
|
+
import { RuntimeContext } from '@mastra/core/di';
|
|
5
7
|
|
|
6
8
|
// src/server/handlers/vNextWorkflows.ts
|
|
7
9
|
var vNextWorkflows_exports = {};
|
|
@@ -124,7 +126,8 @@ async function startAsyncVNextWorkflowHandler({
|
|
|
124
126
|
runtimeContext,
|
|
125
127
|
workflowId,
|
|
126
128
|
runId,
|
|
127
|
-
inputData
|
|
129
|
+
inputData,
|
|
130
|
+
runtimeContextFromRequest
|
|
128
131
|
}) {
|
|
129
132
|
try {
|
|
130
133
|
if (!workflowId) {
|
|
@@ -134,10 +137,14 @@ async function startAsyncVNextWorkflowHandler({
|
|
|
134
137
|
if (!workflow) {
|
|
135
138
|
throw new HTTPException(404, { message: "Workflow not found" });
|
|
136
139
|
}
|
|
140
|
+
const finalRuntimeContext = new RuntimeContext([
|
|
141
|
+
...Array.from(runtimeContext?.entries() ?? []),
|
|
142
|
+
...Array.from(Object.entries(runtimeContextFromRequest ?? {}))
|
|
143
|
+
]);
|
|
137
144
|
const _run = workflow.createRun({ runId });
|
|
138
145
|
const result = await _run.start({
|
|
139
146
|
inputData,
|
|
140
|
-
runtimeContext
|
|
147
|
+
runtimeContext: finalRuntimeContext
|
|
141
148
|
});
|
|
142
149
|
return result;
|
|
143
150
|
} catch (error) {
|
|
@@ -149,7 +156,8 @@ async function startVNextWorkflowRunHandler({
|
|
|
149
156
|
runtimeContext,
|
|
150
157
|
workflowId,
|
|
151
158
|
runId,
|
|
152
|
-
inputData
|
|
159
|
+
inputData,
|
|
160
|
+
runtimeContextFromRequest
|
|
153
161
|
}) {
|
|
154
162
|
try {
|
|
155
163
|
if (!workflowId) {
|
|
@@ -163,10 +171,14 @@ async function startVNextWorkflowRunHandler({
|
|
|
163
171
|
if (!run) {
|
|
164
172
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
165
173
|
}
|
|
174
|
+
const finalRuntimeContext = new RuntimeContext([
|
|
175
|
+
...Array.from(runtimeContext?.entries() ?? []),
|
|
176
|
+
...Array.from(Object.entries(runtimeContextFromRequest ?? {}))
|
|
177
|
+
]);
|
|
166
178
|
const _run = workflow.createRun({ runId });
|
|
167
|
-
|
|
179
|
+
void _run.start({
|
|
168
180
|
inputData,
|
|
169
|
-
runtimeContext
|
|
181
|
+
runtimeContext: finalRuntimeContext
|
|
170
182
|
});
|
|
171
183
|
return { message: "Workflow run started" };
|
|
172
184
|
} catch (e) {
|
|
@@ -224,7 +236,8 @@ async function resumeAsyncVNextWorkflowHandler({
|
|
|
224
236
|
workflowId,
|
|
225
237
|
runId,
|
|
226
238
|
body,
|
|
227
|
-
runtimeContext
|
|
239
|
+
runtimeContext,
|
|
240
|
+
runtimeContextFromRequest
|
|
228
241
|
}) {
|
|
229
242
|
try {
|
|
230
243
|
if (!workflowId) {
|
|
@@ -241,11 +254,15 @@ async function resumeAsyncVNextWorkflowHandler({
|
|
|
241
254
|
if (!run) {
|
|
242
255
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
243
256
|
}
|
|
257
|
+
const finalRuntimeContext = new RuntimeContext([
|
|
258
|
+
...Array.from(runtimeContext?.entries() ?? []),
|
|
259
|
+
...Array.from(Object.entries(runtimeContextFromRequest ?? {}))
|
|
260
|
+
]);
|
|
244
261
|
const _run = workflow.createRun({ runId });
|
|
245
262
|
const result = await _run.resume({
|
|
246
263
|
step: body.step,
|
|
247
264
|
resumeData: body.resumeData,
|
|
248
|
-
runtimeContext
|
|
265
|
+
runtimeContext: finalRuntimeContext
|
|
249
266
|
});
|
|
250
267
|
return result;
|
|
251
268
|
} catch (error) {
|
|
@@ -275,7 +292,7 @@ async function resumeVNextWorkflowHandler({
|
|
|
275
292
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
276
293
|
}
|
|
277
294
|
const _run = workflow.createRun({ runId });
|
|
278
|
-
|
|
295
|
+
void _run.resume({
|
|
279
296
|
step: body.step,
|
|
280
297
|
resumeData: body.resumeData,
|
|
281
298
|
runtimeContext
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
// src/server/http-exception.ts
|
|
8
2
|
var HTTPException = class extends Error {
|
|
9
3
|
res;
|
|
@@ -37,4 +31,4 @@ var HTTPException = class extends Error {
|
|
|
37
31
|
}
|
|
38
32
|
};
|
|
39
33
|
|
|
40
|
-
export { HTTPException
|
|
34
|
+
export { HTTPException };
|
|
@@ -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;
|
|
@@ -40,4 +34,3 @@ var HTTPException = class extends Error {
|
|
|
40
34
|
};
|
|
41
35
|
|
|
42
36
|
exports.HTTPException = HTTPException;
|
|
43
|
-
exports.__export = __export;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk57CJTIPW_cjs = require('./chunk-57CJTIPW.cjs');
|
|
4
|
+
var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
|
|
5
|
+
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
6
6
|
|
|
7
7
|
// src/server/handlers/logs.ts
|
|
8
8
|
var logs_exports = {};
|
|
9
|
-
|
|
9
|
+
chunk75ZPJI57_cjs.__export(logs_exports, {
|
|
10
10
|
getLogTransports: () => getLogTransports,
|
|
11
11
|
getLogsByRunIdHandler: () => getLogsByRunIdHandler,
|
|
12
12
|
getLogsHandler: () => getLogsHandler
|
|
@@ -16,11 +16,11 @@ async function getLogsHandler({
|
|
|
16
16
|
transportId
|
|
17
17
|
}) {
|
|
18
18
|
try {
|
|
19
|
-
|
|
19
|
+
chunk57CJTIPW_cjs.validateBody({ transportId });
|
|
20
20
|
const logs = await mastra.getLogs(transportId);
|
|
21
21
|
return logs;
|
|
22
22
|
} catch (error) {
|
|
23
|
-
return
|
|
23
|
+
return chunk64U3UDTH_cjs.handleError(error, "Error getting logs");
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
async function getLogsByRunIdHandler({
|
|
@@ -29,11 +29,11 @@ async function getLogsByRunIdHandler({
|
|
|
29
29
|
transportId
|
|
30
30
|
}) {
|
|
31
31
|
try {
|
|
32
|
-
|
|
32
|
+
chunk57CJTIPW_cjs.validateBody({ runId, transportId });
|
|
33
33
|
const logs = await mastra.getLogsByRunId({ runId, transportId });
|
|
34
34
|
return logs;
|
|
35
35
|
} catch (error) {
|
|
36
|
-
return
|
|
36
|
+
return chunk64U3UDTH_cjs.handleError(error, "Error getting logs by run ID");
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
async function getLogTransports({ mastra }) {
|
|
@@ -44,7 +44,7 @@ async function getLogTransports({ mastra }) {
|
|
|
44
44
|
transports: transports ? Object.keys(transports) : []
|
|
45
45
|
};
|
|
46
46
|
} catch (error) {
|
|
47
|
-
return
|
|
47
|
+
return chunk64U3UDTH_cjs.handleError(error, "Error getting log Transports");
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { handleError } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { handleError } from './chunk-M5ABIP7D.js';
|
|
2
|
+
import { HTTPException } from './chunk-NYN7KFXL.js';
|
|
3
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
3
4
|
|
|
4
5
|
// src/server/handlers/telemetry.ts
|
|
5
6
|
var telemetry_exports = {};
|