@mastra/deployer 0.10.7 → 0.10.8-alpha.0
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.
|
@@ -649,6 +649,8 @@ total_count: number;
|
|
|
649
649
|
*/
|
|
650
650
|
export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
|
|
651
651
|
|
|
652
|
+
export declare function loopStreamVNextNetworkHandler(c: Context): Promise<Response>;
|
|
653
|
+
|
|
652
654
|
export declare function loopVNextNetworkHandler(c: Context): Promise<Response>;
|
|
653
655
|
|
|
654
656
|
export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
|
|
@@ -649,6 +649,8 @@ total_count: number;
|
|
|
649
649
|
*/
|
|
650
650
|
export declare const listMcpServerToolsHandler: (c: Context) => Promise<Response>;
|
|
651
651
|
|
|
652
|
+
export declare function loopStreamVNextNetworkHandler(c: Context): Promise<Response>;
|
|
653
|
+
|
|
652
654
|
export declare function loopVNextNetworkHandler(c: Context): Promise<Response>;
|
|
653
655
|
|
|
654
656
|
export declare const matchesOrIncludes: (values: string | string[], value: string) => boolean;
|
package/dist/server/index.cjs
CHANGED
|
@@ -4166,11 +4166,11 @@ async function streamGenerateVNextNetworkHandler(c2) {
|
|
|
4166
4166
|
await stream5.write(JSON.stringify(chunkResult.value) + "");
|
|
4167
4167
|
}
|
|
4168
4168
|
} catch (err) {
|
|
4169
|
-
mastra.getLogger().error("Error in
|
|
4169
|
+
mastra.getLogger().error("Error in network stream: " + (err?.message ?? "Unknown error"));
|
|
4170
4170
|
}
|
|
4171
4171
|
},
|
|
4172
4172
|
async (err) => {
|
|
4173
|
-
logger2.error("Error in
|
|
4173
|
+
logger2.error("Error in network stream: " + err?.message);
|
|
4174
4174
|
}
|
|
4175
4175
|
);
|
|
4176
4176
|
} catch (error) {
|
|
@@ -4194,6 +4194,44 @@ async function loopVNextNetworkHandler(c2) {
|
|
|
4194
4194
|
return handleError(error, "Error looping from network");
|
|
4195
4195
|
}
|
|
4196
4196
|
}
|
|
4197
|
+
async function loopStreamVNextNetworkHandler(c2) {
|
|
4198
|
+
try {
|
|
4199
|
+
const mastra = c2.get("mastra");
|
|
4200
|
+
const runtimeContext = c2.get("runtimeContext");
|
|
4201
|
+
const logger2 = mastra.getLogger();
|
|
4202
|
+
const networkId = c2.req.param("networkId");
|
|
4203
|
+
const body = await c2.req.json();
|
|
4204
|
+
c2.header("Transfer-Encoding", "chunked");
|
|
4205
|
+
return streaming.stream(
|
|
4206
|
+
c2,
|
|
4207
|
+
async (stream5) => {
|
|
4208
|
+
try {
|
|
4209
|
+
const result = await vNextNetwork.loopStreamVNextNetworkHandler({
|
|
4210
|
+
mastra,
|
|
4211
|
+
runtimeContext,
|
|
4212
|
+
networkId,
|
|
4213
|
+
body
|
|
4214
|
+
});
|
|
4215
|
+
const reader = result.stream.getReader();
|
|
4216
|
+
stream5.onAbort(() => {
|
|
4217
|
+
void reader.cancel("request aborted");
|
|
4218
|
+
});
|
|
4219
|
+
let chunkResult;
|
|
4220
|
+
while ((chunkResult = await reader.read()) && !chunkResult.done) {
|
|
4221
|
+
await stream5.write(JSON.stringify(chunkResult.value) + "");
|
|
4222
|
+
}
|
|
4223
|
+
} catch (err) {
|
|
4224
|
+
mastra.getLogger().error("Error in network loop stream: " + (err?.message ?? "Unknown error"));
|
|
4225
|
+
}
|
|
4226
|
+
},
|
|
4227
|
+
async (err) => {
|
|
4228
|
+
logger2.error("Error in network loop stream: " + err?.message);
|
|
4229
|
+
}
|
|
4230
|
+
);
|
|
4231
|
+
} catch (error) {
|
|
4232
|
+
return handleError(error, "Error streaming network loop");
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4197
4235
|
async function getSpeakersHandler(c2) {
|
|
4198
4236
|
try {
|
|
4199
4237
|
const mastra = c2.get("mastra");
|
|
@@ -5054,11 +5092,65 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
5054
5092
|
}),
|
|
5055
5093
|
loopVNextNetworkHandler
|
|
5056
5094
|
);
|
|
5095
|
+
app.post(
|
|
5096
|
+
"/api/networks/v-next/:networkId/loop-stream",
|
|
5097
|
+
bodyLimit.bodyLimit(bodyLimitOptions),
|
|
5098
|
+
w({
|
|
5099
|
+
description: "Stream a v-next network loop",
|
|
5100
|
+
tags: ["vNextNetworks"],
|
|
5101
|
+
parameters: [
|
|
5102
|
+
{
|
|
5103
|
+
name: "networkId",
|
|
5104
|
+
in: "path",
|
|
5105
|
+
required: true,
|
|
5106
|
+
schema: { type: "string" }
|
|
5107
|
+
}
|
|
5108
|
+
],
|
|
5109
|
+
requestBody: {
|
|
5110
|
+
required: true,
|
|
5111
|
+
content: {
|
|
5112
|
+
"application/json": {
|
|
5113
|
+
schema: {
|
|
5114
|
+
type: "object",
|
|
5115
|
+
properties: {
|
|
5116
|
+
message: {
|
|
5117
|
+
type: "string",
|
|
5118
|
+
description: "Message for the v-next network"
|
|
5119
|
+
},
|
|
5120
|
+
threadId: {
|
|
5121
|
+
type: "string",
|
|
5122
|
+
description: "Thread Id of the conversation"
|
|
5123
|
+
},
|
|
5124
|
+
resourceId: {
|
|
5125
|
+
type: "string",
|
|
5126
|
+
description: "Resource Id of the conversation"
|
|
5127
|
+
},
|
|
5128
|
+
maxIterations: {
|
|
5129
|
+
type: "number",
|
|
5130
|
+
description: "Maximum number of iterations to run"
|
|
5131
|
+
}
|
|
5132
|
+
},
|
|
5133
|
+
required: ["message"]
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
}
|
|
5137
|
+
},
|
|
5138
|
+
responses: {
|
|
5139
|
+
200: {
|
|
5140
|
+
description: "Streamed response"
|
|
5141
|
+
},
|
|
5142
|
+
404: {
|
|
5143
|
+
description: "v-next Network not found"
|
|
5144
|
+
}
|
|
5145
|
+
}
|
|
5146
|
+
}),
|
|
5147
|
+
loopStreamVNextNetworkHandler
|
|
5148
|
+
);
|
|
5057
5149
|
app.post(
|
|
5058
5150
|
"/api/networks/v-next/:networkId/stream",
|
|
5059
5151
|
bodyLimit.bodyLimit(bodyLimitOptions),
|
|
5060
5152
|
w({
|
|
5061
|
-
description: "
|
|
5153
|
+
description: "Stream a response from a v-next network",
|
|
5062
5154
|
tags: ["vNextNetworks"],
|
|
5063
5155
|
parameters: [
|
|
5064
5156
|
{
|
|
@@ -5095,7 +5187,7 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
5095
5187
|
},
|
|
5096
5188
|
responses: {
|
|
5097
5189
|
200: {
|
|
5098
|
-
description: "
|
|
5190
|
+
description: "Streamed response"
|
|
5099
5191
|
},
|
|
5100
5192
|
404: {
|
|
5101
5193
|
description: "v-next Network not found"
|
package/dist/server/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import { z } from 'zod';
|
|
|
30
30
|
import { getTelemetryHandler as getTelemetryHandler$1, storeTelemetryHandler as storeTelemetryHandler$1 } from '@mastra/server/handlers/telemetry';
|
|
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
|
-
import { getVNextNetworksHandler as getVNextNetworksHandler$1, getVNextNetworkByIdHandler as getVNextNetworkByIdHandler$1, generateVNextNetworkHandler as generateVNextNetworkHandler$1, loopVNextNetworkHandler as loopVNextNetworkHandler$1, streamGenerateVNextNetworkHandler as streamGenerateVNextNetworkHandler$1 } from '@mastra/server/handlers/vNextNetwork';
|
|
33
|
+
import { getVNextNetworksHandler as getVNextNetworksHandler$1, getVNextNetworkByIdHandler as getVNextNetworkByIdHandler$1, generateVNextNetworkHandler as generateVNextNetworkHandler$1, loopVNextNetworkHandler as loopVNextNetworkHandler$1, loopStreamVNextNetworkHandler as loopStreamVNextNetworkHandler$1, streamGenerateVNextNetworkHandler as streamGenerateVNextNetworkHandler$1 } from '@mastra/server/handlers/vNextNetwork';
|
|
34
34
|
import { getSpeakersHandler as getSpeakersHandler$1, generateSpeechHandler, getListenerHandler as getListenerHandler$1, transcribeSpeechHandler } from '@mastra/server/handlers/voice';
|
|
35
35
|
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';
|
|
36
36
|
|
|
@@ -4159,11 +4159,11 @@ async function streamGenerateVNextNetworkHandler(c2) {
|
|
|
4159
4159
|
await stream5.write(JSON.stringify(chunkResult.value) + "");
|
|
4160
4160
|
}
|
|
4161
4161
|
} catch (err) {
|
|
4162
|
-
mastra.getLogger().error("Error in
|
|
4162
|
+
mastra.getLogger().error("Error in network stream: " + (err?.message ?? "Unknown error"));
|
|
4163
4163
|
}
|
|
4164
4164
|
},
|
|
4165
4165
|
async (err) => {
|
|
4166
|
-
logger2.error("Error in
|
|
4166
|
+
logger2.error("Error in network stream: " + err?.message);
|
|
4167
4167
|
}
|
|
4168
4168
|
);
|
|
4169
4169
|
} catch (error) {
|
|
@@ -4187,6 +4187,44 @@ async function loopVNextNetworkHandler(c2) {
|
|
|
4187
4187
|
return handleError(error, "Error looping from network");
|
|
4188
4188
|
}
|
|
4189
4189
|
}
|
|
4190
|
+
async function loopStreamVNextNetworkHandler(c2) {
|
|
4191
|
+
try {
|
|
4192
|
+
const mastra = c2.get("mastra");
|
|
4193
|
+
const runtimeContext = c2.get("runtimeContext");
|
|
4194
|
+
const logger2 = mastra.getLogger();
|
|
4195
|
+
const networkId = c2.req.param("networkId");
|
|
4196
|
+
const body = await c2.req.json();
|
|
4197
|
+
c2.header("Transfer-Encoding", "chunked");
|
|
4198
|
+
return stream(
|
|
4199
|
+
c2,
|
|
4200
|
+
async (stream5) => {
|
|
4201
|
+
try {
|
|
4202
|
+
const result = await loopStreamVNextNetworkHandler$1({
|
|
4203
|
+
mastra,
|
|
4204
|
+
runtimeContext,
|
|
4205
|
+
networkId,
|
|
4206
|
+
body
|
|
4207
|
+
});
|
|
4208
|
+
const reader = result.stream.getReader();
|
|
4209
|
+
stream5.onAbort(() => {
|
|
4210
|
+
void reader.cancel("request aborted");
|
|
4211
|
+
});
|
|
4212
|
+
let chunkResult;
|
|
4213
|
+
while ((chunkResult = await reader.read()) && !chunkResult.done) {
|
|
4214
|
+
await stream5.write(JSON.stringify(chunkResult.value) + "");
|
|
4215
|
+
}
|
|
4216
|
+
} catch (err) {
|
|
4217
|
+
mastra.getLogger().error("Error in network loop stream: " + (err?.message ?? "Unknown error"));
|
|
4218
|
+
}
|
|
4219
|
+
},
|
|
4220
|
+
async (err) => {
|
|
4221
|
+
logger2.error("Error in network loop stream: " + err?.message);
|
|
4222
|
+
}
|
|
4223
|
+
);
|
|
4224
|
+
} catch (error) {
|
|
4225
|
+
return handleError(error, "Error streaming network loop");
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4190
4228
|
async function getSpeakersHandler(c2) {
|
|
4191
4229
|
try {
|
|
4192
4230
|
const mastra = c2.get("mastra");
|
|
@@ -5047,11 +5085,65 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
5047
5085
|
}),
|
|
5048
5086
|
loopVNextNetworkHandler
|
|
5049
5087
|
);
|
|
5088
|
+
app.post(
|
|
5089
|
+
"/api/networks/v-next/:networkId/loop-stream",
|
|
5090
|
+
bodyLimit(bodyLimitOptions),
|
|
5091
|
+
w({
|
|
5092
|
+
description: "Stream a v-next network loop",
|
|
5093
|
+
tags: ["vNextNetworks"],
|
|
5094
|
+
parameters: [
|
|
5095
|
+
{
|
|
5096
|
+
name: "networkId",
|
|
5097
|
+
in: "path",
|
|
5098
|
+
required: true,
|
|
5099
|
+
schema: { type: "string" }
|
|
5100
|
+
}
|
|
5101
|
+
],
|
|
5102
|
+
requestBody: {
|
|
5103
|
+
required: true,
|
|
5104
|
+
content: {
|
|
5105
|
+
"application/json": {
|
|
5106
|
+
schema: {
|
|
5107
|
+
type: "object",
|
|
5108
|
+
properties: {
|
|
5109
|
+
message: {
|
|
5110
|
+
type: "string",
|
|
5111
|
+
description: "Message for the v-next network"
|
|
5112
|
+
},
|
|
5113
|
+
threadId: {
|
|
5114
|
+
type: "string",
|
|
5115
|
+
description: "Thread Id of the conversation"
|
|
5116
|
+
},
|
|
5117
|
+
resourceId: {
|
|
5118
|
+
type: "string",
|
|
5119
|
+
description: "Resource Id of the conversation"
|
|
5120
|
+
},
|
|
5121
|
+
maxIterations: {
|
|
5122
|
+
type: "number",
|
|
5123
|
+
description: "Maximum number of iterations to run"
|
|
5124
|
+
}
|
|
5125
|
+
},
|
|
5126
|
+
required: ["message"]
|
|
5127
|
+
}
|
|
5128
|
+
}
|
|
5129
|
+
}
|
|
5130
|
+
},
|
|
5131
|
+
responses: {
|
|
5132
|
+
200: {
|
|
5133
|
+
description: "Streamed response"
|
|
5134
|
+
},
|
|
5135
|
+
404: {
|
|
5136
|
+
description: "v-next Network not found"
|
|
5137
|
+
}
|
|
5138
|
+
}
|
|
5139
|
+
}),
|
|
5140
|
+
loopStreamVNextNetworkHandler
|
|
5141
|
+
);
|
|
5050
5142
|
app.post(
|
|
5051
5143
|
"/api/networks/v-next/:networkId/stream",
|
|
5052
5144
|
bodyLimit(bodyLimitOptions),
|
|
5053
5145
|
w({
|
|
5054
|
-
description: "
|
|
5146
|
+
description: "Stream a response from a v-next network",
|
|
5055
5147
|
tags: ["vNextNetworks"],
|
|
5056
5148
|
parameters: [
|
|
5057
5149
|
{
|
|
@@ -5088,7 +5180,7 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
5088
5180
|
},
|
|
5089
5181
|
responses: {
|
|
5090
5182
|
200: {
|
|
5091
|
-
description: "
|
|
5183
|
+
description: "Streamed response"
|
|
5092
5184
|
},
|
|
5093
5185
|
404: {
|
|
5094
5186
|
description: "v-next Network not found"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"rollup-plugin-node-externals": "^8.0.1",
|
|
109
109
|
"typescript-paths": "^1.5.1",
|
|
110
110
|
"zod": "^3.25.67",
|
|
111
|
-
"@mastra/server": "^0.10.
|
|
111
|
+
"@mastra/server": "^0.10.8-alpha.0"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@hono/node-server": "^1.14.4",
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"type-fest": "^4.41.0",
|
|
128
128
|
"typescript": "^5.8.3",
|
|
129
129
|
"vitest": "^2.1.9",
|
|
130
|
-
"@
|
|
131
|
-
"@mastra/
|
|
132
|
-
"@
|
|
130
|
+
"@mastra/core": "0.10.8-alpha.0",
|
|
131
|
+
"@mastra/mcp": "^0.10.5",
|
|
132
|
+
"@internal/lint": "0.0.14"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@mastra/core": "^0.10.2-alpha.0"
|