@mastra/deployer 0.10.2-alpha.2 → 0.10.2-alpha.4
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 +5 -0
- package/dist/_tsup-dts-rollup.d.ts +5 -0
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/index.cjs +9 -9
- package/dist/build/index.js +3 -3
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-W46BY5GT.js → chunk-2LZRVR53.js} +1 -1
- package/dist/{chunk-Z2JXT2NK.cjs → chunk-3W43JESU.cjs} +6 -9
- package/dist/{chunk-WK63QOD5.cjs → chunk-DTQ7BTPM.cjs} +3 -3
- package/dist/{chunk-YHCVXGZM.cjs → chunk-J46MFOZR.cjs} +4 -4
- package/dist/{chunk-O3VM5GJZ.js → chunk-KWJ2766I.js} +1 -1
- package/dist/{chunk-HNAN6FSJ.js → chunk-TDWDSZWX.js} +2 -5
- package/dist/{chunk-OJY5LJPT.cjs → chunk-TSG63RGL.cjs} +1 -1
- package/dist/{chunk-5ZQI6XPC.js → chunk-XFHGCEOK.js} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +57 -1
- package/dist/server/index.js +58 -2
- package/package.json +4 -4
|
@@ -387,6 +387,11 @@ export declare function getLegacyWorkflowRunsHandler(c: Context): Promise<Respon
|
|
|
387
387
|
|
|
388
388
|
export declare function getLegacyWorkflowsHandler(c: Context): Promise<Response>;
|
|
389
389
|
|
|
390
|
+
/**
|
|
391
|
+
* Get available speakers for an agent
|
|
392
|
+
*/
|
|
393
|
+
export declare function getListenerHandler(c: Context): Promise<Response>;
|
|
394
|
+
|
|
390
395
|
export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
|
|
391
396
|
id: string;
|
|
392
397
|
name: any;
|
|
@@ -387,6 +387,11 @@ export declare function getLegacyWorkflowRunsHandler(c: Context): Promise<Respon
|
|
|
387
387
|
|
|
388
388
|
export declare function getLegacyWorkflowsHandler(c: Context): Promise<Response>;
|
|
389
389
|
|
|
390
|
+
/**
|
|
391
|
+
* Get available speakers for an agent
|
|
392
|
+
*/
|
|
393
|
+
export declare function getListenerHandler(c: Context): Promise<Response>;
|
|
394
|
+
|
|
390
395
|
export declare function getLiveEvalsByAgentIdHandler(c: Context): Promise<Response & TypedResponse< {
|
|
391
396
|
id: string;
|
|
392
397
|
name: any;
|
package/dist/build/analyze.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTSG63RGL_cjs = require('../chunk-TSG63RGL.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 chunkTSG63RGL_cjs.analyzeBundle; }
|
|
10
10
|
});
|
package/dist/build/analyze.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { analyzeBundle } from '../chunk-
|
|
1
|
+
export { analyzeBundle } from '../chunk-2LZRVR53.js';
|
package/dist/build/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkJ46MFOZR_cjs = require('../chunk-J46MFOZR.cjs');
|
|
4
|
+
var chunkDTQ7BTPM_cjs = require('../chunk-DTQ7BTPM.cjs');
|
|
5
|
+
var chunkTSG63RGL_cjs = require('../chunk-TSG63RGL.cjs');
|
|
6
6
|
var chunkIMGVLBV7_cjs = require('../chunk-IMGVLBV7.cjs');
|
|
7
7
|
var chunk4VC5Z4YR_cjs = require('../chunk-4VC5Z4YR.cjs');
|
|
8
8
|
|
|
@@ -10,27 +10,27 @@ 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 chunkJ46MFOZR_cjs.createWatcher; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getServerOptions", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkJ46MFOZR_cjs.getServerOptions; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getWatcherInputOptions", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkJ46MFOZR_cjs.getInputOptions; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkDTQ7BTPM_cjs.writeTelemetryConfig; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkTSG63RGL_cjs.analyzeBundle; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "getBundlerOptions", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkTSG63RGL_cjs.getBundlerOptions; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "createBundler", {
|
|
36
36
|
enumerable: true,
|
package/dist/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-
|
|
2
|
-
export { writeTelemetryConfig } from '../chunk-
|
|
3
|
-
export { analyzeBundle, getBundlerOptions } from '../chunk-
|
|
1
|
+
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-XFHGCEOK.js';
|
|
2
|
+
export { writeTelemetryConfig } from '../chunk-KWJ2766I.js';
|
|
3
|
+
export { analyzeBundle, getBundlerOptions } from '../chunk-2LZRVR53.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 chunk3W43JESU_cjs = require('../chunk-3W43JESU.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 chunk3W43JESU_cjs.Bundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Bundler } from '../chunk-
|
|
1
|
+
export { Bundler } from '../chunk-TDWDSZWX.js';
|
|
@@ -392,7 +392,7 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
392
392
|
continue;
|
|
393
393
|
}
|
|
394
394
|
for (const dynamicImport of o.dynamicImports) {
|
|
395
|
-
if (!depsToOptimize.has(dynamicImport)) {
|
|
395
|
+
if (!depsToOptimize.has(dynamicImport) && !isNodeBuiltin(dynamicImport)) {
|
|
396
396
|
depsToOptimize.set(dynamicImport, ["*"]);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDTQ7BTPM_cjs = require('./chunk-DTQ7BTPM.cjs');
|
|
4
|
+
var chunkTSG63RGL_cjs = require('./chunk-TSG63RGL.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');
|
|
@@ -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-3W43JESU.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) {
|
|
@@ -178,7 +178,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
178
178
|
return chunkIMGVLBV7_cjs.createBundler(inputOptions, outputOptions);
|
|
179
179
|
}
|
|
180
180
|
async analyze(entry, mastraFile, outputDirectory) {
|
|
181
|
-
return await
|
|
181
|
+
return await chunkTSG63RGL_cjs.analyzeBundle(entry, mastraFile, path.join(outputDirectory, this.analyzeOutputDir), "node", this.logger);
|
|
182
182
|
}
|
|
183
183
|
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
184
184
|
const deps = new chunk4VC5Z4YR_cjs.DepsService(rootDir);
|
|
@@ -240,14 +240,14 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
240
240
|
}
|
|
241
241
|
async _bundle(serverFile, mastraEntryFile, outputDirectory, toolsPaths = [], bundleLocation = path.join(outputDirectory, this.outputDir)) {
|
|
242
242
|
this.logger.info("Start bundling Mastra");
|
|
243
|
-
const analyzedBundleInfo = await
|
|
243
|
+
const analyzedBundleInfo = await chunkTSG63RGL_cjs.analyzeBundle(
|
|
244
244
|
serverFile,
|
|
245
245
|
mastraEntryFile,
|
|
246
246
|
path.join(outputDirectory, this.analyzeOutputDir),
|
|
247
247
|
"node",
|
|
248
248
|
this.logger
|
|
249
249
|
);
|
|
250
|
-
const { externalDependencies } = await
|
|
250
|
+
const { externalDependencies } = await chunkDTQ7BTPM_cjs.writeTelemetryConfig(mastraEntryFile, path.join(outputDirectory, this.outputDir));
|
|
251
251
|
const dependenciesToInstall = /* @__PURE__ */ new Map();
|
|
252
252
|
for (const external of externalDependencies) {
|
|
253
253
|
dependenciesToInstall.set(external, "latest");
|
|
@@ -290,9 +290,6 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
if (analyzedBundleInfo.externalDependencies.has("@mastra/memory") || analyzedBundleInfo.dependencies.has("@mastra/memory")) {
|
|
294
|
-
dependenciesToInstall.set("fastembed", "latest");
|
|
295
|
-
}
|
|
296
293
|
await this.writePackageJson(path.join(outputDirectory, this.outputDir), dependenciesToInstall, resolutions);
|
|
297
294
|
await this.writeInstrumentationFile(path.join(outputDirectory, this.outputDir));
|
|
298
295
|
this.logger.info("Bundling Mastra application");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTSG63RGL_cjs = require('./chunk-TSG63RGL.cjs');
|
|
4
4
|
var babel = require('@babel/core');
|
|
5
5
|
var rollup = require('rollup');
|
|
6
6
|
var esbuild = require('rollup-plugin-esbuild');
|
|
@@ -32,7 +32,7 @@ var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
|
|
|
32
32
|
|
|
33
33
|
// src/build/babel/remove-all-options-telemetry.ts
|
|
34
34
|
function removeAllOptionsExceptTelemetry(result) {
|
|
35
|
-
return
|
|
35
|
+
return chunkTSG63RGL_cjs.removeAllOptionsFromMastraExcept(result, "telemetry");
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// src/build/telemetry.ts
|
|
@@ -96,7 +96,7 @@ function getTelemetryBundler(entryFile, result) {
|
|
|
96
96
|
if (id !== entryFile) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return chunkTSG63RGL_cjs.recursiveRemoveNonReferencedNodes(code);
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
// let esbuild remove all unused imports
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
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');
|
|
@@ -48,7 +48,7 @@ async function getInputOptions2(entryFile, platform, env) {
|
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
(plugin) => !plugin || !plugin?.name || plugin.name !== "node-resolve"
|
|
50
50
|
);
|
|
51
|
-
inputOptions.plugins.push(
|
|
51
|
+
inputOptions.plugins.push(chunkTSG63RGL_cjs.aliasHono());
|
|
52
52
|
}
|
|
53
53
|
return inputOptions;
|
|
54
54
|
}
|
|
@@ -67,7 +67,7 @@ async function createWatcher(inputOptions, outputOptions) {
|
|
|
67
67
|
|
|
68
68
|
// src/build/babel/remove-all-options-server.ts
|
|
69
69
|
function removeAllOptionsExceptServer(result) {
|
|
70
|
-
return
|
|
70
|
+
return chunkTSG63RGL_cjs.removeAllOptionsFromMastraExcept(result, "server");
|
|
71
71
|
}
|
|
72
72
|
function getServerOptionsBundler(entryFile, result) {
|
|
73
73
|
return rollup.rollup({
|
|
@@ -130,7 +130,7 @@ function getServerOptionsBundler(entryFile, result) {
|
|
|
130
130
|
if (id !== entryFile) {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return chunkTSG63RGL_cjs.recursiveRemoveNonReferencedNodes(code);
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
// let esbuild remove all unused imports
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastraExcept } from './chunk-
|
|
1
|
+
import { recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastraExcept } from './chunk-2LZRVR53.js';
|
|
2
2
|
import * as babel from '@babel/core';
|
|
3
3
|
import { rollup } from 'rollup';
|
|
4
4
|
import esbuild from 'rollup-plugin-esbuild';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { writeTelemetryConfig } from './chunk-
|
|
2
|
-
import { analyzeBundle } from './chunk-
|
|
1
|
+
import { writeTelemetryConfig } from './chunk-KWJ2766I.js';
|
|
2
|
+
import { analyzeBundle } from './chunk-2LZRVR53.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';
|
|
@@ -280,9 +280,6 @@ var Bundler = class extends MastraBundler {
|
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
if (analyzedBundleInfo.externalDependencies.has("@mastra/memory") || analyzedBundleInfo.dependencies.has("@mastra/memory")) {
|
|
284
|
-
dependenciesToInstall.set("fastembed", "latest");
|
|
285
|
-
}
|
|
286
283
|
await this.writePackageJson(join(outputDirectory, this.outputDir), dependenciesToInstall, resolutions);
|
|
287
284
|
await this.writeInstrumentationFile(join(outputDirectory, this.outputDir));
|
|
288
285
|
this.logger.info("Bundling Mastra application");
|
|
@@ -420,7 +420,7 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
420
420
|
continue;
|
|
421
421
|
}
|
|
422
422
|
for (const dynamicImport of o.dynamicImports) {
|
|
423
|
-
if (!depsToOptimize.has(dynamicImport)) {
|
|
423
|
+
if (!depsToOptimize.has(dynamicImport) && !isNodeBuiltin(dynamicImport)) {
|
|
424
424
|
depsToOptimize.set(dynamicImport, ["*"]);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aliasHono, recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastraExcept } from './chunk-
|
|
1
|
+
import { aliasHono, recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastraExcept } from './chunk-2LZRVR53.js';
|
|
2
2
|
import { getInputOptions } from './chunk-AOSWYZKN.js';
|
|
3
3
|
import { tsConfigPaths } from './chunk-WVBUOQT6.js';
|
|
4
4
|
import { watch, rollup } from 'rollup';
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk3W43JESU_cjs = require('./chunk-3W43JESU.cjs');
|
|
4
|
+
var chunkTSG63RGL_cjs = require('./chunk-TSG63RGL.cjs');
|
|
5
5
|
var chunk4VC5Z4YR_cjs = require('./chunk-4VC5Z4YR.cjs');
|
|
6
6
|
var babel = require('@babel/core');
|
|
7
7
|
var rollup = require('rollup');
|
|
@@ -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 chunk3W43JESU_cjs.Bundler {
|
|
37
37
|
deps = new chunk4VC5Z4YR_cjs.DepsService();
|
|
38
38
|
constructor(args) {
|
|
39
39
|
super(args.name, "DEPLOYER");
|
|
@@ -148,7 +148,7 @@ function getDeployerBundler(entryFile, result) {
|
|
|
148
148
|
if (id !== entryFile) {
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
return
|
|
151
|
+
return chunkTSG63RGL_cjs.recursiveRemoveNonReferencedNodes(code);
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
// let esbuild remove all unused imports
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Bundler } from './chunk-
|
|
2
|
-
import { recursiveRemoveNonReferencedNodes } from './chunk-
|
|
1
|
+
import { Bundler } from './chunk-TDWDSZWX.js';
|
|
2
|
+
import { recursiveRemoveNonReferencedNodes } from './chunk-2LZRVR53.js';
|
|
3
3
|
import { DepsService, FileService } from './chunk-UV4RQQ3R.js';
|
|
4
4
|
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-UV4RQQ3R.js';
|
|
5
5
|
import * as babel from '@babel/core';
|
package/dist/server/index.cjs
CHANGED
|
@@ -4054,6 +4054,19 @@ async function speakHandler(c2) {
|
|
|
4054
4054
|
return handleError(error, "Error generating speech");
|
|
4055
4055
|
}
|
|
4056
4056
|
}
|
|
4057
|
+
async function getListenerHandler(c2) {
|
|
4058
|
+
try {
|
|
4059
|
+
const mastra = c2.get("mastra");
|
|
4060
|
+
const agentId = c2.req.param("agentId");
|
|
4061
|
+
const listeners = await voice.getListenerHandler({
|
|
4062
|
+
mastra,
|
|
4063
|
+
agentId
|
|
4064
|
+
});
|
|
4065
|
+
return c2.json(listeners);
|
|
4066
|
+
} catch (error) {
|
|
4067
|
+
return handleError(error, "Error getting listener");
|
|
4068
|
+
}
|
|
4069
|
+
}
|
|
4057
4070
|
async function listenHandler(c2) {
|
|
4058
4071
|
try {
|
|
4059
4072
|
const mastra = c2.get("mastra");
|
|
@@ -5364,6 +5377,45 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5364
5377
|
}),
|
|
5365
5378
|
speakHandler
|
|
5366
5379
|
);
|
|
5380
|
+
app.get(
|
|
5381
|
+
"/api/agents/:agentId/voice/listener",
|
|
5382
|
+
h({
|
|
5383
|
+
description: "Get available listener for an agent",
|
|
5384
|
+
tags: ["agents"],
|
|
5385
|
+
parameters: [
|
|
5386
|
+
{
|
|
5387
|
+
name: "agentId",
|
|
5388
|
+
in: "path",
|
|
5389
|
+
required: true,
|
|
5390
|
+
schema: { type: "string" }
|
|
5391
|
+
}
|
|
5392
|
+
],
|
|
5393
|
+
responses: {
|
|
5394
|
+
200: {
|
|
5395
|
+
description: "Checks if listener is available for the agent",
|
|
5396
|
+
content: {
|
|
5397
|
+
"application/json": {
|
|
5398
|
+
schema: {
|
|
5399
|
+
type: "object",
|
|
5400
|
+
description: "Listener information depending on the voice provider",
|
|
5401
|
+
properties: {
|
|
5402
|
+
enabled: { type: "boolean" }
|
|
5403
|
+
},
|
|
5404
|
+
additionalProperties: true
|
|
5405
|
+
}
|
|
5406
|
+
}
|
|
5407
|
+
}
|
|
5408
|
+
},
|
|
5409
|
+
400: {
|
|
5410
|
+
description: "Agent does not have voice capabilities"
|
|
5411
|
+
},
|
|
5412
|
+
404: {
|
|
5413
|
+
description: "Agent not found"
|
|
5414
|
+
}
|
|
5415
|
+
}
|
|
5416
|
+
}),
|
|
5417
|
+
getListenerHandler
|
|
5418
|
+
);
|
|
5367
5419
|
app.post(
|
|
5368
5420
|
"/api/agents/:agentId/listen",
|
|
5369
5421
|
bodyLimit.bodyLimit({
|
|
@@ -7224,7 +7276,11 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7224
7276
|
return await next();
|
|
7225
7277
|
}
|
|
7226
7278
|
if (options?.playground) {
|
|
7227
|
-
|
|
7279
|
+
let indexHtml = await promises.readFile(posix.join(process.cwd(), "./playground/index.html"), "utf-8");
|
|
7280
|
+
indexHtml = indexHtml.replace(
|
|
7281
|
+
`'%%MASTRA_TELEMETRY_DISABLED%%'`,
|
|
7282
|
+
`${Boolean(process.env.MASTRA_TELEMETRY_DISABLED)}`
|
|
7283
|
+
);
|
|
7228
7284
|
return c2.newResponse(indexHtml, 200, { "Content-Type": "text/html" });
|
|
7229
7285
|
}
|
|
7230
7286
|
return c2.newResponse(html2, 200, { "Content-Type": "text/html" });
|
package/dist/server/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import { z } from 'zod';
|
|
|
31
31
|
import { getTelemetryHandler as getTelemetryHandler$1, storeTelemetryHandler as storeTelemetryHandler$1 } from '@mastra/server/handlers/telemetry';
|
|
32
32
|
import { executeAgentToolHandler as executeAgentToolHandler$1, getToolsHandler as getToolsHandler$1, getToolByIdHandler as getToolByIdHandler$1, executeToolHandler as executeToolHandler$1 } from '@mastra/server/handlers/tools';
|
|
33
33
|
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';
|
|
34
|
-
import { getSpeakersHandler as getSpeakersHandler$1, generateSpeechHandler, transcribeSpeechHandler } from '@mastra/server/handlers/voice';
|
|
34
|
+
import { getSpeakersHandler as getSpeakersHandler$1, generateSpeechHandler, getListenerHandler as getListenerHandler$1, transcribeSpeechHandler } from '@mastra/server/handlers/voice';
|
|
35
35
|
import { streamWorkflowHandler as streamWorkflowHandler$1, getWorkflowsHandler as getWorkflowsHandler$1, getWorkflowByIdHandler as getWorkflowByIdHandler$1, getWorkflowRunsHandler as getWorkflowRunsHandler$1, resumeWorkflowHandler as resumeWorkflowHandler$1, resumeAsyncWorkflowHandler as resumeAsyncWorkflowHandler$1, createWorkflowRunHandler as createWorkflowRunHandler$1, startAsyncWorkflowHandler as startAsyncWorkflowHandler$1, startWorkflowRunHandler as startWorkflowRunHandler$1, watchWorkflowHandler as watchWorkflowHandler$1 } from '@mastra/server/handlers/workflows';
|
|
36
36
|
|
|
37
37
|
// src/server/index.ts
|
|
@@ -4048,6 +4048,19 @@ async function speakHandler(c2) {
|
|
|
4048
4048
|
return handleError(error, "Error generating speech");
|
|
4049
4049
|
}
|
|
4050
4050
|
}
|
|
4051
|
+
async function getListenerHandler(c2) {
|
|
4052
|
+
try {
|
|
4053
|
+
const mastra = c2.get("mastra");
|
|
4054
|
+
const agentId = c2.req.param("agentId");
|
|
4055
|
+
const listeners = await getListenerHandler$1({
|
|
4056
|
+
mastra,
|
|
4057
|
+
agentId
|
|
4058
|
+
});
|
|
4059
|
+
return c2.json(listeners);
|
|
4060
|
+
} catch (error) {
|
|
4061
|
+
return handleError(error, "Error getting listener");
|
|
4062
|
+
}
|
|
4063
|
+
}
|
|
4051
4064
|
async function listenHandler(c2) {
|
|
4052
4065
|
try {
|
|
4053
4066
|
const mastra = c2.get("mastra");
|
|
@@ -5358,6 +5371,45 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
5358
5371
|
}),
|
|
5359
5372
|
speakHandler
|
|
5360
5373
|
);
|
|
5374
|
+
app.get(
|
|
5375
|
+
"/api/agents/:agentId/voice/listener",
|
|
5376
|
+
h({
|
|
5377
|
+
description: "Get available listener for an agent",
|
|
5378
|
+
tags: ["agents"],
|
|
5379
|
+
parameters: [
|
|
5380
|
+
{
|
|
5381
|
+
name: "agentId",
|
|
5382
|
+
in: "path",
|
|
5383
|
+
required: true,
|
|
5384
|
+
schema: { type: "string" }
|
|
5385
|
+
}
|
|
5386
|
+
],
|
|
5387
|
+
responses: {
|
|
5388
|
+
200: {
|
|
5389
|
+
description: "Checks if listener is available for the agent",
|
|
5390
|
+
content: {
|
|
5391
|
+
"application/json": {
|
|
5392
|
+
schema: {
|
|
5393
|
+
type: "object",
|
|
5394
|
+
description: "Listener information depending on the voice provider",
|
|
5395
|
+
properties: {
|
|
5396
|
+
enabled: { type: "boolean" }
|
|
5397
|
+
},
|
|
5398
|
+
additionalProperties: true
|
|
5399
|
+
}
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5402
|
+
},
|
|
5403
|
+
400: {
|
|
5404
|
+
description: "Agent does not have voice capabilities"
|
|
5405
|
+
},
|
|
5406
|
+
404: {
|
|
5407
|
+
description: "Agent not found"
|
|
5408
|
+
}
|
|
5409
|
+
}
|
|
5410
|
+
}),
|
|
5411
|
+
getListenerHandler
|
|
5412
|
+
);
|
|
5361
5413
|
app.post(
|
|
5362
5414
|
"/api/agents/:agentId/listen",
|
|
5363
5415
|
bodyLimit({
|
|
@@ -7218,7 +7270,11 @@ async function createHonoServer(mastra, options = {}) {
|
|
|
7218
7270
|
return await next();
|
|
7219
7271
|
}
|
|
7220
7272
|
if (options?.playground) {
|
|
7221
|
-
|
|
7273
|
+
let indexHtml = await readFile(join(process.cwd(), "./playground/index.html"), "utf-8");
|
|
7274
|
+
indexHtml = indexHtml.replace(
|
|
7275
|
+
`'%%MASTRA_TELEMETRY_DISABLED%%'`,
|
|
7276
|
+
`${Boolean(process.env.MASTRA_TELEMETRY_DISABLED)}`
|
|
7277
|
+
);
|
|
7222
7278
|
return c2.newResponse(indexHtml, 200, { "Content-Type": "text/html" });
|
|
7223
7279
|
}
|
|
7224
7280
|
return c2.newResponse(html2, 200, { "Content-Type": "text/html" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.10.2-alpha.
|
|
3
|
+
"version": "0.10.2-alpha.4",
|
|
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.24.3",
|
|
111
|
-
"@mastra/server": "^0.10.2-alpha.
|
|
111
|
+
"@mastra/server": "^0.10.2-alpha.4"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@hono/node-server": "^1.13.8",
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"type-fest": "^4.37.0",
|
|
128
128
|
"typescript": "^5.8.2",
|
|
129
129
|
"vitest": "^2.1.9",
|
|
130
|
-
"@internal/lint": "0.0.7",
|
|
131
130
|
"@mastra/mcp": "^0.10.2-alpha.1",
|
|
132
|
-
"@
|
|
131
|
+
"@internal/lint": "0.0.7",
|
|
132
|
+
"@mastra/core": "0.10.2-alpha.4"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@mastra/core": "^0.10.2-alpha.0"
|