@mastra/deployer 0.3.0-alpha.9 → 0.3.1-alpha.1
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 +23 -3
- package/dist/_tsup-dts-rollup.d.ts +23 -3
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/index.cjs +6 -6
- package/dist/build/index.js +2 -2
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-LA6Y6GAB.cjs → chunk-6J52IX4J.cjs} +10 -0
- package/dist/{chunk-ITJLMUBF.js → chunk-ABTWXYGO.js} +1 -1
- package/dist/{chunk-EZPRF2XZ.cjs → chunk-GO4WLOL7.cjs} +9 -9
- package/dist/{chunk-GDLBKKIV.cjs → chunk-KCX3UGHY.cjs} +2 -2
- package/dist/{chunk-M6HTLNVA.js → chunk-OV2EMRTY.js} +6 -6
- package/dist/{chunk-USZDOFES.js → chunk-QJQ2V3Z2.js} +10 -0
- package/dist/index.cjs +12 -8
- package/dist/index.js +11 -7
- package/dist/server/index.cjs +479 -30
- package/dist/server/index.js +477 -27
- package/package.json +3 -3
|
@@ -24,7 +24,7 @@ import type { ResolveHookContext } from 'node:module';
|
|
|
24
24
|
import { RollupBuild } from 'rollup';
|
|
25
25
|
import { RollupOutput } from 'rollup';
|
|
26
26
|
import { RollupWatcher } from 'rollup';
|
|
27
|
-
import { RuntimeContext } from '@mastra/core/
|
|
27
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
28
28
|
import { ServerType } from '@hono/node-server';
|
|
29
29
|
import { Transform } from 'stream';
|
|
30
30
|
import { TypedResponse } from 'hono';
|
|
@@ -135,6 +135,8 @@ export declare function createRunHandler(c: Context): Promise<Response>;
|
|
|
135
135
|
|
|
136
136
|
export declare function createThreadHandler(c: Context): Promise<Response>;
|
|
137
137
|
|
|
138
|
+
export declare function createVNextWorkflowRunHandler(c: Context): Promise<Response>;
|
|
139
|
+
|
|
138
140
|
declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
|
|
139
141
|
export { createWatcher }
|
|
140
142
|
export { createWatcher as createWatcher_alias_1 }
|
|
@@ -268,11 +270,13 @@ modelId: string;
|
|
|
268
270
|
|
|
269
271
|
export declare function getAgentsHandler(c: Context): Promise<Response & TypedResponse<any, ContentfulStatusCode, "json">>;
|
|
270
272
|
|
|
271
|
-
declare function getDeployer(entryFile: string, outputDir: string): Promise<MastraDeployer>;
|
|
273
|
+
declare function getDeployer(entryFile: string, outputDir: string): Promise<MastraDeployer | undefined>;
|
|
272
274
|
export { getDeployer }
|
|
273
275
|
export { getDeployer as getDeployer_alias_1 }
|
|
274
276
|
|
|
275
|
-
export declare function getDeployerBundler(entryFile: string
|
|
277
|
+
export declare function getDeployerBundler(entryFile: string, result: {
|
|
278
|
+
isDeployerRemoved: boolean;
|
|
279
|
+
}): Promise<RollupBuild>;
|
|
276
280
|
|
|
277
281
|
export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
|
|
278
282
|
id: string;
|
|
@@ -377,6 +381,12 @@ export declare function getToolsHandler(c: Context): Promise<Response>;
|
|
|
377
381
|
|
|
378
382
|
export declare const getVector: (c: Context, vectorName: string) => MastraVector;
|
|
379
383
|
|
|
384
|
+
export declare function getVNextWorkflowByIdHandler(c: Context): Promise<Response>;
|
|
385
|
+
|
|
386
|
+
export declare function getVNextWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
387
|
+
|
|
388
|
+
export declare function getVNextWorkflowsHandler(c: Context): Promise<Response>;
|
|
389
|
+
|
|
380
390
|
export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
|
|
381
391
|
|
|
382
392
|
export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
@@ -461,8 +471,12 @@ export declare function resolve(specifier: string, context: ResolveHookContext,
|
|
|
461
471
|
url: string;
|
|
462
472
|
}>;
|
|
463
473
|
|
|
474
|
+
export declare function resumeAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
475
|
+
|
|
464
476
|
export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
|
|
465
477
|
|
|
478
|
+
export declare function resumeVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
479
|
+
|
|
466
480
|
export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
|
|
467
481
|
|
|
468
482
|
export declare function rootHandler(c: Context): Promise<Response & TypedResponse<"Hello to the Mastra API!", ContentfulStatusCode, "text">>;
|
|
@@ -483,8 +497,12 @@ export declare function setAgentInstructionsHandler(c: Context): Promise<Respons
|
|
|
483
497
|
*/
|
|
484
498
|
export declare function speakHandler(c: Context): Promise<Response>;
|
|
485
499
|
|
|
500
|
+
export declare function startAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
501
|
+
|
|
486
502
|
export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
|
|
487
503
|
|
|
504
|
+
export declare function startVNextWorkflowRunHandler(c: Context): Promise<Response>;
|
|
505
|
+
|
|
488
506
|
export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
|
|
489
507
|
|
|
490
508
|
export declare function storeTelemetryHandler(c: Context): Promise<Response>;
|
|
@@ -523,6 +541,8 @@ declare type Variables = {
|
|
|
523
541
|
isDev: boolean;
|
|
524
542
|
};
|
|
525
543
|
|
|
544
|
+
export declare function watchVNextWorkflowHandler(c: Context): Response | Promise<Response>;
|
|
545
|
+
|
|
526
546
|
export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
|
|
527
547
|
|
|
528
548
|
declare type WorkspacePackageInfo = {
|
|
@@ -24,7 +24,7 @@ import type { ResolveHookContext } from 'node:module';
|
|
|
24
24
|
import { RollupBuild } from 'rollup';
|
|
25
25
|
import { RollupOutput } from 'rollup';
|
|
26
26
|
import { RollupWatcher } from 'rollup';
|
|
27
|
-
import { RuntimeContext } from '@mastra/core/
|
|
27
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
28
28
|
import { ServerType } from '@hono/node-server';
|
|
29
29
|
import { Transform } from 'stream';
|
|
30
30
|
import { TypedResponse } from 'hono';
|
|
@@ -135,6 +135,8 @@ export declare function createRunHandler(c: Context): Promise<Response>;
|
|
|
135
135
|
|
|
136
136
|
export declare function createThreadHandler(c: Context): Promise<Response>;
|
|
137
137
|
|
|
138
|
+
export declare function createVNextWorkflowRunHandler(c: Context): Promise<Response>;
|
|
139
|
+
|
|
138
140
|
declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<RollupWatcher>;
|
|
139
141
|
export { createWatcher }
|
|
140
142
|
export { createWatcher as createWatcher_alias_1 }
|
|
@@ -268,11 +270,13 @@ modelId: string;
|
|
|
268
270
|
|
|
269
271
|
export declare function getAgentsHandler(c: Context): Promise<Response & TypedResponse<any, ContentfulStatusCode, "json">>;
|
|
270
272
|
|
|
271
|
-
declare function getDeployer(entryFile: string, outputDir: string): Promise<MastraDeployer>;
|
|
273
|
+
declare function getDeployer(entryFile: string, outputDir: string): Promise<MastraDeployer | undefined>;
|
|
272
274
|
export { getDeployer }
|
|
273
275
|
export { getDeployer as getDeployer_alias_1 }
|
|
274
276
|
|
|
275
|
-
export declare function getDeployerBundler(entryFile: string
|
|
277
|
+
export declare function getDeployerBundler(entryFile: string, result: {
|
|
278
|
+
isDeployerRemoved: boolean;
|
|
279
|
+
}): Promise<RollupBuild>;
|
|
276
280
|
|
|
277
281
|
export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
|
|
278
282
|
id: string;
|
|
@@ -377,6 +381,12 @@ export declare function getToolsHandler(c: Context): Promise<Response>;
|
|
|
377
381
|
|
|
378
382
|
export declare const getVector: (c: Context, vectorName: string) => MastraVector;
|
|
379
383
|
|
|
384
|
+
export declare function getVNextWorkflowByIdHandler(c: Context): Promise<Response>;
|
|
385
|
+
|
|
386
|
+
export declare function getVNextWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
387
|
+
|
|
388
|
+
export declare function getVNextWorkflowsHandler(c: Context): Promise<Response>;
|
|
389
|
+
|
|
380
390
|
export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
|
|
381
391
|
|
|
382
392
|
export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
|
|
@@ -461,8 +471,12 @@ export declare function resolve(specifier: string, context: ResolveHookContext,
|
|
|
461
471
|
url: string;
|
|
462
472
|
}>;
|
|
463
473
|
|
|
474
|
+
export declare function resumeAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
475
|
+
|
|
464
476
|
export declare function resumeAsyncWorkflowHandler(c: Context): Promise<Response>;
|
|
465
477
|
|
|
478
|
+
export declare function resumeVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
479
|
+
|
|
466
480
|
export declare function resumeWorkflowHandler(c: Context): Promise<Response>;
|
|
467
481
|
|
|
468
482
|
export declare function rootHandler(c: Context): Promise<Response & TypedResponse<"Hello to the Mastra API!", ContentfulStatusCode, "text">>;
|
|
@@ -483,8 +497,12 @@ export declare function setAgentInstructionsHandler(c: Context): Promise<Respons
|
|
|
483
497
|
*/
|
|
484
498
|
export declare function speakHandler(c: Context): Promise<Response>;
|
|
485
499
|
|
|
500
|
+
export declare function startAsyncVNextWorkflowHandler(c: Context): Promise<Response>;
|
|
501
|
+
|
|
486
502
|
export declare function startAsyncWorkflowHandler(c: Context): Promise<Response>;
|
|
487
503
|
|
|
504
|
+
export declare function startVNextWorkflowRunHandler(c: Context): Promise<Response>;
|
|
505
|
+
|
|
488
506
|
export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
|
|
489
507
|
|
|
490
508
|
export declare function storeTelemetryHandler(c: Context): Promise<Response>;
|
|
@@ -523,6 +541,8 @@ declare type Variables = {
|
|
|
523
541
|
isDev: boolean;
|
|
524
542
|
};
|
|
525
543
|
|
|
544
|
+
export declare function watchVNextWorkflowHandler(c: Context): Response | Promise<Response>;
|
|
545
|
+
|
|
526
546
|
export declare function watchWorkflowHandler(c: Context): Response | Promise<Response>;
|
|
527
547
|
|
|
528
548
|
declare type WorkspacePackageInfo = {
|
package/dist/build/analyze.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6J52IX4J_cjs = require('../chunk-6J52IX4J.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk6J52IX4J_cjs.analyzeBundle; }
|
|
10
10
|
});
|
package/dist/build/analyze.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { analyzeBundle } from '../chunk-
|
|
1
|
+
export { analyzeBundle } from '../chunk-QJQ2V3Z2.js';
|
package/dist/build/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKCX3UGHY_cjs = require('../chunk-KCX3UGHY.cjs');
|
|
4
4
|
var chunk3R6WDRBB_cjs = require('../chunk-3R6WDRBB.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk6J52IX4J_cjs = require('../chunk-6J52IX4J.cjs');
|
|
6
6
|
var chunkIMGVLBV7_cjs = require('../chunk-IMGVLBV7.cjs');
|
|
7
7
|
var chunk4VC5Z4YR_cjs = require('../chunk-4VC5Z4YR.cjs');
|
|
8
8
|
|
|
@@ -10,15 +10,15 @@ var chunk4VC5Z4YR_cjs = require('../chunk-4VC5Z4YR.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "createWatcher", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkKCX3UGHY_cjs.createWatcher; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getServerOptions", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkKCX3UGHY_cjs.getServerOptions; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getWatcherInputOptions", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkKCX3UGHY_cjs.getInputOptions; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
24
24
|
enumerable: true,
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk6J52IX4J_cjs.analyzeBundle; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "createBundler", {
|
|
32
32
|
enumerable: true,
|
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-ABTWXYGO.js';
|
|
2
2
|
export { writeTelemetryConfig } from '../chunk-TUMXQX4H.js';
|
|
3
|
-
export { analyzeBundle } from '../chunk-
|
|
3
|
+
export { analyzeBundle } from '../chunk-QJQ2V3Z2.js';
|
|
4
4
|
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-AOSWYZKN.js';
|
|
5
5
|
export { Deps, FileService } from '../chunk-UV4RQQ3R.js';
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGO4WLOL7_cjs = require('../chunk-GO4WLOL7.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 chunkGO4WLOL7_cjs.Bundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Bundler } from '../chunk-
|
|
1
|
+
export { Bundler } from '../chunk-OV2EMRTY.js';
|
|
@@ -161,6 +161,16 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
161
161
|
depsToOptimize.delete(dep);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
+
for (const o of output) {
|
|
165
|
+
if (o.type !== "chunk" || o.dynamicImports.length === 0) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
for (const dynamicImport of o.dynamicImports) {
|
|
169
|
+
if (!depsToOptimize.has(dynamicImport)) {
|
|
170
|
+
depsToOptimize.set(dynamicImport, ["*"]);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
164
174
|
return depsToOptimize;
|
|
165
175
|
}
|
|
166
176
|
async function bundleExternals(depsToOptimize, outputDir, logger) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastraExcept } from './chunk-TUMXQX4H.js';
|
|
2
|
-
import { aliasHono } from './chunk-
|
|
2
|
+
import { aliasHono } from './chunk-QJQ2V3Z2.js';
|
|
3
3
|
import { getInputOptions } from './chunk-AOSWYZKN.js';
|
|
4
4
|
import { tsConfigPaths } from './chunk-WVBUOQT6.js';
|
|
5
5
|
import { watch, rollup } from 'rollup';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3R6WDRBB_cjs = require('./chunk-3R6WDRBB.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk6J52IX4J_cjs = require('./chunk-6J52IX4J.cjs');
|
|
5
5
|
var chunkIMGVLBV7_cjs = require('./chunk-IMGVLBV7.cjs');
|
|
6
6
|
var chunk4VC5Z4YR_cjs = require('./chunk-4VC5Z4YR.cjs');
|
|
7
7
|
var fs = require('fs');
|
|
@@ -130,7 +130,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
130
130
|
}
|
|
131
131
|
async writeInstrumentationFile(outputDirectory) {
|
|
132
132
|
const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
|
|
133
|
-
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-
|
|
133
|
+
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-GO4WLOL7.cjs', document.baseURI).href))));
|
|
134
134
|
await fsExtra.copy(path.join(__dirname, "templates", "instrumentation-template.js"), instrumentationFile);
|
|
135
135
|
}
|
|
136
136
|
async writePackageJson(outputDirectory, dependencies, resolutions) {
|
|
@@ -162,7 +162,10 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
162
162
|
author: "Mastra",
|
|
163
163
|
license: "ISC",
|
|
164
164
|
dependencies: Object.fromEntries(dependenciesMap.entries()),
|
|
165
|
-
...Object.keys(resolutions ?? {}).length > 0 && { resolutions }
|
|
165
|
+
...Object.keys(resolutions ?? {}).length > 0 && { resolutions },
|
|
166
|
+
pnpm: {
|
|
167
|
+
neverBuiltDependencies: []
|
|
168
|
+
}
|
|
166
169
|
},
|
|
167
170
|
null,
|
|
168
171
|
2
|
|
@@ -173,7 +176,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
173
176
|
return chunkIMGVLBV7_cjs.createBundler(inputOptions, outputOptions);
|
|
174
177
|
}
|
|
175
178
|
async analyze(entry, mastraFile, outputDirectory) {
|
|
176
|
-
return await
|
|
179
|
+
return await chunk6J52IX4J_cjs.analyzeBundle(entry, mastraFile, path.join(outputDirectory, this.analyzeOutputDir), "node", this.logger);
|
|
177
180
|
}
|
|
178
181
|
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
179
182
|
const deps = new chunk4VC5Z4YR_cjs.DepsService(rootDir);
|
|
@@ -232,7 +235,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
232
235
|
}
|
|
233
236
|
async _bundle(serverFile, mastraEntryFile, outputDirectory, toolsPaths = [], bundleLocation = path.join(outputDirectory, this.outputDir)) {
|
|
234
237
|
this.logger.info("Start bundling Mastra");
|
|
235
|
-
const analyzedBundleInfo = await
|
|
238
|
+
const analyzedBundleInfo = await chunk6J52IX4J_cjs.analyzeBundle(
|
|
236
239
|
serverFile,
|
|
237
240
|
mastraEntryFile,
|
|
238
241
|
path.join(outputDirectory, this.analyzeOutputDir),
|
|
@@ -302,10 +305,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
302
305
|
});
|
|
303
306
|
await bundler.write();
|
|
304
307
|
const toolsInputOptions = Array.from(Object.keys(inputOptions.input || {})).filter((key) => key.startsWith("tools/")).map((key) => `./${key}.mjs`);
|
|
305
|
-
await promises.writeFile(
|
|
306
|
-
path.join(outputDirectory, this.outputDir, "tools.mjs"),
|
|
307
|
-
`export const tools = ${JSON.stringify(toolsInputOptions)};`
|
|
308
|
-
);
|
|
308
|
+
await promises.writeFile(path.join(bundleLocation, "tools.mjs"), `export const tools = ${JSON.stringify(toolsInputOptions)};`);
|
|
309
309
|
this.logger.info("Bundling Mastra done");
|
|
310
310
|
this.logger.info("Copying public files");
|
|
311
311
|
await this.copyPublic(path.dirname(mastraEntryFile), outputDirectory);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3R6WDRBB_cjs = require('./chunk-3R6WDRBB.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk6J52IX4J_cjs = require('./chunk-6J52IX4J.cjs');
|
|
5
5
|
var chunkIMGVLBV7_cjs = require('./chunk-IMGVLBV7.cjs');
|
|
6
6
|
var chunk54KOF3NB_cjs = require('./chunk-54KOF3NB.cjs');
|
|
7
7
|
var rollup = require('rollup');
|
|
@@ -49,7 +49,7 @@ async function getInputOptions2(entryFile, platform, env) {
|
|
|
49
49
|
// @ts-ignore
|
|
50
50
|
(plugin) => !plugin || !plugin?.name || plugin.name !== "node-resolve"
|
|
51
51
|
);
|
|
52
|
-
inputOptions.plugins.push(
|
|
52
|
+
inputOptions.plugins.push(chunk6J52IX4J_cjs.aliasHono());
|
|
53
53
|
}
|
|
54
54
|
return inputOptions;
|
|
55
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { writeTelemetryConfig } from './chunk-TUMXQX4H.js';
|
|
2
|
-
import { analyzeBundle } from './chunk-
|
|
2
|
+
import { analyzeBundle } from './chunk-QJQ2V3Z2.js';
|
|
3
3
|
import { createBundler, getInputOptions } from './chunk-AOSWYZKN.js';
|
|
4
4
|
import { DepsService, FileService } from './chunk-UV4RQQ3R.js';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
@@ -152,7 +152,10 @@ var Bundler = class extends MastraBundler {
|
|
|
152
152
|
author: "Mastra",
|
|
153
153
|
license: "ISC",
|
|
154
154
|
dependencies: Object.fromEntries(dependenciesMap.entries()),
|
|
155
|
-
...Object.keys(resolutions ?? {}).length > 0 && { resolutions }
|
|
155
|
+
...Object.keys(resolutions ?? {}).length > 0 && { resolutions },
|
|
156
|
+
pnpm: {
|
|
157
|
+
neverBuiltDependencies: []
|
|
158
|
+
}
|
|
156
159
|
},
|
|
157
160
|
null,
|
|
158
161
|
2
|
|
@@ -292,10 +295,7 @@ var Bundler = class extends MastraBundler {
|
|
|
292
295
|
});
|
|
293
296
|
await bundler.write();
|
|
294
297
|
const toolsInputOptions = Array.from(Object.keys(inputOptions.input || {})).filter((key) => key.startsWith("tools/")).map((key) => `./${key}.mjs`);
|
|
295
|
-
await writeFile(
|
|
296
|
-
join(outputDirectory, this.outputDir, "tools.mjs"),
|
|
297
|
-
`export const tools = ${JSON.stringify(toolsInputOptions)};`
|
|
298
|
-
);
|
|
298
|
+
await writeFile(join(bundleLocation, "tools.mjs"), `export const tools = ${JSON.stringify(toolsInputOptions)};`);
|
|
299
299
|
this.logger.info("Bundling Mastra done");
|
|
300
300
|
this.logger.info("Copying public files");
|
|
301
301
|
await this.copyPublic(dirname(mastraEntryFile), outputDirectory);
|
|
@@ -151,6 +151,16 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
151
151
|
depsToOptimize.delete(dep);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
+
for (const o of output) {
|
|
155
|
+
if (o.type !== "chunk" || o.dynamicImports.length === 0) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
for (const dynamicImport of o.dynamicImports) {
|
|
159
|
+
if (!depsToOptimize.has(dynamicImport)) {
|
|
160
|
+
depsToOptimize.set(dynamicImport, ["*"]);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
154
164
|
return depsToOptimize;
|
|
155
165
|
}
|
|
156
166
|
async function bundleExternals(depsToOptimize, outputDir, logger) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGO4WLOL7_cjs = require('./chunk-GO4WLOL7.cjs');
|
|
4
4
|
var chunk3R6WDRBB_cjs = require('./chunk-3R6WDRBB.cjs');
|
|
5
5
|
var chunk4VC5Z4YR_cjs = require('./chunk-4VC5Z4YR.cjs');
|
|
6
6
|
var babel = require('@babel/core');
|
|
@@ -33,7 +33,7 @@ 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
|
|
36
|
+
var Deployer = class extends chunkGO4WLOL7_cjs.Bundler {
|
|
37
37
|
deps = new chunk4VC5Z4YR_cjs.DepsService();
|
|
38
38
|
constructor(args) {
|
|
39
39
|
super(args.name, "DEPLOYER");
|
|
@@ -87,7 +87,7 @@ function removeAllExceptDeployer() {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function getDeployerBundler(entryFile) {
|
|
90
|
+
function getDeployerBundler(entryFile, result) {
|
|
91
91
|
return rollup.rollup({
|
|
92
92
|
logLevel: "silent",
|
|
93
93
|
input: {
|
|
@@ -113,6 +113,7 @@ function getDeployerBundler(entryFile) {
|
|
|
113
113
|
if (id !== entryFile) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
+
result.isDeployerRemoved = true;
|
|
116
117
|
return new Promise((resolve, reject) => {
|
|
117
118
|
babel__namespace.transform(
|
|
118
119
|
code,
|
|
@@ -122,13 +123,13 @@ function getDeployerBundler(entryFile) {
|
|
|
122
123
|
filename: id,
|
|
123
124
|
plugins: [removeAllExceptDeployer]
|
|
124
125
|
},
|
|
125
|
-
(err,
|
|
126
|
+
(err, result2) => {
|
|
126
127
|
if (err) {
|
|
127
128
|
return reject(err);
|
|
128
129
|
}
|
|
129
130
|
resolve({
|
|
130
|
-
code:
|
|
131
|
-
map:
|
|
131
|
+
code: result2.code,
|
|
132
|
+
map: result2.map
|
|
132
133
|
});
|
|
133
134
|
}
|
|
134
135
|
);
|
|
@@ -160,13 +161,16 @@ function getDeployerBundler(entryFile) {
|
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
async function getDeployer(entryFile, outputDir) {
|
|
163
|
-
|
|
164
|
-
const bundle = await getDeployerBundler(entryFile);
|
|
164
|
+
const result = { isDeployerRemoved: false };
|
|
165
|
+
const bundle = await getDeployerBundler(entryFile, result);
|
|
165
166
|
await bundle.write({
|
|
166
167
|
dir: outputDir,
|
|
167
168
|
format: "es",
|
|
168
169
|
entryFileNames: "[name].mjs"
|
|
169
170
|
});
|
|
171
|
+
if (!result.isDeployerRemoved) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
170
174
|
return (await import(`file:${outputDir}/deployer.mjs`)).deployer;
|
|
171
175
|
}
|
|
172
176
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bundler } from './chunk-
|
|
1
|
+
import { Bundler } from './chunk-OV2EMRTY.js';
|
|
2
2
|
import { recursiveRemoveNonReferencedNodes } from './chunk-TUMXQX4H.js';
|
|
3
3
|
import { DepsService, FileService } from './chunk-UV4RQQ3R.js';
|
|
4
4
|
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-UV4RQQ3R.js';
|
|
@@ -63,7 +63,7 @@ function removeAllExceptDeployer() {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function getDeployerBundler(entryFile) {
|
|
66
|
+
function getDeployerBundler(entryFile, result) {
|
|
67
67
|
return rollup({
|
|
68
68
|
logLevel: "silent",
|
|
69
69
|
input: {
|
|
@@ -89,6 +89,7 @@ function getDeployerBundler(entryFile) {
|
|
|
89
89
|
if (id !== entryFile) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
+
result.isDeployerRemoved = true;
|
|
92
93
|
return new Promise((resolve, reject) => {
|
|
93
94
|
babel.transform(
|
|
94
95
|
code,
|
|
@@ -98,13 +99,13 @@ function getDeployerBundler(entryFile) {
|
|
|
98
99
|
filename: id,
|
|
99
100
|
plugins: [removeAllExceptDeployer]
|
|
100
101
|
},
|
|
101
|
-
(err,
|
|
102
|
+
(err, result2) => {
|
|
102
103
|
if (err) {
|
|
103
104
|
return reject(err);
|
|
104
105
|
}
|
|
105
106
|
resolve({
|
|
106
|
-
code:
|
|
107
|
-
map:
|
|
107
|
+
code: result2.code,
|
|
108
|
+
map: result2.map
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
111
|
);
|
|
@@ -136,13 +137,16 @@ function getDeployerBundler(entryFile) {
|
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
139
|
async function getDeployer(entryFile, outputDir) {
|
|
139
|
-
|
|
140
|
-
const bundle = await getDeployerBundler(entryFile);
|
|
140
|
+
const result = { isDeployerRemoved: false };
|
|
141
|
+
const bundle = await getDeployerBundler(entryFile, result);
|
|
141
142
|
await bundle.write({
|
|
142
143
|
dir: outputDir,
|
|
143
144
|
format: "es",
|
|
144
145
|
entryFileNames: "[name].mjs"
|
|
145
146
|
});
|
|
147
|
+
if (!result.isDeployerRemoved) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
146
150
|
return (await import(`file:${outputDir}/deployer.mjs`)).deployer;
|
|
147
151
|
}
|
|
148
152
|
|