@mastra/deployer 0.14.0-alpha.3 → 0.14.0-alpha.5
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/build/analyze.cjs +3 -3
- package/dist/build/analyze.d.ts.map +1 -1
- package/dist/build/analyze.js +1 -1
- package/dist/build/babel/remove-all-options-bundler.d.ts +2 -1
- package/dist/build/babel/remove-all-options-bundler.d.ts.map +1 -1
- package/dist/build/babel/remove-all-options-deployer.d.ts +5 -0
- package/dist/build/babel/remove-all-options-deployer.d.ts.map +1 -0
- package/dist/build/babel/remove-all-options-except.d.ts +2 -1
- package/dist/build/babel/remove-all-options-except.d.ts.map +1 -1
- package/dist/build/babel/remove-all-options-server.d.ts +2 -1
- package/dist/build/babel/remove-all-options-server.d.ts.map +1 -1
- package/dist/build/babel/remove-all-options-telemetry.d.ts +1 -1
- package/dist/build/babel/remove-all-options-telemetry.d.ts.map +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.d.ts.map +1 -1
- package/dist/build/bundler.js +1 -1
- package/dist/build/bundlerOptions.d.ts +3 -2
- package/dist/build/bundlerOptions.d.ts.map +1 -1
- package/dist/build/customInstrumentation.d.ts.map +1 -1
- package/dist/build/deployer.d.ts +4 -3
- package/dist/build/deployer.d.ts.map +1 -1
- package/dist/build/index.cjs +12 -12
- package/dist/build/index.js +4 -4
- package/dist/build/plugins/esbuild.d.ts +3 -0
- package/dist/build/plugins/esbuild.d.ts.map +1 -0
- package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
- package/dist/build/serverOptions.d.ts +3 -2
- package/dist/build/serverOptions.d.ts.map +1 -1
- package/dist/build/shared/extract-mastra-option.d.ts +15 -0
- package/dist/build/shared/extract-mastra-option.d.ts.map +1 -0
- package/dist/build/telemetry.d.ts +3 -11
- package/dist/build/telemetry.d.ts.map +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-SA7YCRKF.js → chunk-3ZVEABRA.js} +21 -100
- package/dist/chunk-3ZVEABRA.js.map +1 -0
- package/dist/{chunk-3RRMEPHU.js → chunk-4HS72TCL.js} +13 -24
- package/dist/chunk-4HS72TCL.js.map +1 -0
- package/dist/{chunk-J42QUFVB.cjs → chunk-FIOHFXQ4.cjs} +8 -14
- package/dist/chunk-FIOHFXQ4.cjs.map +1 -0
- package/dist/{chunk-MRJUFOEN.cjs → chunk-G4TSJE4W.cjs} +47 -52
- package/dist/chunk-G4TSJE4W.cjs.map +1 -0
- package/dist/{chunk-4CTQZBDI.js → chunk-GXPWEOOA.js} +43 -47
- package/dist/chunk-GXPWEOOA.js.map +1 -0
- package/dist/chunk-HHNOUMJH.js +26 -0
- package/dist/chunk-HHNOUMJH.js.map +1 -0
- package/dist/{chunk-VAE7BL7I.cjs → chunk-LG5W6D2R.cjs} +19 -10
- package/dist/chunk-LG5W6D2R.cjs.map +1 -0
- package/dist/{chunk-OOVC5E4J.js → chunk-NOI4CTSN.js} +18 -10
- package/dist/chunk-NOI4CTSN.js.map +1 -0
- package/dist/{chunk-N66CXJKO.js → chunk-SBEJU32H.js} +4 -9
- package/dist/chunk-SBEJU32H.js.map +1 -0
- package/dist/chunk-UD4WRJI3.cjs +28 -0
- package/dist/chunk-UD4WRJI3.cjs.map +1 -0
- package/dist/{chunk-PBN66NLE.cjs → chunk-UYBVYWPG.cjs} +24 -124
- package/dist/chunk-UYBVYWPG.cjs.map +1 -0
- package/dist/{chunk-PO2BAZ5A.cjs → chunk-V7XDPQFQ.cjs} +19 -31
- package/dist/chunk-V7XDPQFQ.cjs.map +1 -0
- package/dist/index.cjs +20 -154
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -129
- package/dist/index.js.map +1 -1
- package/dist/server/handlers/routes/agents/handlers.d.ts +12 -1
- package/dist/server/handlers/routes/agents/handlers.d.ts.map +1 -1
- package/dist/server/handlers/routes/agents/router.d.ts.map +1 -1
- package/dist/server/handlers/routes/scores/handlers.d.ts +50 -0
- package/dist/server/handlers/routes/scores/handlers.d.ts.map +1 -1
- package/dist/server/index.cjs +228 -5
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +229 -6
- package/dist/server/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-3RRMEPHU.js.map +0 -1
- package/dist/chunk-4CTQZBDI.js.map +0 -1
- package/dist/chunk-EFPKWUPY.js +0 -107
- package/dist/chunk-EFPKWUPY.js.map +0 -1
- package/dist/chunk-J42QUFVB.cjs.map +0 -1
- package/dist/chunk-MRJUFOEN.cjs.map +0 -1
- package/dist/chunk-N66CXJKO.js.map +0 -1
- package/dist/chunk-OOVC5E4J.js.map +0 -1
- package/dist/chunk-PBN66NLE.cjs.map +0 -1
- package/dist/chunk-PO2BAZ5A.cjs.map +0 -1
- package/dist/chunk-SA7YCRKF.js.map +0 -1
- package/dist/chunk-VAE7BL7I.cjs.map +0 -1
- package/dist/chunk-ZGXUX6Z6.cjs +0 -133
- package/dist/chunk-ZGXUX6Z6.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,41 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkV7XDPQFQ_cjs = require('./chunk-V7XDPQFQ.cjs');
|
|
4
|
+
var chunkG4TSJE4W_cjs = require('./chunk-G4TSJE4W.cjs');
|
|
5
5
|
var chunkJ4SL7224_cjs = require('./chunk-J4SL7224.cjs');
|
|
6
|
-
var babel = require('@babel/core');
|
|
7
|
-
var rollup = require('rollup');
|
|
8
|
-
var esbuild = require('rollup-plugin-esbuild');
|
|
9
|
-
var commonjs = require('@rollup/plugin-commonjs');
|
|
10
|
-
var json = require('@rollup/plugin-json');
|
|
11
|
-
|
|
12
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
function _interopNamespace(e) {
|
|
15
|
-
if (e && e.__esModule) return e;
|
|
16
|
-
var n = Object.create(null);
|
|
17
|
-
if (e) {
|
|
18
|
-
Object.keys(e).forEach(function (k) {
|
|
19
|
-
if (k !== 'default') {
|
|
20
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return e[k]; }
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
n.default = e;
|
|
29
|
-
return Object.freeze(n);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var babel__namespace = /*#__PURE__*/_interopNamespace(babel);
|
|
33
|
-
var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
|
|
34
|
-
var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
|
|
35
|
-
var json__default = /*#__PURE__*/_interopDefault(json);
|
|
36
6
|
|
|
37
7
|
// src/deploy/base.ts
|
|
38
|
-
var Deployer = class extends
|
|
8
|
+
var Deployer = class extends chunkV7XDPQFQ_cjs.Bundler {
|
|
39
9
|
deps = new chunkJ4SL7224_cjs.DepsService();
|
|
40
10
|
constructor(args) {
|
|
41
11
|
super(args.name, "DEPLOYER");
|
|
@@ -52,129 +22,25 @@ var Deployer = class extends chunkPO2BAZ5A_cjs.Bundler {
|
|
|
52
22
|
return Promise.resolve([]);
|
|
53
23
|
}
|
|
54
24
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
visitor: {
|
|
60
|
-
ExportNamedDeclaration: {
|
|
61
|
-
// remove all exports
|
|
62
|
-
exit(path) {
|
|
63
|
-
path.remove();
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
NewExpression(path) {
|
|
67
|
-
const varDeclaratorPath = path.findParent((path2) => t.isVariableDeclarator(path2.node));
|
|
68
|
-
if (!varDeclaratorPath) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const parentNode = path.parentPath.node;
|
|
72
|
-
if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== "mastra") {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const deployer = path.node.arguments[0]?.properties?.find(
|
|
76
|
-
// @ts-ignore
|
|
77
|
-
(prop) => prop.key.name === "deployer"
|
|
78
|
-
);
|
|
79
|
-
const programPath = path.scope.getProgramParent().path;
|
|
80
|
-
if (!deployer || !programPath) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const exportDeclaration = t.exportNamedDeclaration(
|
|
84
|
-
t.variableDeclaration("const", [t.variableDeclarator(t.identifier("deployer"), deployer.value)]),
|
|
85
|
-
[]
|
|
86
|
-
);
|
|
87
|
-
programPath.node.body.push(exportDeclaration);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function getDeployerBundler(entryFile, result) {
|
|
93
|
-
return rollup.rollup({
|
|
94
|
-
logLevel: "silent",
|
|
95
|
-
input: {
|
|
96
|
-
deployer: entryFile
|
|
97
|
-
},
|
|
98
|
-
treeshake: "smallest",
|
|
99
|
-
plugins: [
|
|
100
|
-
// transpile typescript to something we understand
|
|
101
|
-
esbuild__default.default({
|
|
102
|
-
target: "node20",
|
|
103
|
-
platform: "node",
|
|
104
|
-
minify: false
|
|
105
|
-
}),
|
|
106
|
-
commonjs__default.default({
|
|
107
|
-
extensions: [".js", ".ts"],
|
|
108
|
-
strictRequires: "strict",
|
|
109
|
-
transformMixedEsModules: true,
|
|
110
|
-
ignoreTryCatch: false
|
|
111
|
-
}),
|
|
112
|
-
{
|
|
113
|
-
name: "get-deployer",
|
|
114
|
-
transform(code, id) {
|
|
115
|
-
if (id !== entryFile) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
result.isDeployerRemoved = true;
|
|
119
|
-
return new Promise((resolve, reject) => {
|
|
120
|
-
babel__namespace.transform(
|
|
121
|
-
code,
|
|
122
|
-
{
|
|
123
|
-
babelrc: false,
|
|
124
|
-
configFile: false,
|
|
125
|
-
filename: id,
|
|
126
|
-
plugins: [removeAllExceptDeployer]
|
|
127
|
-
},
|
|
128
|
-
(err, result2) => {
|
|
129
|
-
if (err) {
|
|
130
|
-
return reject(err);
|
|
131
|
-
}
|
|
132
|
-
resolve({
|
|
133
|
-
code: result2.code,
|
|
134
|
-
map: result2.map
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
// let esbuild remove all unused imports
|
|
142
|
-
esbuild__default.default({
|
|
143
|
-
target: "node20",
|
|
144
|
-
platform: "node",
|
|
145
|
-
minify: false
|
|
146
|
-
}),
|
|
147
|
-
{
|
|
148
|
-
name: "cleanup-nodes",
|
|
149
|
-
transform(code, id) {
|
|
150
|
-
if (id !== entryFile) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
return chunkMRJUFOEN_cjs.recursiveRemoveNonReferencedNodes(code);
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
// let esbuild remove all unused imports
|
|
157
|
-
esbuild__default.default({
|
|
158
|
-
target: "node20",
|
|
159
|
-
platform: "node",
|
|
160
|
-
minify: false
|
|
161
|
-
}),
|
|
162
|
-
json__default.default()
|
|
163
|
-
]
|
|
164
|
-
});
|
|
25
|
+
|
|
26
|
+
// src/build/babel/remove-all-options-deployer.ts
|
|
27
|
+
function removeAllOptionsExceptDeployer(result, logger) {
|
|
28
|
+
return chunkG4TSJE4W_cjs.removeAllOptionsFromMastraExcept(result, "deployer", logger);
|
|
165
29
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
await
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
30
|
+
|
|
31
|
+
// src/build/deployer.ts
|
|
32
|
+
async function getDeployer(entryFile, outputDir, logger) {
|
|
33
|
+
const result = await chunkG4TSJE4W_cjs.extractMastraOption(
|
|
34
|
+
"deployer",
|
|
35
|
+
entryFile,
|
|
36
|
+
removeAllOptionsExceptDeployer,
|
|
37
|
+
outputDir,
|
|
38
|
+
logger
|
|
39
|
+
);
|
|
40
|
+
if (!result) {
|
|
41
|
+
return null;
|
|
176
42
|
}
|
|
177
|
-
return (
|
|
43
|
+
return result.getConfig();
|
|
178
44
|
}
|
|
179
45
|
|
|
180
46
|
Object.defineProperty(exports, "Deps", {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/deploy/base.ts","../src/build/babel/
|
|
1
|
+
{"version":3,"sources":["../src/deploy/base.ts","../src/build/babel/remove-all-options-deployer.ts","../src/build/deployer.ts"],"names":["Bundler","DepsService","FileService","removeAllOptionsFromMastraExcept","extractMastraOption"],"mappings":";;;;;;;AAMO,IAAe,QAAA,GAAf,cAAgCA,yBAAA,CAA6B;AAAA,EAClE,IAAA,GAAoB,IAAIC,6BAAA,EAAY;AAAA,EAEpC,YAAY,IAAA,EAAwB;AAClC,IAAA,KAAA,CAAM,IAAA,CAAK,MAAM,UAAU,CAAA;AAE3B,IAAA,IAAA,CAAK,IAAA,CAAK,WAAA,CAAY,IAAA,CAAK,MAAM,CAAA;AAAA,EACnC;AAAA,EAEA,WAAA,GAAiC;AAC/B,IAAA,MAAM,aAAA,GAAgB,CAAC,iBAAA,EAAmB,YAAA,EAAc,MAAM,CAAA;AAE9D,IAAA,IAAI;AACF,MAAA,MAAM,WAAA,GAAc,IAAIC,6BAAA,EAAY;AACpC,MAAA,MAAM,OAAA,GAAU,WAAA,CAAY,oBAAA,CAAqB,aAAa,CAAA;AAE9D,MAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,CAAC,OAAO,CAAC,CAAA;AAAA,IAClC,CAAA,CAAA,MAAQ;AAAA,IAAC;AAET,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,EAAE,CAAA;AAAA,EAC3B;AAGF;;;AC1BO,SAAS,8BAAA,CAA+B,QAAsC,MAAA,EAAwB;AAC3G,EAAA,OAAOC,kDAAA,CAAiC,MAAA,EAAQ,UAAA,EAAY,MAAM,CAAA;AACpE;;;ACSA,eAAsB,WAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACoC;AACpC,EAAA,MAAM,SAAS,MAAMC,qCAAA;AAAA,IACnB,UAAA;AAAA,IACA,SAAA;AAAA,IACA,8BAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"index.cjs","sourcesContent":["import type { IDeployer } from '@mastra/core/deployer';\n\nimport { Bundler } from '../bundler';\nimport { DepsService } from '../services/deps.js';\nimport { FileService } from '../services/fs.js';\n\nexport abstract class Deployer extends Bundler implements IDeployer {\n deps: DepsService = new DepsService();\n\n constructor(args: { name: string }) {\n super(args.name, 'DEPLOYER');\n\n this.deps.__setLogger(this.logger);\n }\n\n getEnvFiles(): Promise<string[]> {\n const possibleFiles = ['.env.production', '.env.local', '.env'];\n\n try {\n const fileService = new FileService();\n const envFile = fileService.getFirstExistingFile(possibleFiles);\n\n return Promise.resolve([envFile]);\n } catch {}\n\n return Promise.resolve([]);\n }\n\n abstract deploy(outputDirectory: string): Promise<void>;\n}\n","import { removeAllOptionsFromMastraExcept } from './remove-all-options-except';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function removeAllOptionsExceptDeployer(result: { hasCustomConfig: boolean }, logger?: IMastraLogger) {\n return removeAllOptionsFromMastraExcept(result, 'deployer', logger);\n}\n","import { removeAllOptionsExceptDeployer } from './babel/remove-all-options-deployer';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getDeployerBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('deployer', entryFile, removeAllOptionsExceptDeployer, result);\n}\n\nexport async function getDeployer(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['deployer'] | null> {\n const result = await extractMastraOption<Config['deployer']>(\n 'deployer',\n entryFile,\n removeAllOptionsExceptDeployer,\n outputDir,\n logger,\n );\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { Bundler } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { Bundler } from './chunk-4HS72TCL.js';
|
|
2
|
+
import { extractMastraOption, removeAllOptionsFromMastraExcept } from './chunk-GXPWEOOA.js';
|
|
3
3
|
import { DepsService, FileService } from './chunk-37Q52RJU.js';
|
|
4
4
|
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-37Q52RJU.js';
|
|
5
|
-
import * as babel from '@babel/core';
|
|
6
|
-
import babel__default from '@babel/core';
|
|
7
|
-
import { rollup } from 'rollup';
|
|
8
|
-
import esbuild from 'rollup-plugin-esbuild';
|
|
9
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
10
|
-
import json from '@rollup/plugin-json';
|
|
11
5
|
|
|
12
6
|
// src/deploy/base.ts
|
|
13
7
|
var Deployer = class extends Bundler {
|
|
@@ -27,129 +21,25 @@ var Deployer = class extends Bundler {
|
|
|
27
21
|
return Promise.resolve([]);
|
|
28
22
|
}
|
|
29
23
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
visitor: {
|
|
35
|
-
ExportNamedDeclaration: {
|
|
36
|
-
// remove all exports
|
|
37
|
-
exit(path) {
|
|
38
|
-
path.remove();
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
NewExpression(path) {
|
|
42
|
-
const varDeclaratorPath = path.findParent((path2) => t.isVariableDeclarator(path2.node));
|
|
43
|
-
if (!varDeclaratorPath) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const parentNode = path.parentPath.node;
|
|
47
|
-
if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== "mastra") {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const deployer = path.node.arguments[0]?.properties?.find(
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
(prop) => prop.key.name === "deployer"
|
|
53
|
-
);
|
|
54
|
-
const programPath = path.scope.getProgramParent().path;
|
|
55
|
-
if (!deployer || !programPath) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const exportDeclaration = t.exportNamedDeclaration(
|
|
59
|
-
t.variableDeclaration("const", [t.variableDeclarator(t.identifier("deployer"), deployer.value)]),
|
|
60
|
-
[]
|
|
61
|
-
);
|
|
62
|
-
programPath.node.body.push(exportDeclaration);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function getDeployerBundler(entryFile, result) {
|
|
68
|
-
return rollup({
|
|
69
|
-
logLevel: "silent",
|
|
70
|
-
input: {
|
|
71
|
-
deployer: entryFile
|
|
72
|
-
},
|
|
73
|
-
treeshake: "smallest",
|
|
74
|
-
plugins: [
|
|
75
|
-
// transpile typescript to something we understand
|
|
76
|
-
esbuild({
|
|
77
|
-
target: "node20",
|
|
78
|
-
platform: "node",
|
|
79
|
-
minify: false
|
|
80
|
-
}),
|
|
81
|
-
commonjs({
|
|
82
|
-
extensions: [".js", ".ts"],
|
|
83
|
-
strictRequires: "strict",
|
|
84
|
-
transformMixedEsModules: true,
|
|
85
|
-
ignoreTryCatch: false
|
|
86
|
-
}),
|
|
87
|
-
{
|
|
88
|
-
name: "get-deployer",
|
|
89
|
-
transform(code, id) {
|
|
90
|
-
if (id !== entryFile) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
result.isDeployerRemoved = true;
|
|
94
|
-
return new Promise((resolve, reject) => {
|
|
95
|
-
babel.transform(
|
|
96
|
-
code,
|
|
97
|
-
{
|
|
98
|
-
babelrc: false,
|
|
99
|
-
configFile: false,
|
|
100
|
-
filename: id,
|
|
101
|
-
plugins: [removeAllExceptDeployer]
|
|
102
|
-
},
|
|
103
|
-
(err, result2) => {
|
|
104
|
-
if (err) {
|
|
105
|
-
return reject(err);
|
|
106
|
-
}
|
|
107
|
-
resolve({
|
|
108
|
-
code: result2.code,
|
|
109
|
-
map: result2.map
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
// let esbuild remove all unused imports
|
|
117
|
-
esbuild({
|
|
118
|
-
target: "node20",
|
|
119
|
-
platform: "node",
|
|
120
|
-
minify: false
|
|
121
|
-
}),
|
|
122
|
-
{
|
|
123
|
-
name: "cleanup-nodes",
|
|
124
|
-
transform(code, id) {
|
|
125
|
-
if (id !== entryFile) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
return recursiveRemoveNonReferencedNodes(code);
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
// let esbuild remove all unused imports
|
|
132
|
-
esbuild({
|
|
133
|
-
target: "node20",
|
|
134
|
-
platform: "node",
|
|
135
|
-
minify: false
|
|
136
|
-
}),
|
|
137
|
-
json()
|
|
138
|
-
]
|
|
139
|
-
});
|
|
24
|
+
|
|
25
|
+
// src/build/babel/remove-all-options-deployer.ts
|
|
26
|
+
function removeAllOptionsExceptDeployer(result, logger) {
|
|
27
|
+
return removeAllOptionsFromMastraExcept(result, "deployer", logger);
|
|
140
28
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
await
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
29
|
+
|
|
30
|
+
// src/build/deployer.ts
|
|
31
|
+
async function getDeployer(entryFile, outputDir, logger) {
|
|
32
|
+
const result = await extractMastraOption(
|
|
33
|
+
"deployer",
|
|
34
|
+
entryFile,
|
|
35
|
+
removeAllOptionsExceptDeployer,
|
|
36
|
+
outputDir,
|
|
37
|
+
logger
|
|
38
|
+
);
|
|
39
|
+
if (!result) {
|
|
40
|
+
return null;
|
|
151
41
|
}
|
|
152
|
-
return (
|
|
42
|
+
return result.getConfig();
|
|
153
43
|
}
|
|
154
44
|
|
|
155
45
|
export { Deployer, getDeployer };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/deploy/base.ts","../src/build/babel/
|
|
1
|
+
{"version":3,"sources":["../src/deploy/base.ts","../src/build/babel/remove-all-options-deployer.ts","../src/build/deployer.ts"],"names":[],"mappings":";;;;;;AAMO,IAAe,QAAA,GAAf,cAAgC,OAAA,CAA6B;AAAA,EAClE,IAAA,GAAoB,IAAI,WAAA,EAAY;AAAA,EAEpC,YAAY,IAAA,EAAwB;AAClC,IAAA,KAAA,CAAM,IAAA,CAAK,MAAM,UAAU,CAAA;AAE3B,IAAA,IAAA,CAAK,IAAA,CAAK,WAAA,CAAY,IAAA,CAAK,MAAM,CAAA;AAAA,EACnC;AAAA,EAEA,WAAA,GAAiC;AAC/B,IAAA,MAAM,aAAA,GAAgB,CAAC,iBAAA,EAAmB,YAAA,EAAc,MAAM,CAAA;AAE9D,IAAA,IAAI;AACF,MAAA,MAAM,WAAA,GAAc,IAAI,WAAA,EAAY;AACpC,MAAA,MAAM,OAAA,GAAU,WAAA,CAAY,oBAAA,CAAqB,aAAa,CAAA;AAE9D,MAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,CAAC,OAAO,CAAC,CAAA;AAAA,IAClC,CAAA,CAAA,MAAQ;AAAA,IAAC;AAET,IAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,EAAE,CAAA;AAAA,EAC3B;AAGF;;;AC1BO,SAAS,8BAAA,CAA+B,QAAsC,MAAA,EAAwB;AAC3G,EAAA,OAAO,gCAAA,CAAiC,MAAA,EAAQ,UAAA,EAAY,MAAM,CAAA;AACpE;;;ACSA,eAAsB,WAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACoC;AACpC,EAAA,MAAM,SAAS,MAAM,mBAAA;AAAA,IACnB,UAAA;AAAA,IACA,SAAA;AAAA,IACA,8BAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"index.js","sourcesContent":["import type { IDeployer } from '@mastra/core/deployer';\n\nimport { Bundler } from '../bundler';\nimport { DepsService } from '../services/deps.js';\nimport { FileService } from '../services/fs.js';\n\nexport abstract class Deployer extends Bundler implements IDeployer {\n deps: DepsService = new DepsService();\n\n constructor(args: { name: string }) {\n super(args.name, 'DEPLOYER');\n\n this.deps.__setLogger(this.logger);\n }\n\n getEnvFiles(): Promise<string[]> {\n const possibleFiles = ['.env.production', '.env.local', '.env'];\n\n try {\n const fileService = new FileService();\n const envFile = fileService.getFirstExistingFile(possibleFiles);\n\n return Promise.resolve([envFile]);\n } catch {}\n\n return Promise.resolve([]);\n }\n\n abstract deploy(outputDirectory: string): Promise<void>;\n}\n","import { removeAllOptionsFromMastraExcept } from './remove-all-options-except';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function removeAllOptionsExceptDeployer(result: { hasCustomConfig: boolean }, logger?: IMastraLogger) {\n return removeAllOptionsFromMastraExcept(result, 'deployer', logger);\n}\n","import { removeAllOptionsExceptDeployer } from './babel/remove-all-options-deployer';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getDeployerBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('deployer', entryFile, removeAllOptionsExceptDeployer, result);\n}\n\nexport async function getDeployer(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['deployer'] | null> {\n const result = await extractMastraOption<Config['deployer']>(\n 'deployer',\n entryFile,\n removeAllOptionsExceptDeployer,\n outputDir,\n logger,\n );\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
|
+
export declare const vNextBodyOptions: any;
|
|
2
3
|
export declare function getAgentsHandler(c: Context): Promise<Response & import("hono").TypedResponse<{
|
|
3
4
|
[x: string]: {
|
|
5
|
+
workflows: {};
|
|
4
6
|
name: any;
|
|
5
7
|
tools: any;
|
|
6
|
-
workflows: {};
|
|
7
8
|
provider: string;
|
|
8
9
|
instructions: string;
|
|
9
10
|
modelId: string;
|
|
11
|
+
modelVersion: "v2" | "v1";
|
|
10
12
|
defaultGenerateOptions: any;
|
|
11
13
|
defaultStreamOptions: any;
|
|
12
14
|
};
|
|
@@ -18,6 +20,7 @@ export declare function getAgentByIdHandler(c: Context): Promise<Response & impo
|
|
|
18
20
|
workflows: {};
|
|
19
21
|
provider: string;
|
|
20
22
|
modelId: string;
|
|
23
|
+
modelVersion: "v2" | "v1";
|
|
21
24
|
defaultGenerateOptions: any;
|
|
22
25
|
defaultStreamOptions: any;
|
|
23
26
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
@@ -72,10 +75,18 @@ export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Respon
|
|
|
72
75
|
}[];
|
|
73
76
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
74
77
|
export declare function generateHandler(c: Context): Promise<Response>;
|
|
78
|
+
export declare function generateVNextHandler(c: Context): Promise<Response>;
|
|
75
79
|
export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
76
80
|
export declare function streamVNextGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
81
|
+
export declare function streamVNextUIMessageHandler(c: Context): Promise<Response | undefined>;
|
|
77
82
|
export declare function setAgentInstructionsHandler(c: Context): Promise<Response>;
|
|
78
83
|
export declare function updateAgentModelHandler(c: Context): Promise<Response>;
|
|
84
|
+
export declare function deprecatedStreamVNextHandler(c: Context): Promise<Response & import("hono").TypedResponse<{
|
|
85
|
+
error: string;
|
|
86
|
+
message: string;
|
|
87
|
+
deprecated_endpoint: string;
|
|
88
|
+
replacement_endpoint: string;
|
|
89
|
+
}, 410, "json">>;
|
|
79
90
|
export declare function getModelProvidersHandler(c: Context): Promise<(Response & import("hono").TypedResponse<{
|
|
80
91
|
error: string;
|
|
81
92
|
}, 403, "json">) | (Response & import("hono").TypedResponse<string[], import("hono/utils/http-status").ContentfulStatusCode, "json">)>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/agents/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/agents/handlers.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAOpC,eAAO,MAAM,gBAAgB,EAAE,GAiD9B,CAAC;AAGF,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;mEAOhD;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;mEAcnD;AAED,wBAAsB,wBAAwB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;mEAYxD;AAED,wBAAsB,4BAA4B,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;mEAY5D;AAED,wBAAsB,eAAe,CAAC,CAAC,EAAE,OAAO,qBAmB/C;AAED,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,OAAO,qBAmBpD;AAED,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAmBrF;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CA+C1F;AAED,wBAAsB,2BAA2B,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAmB3F;AAED,wBAAsB,2BAA2B,CAAC,CAAC,EAAE,OAAO,qBAgC3D;AAED,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,OAAO,qBAgBvD;AAED,wBAAsB,4BAA4B,CAAC,CAAC,EAAE,OAAO;;;;;iBAU5D;AAED,wBAAsB,wBAAwB,CAAC,CAAC,EAAE,OAAO;;uIAWxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/agents/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/agents/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAoBvD,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,8EAi4B9D;AAED,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,8EAyHjE"}
|
|
@@ -16,6 +16,31 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
16
16
|
supportsUrl?: {} | undefined;
|
|
17
17
|
doGenerate: {};
|
|
18
18
|
doStream: {};
|
|
19
|
+
} | {
|
|
20
|
+
readonly specificationVersion: "v2";
|
|
21
|
+
readonly provider: string;
|
|
22
|
+
readonly modelId: string;
|
|
23
|
+
supportedUrls: {
|
|
24
|
+
[x: string]: {
|
|
25
|
+
exec: {};
|
|
26
|
+
test: {};
|
|
27
|
+
readonly source: string;
|
|
28
|
+
readonly global: boolean;
|
|
29
|
+
readonly ignoreCase: boolean;
|
|
30
|
+
readonly multiline: boolean;
|
|
31
|
+
lastIndex: number;
|
|
32
|
+
compile: {};
|
|
33
|
+
readonly flags: string;
|
|
34
|
+
readonly sticky: boolean;
|
|
35
|
+
readonly unicode: boolean;
|
|
36
|
+
readonly dotAll: boolean;
|
|
37
|
+
readonly hasIndices: boolean;
|
|
38
|
+
}[];
|
|
39
|
+
} | {
|
|
40
|
+
then: {};
|
|
41
|
+
};
|
|
42
|
+
doGenerate: {};
|
|
43
|
+
doStream: {};
|
|
19
44
|
};
|
|
20
45
|
instructions: string;
|
|
21
46
|
} | undefined;
|
|
@@ -33,6 +58,31 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
33
58
|
supportsUrl?: {} | undefined;
|
|
34
59
|
doGenerate: {};
|
|
35
60
|
doStream: {};
|
|
61
|
+
} | {
|
|
62
|
+
readonly specificationVersion: "v2";
|
|
63
|
+
readonly provider: string;
|
|
64
|
+
readonly modelId: string;
|
|
65
|
+
supportedUrls: {
|
|
66
|
+
[x: string]: {
|
|
67
|
+
exec: {};
|
|
68
|
+
test: {};
|
|
69
|
+
readonly source: string;
|
|
70
|
+
readonly global: boolean;
|
|
71
|
+
readonly ignoreCase: boolean;
|
|
72
|
+
readonly multiline: boolean;
|
|
73
|
+
lastIndex: number;
|
|
74
|
+
compile: {};
|
|
75
|
+
readonly flags: string;
|
|
76
|
+
readonly sticky: boolean;
|
|
77
|
+
readonly unicode: boolean;
|
|
78
|
+
readonly dotAll: boolean;
|
|
79
|
+
readonly hasIndices: boolean;
|
|
80
|
+
}[];
|
|
81
|
+
} | {
|
|
82
|
+
then: {};
|
|
83
|
+
};
|
|
84
|
+
doGenerate: {};
|
|
85
|
+
doStream: {};
|
|
36
86
|
};
|
|
37
87
|
instructions: string;
|
|
38
88
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/scores/handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,qBAUjD;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/scores/handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,qBAUjD;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAYhD;AAED,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,OAAO,qBAkBvD;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,qBAsB1D;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,qBAqB1D;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO,qBAchD"}
|