@mastra/deployer 0.10.6-alpha.0 → 0.10.6-alpha.2
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 +6 -0
- package/dist/_tsup-dts-rollup.d.ts +6 -0
- package/dist/build/index.cjs +7 -7
- package/dist/build/index.js +2 -2
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-UV4RQQ3R.js → chunk-4VKGIENI.js} +14 -6
- package/dist/{chunk-4VC5Z4YR.cjs → chunk-7ICGDVC3.cjs} +16 -8
- package/dist/{chunk-PUW6NUPY.cjs → chunk-DBEMB6OV.cjs} +74 -0
- package/dist/{chunk-77XOUHT3.js → chunk-FBZWTLPQ.js} +1 -1
- package/dist/{chunk-WM2GT75J.js → chunk-G7OBNEAD.js} +73 -0
- package/dist/{chunk-ZEUV45KC.cjs → chunk-VZ6L36CW.cjs} +6 -6
- package/dist/index.cjs +9 -9
- package/dist/index.js +3 -3
- package/dist/server/index.cjs +141 -55
- package/dist/server/index.js +142 -56
- package/dist/services/index.cjs +4 -4
- package/dist/services/index.js +1 -1
- package/package.json +4 -4
|
@@ -572,6 +572,10 @@ export declare const getVector: (c: Context, vectorName: string) => MastraVector
|
|
|
572
572
|
|
|
573
573
|
export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
|
|
574
574
|
|
|
575
|
+
export declare function getWorkflowRunByIdHandler(c: Context): Promise<Response>;
|
|
576
|
+
|
|
577
|
+
export declare function getWorkflowRunExecutionResultHandler(c: Context): Promise<Response>;
|
|
578
|
+
|
|
575
579
|
export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
576
580
|
|
|
577
581
|
export declare function getWorkflowsHandler(c: Context): Promise<Response>;
|
|
@@ -630,6 +634,8 @@ export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response
|
|
|
630
634
|
|
|
631
635
|
export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
|
|
632
636
|
|
|
637
|
+
export declare function nodeModulesExtensionResolver(): Plugin;
|
|
638
|
+
|
|
633
639
|
/**
|
|
634
640
|
* Creates TGZ packages for workspace dependencies in the workspace-module directory
|
|
635
641
|
*/
|
|
@@ -572,6 +572,10 @@ export declare const getVector: (c: Context, vectorName: string) => MastraVector
|
|
|
572
572
|
|
|
573
573
|
export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
|
|
574
574
|
|
|
575
|
+
export declare function getWorkflowRunByIdHandler(c: Context): Promise<Response>;
|
|
576
|
+
|
|
577
|
+
export declare function getWorkflowRunExecutionResultHandler(c: Context): Promise<Response>;
|
|
578
|
+
|
|
575
579
|
export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
576
580
|
|
|
577
581
|
export declare function getWorkflowsHandler(c: Context): Promise<Response>;
|
|
@@ -630,6 +634,8 @@ export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response
|
|
|
630
634
|
|
|
631
635
|
export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
|
|
632
636
|
|
|
637
|
+
export declare function nodeModulesExtensionResolver(): Plugin;
|
|
638
|
+
|
|
633
639
|
/**
|
|
634
640
|
* Creates TGZ packages for workspace dependencies in the workspace-module directory
|
|
635
641
|
*/
|
package/dist/build/index.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDBEMB6OV_cjs = require('../chunk-DBEMB6OV.cjs');
|
|
4
4
|
var chunkDTQ7BTPM_cjs = require('../chunk-DTQ7BTPM.cjs');
|
|
5
5
|
var chunkTSG63RGL_cjs = require('../chunk-TSG63RGL.cjs');
|
|
6
6
|
var chunkIMGVLBV7_cjs = require('../chunk-IMGVLBV7.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunk7ICGDVC3_cjs = require('../chunk-7ICGDVC3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "createWatcher", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkDBEMB6OV_cjs.createWatcher; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getServerOptions", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkDBEMB6OV_cjs.getServerOptions; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getWatcherInputOptions", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkDBEMB6OV_cjs.getInputOptions; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
24
24
|
enumerable: true,
|
|
@@ -42,9 +42,9 @@ Object.defineProperty(exports, "getBundlerInputOptions", {
|
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "Deps", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk7ICGDVC3_cjs.Deps; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "FileService", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk7ICGDVC3_cjs.FileService; }
|
|
50
50
|
});
|
package/dist/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-
|
|
1
|
+
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-G7OBNEAD.js';
|
|
2
2
|
export { writeTelemetryConfig } from '../chunk-EXHFPVZH.js';
|
|
3
3
|
export { analyzeBundle, getBundlerOptions } from '../chunk-WGJTOVLL.js';
|
|
4
4
|
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-HHOCIHND.js';
|
|
5
|
-
export { Deps, FileService } from '../chunk-
|
|
5
|
+
export { Deps, FileService } from '../chunk-4VKGIENI.js';
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVZ6L36CW_cjs = require('../chunk-VZ6L36CW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Bundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkVZ6L36CW_cjs.Bundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Bundler } from '../chunk-
|
|
1
|
+
export { Bundler } from '../chunk-FBZWTLPQ.js';
|
|
@@ -175,12 +175,16 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
175
175
|
logger: this.logger,
|
|
176
176
|
root: dir
|
|
177
177
|
});
|
|
178
|
+
const env = {
|
|
179
|
+
PATH: process.env.PATH
|
|
180
|
+
};
|
|
181
|
+
if (process.env.npm_config_registry) {
|
|
182
|
+
env.npm_config_registry = process.env.npm_config_registry;
|
|
183
|
+
}
|
|
178
184
|
return cpLogger({
|
|
179
185
|
cmd: runCommand,
|
|
180
186
|
args,
|
|
181
|
-
env
|
|
182
|
-
PATH: process.env.PATH
|
|
183
|
-
}
|
|
187
|
+
env
|
|
184
188
|
});
|
|
185
189
|
}
|
|
186
190
|
async installPackages(packages) {
|
|
@@ -190,6 +194,12 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
190
194
|
} else {
|
|
191
195
|
runCommand = `${this.packageManager} add`;
|
|
192
196
|
}
|
|
197
|
+
const env = {
|
|
198
|
+
PATH: process.env.PATH
|
|
199
|
+
};
|
|
200
|
+
if (process.env.npm_config_registry) {
|
|
201
|
+
env.npm_config_registry = process.env.npm_config_registry;
|
|
202
|
+
}
|
|
193
203
|
const cpLogger = createChildProcessLogger({
|
|
194
204
|
logger: this.logger,
|
|
195
205
|
root: ""
|
|
@@ -197,9 +207,7 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
197
207
|
return cpLogger({
|
|
198
208
|
cmd: `${runCommand}`,
|
|
199
209
|
args: packages,
|
|
200
|
-
env
|
|
201
|
-
PATH: process.env.PATH
|
|
202
|
-
}
|
|
210
|
+
env
|
|
203
211
|
});
|
|
204
212
|
}
|
|
205
213
|
async checkDependencies(dependencies) {
|
|
@@ -202,12 +202,16 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
202
202
|
logger: this.logger,
|
|
203
203
|
root: dir
|
|
204
204
|
});
|
|
205
|
+
const env = {
|
|
206
|
+
PATH: process.env.PATH
|
|
207
|
+
};
|
|
208
|
+
if (process.env.npm_config_registry) {
|
|
209
|
+
env.npm_config_registry = process.env.npm_config_registry;
|
|
210
|
+
}
|
|
205
211
|
return cpLogger({
|
|
206
212
|
cmd: runCommand,
|
|
207
213
|
args,
|
|
208
|
-
env
|
|
209
|
-
PATH: process.env.PATH
|
|
210
|
-
}
|
|
214
|
+
env
|
|
211
215
|
});
|
|
212
216
|
}
|
|
213
217
|
async installPackages(packages) {
|
|
@@ -217,6 +221,12 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
217
221
|
} else {
|
|
218
222
|
runCommand = `${this.packageManager} add`;
|
|
219
223
|
}
|
|
224
|
+
const env = {
|
|
225
|
+
PATH: process.env.PATH
|
|
226
|
+
};
|
|
227
|
+
if (process.env.npm_config_registry) {
|
|
228
|
+
env.npm_config_registry = process.env.npm_config_registry;
|
|
229
|
+
}
|
|
220
230
|
const cpLogger = createChildProcessLogger({
|
|
221
231
|
logger: this.logger,
|
|
222
232
|
root: ""
|
|
@@ -224,9 +234,7 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
224
234
|
return cpLogger({
|
|
225
235
|
cmd: `${runCommand}`,
|
|
226
236
|
args: packages,
|
|
227
|
-
env
|
|
228
|
-
PATH: process.env.PATH
|
|
229
|
-
}
|
|
237
|
+
env
|
|
230
238
|
});
|
|
231
239
|
}
|
|
232
240
|
async checkDependencies(dependencies) {
|
|
@@ -259,7 +267,7 @@ ${Object.entries(config.supportedArchitectures).map(([key, value]) => ` ${key}:
|
|
|
259
267
|
}
|
|
260
268
|
}
|
|
261
269
|
async getPackageVersion() {
|
|
262
|
-
const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
270
|
+
const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-7ICGDVC3.cjs', document.baseURI).href)));
|
|
263
271
|
const __dirname = path.dirname(__filename);
|
|
264
272
|
const pkgJsonPath = path__default.default.join(__dirname, "..", "..", "package.json");
|
|
265
273
|
const content = await fsExtra.readJSON(pkgJsonPath);
|
|
@@ -346,7 +354,7 @@ var FileService = class {
|
|
|
346
354
|
* @returns
|
|
347
355
|
*/
|
|
348
356
|
async copyStarterFile(inputFile, outputFilePath, replaceIfExists) {
|
|
349
|
-
const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
357
|
+
const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-7ICGDVC3.cjs', document.baseURI).href)));
|
|
350
358
|
const __dirname = path__default.default.dirname(__filename);
|
|
351
359
|
const filePath = path__default.default.resolve(__dirname, "..", "starter-files", inputFile);
|
|
352
360
|
const fileString = fs3__namespace.default.readFileSync(filePath, "utf8");
|
|
@@ -4,6 +4,9 @@ var chunkTSG63RGL_cjs = require('./chunk-TSG63RGL.cjs');
|
|
|
4
4
|
var chunkIMGVLBV7_cjs = require('./chunk-IMGVLBV7.cjs');
|
|
5
5
|
var chunk54KOF3NB_cjs = require('./chunk-54KOF3NB.cjs');
|
|
6
6
|
var rollup = require('rollup');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var resolveFrom = require('resolve-from');
|
|
9
|
+
var module$1 = require('module');
|
|
7
10
|
var babel = require('@babel/core');
|
|
8
11
|
var esbuild = require('rollup-plugin-esbuild');
|
|
9
12
|
var commonjs = require('@rollup/plugin-commonjs');
|
|
@@ -28,10 +31,80 @@ function _interopNamespace(e) {
|
|
|
28
31
|
return Object.freeze(n);
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
var resolveFrom__default = /*#__PURE__*/_interopDefault(resolveFrom);
|
|
31
35
|
var babel__namespace = /*#__PURE__*/_interopNamespace(babel);
|
|
32
36
|
var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
|
|
33
37
|
var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
|
|
34
38
|
|
|
39
|
+
function isBuiltinModule(specifier) {
|
|
40
|
+
return module$1.builtinModules.includes(specifier) || specifier.startsWith("node:") || module$1.builtinModules.includes(specifier.replace(/^node:/, ""));
|
|
41
|
+
}
|
|
42
|
+
function safeResolve(id, importer) {
|
|
43
|
+
try {
|
|
44
|
+
return resolveFrom__default.default(importer, id);
|
|
45
|
+
} catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function getPackageName(id) {
|
|
50
|
+
const parts = id.split("/");
|
|
51
|
+
if (id.startsWith("@")) {
|
|
52
|
+
return parts.slice(0, 2).join("/");
|
|
53
|
+
}
|
|
54
|
+
return parts[0];
|
|
55
|
+
}
|
|
56
|
+
function nodeModulesExtensionResolver() {
|
|
57
|
+
return {
|
|
58
|
+
name: "node-modules-extension-resolver",
|
|
59
|
+
resolveId(id, importer) {
|
|
60
|
+
if (id.startsWith(".") || id.startsWith("/") || !importer) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
if (isBuiltinModule(id)) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (id.startsWith("@") && id.split("/").length === 2) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (!id.startsWith("@") && id.split("/").length === 1) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const foundExt = path.extname(id);
|
|
73
|
+
if (foundExt) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const resolved = undefined(id);
|
|
78
|
+
if (!path.extname(resolved)) {
|
|
79
|
+
throw new Error(`Cannot resolve ${id} from ${importer}`);
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
for (const ext of [".mjs", ".js", ".cjs"]) {
|
|
84
|
+
const resolved = safeResolve(id + ext, importer);
|
|
85
|
+
if (resolved) {
|
|
86
|
+
const pkgName = getPackageName(id);
|
|
87
|
+
if (!pkgName) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const pkgJsonPath = safeResolve(`${pkgName}/package.json`, importer);
|
|
91
|
+
if (!pkgJsonPath) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const newImportWithExtension = resolved.replace(path.dirname(pkgJsonPath), pkgName);
|
|
95
|
+
return {
|
|
96
|
+
id: newImportWithExtension,
|
|
97
|
+
external: true
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/build/watcher.ts
|
|
35
108
|
async function getInputOptions2(entryFile, platform, env) {
|
|
36
109
|
const inputOptions = await chunkIMGVLBV7_cjs.getInputOptions(
|
|
37
110
|
entryFile,
|
|
@@ -49,6 +122,7 @@ async function getInputOptions2(entryFile, platform, env) {
|
|
|
49
122
|
(plugin) => !plugin || !plugin?.name || plugin.name !== "node-resolve"
|
|
50
123
|
);
|
|
51
124
|
inputOptions.plugins.push(chunkTSG63RGL_cjs.aliasHono());
|
|
125
|
+
inputOptions.plugins.push(nodeModulesExtensionResolver());
|
|
52
126
|
}
|
|
53
127
|
return inputOptions;
|
|
54
128
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writeTelemetryConfig } from './chunk-EXHFPVZH.js';
|
|
2
2
|
import { analyzeBundle } from './chunk-WGJTOVLL.js';
|
|
3
3
|
import { createBundler, getInputOptions } from './chunk-HHOCIHND.js';
|
|
4
|
-
import { DepsService, FileService } from './chunk-
|
|
4
|
+
import { DepsService, FileService } from './chunk-4VKGIENI.js';
|
|
5
5
|
import { existsSync } from 'fs';
|
|
6
6
|
import { writeFile, stat } from 'fs/promises';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
@@ -2,10 +2,82 @@ import { aliasHono, recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastr
|
|
|
2
2
|
import { getInputOptions } from './chunk-HHOCIHND.js';
|
|
3
3
|
import { tsConfigPaths } from './chunk-Z544XXXK.js';
|
|
4
4
|
import { watch, rollup } from 'rollup';
|
|
5
|
+
import { extname, dirname } from 'path';
|
|
6
|
+
import resolveFrom from 'resolve-from';
|
|
7
|
+
import { builtinModules } from 'module';
|
|
5
8
|
import * as babel from '@babel/core';
|
|
6
9
|
import esbuild from 'rollup-plugin-esbuild';
|
|
7
10
|
import commonjs from '@rollup/plugin-commonjs';
|
|
8
11
|
|
|
12
|
+
function isBuiltinModule(specifier) {
|
|
13
|
+
return builtinModules.includes(specifier) || specifier.startsWith("node:") || builtinModules.includes(specifier.replace(/^node:/, ""));
|
|
14
|
+
}
|
|
15
|
+
function safeResolve(id, importer) {
|
|
16
|
+
try {
|
|
17
|
+
return resolveFrom(importer, id);
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function getPackageName(id) {
|
|
23
|
+
const parts = id.split("/");
|
|
24
|
+
if (id.startsWith("@")) {
|
|
25
|
+
return parts.slice(0, 2).join("/");
|
|
26
|
+
}
|
|
27
|
+
return parts[0];
|
|
28
|
+
}
|
|
29
|
+
function nodeModulesExtensionResolver() {
|
|
30
|
+
return {
|
|
31
|
+
name: "node-modules-extension-resolver",
|
|
32
|
+
resolveId(id, importer) {
|
|
33
|
+
if (id.startsWith(".") || id.startsWith("/") || !importer) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (isBuiltinModule(id)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (id.startsWith("@") && id.split("/").length === 2) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if (!id.startsWith("@") && id.split("/").length === 1) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const foundExt = extname(id);
|
|
46
|
+
if (foundExt) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const resolved = import.meta.resolve(id);
|
|
51
|
+
if (!extname(resolved)) {
|
|
52
|
+
throw new Error(`Cannot resolve ${id} from ${importer}`);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
} catch (e) {
|
|
56
|
+
for (const ext of [".mjs", ".js", ".cjs"]) {
|
|
57
|
+
const resolved = safeResolve(id + ext, importer);
|
|
58
|
+
if (resolved) {
|
|
59
|
+
const pkgName = getPackageName(id);
|
|
60
|
+
if (!pkgName) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const pkgJsonPath = safeResolve(`${pkgName}/package.json`, importer);
|
|
64
|
+
if (!pkgJsonPath) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const newImportWithExtension = resolved.replace(dirname(pkgJsonPath), pkgName);
|
|
68
|
+
return {
|
|
69
|
+
id: newImportWithExtension,
|
|
70
|
+
external: true
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/build/watcher.ts
|
|
9
81
|
async function getInputOptions2(entryFile, platform, env) {
|
|
10
82
|
const inputOptions = await getInputOptions(
|
|
11
83
|
entryFile,
|
|
@@ -23,6 +95,7 @@ async function getInputOptions2(entryFile, platform, env) {
|
|
|
23
95
|
(plugin) => !plugin || !plugin?.name || plugin.name !== "node-resolve"
|
|
24
96
|
);
|
|
25
97
|
inputOptions.plugins.push(aliasHono());
|
|
98
|
+
inputOptions.plugins.push(nodeModulesExtensionResolver());
|
|
26
99
|
}
|
|
27
100
|
return inputOptions;
|
|
28
101
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkDTQ7BTPM_cjs = require('./chunk-DTQ7BTPM.cjs');
|
|
4
4
|
var chunkTSG63RGL_cjs = require('./chunk-TSG63RGL.cjs');
|
|
5
5
|
var chunkIMGVLBV7_cjs = require('./chunk-IMGVLBV7.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk7ICGDVC3_cjs = require('./chunk-7ICGDVC3.cjs');
|
|
7
7
|
var fs = require('fs');
|
|
8
8
|
var promises = require('fs/promises');
|
|
9
9
|
var path = require('path');
|
|
@@ -60,7 +60,7 @@ var collectTransitiveWorkspaceDependencies = ({
|
|
|
60
60
|
if (!root) {
|
|
61
61
|
throw new Error("Could not find workspace root");
|
|
62
62
|
}
|
|
63
|
-
const depsService = new
|
|
63
|
+
const depsService = new chunk7ICGDVC3_cjs.DepsService(root.location);
|
|
64
64
|
depsService.__setLogger(logger);
|
|
65
65
|
const sanitizedName = slugify__default.default(pkgName);
|
|
66
66
|
const tgzPath = depsService.getWorkspaceDependencyPath({
|
|
@@ -88,7 +88,7 @@ var packWorkspaceDependencies = async ({
|
|
|
88
88
|
if (!root) {
|
|
89
89
|
throw new Error("Could not find workspace root");
|
|
90
90
|
}
|
|
91
|
-
const depsService = new
|
|
91
|
+
const depsService = new chunk7ICGDVC3_cjs.DepsService(root.location);
|
|
92
92
|
depsService.__setLogger(logger);
|
|
93
93
|
if (usedWorkspacePackages.size > 0) {
|
|
94
94
|
const workspaceDirPath = path.join(bundleOutputDir, "workspace-module");
|
|
@@ -131,7 +131,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
131
131
|
}
|
|
132
132
|
async writeInstrumentationFile(outputDirectory) {
|
|
133
133
|
const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
|
|
134
|
-
const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
134
|
+
const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-VZ6L36CW.cjs', document.baseURI).href))));
|
|
135
135
|
await fsExtra.copy(path.join(__dirname, "templates", "instrumentation-template.js"), instrumentationFile);
|
|
136
136
|
}
|
|
137
137
|
async writePackageJson(outputDirectory, dependencies, resolutions) {
|
|
@@ -189,7 +189,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
189
189
|
return await chunkTSG63RGL_cjs.analyzeBundle(entry, mastraFile, path.join(outputDirectory, this.analyzeOutputDir), "node", this.logger);
|
|
190
190
|
}
|
|
191
191
|
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
192
|
-
const deps = new
|
|
192
|
+
const deps = new chunk7ICGDVC3_cjs.DepsService(rootDir);
|
|
193
193
|
deps.__setLogger(this.logger);
|
|
194
194
|
await deps.install({ dir: path.join(outputDirectory, this.outputDir) });
|
|
195
195
|
}
|
|
@@ -226,7 +226,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
226
226
|
const expandedPaths = await globby.globby(toolPath, {});
|
|
227
227
|
for (const path$1 of expandedPaths) {
|
|
228
228
|
if (await fsExtra__default.default.pathExists(path$1)) {
|
|
229
|
-
const fileService = new
|
|
229
|
+
const fileService = new chunk7ICGDVC3_cjs.FileService();
|
|
230
230
|
const entryFile = fileService.getFirstExistingFile([
|
|
231
231
|
path.join(path$1, "index.ts"),
|
|
232
232
|
path.join(path$1, "index.js"),
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVZ6L36CW_cjs = require('./chunk-VZ6L36CW.cjs');
|
|
4
4
|
var chunkTSG63RGL_cjs = require('./chunk-TSG63RGL.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk7ICGDVC3_cjs = require('./chunk-7ICGDVC3.cjs');
|
|
6
6
|
var babel = require('@babel/core');
|
|
7
7
|
var rollup = require('rollup');
|
|
8
8
|
var esbuild = require('rollup-plugin-esbuild');
|
|
@@ -33,8 +33,8 @@ var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
|
|
|
33
33
|
var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
|
|
34
34
|
|
|
35
35
|
// src/deploy/base.ts
|
|
36
|
-
var Deployer = class extends
|
|
37
|
-
deps = new
|
|
36
|
+
var Deployer = class extends chunkVZ6L36CW_cjs.Bundler {
|
|
37
|
+
deps = new chunk7ICGDVC3_cjs.DepsService();
|
|
38
38
|
constructor(args) {
|
|
39
39
|
super(args.name, "DEPLOYER");
|
|
40
40
|
this.deps.__setLogger(this.logger);
|
|
@@ -42,7 +42,7 @@ var Deployer = class extends chunkZEUV45KC_cjs.Bundler {
|
|
|
42
42
|
getEnvFiles() {
|
|
43
43
|
const possibleFiles = [".env.production", ".env.local", ".env"];
|
|
44
44
|
try {
|
|
45
|
-
const fileService = new
|
|
45
|
+
const fileService = new chunk7ICGDVC3_cjs.FileService();
|
|
46
46
|
const envFile = fileService.getFirstExistingFile(possibleFiles);
|
|
47
47
|
return Promise.resolve([envFile]);
|
|
48
48
|
} catch {
|
|
@@ -176,19 +176,19 @@ async function getDeployer(entryFile, outputDir) {
|
|
|
176
176
|
|
|
177
177
|
Object.defineProperty(exports, "Deps", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunk7ICGDVC3_cjs.Deps; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "FileService", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunk7ICGDVC3_cjs.FileService; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "createChildProcessLogger", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunk7ICGDVC3_cjs.createChildProcessLogger; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "createPinoStream", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunk7ICGDVC3_cjs.createPinoStream; }
|
|
192
192
|
});
|
|
193
193
|
exports.Deployer = Deployer;
|
|
194
194
|
exports.getDeployer = getDeployer;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bundler } from './chunk-
|
|
1
|
+
import { Bundler } from './chunk-FBZWTLPQ.js';
|
|
2
2
|
import { recursiveRemoveNonReferencedNodes } from './chunk-WGJTOVLL.js';
|
|
3
|
-
import { DepsService, FileService } from './chunk-
|
|
4
|
-
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-
|
|
3
|
+
import { DepsService, FileService } from './chunk-4VKGIENI.js';
|
|
4
|
+
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-4VKGIENI.js';
|
|
5
5
|
import * as babel from '@babel/core';
|
|
6
6
|
import babel__default from '@babel/core';
|
|
7
7
|
import { rollup } from 'rollup';
|
package/dist/server/index.cjs
CHANGED
|
@@ -4190,8 +4190,7 @@ async function startAsyncWorkflowHandler(c2) {
|
|
|
4190
4190
|
try {
|
|
4191
4191
|
const mastra = c2.get("mastra");
|
|
4192
4192
|
const workflowId = c2.req.param("workflowId");
|
|
4193
|
-
const runtimeContext = c2.
|
|
4194
|
-
const { inputData } = await c2.req.json();
|
|
4193
|
+
const { inputData, runtimeContext } = await c2.req.json();
|
|
4195
4194
|
const runId = c2.req.query("runId");
|
|
4196
4195
|
const result = await workflows.startAsyncWorkflowHandler({
|
|
4197
4196
|
mastra,
|
|
@@ -4209,8 +4208,7 @@ async function startWorkflowRunHandler(c2) {
|
|
|
4209
4208
|
try {
|
|
4210
4209
|
const mastra = c2.get("mastra");
|
|
4211
4210
|
const workflowId = c2.req.param("workflowId");
|
|
4212
|
-
const runtimeContext = c2.
|
|
4213
|
-
const { inputData } = await c2.req.json();
|
|
4211
|
+
const { inputData, runtimeContext } = await c2.req.json();
|
|
4214
4212
|
const runId = c2.req.query("runId");
|
|
4215
4213
|
await workflows.startWorkflowRunHandler({
|
|
4216
4214
|
mastra,
|
|
@@ -4267,8 +4265,7 @@ async function streamWorkflowHandler(c2) {
|
|
|
4267
4265
|
const mastra = c2.get("mastra");
|
|
4268
4266
|
const logger2 = mastra.getLogger();
|
|
4269
4267
|
const workflowId = c2.req.param("workflowId");
|
|
4270
|
-
const runtimeContext = c2.
|
|
4271
|
-
const { inputData } = await c2.req.json();
|
|
4268
|
+
const { inputData, runtimeContext } = await c2.req.json();
|
|
4272
4269
|
const runId = c2.req.query("runId");
|
|
4273
4270
|
return streaming.stream(
|
|
4274
4271
|
c2,
|
|
@@ -4306,8 +4303,7 @@ async function resumeAsyncWorkflowHandler(c2) {
|
|
|
4306
4303
|
const mastra = c2.get("mastra");
|
|
4307
4304
|
const workflowId = c2.req.param("workflowId");
|
|
4308
4305
|
const runId = c2.req.query("runId");
|
|
4309
|
-
const runtimeContext = c2.
|
|
4310
|
-
const { step, resumeData } = await c2.req.json();
|
|
4306
|
+
const { step, resumeData, runtimeContext } = await c2.req.json();
|
|
4311
4307
|
if (!runId) {
|
|
4312
4308
|
throw new httpException.HTTPException(400, { message: "runId required to resume workflow" });
|
|
4313
4309
|
}
|
|
@@ -4363,6 +4359,36 @@ async function getWorkflowRunsHandler(c2) {
|
|
|
4363
4359
|
return handleError(error, "Error getting workflow runs");
|
|
4364
4360
|
}
|
|
4365
4361
|
}
|
|
4362
|
+
async function getWorkflowRunByIdHandler(c2) {
|
|
4363
|
+
try {
|
|
4364
|
+
const mastra = c2.get("mastra");
|
|
4365
|
+
const workflowId = c2.req.param("workflowId");
|
|
4366
|
+
const runId = c2.req.param("runId");
|
|
4367
|
+
const workflowRun = await workflows.getWorkflowRunByIdHandler({
|
|
4368
|
+
mastra,
|
|
4369
|
+
workflowId,
|
|
4370
|
+
runId
|
|
4371
|
+
});
|
|
4372
|
+
return c2.json(workflowRun);
|
|
4373
|
+
} catch (error) {
|
|
4374
|
+
return handleError(error, "Error getting workflow run");
|
|
4375
|
+
}
|
|
4376
|
+
}
|
|
4377
|
+
async function getWorkflowRunExecutionResultHandler(c2) {
|
|
4378
|
+
try {
|
|
4379
|
+
const mastra = c2.get("mastra");
|
|
4380
|
+
const workflowId = c2.req.param("workflowId");
|
|
4381
|
+
const runId = c2.req.param("runId");
|
|
4382
|
+
const workflowRunExecutionResult = await workflows.getWorkflowRunExecutionResultHandler({
|
|
4383
|
+
mastra,
|
|
4384
|
+
workflowId,
|
|
4385
|
+
runId
|
|
4386
|
+
});
|
|
4387
|
+
return c2.json(workflowRunExecutionResult);
|
|
4388
|
+
} catch (error) {
|
|
4389
|
+
return handleError(error, "Error getting workflow run execution result");
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4366
4392
|
|
|
4367
4393
|
// src/server/welcome.ts
|
|
4368
4394
|
var html2 = `
|
|
@@ -6611,53 +6637,6 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
6611
6637
|
}),
|
|
6612
6638
|
watchLegacyWorkflowHandler
|
|
6613
6639
|
);
|
|
6614
|
-
app.post(
|
|
6615
|
-
"/api/workflows/:workflowId/stream",
|
|
6616
|
-
w({
|
|
6617
|
-
description: "Stream workflow in real-time",
|
|
6618
|
-
parameters: [
|
|
6619
|
-
{
|
|
6620
|
-
name: "workflowId",
|
|
6621
|
-
in: "path",
|
|
6622
|
-
required: true,
|
|
6623
|
-
schema: { type: "string" }
|
|
6624
|
-
},
|
|
6625
|
-
{
|
|
6626
|
-
name: "runId",
|
|
6627
|
-
in: "query",
|
|
6628
|
-
required: false,
|
|
6629
|
-
schema: { type: "string" }
|
|
6630
|
-
}
|
|
6631
|
-
],
|
|
6632
|
-
requestBody: {
|
|
6633
|
-
required: true,
|
|
6634
|
-
content: {
|
|
6635
|
-
"application/json": {
|
|
6636
|
-
schema: {
|
|
6637
|
-
type: "object",
|
|
6638
|
-
properties: {
|
|
6639
|
-
inputData: { type: "object" },
|
|
6640
|
-
runtimeContext: {
|
|
6641
|
-
type: "object",
|
|
6642
|
-
description: "Runtime context for the workflow execution"
|
|
6643
|
-
}
|
|
6644
|
-
}
|
|
6645
|
-
}
|
|
6646
|
-
}
|
|
6647
|
-
}
|
|
6648
|
-
},
|
|
6649
|
-
responses: {
|
|
6650
|
-
200: {
|
|
6651
|
-
description: "vNext workflow run started"
|
|
6652
|
-
},
|
|
6653
|
-
404: {
|
|
6654
|
-
description: "vNext workflow not found"
|
|
6655
|
-
}
|
|
6656
|
-
},
|
|
6657
|
-
tags: ["vNextWorkflows"]
|
|
6658
|
-
}),
|
|
6659
|
-
streamWorkflowHandler
|
|
6660
|
-
);
|
|
6661
6640
|
app.get(
|
|
6662
6641
|
"/api/workflows",
|
|
6663
6642
|
w({
|
|
@@ -6721,6 +6700,66 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
6721
6700
|
}),
|
|
6722
6701
|
getWorkflowRunsHandler
|
|
6723
6702
|
);
|
|
6703
|
+
app.get(
|
|
6704
|
+
"/api/workflows/:workflowId/runs/:runId/execution-result",
|
|
6705
|
+
w({
|
|
6706
|
+
description: "Get execution result for a workflow run",
|
|
6707
|
+
tags: ["workflows"],
|
|
6708
|
+
parameters: [
|
|
6709
|
+
{
|
|
6710
|
+
name: "workflowId",
|
|
6711
|
+
in: "path",
|
|
6712
|
+
required: true,
|
|
6713
|
+
schema: { type: "string" }
|
|
6714
|
+
},
|
|
6715
|
+
{
|
|
6716
|
+
name: "runId",
|
|
6717
|
+
in: "path",
|
|
6718
|
+
required: true,
|
|
6719
|
+
schema: { type: "string" }
|
|
6720
|
+
}
|
|
6721
|
+
],
|
|
6722
|
+
responses: {
|
|
6723
|
+
200: {
|
|
6724
|
+
description: "Workflow run execution result"
|
|
6725
|
+
},
|
|
6726
|
+
404: {
|
|
6727
|
+
description: "Workflow run execution result not found"
|
|
6728
|
+
}
|
|
6729
|
+
}
|
|
6730
|
+
}),
|
|
6731
|
+
getWorkflowRunExecutionResultHandler
|
|
6732
|
+
);
|
|
6733
|
+
app.get(
|
|
6734
|
+
"/api/workflows/:workflowId/runs/:runId",
|
|
6735
|
+
w({
|
|
6736
|
+
description: "Get workflow run by ID",
|
|
6737
|
+
tags: ["workflows"],
|
|
6738
|
+
parameters: [
|
|
6739
|
+
{
|
|
6740
|
+
name: "workflowId",
|
|
6741
|
+
in: "path",
|
|
6742
|
+
required: true,
|
|
6743
|
+
schema: { type: "string" }
|
|
6744
|
+
},
|
|
6745
|
+
{
|
|
6746
|
+
name: "runId",
|
|
6747
|
+
in: "path",
|
|
6748
|
+
required: true,
|
|
6749
|
+
schema: { type: "string" }
|
|
6750
|
+
}
|
|
6751
|
+
],
|
|
6752
|
+
responses: {
|
|
6753
|
+
200: {
|
|
6754
|
+
description: "Workflow run by ID"
|
|
6755
|
+
},
|
|
6756
|
+
404: {
|
|
6757
|
+
description: "Workflow run not found"
|
|
6758
|
+
}
|
|
6759
|
+
}
|
|
6760
|
+
}),
|
|
6761
|
+
getWorkflowRunByIdHandler
|
|
6762
|
+
);
|
|
6724
6763
|
app.post(
|
|
6725
6764
|
"/api/workflows/:workflowId/resume",
|
|
6726
6765
|
w({
|
|
@@ -6808,6 +6847,53 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
6808
6847
|
}),
|
|
6809
6848
|
resumeAsyncWorkflowHandler
|
|
6810
6849
|
);
|
|
6850
|
+
app.post(
|
|
6851
|
+
"/api/workflows/:workflowId/stream",
|
|
6852
|
+
w({
|
|
6853
|
+
description: "Stream workflow in real-time",
|
|
6854
|
+
parameters: [
|
|
6855
|
+
{
|
|
6856
|
+
name: "workflowId",
|
|
6857
|
+
in: "path",
|
|
6858
|
+
required: true,
|
|
6859
|
+
schema: { type: "string" }
|
|
6860
|
+
},
|
|
6861
|
+
{
|
|
6862
|
+
name: "runId",
|
|
6863
|
+
in: "query",
|
|
6864
|
+
required: false,
|
|
6865
|
+
schema: { type: "string" }
|
|
6866
|
+
}
|
|
6867
|
+
],
|
|
6868
|
+
requestBody: {
|
|
6869
|
+
required: true,
|
|
6870
|
+
content: {
|
|
6871
|
+
"application/json": {
|
|
6872
|
+
schema: {
|
|
6873
|
+
type: "object",
|
|
6874
|
+
properties: {
|
|
6875
|
+
inputData: { type: "object" },
|
|
6876
|
+
runtimeContext: {
|
|
6877
|
+
type: "object",
|
|
6878
|
+
description: "Runtime context for the workflow execution"
|
|
6879
|
+
}
|
|
6880
|
+
}
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6883
|
+
}
|
|
6884
|
+
},
|
|
6885
|
+
responses: {
|
|
6886
|
+
200: {
|
|
6887
|
+
description: "workflow run started"
|
|
6888
|
+
},
|
|
6889
|
+
404: {
|
|
6890
|
+
description: "workflow not found"
|
|
6891
|
+
}
|
|
6892
|
+
},
|
|
6893
|
+
tags: ["workflows"]
|
|
6894
|
+
}),
|
|
6895
|
+
streamWorkflowHandler
|
|
6896
|
+
);
|
|
6811
6897
|
app.post(
|
|
6812
6898
|
"/api/workflows/:workflowId/create-run",
|
|
6813
6899
|
bodyLimit.bodyLimit(bodyLimitOptions),
|
package/dist/server/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import { getTelemetryHandler as getTelemetryHandler$1, storeTelemetryHandler as
|
|
|
31
31
|
import { executeAgentToolHandler as executeAgentToolHandler$1, getToolsHandler as getToolsHandler$1, getToolByIdHandler as getToolByIdHandler$1, executeToolHandler as executeToolHandler$1 } from '@mastra/server/handlers/tools';
|
|
32
32
|
import { upsertVectors as upsertVectors$1, createIndex as createIndex$1, queryVectors as queryVectors$1, listIndexes as listIndexes$1, describeIndex as describeIndex$1, deleteIndex as deleteIndex$1 } from '@mastra/server/handlers/vector';
|
|
33
33
|
import { getSpeakersHandler as getSpeakersHandler$1, generateSpeechHandler, getListenerHandler as getListenerHandler$1, transcribeSpeechHandler } from '@mastra/server/handlers/voice';
|
|
34
|
-
import {
|
|
34
|
+
import { getWorkflowsHandler as getWorkflowsHandler$1, getWorkflowByIdHandler as getWorkflowByIdHandler$1, getWorkflowRunsHandler as getWorkflowRunsHandler$1, getWorkflowRunExecutionResultHandler as getWorkflowRunExecutionResultHandler$1, getWorkflowRunByIdHandler as getWorkflowRunByIdHandler$1, resumeWorkflowHandler as resumeWorkflowHandler$1, resumeAsyncWorkflowHandler as resumeAsyncWorkflowHandler$1, streamWorkflowHandler as streamWorkflowHandler$1, createWorkflowRunHandler as createWorkflowRunHandler$1, startAsyncWorkflowHandler as startAsyncWorkflowHandler$1, startWorkflowRunHandler as startWorkflowRunHandler$1, watchWorkflowHandler as watchWorkflowHandler$1 } from '@mastra/server/handlers/workflows';
|
|
35
35
|
|
|
36
36
|
// src/server/index.ts
|
|
37
37
|
var RequestError = class extends Error {
|
|
@@ -4183,8 +4183,7 @@ async function startAsyncWorkflowHandler(c2) {
|
|
|
4183
4183
|
try {
|
|
4184
4184
|
const mastra = c2.get("mastra");
|
|
4185
4185
|
const workflowId = c2.req.param("workflowId");
|
|
4186
|
-
const runtimeContext = c2.
|
|
4187
|
-
const { inputData } = await c2.req.json();
|
|
4186
|
+
const { inputData, runtimeContext } = await c2.req.json();
|
|
4188
4187
|
const runId = c2.req.query("runId");
|
|
4189
4188
|
const result = await startAsyncWorkflowHandler$1({
|
|
4190
4189
|
mastra,
|
|
@@ -4202,8 +4201,7 @@ async function startWorkflowRunHandler(c2) {
|
|
|
4202
4201
|
try {
|
|
4203
4202
|
const mastra = c2.get("mastra");
|
|
4204
4203
|
const workflowId = c2.req.param("workflowId");
|
|
4205
|
-
const runtimeContext = c2.
|
|
4206
|
-
const { inputData } = await c2.req.json();
|
|
4204
|
+
const { inputData, runtimeContext } = await c2.req.json();
|
|
4207
4205
|
const runId = c2.req.query("runId");
|
|
4208
4206
|
await startWorkflowRunHandler$1({
|
|
4209
4207
|
mastra,
|
|
@@ -4260,8 +4258,7 @@ async function streamWorkflowHandler(c2) {
|
|
|
4260
4258
|
const mastra = c2.get("mastra");
|
|
4261
4259
|
const logger2 = mastra.getLogger();
|
|
4262
4260
|
const workflowId = c2.req.param("workflowId");
|
|
4263
|
-
const runtimeContext = c2.
|
|
4264
|
-
const { inputData } = await c2.req.json();
|
|
4261
|
+
const { inputData, runtimeContext } = await c2.req.json();
|
|
4265
4262
|
const runId = c2.req.query("runId");
|
|
4266
4263
|
return stream(
|
|
4267
4264
|
c2,
|
|
@@ -4299,8 +4296,7 @@ async function resumeAsyncWorkflowHandler(c2) {
|
|
|
4299
4296
|
const mastra = c2.get("mastra");
|
|
4300
4297
|
const workflowId = c2.req.param("workflowId");
|
|
4301
4298
|
const runId = c2.req.query("runId");
|
|
4302
|
-
const runtimeContext = c2.
|
|
4303
|
-
const { step, resumeData } = await c2.req.json();
|
|
4299
|
+
const { step, resumeData, runtimeContext } = await c2.req.json();
|
|
4304
4300
|
if (!runId) {
|
|
4305
4301
|
throw new HTTPException(400, { message: "runId required to resume workflow" });
|
|
4306
4302
|
}
|
|
@@ -4356,6 +4352,36 @@ async function getWorkflowRunsHandler(c2) {
|
|
|
4356
4352
|
return handleError(error, "Error getting workflow runs");
|
|
4357
4353
|
}
|
|
4358
4354
|
}
|
|
4355
|
+
async function getWorkflowRunByIdHandler(c2) {
|
|
4356
|
+
try {
|
|
4357
|
+
const mastra = c2.get("mastra");
|
|
4358
|
+
const workflowId = c2.req.param("workflowId");
|
|
4359
|
+
const runId = c2.req.param("runId");
|
|
4360
|
+
const workflowRun = await getWorkflowRunByIdHandler$1({
|
|
4361
|
+
mastra,
|
|
4362
|
+
workflowId,
|
|
4363
|
+
runId
|
|
4364
|
+
});
|
|
4365
|
+
return c2.json(workflowRun);
|
|
4366
|
+
} catch (error) {
|
|
4367
|
+
return handleError(error, "Error getting workflow run");
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
async function getWorkflowRunExecutionResultHandler(c2) {
|
|
4371
|
+
try {
|
|
4372
|
+
const mastra = c2.get("mastra");
|
|
4373
|
+
const workflowId = c2.req.param("workflowId");
|
|
4374
|
+
const runId = c2.req.param("runId");
|
|
4375
|
+
const workflowRunExecutionResult = await getWorkflowRunExecutionResultHandler$1({
|
|
4376
|
+
mastra,
|
|
4377
|
+
workflowId,
|
|
4378
|
+
runId
|
|
4379
|
+
});
|
|
4380
|
+
return c2.json(workflowRunExecutionResult);
|
|
4381
|
+
} catch (error) {
|
|
4382
|
+
return handleError(error, "Error getting workflow run execution result");
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4359
4385
|
|
|
4360
4386
|
// src/server/welcome.ts
|
|
4361
4387
|
var html2 = `
|
|
@@ -6604,53 +6630,6 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
6604
6630
|
}),
|
|
6605
6631
|
watchLegacyWorkflowHandler
|
|
6606
6632
|
);
|
|
6607
|
-
app.post(
|
|
6608
|
-
"/api/workflows/:workflowId/stream",
|
|
6609
|
-
w({
|
|
6610
|
-
description: "Stream workflow in real-time",
|
|
6611
|
-
parameters: [
|
|
6612
|
-
{
|
|
6613
|
-
name: "workflowId",
|
|
6614
|
-
in: "path",
|
|
6615
|
-
required: true,
|
|
6616
|
-
schema: { type: "string" }
|
|
6617
|
-
},
|
|
6618
|
-
{
|
|
6619
|
-
name: "runId",
|
|
6620
|
-
in: "query",
|
|
6621
|
-
required: false,
|
|
6622
|
-
schema: { type: "string" }
|
|
6623
|
-
}
|
|
6624
|
-
],
|
|
6625
|
-
requestBody: {
|
|
6626
|
-
required: true,
|
|
6627
|
-
content: {
|
|
6628
|
-
"application/json": {
|
|
6629
|
-
schema: {
|
|
6630
|
-
type: "object",
|
|
6631
|
-
properties: {
|
|
6632
|
-
inputData: { type: "object" },
|
|
6633
|
-
runtimeContext: {
|
|
6634
|
-
type: "object",
|
|
6635
|
-
description: "Runtime context for the workflow execution"
|
|
6636
|
-
}
|
|
6637
|
-
}
|
|
6638
|
-
}
|
|
6639
|
-
}
|
|
6640
|
-
}
|
|
6641
|
-
},
|
|
6642
|
-
responses: {
|
|
6643
|
-
200: {
|
|
6644
|
-
description: "vNext workflow run started"
|
|
6645
|
-
},
|
|
6646
|
-
404: {
|
|
6647
|
-
description: "vNext workflow not found"
|
|
6648
|
-
}
|
|
6649
|
-
},
|
|
6650
|
-
tags: ["vNextWorkflows"]
|
|
6651
|
-
}),
|
|
6652
|
-
streamWorkflowHandler
|
|
6653
|
-
);
|
|
6654
6633
|
app.get(
|
|
6655
6634
|
"/api/workflows",
|
|
6656
6635
|
w({
|
|
@@ -6714,6 +6693,66 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
6714
6693
|
}),
|
|
6715
6694
|
getWorkflowRunsHandler
|
|
6716
6695
|
);
|
|
6696
|
+
app.get(
|
|
6697
|
+
"/api/workflows/:workflowId/runs/:runId/execution-result",
|
|
6698
|
+
w({
|
|
6699
|
+
description: "Get execution result for a workflow run",
|
|
6700
|
+
tags: ["workflows"],
|
|
6701
|
+
parameters: [
|
|
6702
|
+
{
|
|
6703
|
+
name: "workflowId",
|
|
6704
|
+
in: "path",
|
|
6705
|
+
required: true,
|
|
6706
|
+
schema: { type: "string" }
|
|
6707
|
+
},
|
|
6708
|
+
{
|
|
6709
|
+
name: "runId",
|
|
6710
|
+
in: "path",
|
|
6711
|
+
required: true,
|
|
6712
|
+
schema: { type: "string" }
|
|
6713
|
+
}
|
|
6714
|
+
],
|
|
6715
|
+
responses: {
|
|
6716
|
+
200: {
|
|
6717
|
+
description: "Workflow run execution result"
|
|
6718
|
+
},
|
|
6719
|
+
404: {
|
|
6720
|
+
description: "Workflow run execution result not found"
|
|
6721
|
+
}
|
|
6722
|
+
}
|
|
6723
|
+
}),
|
|
6724
|
+
getWorkflowRunExecutionResultHandler
|
|
6725
|
+
);
|
|
6726
|
+
app.get(
|
|
6727
|
+
"/api/workflows/:workflowId/runs/:runId",
|
|
6728
|
+
w({
|
|
6729
|
+
description: "Get workflow run by ID",
|
|
6730
|
+
tags: ["workflows"],
|
|
6731
|
+
parameters: [
|
|
6732
|
+
{
|
|
6733
|
+
name: "workflowId",
|
|
6734
|
+
in: "path",
|
|
6735
|
+
required: true,
|
|
6736
|
+
schema: { type: "string" }
|
|
6737
|
+
},
|
|
6738
|
+
{
|
|
6739
|
+
name: "runId",
|
|
6740
|
+
in: "path",
|
|
6741
|
+
required: true,
|
|
6742
|
+
schema: { type: "string" }
|
|
6743
|
+
}
|
|
6744
|
+
],
|
|
6745
|
+
responses: {
|
|
6746
|
+
200: {
|
|
6747
|
+
description: "Workflow run by ID"
|
|
6748
|
+
},
|
|
6749
|
+
404: {
|
|
6750
|
+
description: "Workflow run not found"
|
|
6751
|
+
}
|
|
6752
|
+
}
|
|
6753
|
+
}),
|
|
6754
|
+
getWorkflowRunByIdHandler
|
|
6755
|
+
);
|
|
6717
6756
|
app.post(
|
|
6718
6757
|
"/api/workflows/:workflowId/resume",
|
|
6719
6758
|
w({
|
|
@@ -6801,6 +6840,53 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
6801
6840
|
}),
|
|
6802
6841
|
resumeAsyncWorkflowHandler
|
|
6803
6842
|
);
|
|
6843
|
+
app.post(
|
|
6844
|
+
"/api/workflows/:workflowId/stream",
|
|
6845
|
+
w({
|
|
6846
|
+
description: "Stream workflow in real-time",
|
|
6847
|
+
parameters: [
|
|
6848
|
+
{
|
|
6849
|
+
name: "workflowId",
|
|
6850
|
+
in: "path",
|
|
6851
|
+
required: true,
|
|
6852
|
+
schema: { type: "string" }
|
|
6853
|
+
},
|
|
6854
|
+
{
|
|
6855
|
+
name: "runId",
|
|
6856
|
+
in: "query",
|
|
6857
|
+
required: false,
|
|
6858
|
+
schema: { type: "string" }
|
|
6859
|
+
}
|
|
6860
|
+
],
|
|
6861
|
+
requestBody: {
|
|
6862
|
+
required: true,
|
|
6863
|
+
content: {
|
|
6864
|
+
"application/json": {
|
|
6865
|
+
schema: {
|
|
6866
|
+
type: "object",
|
|
6867
|
+
properties: {
|
|
6868
|
+
inputData: { type: "object" },
|
|
6869
|
+
runtimeContext: {
|
|
6870
|
+
type: "object",
|
|
6871
|
+
description: "Runtime context for the workflow execution"
|
|
6872
|
+
}
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6875
|
+
}
|
|
6876
|
+
}
|
|
6877
|
+
},
|
|
6878
|
+
responses: {
|
|
6879
|
+
200: {
|
|
6880
|
+
description: "workflow run started"
|
|
6881
|
+
},
|
|
6882
|
+
404: {
|
|
6883
|
+
description: "workflow not found"
|
|
6884
|
+
}
|
|
6885
|
+
},
|
|
6886
|
+
tags: ["workflows"]
|
|
6887
|
+
}),
|
|
6888
|
+
streamWorkflowHandler
|
|
6889
|
+
);
|
|
6804
6890
|
app.post(
|
|
6805
6891
|
"/api/workflows/:workflowId/create-run",
|
|
6806
6892
|
bodyLimit(bodyLimitOptions),
|
package/dist/services/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7ICGDVC3_cjs = require('../chunk-7ICGDVC3.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "DepsService", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk7ICGDVC3_cjs.DepsService; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "EnvService", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk7ICGDVC3_cjs.EnvService; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FileService", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk7ICGDVC3_cjs.FileService; }
|
|
18
18
|
});
|
package/dist/services/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DepsService, EnvService, FileService } from '../chunk-
|
|
1
|
+
export { DepsService, EnvService, FileService } from '../chunk-4VKGIENI.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.10.6-alpha.
|
|
3
|
+
"version": "0.10.6-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"rollup-plugin-node-externals": "^8.0.0",
|
|
109
109
|
"typescript-paths": "^1.5.1",
|
|
110
110
|
"zod": "^3.25.57",
|
|
111
|
-
"@mastra/server": "^0.10.6-alpha.
|
|
111
|
+
"@mastra/server": "^0.10.6-alpha.2"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@hono/node-server": "^1.14.4",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"typescript": "^5.8.3",
|
|
129
129
|
"vitest": "^2.1.9",
|
|
130
130
|
"@internal/lint": "0.0.12",
|
|
131
|
-
"@mastra/
|
|
132
|
-
"@mastra/
|
|
131
|
+
"@mastra/mcp": "^0.10.4-alpha.0",
|
|
132
|
+
"@mastra/core": "0.10.6-alpha.2"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@mastra/core": "^0.10.2-alpha.0"
|