@mastra/server 0.0.0-generate-message-id-20250512171942 → 0.0.0-http-transporter-20250702160118
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/dist/_tsup-dts-rollup.d.cts +394 -128
- package/dist/_tsup-dts-rollup.d.ts +394 -128
- package/dist/{chunk-OCWPVYNI.cjs → chunk-2KZFMI6P.cjs} +1 -0
- package/dist/{chunk-VPNDC2DI.cjs → chunk-2SLFAFTR.cjs} +12 -12
- package/dist/chunk-4D66QEKC.js +81 -0
- package/dist/{chunk-EJO45KYT.js → chunk-5PQQ42EZ.js} +43 -43
- package/dist/{chunk-4YZ3U35L.cjs → chunk-7TP2LX5L.cjs} +18 -18
- package/dist/chunk-B2PAS2IB.cjs +514 -0
- package/dist/{chunk-Q6KMBIAN.js → chunk-BK4XT6EG.js} +93 -14
- package/dist/{chunk-57CJTIPW.cjs → chunk-CCGRCYWJ.cjs} +2 -2
- package/dist/{chunk-C7564HUT.js → chunk-CRCR3ZUK.js} +3 -3
- package/dist/{chunk-24EGIVT7.cjs → chunk-DN7K6FJK.cjs} +91 -54
- package/dist/{chunk-ZE5AAC4I.cjs → chunk-FRVBFMO2.cjs} +26 -36
- package/dist/{chunk-MHKNLNAN.cjs → chunk-G7KH752Y.cjs} +10 -7
- package/dist/{chunk-P6SCPDYW.js → chunk-GHC4YV6R.js} +5 -1
- package/dist/chunk-H7DMHBKY.js +498 -0
- package/dist/chunk-JMLYCXMK.cjs +332 -0
- package/dist/{chunk-HFWCEP5S.js → chunk-KHZKYUNR.js} +33 -10
- package/dist/{chunk-NYN7KFXL.js → chunk-LCM566I4.js} +1 -0
- package/dist/chunk-LF7P5PLR.js +14 -0
- package/dist/{chunk-YWLUOY3D.cjs → chunk-LI436ITD.cjs} +107 -69
- package/dist/{chunk-TJKLBTFB.js → chunk-LRCAAFUA.js} +10 -20
- package/dist/{chunk-3HQNCTZ2.cjs → chunk-LZ3VJXSO.cjs} +107 -28
- package/dist/{chunk-LIVAK2DM.js → chunk-MEGCYGBU.js} +108 -70
- package/dist/{chunk-X3ZDCS52.js → chunk-MKLYEKEF.js} +62 -25
- package/dist/chunk-PZQDCRPV.cjs +16 -0
- package/dist/chunk-QGX47B5D.cjs +86 -0
- package/dist/{chunk-OR3CIE2H.js → chunk-RG473F6Y.js} +7 -4
- package/dist/chunk-RHSWAXKB.cjs +118 -0
- package/dist/{chunk-H5PTF3Y4.js → chunk-RSEO4XPX.js} +1 -1
- package/dist/{chunk-5SN4U5AC.cjs → chunk-SDPGVWQJ.cjs} +5 -1
- package/dist/{chunk-IU5VO2I2.js → chunk-WNVFNNWN.js} +4 -4
- package/dist/server/handlers/a2a.cjs +7 -7
- package/dist/server/handlers/a2a.js +1 -1
- 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/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 +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/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 +29 -13
- package/dist/server/handlers/workflows.d.cts +6 -2
- package/dist/server/handlers/workflows.d.ts +6 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +28 -28
- package/dist/server/handlers.d.cts +1 -1
- package/dist/server/handlers.d.ts +1 -1
- package/dist/server/handlers.js +11 -11
- package/package.json +12 -13
- package/dist/chunk-64U3UDTH.cjs +0 -13
- package/dist/chunk-HWZVAG3H.js +0 -49
- package/dist/chunk-I2B73Y4I.cjs +0 -332
- package/dist/chunk-M5ABIP7D.js +0 -11
- package/dist/chunk-MIQYDLLM.js +0 -329
- package/dist/chunk-OGCNNUHF.cjs +0 -54
- package/dist/chunk-UCTEMO2Q.cjs +0 -341
- package/dist/chunk-YBVOQN4M.cjs +0 -94
- 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,10 +1,14 @@
|
|
|
1
1
|
export { getWorkflowsHandler } from '../../_tsup-dts-rollup.js';
|
|
2
2
|
export { getWorkflowByIdHandler } from '../../_tsup-dts-rollup.js';
|
|
3
|
+
export { getWorkflowRunByIdHandler } from '../../_tsup-dts-rollup.js';
|
|
4
|
+
export { getWorkflowRunExecutionResultHandler } from '../../_tsup-dts-rollup.js';
|
|
5
|
+
export { createWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
|
|
3
6
|
export { startAsyncWorkflowHandler } from '../../_tsup-dts-rollup.js';
|
|
4
|
-
export { getWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
|
|
5
|
-
export { createRunHandler } from '../../_tsup-dts-rollup.js';
|
|
6
7
|
export { startWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
|
|
7
8
|
export { watchWorkflowHandler } from '../../_tsup-dts-rollup.js';
|
|
9
|
+
export { streamWorkflowHandler } from '../../_tsup-dts-rollup.js';
|
|
8
10
|
export { resumeAsyncWorkflowHandler } from '../../_tsup-dts-rollup.js';
|
|
9
11
|
export { resumeWorkflowHandler } from '../../_tsup-dts-rollup.js';
|
|
10
12
|
export { getWorkflowRunsHandler } from '../../_tsup-dts-rollup.js';
|
|
13
|
+
export { cancelWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
|
|
14
|
+
export { sendWorkflowRunEventHandler } from '../../_tsup-dts-rollup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { cancelWorkflowRunHandler, createWorkflowRunHandler, getWorkflowByIdHandler, getWorkflowRunByIdHandler, getWorkflowRunExecutionResultHandler, getWorkflowRunsHandler, getWorkflowsHandler, resumeAsyncWorkflowHandler, resumeWorkflowHandler, sendWorkflowRunEventHandler, startAsyncWorkflowHandler, startWorkflowRunHandler, streamWorkflowHandler, watchWorkflowHandler } from '../../chunk-H7DMHBKY.js';
|
package/dist/server/handlers.cjs
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
3
|
+
var chunk2SLFAFTR_cjs = require('../chunk-2SLFAFTR.cjs');
|
|
4
|
+
var chunkG7KH752Y_cjs = require('../chunk-G7KH752Y.cjs');
|
|
5
|
+
var chunkFRVBFMO2_cjs = require('../chunk-FRVBFMO2.cjs');
|
|
6
|
+
var chunk7TP2LX5L_cjs = require('../chunk-7TP2LX5L.cjs');
|
|
7
|
+
var chunkRHSWAXKB_cjs = require('../chunk-RHSWAXKB.cjs');
|
|
8
|
+
var chunkB2PAS2IB_cjs = require('../chunk-B2PAS2IB.cjs');
|
|
9
|
+
var chunkSDPGVWQJ_cjs = require('../chunk-SDPGVWQJ.cjs');
|
|
10
|
+
var chunkLZ3VJXSO_cjs = require('../chunk-LZ3VJXSO.cjs');
|
|
11
|
+
var chunkJMLYCXMK_cjs = require('../chunk-JMLYCXMK.cjs');
|
|
12
|
+
var chunkQGX47B5D_cjs = require('../chunk-QGX47B5D.cjs');
|
|
13
|
+
var chunkDN7K6FJK_cjs = require('../chunk-DN7K6FJK.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "network", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk2SLFAFTR_cjs.network_exports; }
|
|
20
20
|
});
|
|
21
|
-
Object.defineProperty(exports, "
|
|
21
|
+
Object.defineProperty(exports, "telemetry", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkG7KH752Y_cjs.telemetry_exports; }
|
|
24
24
|
});
|
|
25
|
-
Object.defineProperty(exports, "
|
|
25
|
+
Object.defineProperty(exports, "tools", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkFRVBFMO2_cjs.tools_exports; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "vector", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk7TP2LX5L_cjs.vector_exports; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "voice", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkRHSWAXKB_cjs.voice_exports; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "workflows", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkB2PAS2IB_cjs.workflows_exports; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "a2a", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkSDPGVWQJ_cjs.a2a_exports; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "agents", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkLZ3VJXSO_cjs.agents_exports; }
|
|
48
48
|
});
|
|
49
|
-
Object.defineProperty(exports, "
|
|
49
|
+
Object.defineProperty(exports, "legacyWorkflows", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkJMLYCXMK_cjs.legacyWorkflows_exports; }
|
|
52
52
|
});
|
|
53
|
-
Object.defineProperty(exports, "
|
|
53
|
+
Object.defineProperty(exports, "logs", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkQGX47B5D_cjs.logs_exports; }
|
|
56
56
|
});
|
|
57
|
-
Object.defineProperty(exports, "
|
|
57
|
+
Object.defineProperty(exports, "memory", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkDN7K6FJK_cjs.memory_exports; }
|
|
60
60
|
});
|
|
@@ -5,7 +5,7 @@ export { memory } from '../_tsup-dts-rollup.cjs';
|
|
|
5
5
|
export { network } from '../_tsup-dts-rollup.cjs';
|
|
6
6
|
export { telemetry } from '../_tsup-dts-rollup.cjs';
|
|
7
7
|
export { tools } from '../_tsup-dts-rollup.cjs';
|
|
8
|
+
export { legacyWorkflows } from '../_tsup-dts-rollup.cjs';
|
|
8
9
|
export { workflows } from '../_tsup-dts-rollup.cjs';
|
|
9
|
-
export { vNextWorkflows } from '../_tsup-dts-rollup.cjs';
|
|
10
10
|
export { vector } from '../_tsup-dts-rollup.cjs';
|
|
11
11
|
export { voice } from '../_tsup-dts-rollup.cjs';
|
|
@@ -5,7 +5,7 @@ export { memory } from '../_tsup-dts-rollup.js';
|
|
|
5
5
|
export { network } from '../_tsup-dts-rollup.js';
|
|
6
6
|
export { telemetry } from '../_tsup-dts-rollup.js';
|
|
7
7
|
export { tools } from '../_tsup-dts-rollup.js';
|
|
8
|
+
export { legacyWorkflows } from '../_tsup-dts-rollup.js';
|
|
8
9
|
export { workflows } from '../_tsup-dts-rollup.js';
|
|
9
|
-
export { vNextWorkflows } from '../_tsup-dts-rollup.js';
|
|
10
10
|
export { vector } from '../_tsup-dts-rollup.js';
|
|
11
11
|
export { voice } from '../_tsup-dts-rollup.js';
|
package/dist/server/handlers.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { vector_exports as vector } from '../chunk-
|
|
5
|
-
export { voice_exports as voice } from '../chunk-
|
|
6
|
-
export { workflows_exports as workflows } from '../chunk-
|
|
7
|
-
export { a2a_exports as a2a } from '../chunk-
|
|
8
|
-
export { agents_exports as agents } from '../chunk-
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
1
|
+
export { network_exports as network } from '../chunk-CRCR3ZUK.js';
|
|
2
|
+
export { telemetry_exports as telemetry } from '../chunk-RG473F6Y.js';
|
|
3
|
+
export { tools_exports as tools } from '../chunk-LRCAAFUA.js';
|
|
4
|
+
export { vector_exports as vector } from '../chunk-WNVFNNWN.js';
|
|
5
|
+
export { voice_exports as voice } from '../chunk-KHZKYUNR.js';
|
|
6
|
+
export { workflows_exports as workflows } from '../chunk-H7DMHBKY.js';
|
|
7
|
+
export { a2a_exports as a2a } from '../chunk-GHC4YV6R.js';
|
|
8
|
+
export { agents_exports as agents } from '../chunk-BK4XT6EG.js';
|
|
9
|
+
export { legacyWorkflows_exports as legacyWorkflows } from '../chunk-5PQQ42EZ.js';
|
|
10
|
+
export { logs_exports as logs } from '../chunk-4D66QEKC.js';
|
|
11
|
+
export { memory_exports as memory } from '../chunk-MKLYEKEF.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/server",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-http-transporter-20250702160118",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -44,24 +44,23 @@
|
|
|
44
44
|
"keywords": [],
|
|
45
45
|
"author": "",
|
|
46
46
|
"license": "Elastic-2.0",
|
|
47
|
-
"dependencies": {},
|
|
48
47
|
"peerDependencies": {
|
|
49
48
|
"zod": "^3.0.0",
|
|
50
|
-
"@mastra/core": "0.0.0-
|
|
49
|
+
"@mastra/core": "0.0.0-http-transporter-20250702160118"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@ai-sdk/openai": "^1.3.
|
|
54
|
-
"@microsoft/api-extractor": "^7.52.
|
|
55
|
-
"@types/node": "^20.
|
|
56
|
-
"eslint": "^9.
|
|
52
|
+
"@ai-sdk/openai": "^1.3.22",
|
|
53
|
+
"@microsoft/api-extractor": "^7.52.8",
|
|
54
|
+
"@types/node": "^20.19.0",
|
|
55
|
+
"eslint": "^9.29.0",
|
|
57
56
|
"superjson": "^2.2.2",
|
|
58
|
-
"tsup": "^8.
|
|
59
|
-
"typescript": "^5.8.
|
|
60
|
-
"vitest": "^2.
|
|
61
|
-
"zod": "^3.
|
|
57
|
+
"tsup": "^8.5.0",
|
|
58
|
+
"typescript": "^5.8.3",
|
|
59
|
+
"vitest": "^3.2.4",
|
|
60
|
+
"zod": "^3.25.67",
|
|
62
61
|
"zod-to-json-schema": "^3.24.5",
|
|
63
|
-
"@internal/lint": "0.0.0-
|
|
64
|
-
"@mastra/core": "0.0.0-
|
|
62
|
+
"@internal/lint": "0.0.0-http-transporter-20250702160118",
|
|
63
|
+
"@mastra/core": "0.0.0-http-transporter-20250702160118"
|
|
65
64
|
},
|
|
66
65
|
"scripts": {
|
|
67
66
|
"build": "tsup src/index.ts src/server/handlers.ts src/server/handlers/*.ts !src/server/handlers/*.test.ts --format esm,cjs --clean --experimental-dts --treeshake=smallest --splitting",
|
package/dist/chunk-64U3UDTH.cjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
|
|
4
|
-
|
|
5
|
-
// src/server/handlers/error.ts
|
|
6
|
-
function handleError(error, defaultMessage) {
|
|
7
|
-
const apiError = error;
|
|
8
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(apiError.status || 500, {
|
|
9
|
-
message: apiError.message || defaultMessage
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
exports.handleError = handleError;
|
package/dist/chunk-HWZVAG3H.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { validateBody } from './chunk-H5PTF3Y4.js';
|
|
2
|
-
import { handleError } from './chunk-M5ABIP7D.js';
|
|
3
|
-
import { __export } from './chunk-MLKGABMK.js';
|
|
4
|
-
|
|
5
|
-
// src/server/handlers/logs.ts
|
|
6
|
-
var logs_exports = {};
|
|
7
|
-
__export(logs_exports, {
|
|
8
|
-
getLogTransports: () => getLogTransports,
|
|
9
|
-
getLogsByRunIdHandler: () => getLogsByRunIdHandler,
|
|
10
|
-
getLogsHandler: () => getLogsHandler
|
|
11
|
-
});
|
|
12
|
-
async function getLogsHandler({
|
|
13
|
-
mastra,
|
|
14
|
-
transportId
|
|
15
|
-
}) {
|
|
16
|
-
try {
|
|
17
|
-
validateBody({ transportId });
|
|
18
|
-
const logs = await mastra.getLogs(transportId);
|
|
19
|
-
return logs;
|
|
20
|
-
} catch (error) {
|
|
21
|
-
return handleError(error, "Error getting logs");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async function getLogsByRunIdHandler({
|
|
25
|
-
mastra,
|
|
26
|
-
runId,
|
|
27
|
-
transportId
|
|
28
|
-
}) {
|
|
29
|
-
try {
|
|
30
|
-
validateBody({ runId, transportId });
|
|
31
|
-
const logs = await mastra.getLogsByRunId({ runId, transportId });
|
|
32
|
-
return logs;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
return handleError(error, "Error getting logs by run ID");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async function getLogTransports({ mastra }) {
|
|
38
|
-
try {
|
|
39
|
-
const logger = mastra.getLogger();
|
|
40
|
-
const transports = logger.transports;
|
|
41
|
-
return {
|
|
42
|
-
transports: transports ? Object.keys(transports) : []
|
|
43
|
-
};
|
|
44
|
-
} catch (error) {
|
|
45
|
-
return handleError(error, "Error getting log Transports");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { getLogTransports, getLogsByRunIdHandler, getLogsHandler, logs_exports };
|
package/dist/chunk-I2B73Y4I.cjs
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkYWLUOY3D_cjs = require('./chunk-YWLUOY3D.cjs');
|
|
4
|
-
var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
|
|
5
|
-
var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
|
|
6
|
-
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
7
|
-
var web = require('stream/web');
|
|
8
|
-
|
|
9
|
-
// src/server/handlers/workflows.ts
|
|
10
|
-
var workflows_exports = {};
|
|
11
|
-
chunk75ZPJI57_cjs.__export(workflows_exports, {
|
|
12
|
-
createRunHandler: () => createRunHandler,
|
|
13
|
-
getWorkflowByIdHandler: () => getWorkflowByIdHandler,
|
|
14
|
-
getWorkflowRunHandler: () => getWorkflowRunHandler,
|
|
15
|
-
getWorkflowRunsHandler: () => getWorkflowRunsHandler,
|
|
16
|
-
getWorkflowsHandler: () => getWorkflowsHandler,
|
|
17
|
-
resumeAsyncWorkflowHandler: () => resumeAsyncWorkflowHandler,
|
|
18
|
-
resumeWorkflowHandler: () => resumeWorkflowHandler,
|
|
19
|
-
startAsyncWorkflowHandler: () => startAsyncWorkflowHandler,
|
|
20
|
-
startWorkflowRunHandler: () => startWorkflowRunHandler,
|
|
21
|
-
watchWorkflowHandler: () => watchWorkflowHandler
|
|
22
|
-
});
|
|
23
|
-
async function getWorkflowsHandler({ mastra }) {
|
|
24
|
-
try {
|
|
25
|
-
const workflows = mastra.getWorkflows({ serialized: false });
|
|
26
|
-
const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
|
|
27
|
-
if (workflow.isNested) return acc;
|
|
28
|
-
acc[key] = {
|
|
29
|
-
stepGraph: workflow.stepGraph,
|
|
30
|
-
stepSubscriberGraph: workflow.stepSubscriberGraph,
|
|
31
|
-
serializedStepGraph: workflow.serializedStepGraph,
|
|
32
|
-
serializedStepSubscriberGraph: workflow.serializedStepSubscriberGraph,
|
|
33
|
-
name: workflow.name,
|
|
34
|
-
triggerSchema: workflow.triggerSchema ? chunkYWLUOY3D_cjs.stringify(chunkYWLUOY3D_cjs.esm_default(workflow.triggerSchema)) : void 0,
|
|
35
|
-
steps: Object.entries(workflow.steps).reduce((acc2, [key2, step]) => {
|
|
36
|
-
const _step = step;
|
|
37
|
-
acc2[key2] = {
|
|
38
|
-
id: _step.id,
|
|
39
|
-
description: _step.description,
|
|
40
|
-
workflowId: _step.workflowId,
|
|
41
|
-
inputSchema: _step.inputSchema ? chunkYWLUOY3D_cjs.stringify(chunkYWLUOY3D_cjs.esm_default(_step.inputSchema)) : void 0,
|
|
42
|
-
outputSchema: _step.outputSchema ? chunkYWLUOY3D_cjs.stringify(chunkYWLUOY3D_cjs.esm_default(_step.outputSchema)) : void 0
|
|
43
|
-
};
|
|
44
|
-
return acc2;
|
|
45
|
-
}, {})
|
|
46
|
-
};
|
|
47
|
-
return acc;
|
|
48
|
-
}, {});
|
|
49
|
-
return _workflows;
|
|
50
|
-
} catch (error) {
|
|
51
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflows" });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async function getWorkflowByIdHandler({ mastra, workflowId }) {
|
|
55
|
-
try {
|
|
56
|
-
if (!workflowId) {
|
|
57
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
58
|
-
}
|
|
59
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
60
|
-
if (!workflow) {
|
|
61
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
stepGraph: workflow.stepGraph,
|
|
65
|
-
stepSubscriberGraph: workflow.stepSubscriberGraph,
|
|
66
|
-
serializedStepGraph: workflow.serializedStepGraph,
|
|
67
|
-
serializedStepSubscriberGraph: workflow.serializedStepSubscriberGraph,
|
|
68
|
-
name: workflow.name,
|
|
69
|
-
triggerSchema: workflow.triggerSchema ? chunkYWLUOY3D_cjs.stringify(chunkYWLUOY3D_cjs.esm_default(workflow.triggerSchema)) : void 0,
|
|
70
|
-
steps: Object.entries(workflow.steps).reduce((acc, [key, step]) => {
|
|
71
|
-
const _step = step;
|
|
72
|
-
acc[key] = {
|
|
73
|
-
id: _step.id,
|
|
74
|
-
description: _step.description,
|
|
75
|
-
workflowId: _step.workflowId,
|
|
76
|
-
inputSchema: _step.inputSchema ? chunkYWLUOY3D_cjs.stringify(chunkYWLUOY3D_cjs.esm_default(_step.inputSchema)) : void 0,
|
|
77
|
-
outputSchema: _step.outputSchema ? chunkYWLUOY3D_cjs.stringify(chunkYWLUOY3D_cjs.esm_default(_step.outputSchema)) : void 0
|
|
78
|
-
};
|
|
79
|
-
return acc;
|
|
80
|
-
}, {})
|
|
81
|
-
};
|
|
82
|
-
} catch (error) {
|
|
83
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow" });
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function startAsyncWorkflowHandler({
|
|
87
|
-
mastra,
|
|
88
|
-
runtimeContext,
|
|
89
|
-
workflowId,
|
|
90
|
-
runId,
|
|
91
|
-
triggerData
|
|
92
|
-
}) {
|
|
93
|
-
try {
|
|
94
|
-
if (!workflowId) {
|
|
95
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
96
|
-
}
|
|
97
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
98
|
-
if (!workflow) {
|
|
99
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
100
|
-
}
|
|
101
|
-
if (!runId) {
|
|
102
|
-
const newRun = workflow.createRun();
|
|
103
|
-
const result2 = await newRun.start({
|
|
104
|
-
triggerData,
|
|
105
|
-
runtimeContext
|
|
106
|
-
});
|
|
107
|
-
return result2;
|
|
108
|
-
}
|
|
109
|
-
const run = workflow.getMemoryRun(runId);
|
|
110
|
-
if (!run) {
|
|
111
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
112
|
-
}
|
|
113
|
-
const result = await run.start({
|
|
114
|
-
triggerData,
|
|
115
|
-
runtimeContext
|
|
116
|
-
});
|
|
117
|
-
return result;
|
|
118
|
-
} catch (error) {
|
|
119
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error executing workflow" });
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async function getWorkflowRunHandler({
|
|
123
|
-
mastra,
|
|
124
|
-
workflowId,
|
|
125
|
-
runId
|
|
126
|
-
}) {
|
|
127
|
-
try {
|
|
128
|
-
if (!workflowId) {
|
|
129
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
130
|
-
}
|
|
131
|
-
if (!runId) {
|
|
132
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Run ID is required" });
|
|
133
|
-
}
|
|
134
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
135
|
-
if (!workflow) {
|
|
136
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
137
|
-
}
|
|
138
|
-
const run = await workflow.getRun(runId);
|
|
139
|
-
if (!run) {
|
|
140
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
141
|
-
}
|
|
142
|
-
return run;
|
|
143
|
-
} catch (error) {
|
|
144
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow run" });
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
async function createRunHandler({
|
|
148
|
-
mastra,
|
|
149
|
-
workflowId,
|
|
150
|
-
runId: prevRunId
|
|
151
|
-
}) {
|
|
152
|
-
try {
|
|
153
|
-
if (!workflowId) {
|
|
154
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
155
|
-
}
|
|
156
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
157
|
-
if (!workflow) {
|
|
158
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
159
|
-
}
|
|
160
|
-
const newRun = workflow.createRun({ runId: prevRunId });
|
|
161
|
-
return { runId: newRun.runId };
|
|
162
|
-
} catch (error) {
|
|
163
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error creating workflow run" });
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async function startWorkflowRunHandler({
|
|
167
|
-
mastra,
|
|
168
|
-
runtimeContext,
|
|
169
|
-
workflowId,
|
|
170
|
-
runId,
|
|
171
|
-
triggerData
|
|
172
|
-
}) {
|
|
173
|
-
try {
|
|
174
|
-
if (!workflowId) {
|
|
175
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
176
|
-
}
|
|
177
|
-
if (!runId) {
|
|
178
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to start run" });
|
|
179
|
-
}
|
|
180
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
181
|
-
const run = workflow.getMemoryRun(runId);
|
|
182
|
-
if (!run) {
|
|
183
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
184
|
-
}
|
|
185
|
-
void run.start({
|
|
186
|
-
triggerData,
|
|
187
|
-
runtimeContext
|
|
188
|
-
});
|
|
189
|
-
return { message: "Workflow run started" };
|
|
190
|
-
} catch (e) {
|
|
191
|
-
return chunk64U3UDTH_cjs.handleError(e, "Error starting workflow run");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
async function watchWorkflowHandler({
|
|
195
|
-
mastra,
|
|
196
|
-
workflowId,
|
|
197
|
-
runId
|
|
198
|
-
}) {
|
|
199
|
-
try {
|
|
200
|
-
if (!workflowId) {
|
|
201
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
202
|
-
}
|
|
203
|
-
if (!runId) {
|
|
204
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to watch workflow" });
|
|
205
|
-
}
|
|
206
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
207
|
-
const run = workflow.getMemoryRun(runId);
|
|
208
|
-
if (!run) {
|
|
209
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
210
|
-
}
|
|
211
|
-
let unwatch;
|
|
212
|
-
let asyncRef = null;
|
|
213
|
-
const stream = new web.ReadableStream({
|
|
214
|
-
start(controller) {
|
|
215
|
-
unwatch = run.watch(({ activePaths, runId: runId2, timestamp, results }) => {
|
|
216
|
-
const activePathsObj = Object.fromEntries(activePaths);
|
|
217
|
-
controller.enqueue(JSON.stringify({ activePaths: activePathsObj, runId: runId2, timestamp, results }));
|
|
218
|
-
if (asyncRef) {
|
|
219
|
-
clearImmediate(asyncRef);
|
|
220
|
-
asyncRef = null;
|
|
221
|
-
}
|
|
222
|
-
asyncRef = setImmediate(() => {
|
|
223
|
-
const runDone = Object.values(activePathsObj).every((value) => value.status !== "executing");
|
|
224
|
-
if (runDone) {
|
|
225
|
-
controller.close();
|
|
226
|
-
unwatch?.();
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
},
|
|
231
|
-
cancel() {
|
|
232
|
-
unwatch?.();
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
return stream;
|
|
236
|
-
} catch (error) {
|
|
237
|
-
return chunk64U3UDTH_cjs.handleError(error, "Error watching workflow");
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
async function resumeAsyncWorkflowHandler({
|
|
241
|
-
mastra,
|
|
242
|
-
workflowId,
|
|
243
|
-
runId,
|
|
244
|
-
body,
|
|
245
|
-
runtimeContext
|
|
246
|
-
}) {
|
|
247
|
-
try {
|
|
248
|
-
if (!workflowId) {
|
|
249
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
250
|
-
}
|
|
251
|
-
if (!runId) {
|
|
252
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
|
|
253
|
-
}
|
|
254
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
255
|
-
const run = workflow.getMemoryRun(runId);
|
|
256
|
-
if (!run) {
|
|
257
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
258
|
-
}
|
|
259
|
-
const result = await run.resume({
|
|
260
|
-
stepId: body.stepId,
|
|
261
|
-
context: body.context,
|
|
262
|
-
runtimeContext
|
|
263
|
-
});
|
|
264
|
-
return result;
|
|
265
|
-
} catch (error) {
|
|
266
|
-
return chunk64U3UDTH_cjs.handleError(error, "Error resuming workflow step");
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
async function resumeWorkflowHandler({
|
|
270
|
-
mastra,
|
|
271
|
-
workflowId,
|
|
272
|
-
runId,
|
|
273
|
-
body,
|
|
274
|
-
runtimeContext
|
|
275
|
-
}) {
|
|
276
|
-
try {
|
|
277
|
-
if (!workflowId) {
|
|
278
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
279
|
-
}
|
|
280
|
-
if (!runId) {
|
|
281
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
|
|
282
|
-
}
|
|
283
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
284
|
-
const run = workflow.getMemoryRun(runId);
|
|
285
|
-
if (!run) {
|
|
286
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
287
|
-
}
|
|
288
|
-
void run.resume({
|
|
289
|
-
stepId: body.stepId,
|
|
290
|
-
context: body.context,
|
|
291
|
-
runtimeContext
|
|
292
|
-
});
|
|
293
|
-
return { message: "Workflow run resumed" };
|
|
294
|
-
} catch (error) {
|
|
295
|
-
return chunk64U3UDTH_cjs.handleError(error, "Error resuming workflow");
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
async function getWorkflowRunsHandler({
|
|
299
|
-
mastra,
|
|
300
|
-
workflowId,
|
|
301
|
-
fromDate,
|
|
302
|
-
toDate,
|
|
303
|
-
limit,
|
|
304
|
-
offset,
|
|
305
|
-
resourceId
|
|
306
|
-
}) {
|
|
307
|
-
try {
|
|
308
|
-
if (!workflowId) {
|
|
309
|
-
throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
310
|
-
}
|
|
311
|
-
const workflow = mastra.getWorkflow(workflowId);
|
|
312
|
-
const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
|
|
313
|
-
runs: [],
|
|
314
|
-
total: 0
|
|
315
|
-
};
|
|
316
|
-
return workflowRuns;
|
|
317
|
-
} catch (error) {
|
|
318
|
-
return chunk64U3UDTH_cjs.handleError(error, "Error getting workflow runs");
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
exports.createRunHandler = createRunHandler;
|
|
323
|
-
exports.getWorkflowByIdHandler = getWorkflowByIdHandler;
|
|
324
|
-
exports.getWorkflowRunHandler = getWorkflowRunHandler;
|
|
325
|
-
exports.getWorkflowRunsHandler = getWorkflowRunsHandler;
|
|
326
|
-
exports.getWorkflowsHandler = getWorkflowsHandler;
|
|
327
|
-
exports.resumeAsyncWorkflowHandler = resumeAsyncWorkflowHandler;
|
|
328
|
-
exports.resumeWorkflowHandler = resumeWorkflowHandler;
|
|
329
|
-
exports.startAsyncWorkflowHandler = startAsyncWorkflowHandler;
|
|
330
|
-
exports.startWorkflowRunHandler = startWorkflowRunHandler;
|
|
331
|
-
exports.watchWorkflowHandler = watchWorkflowHandler;
|
|
332
|
-
exports.workflows_exports = workflows_exports;
|
package/dist/chunk-M5ABIP7D.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HTTPException } from './chunk-NYN7KFXL.js';
|
|
2
|
-
|
|
3
|
-
// src/server/handlers/error.ts
|
|
4
|
-
function handleError(error, defaultMessage) {
|
|
5
|
-
const apiError = error;
|
|
6
|
-
throw new HTTPException(apiError.status || 500, {
|
|
7
|
-
message: apiError.message || defaultMessage
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { handleError };
|