@mastra/deployer 0.16.2-alpha.0 → 0.16.3-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.
- package/CHANGELOG.md +21 -0
- package/dist/server/handlers/routes/agents/handlers.d.ts +5 -12
- 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/index.cjs +96 -21
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +97 -22
- package/dist/server/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 0.16.3-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dependencies updates: ([#7545](https://github.com/mastra-ai/mastra/pull/7545))
|
|
8
|
+
- Updated dependency [`hono@^4.9.6` ↗︎](https://www.npmjs.com/package/hono/v/4.9.6) (from `^4.8.12`, in `dependencies`)
|
|
9
|
+
|
|
10
|
+
- AN packages ([#7711](https://github.com/mastra-ai/mastra/pull/7711))
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [[`b4379f7`](https://github.com/mastra-ai/mastra/commit/b4379f703fd74474f253420e8c3a684f2c4b2f8e), [`dd9119b`](https://github.com/mastra-ai/mastra/commit/dd9119b175a8f389082f75c12750e51f96d65dca), [`d34aaa1`](https://github.com/mastra-ai/mastra/commit/d34aaa1da5d3c5f991740f59e2fe6d28d3e2dd91), [`ce1e580`](https://github.com/mastra-ai/mastra/commit/ce1e580f6391e94a0c6816a9c5db0a21566a262f), [`4a2e636`](https://github.com/mastra-ai/mastra/commit/4a2e636719b410b25cdae46fb40d4a9c575d3ed0), [`b2babfa`](https://github.com/mastra-ai/mastra/commit/b2babfa9e75b22f2759179e71d8473f6dc5421ed), [`d8c3ba5`](https://github.com/mastra-ai/mastra/commit/d8c3ba516f4173282d293f7e64769cfc8738d360), [`a566c4e`](https://github.com/mastra-ai/mastra/commit/a566c4e92d86c1671707c54359b1d33934f7cc13), [`af333aa`](https://github.com/mastra-ai/mastra/commit/af333aa30fe6d1b127024b03a64736c46eddeca2), [`3863c52`](https://github.com/mastra-ai/mastra/commit/3863c52d44b4e5779968b802d977e87adf939d8e), [`6424c7e`](https://github.com/mastra-ai/mastra/commit/6424c7ec38b6921d66212431db1e0958f441b2a7), [`db94750`](https://github.com/mastra-ai/mastra/commit/db94750a41fd29b43eb1f7ce8e97ba8b9978c91b), [`a66a371`](https://github.com/mastra-ai/mastra/commit/a66a3716b00553d7f01842be9deb34f720b10fab), [`69fc3cd`](https://github.com/mastra-ai/mastra/commit/69fc3cd0fd814901785bdcf49bf536ab1e7fd975)]:
|
|
13
|
+
- @mastra/core@0.16.3-alpha.0
|
|
14
|
+
- @mastra/server@0.16.3-alpha.0
|
|
15
|
+
|
|
16
|
+
## 0.16.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`61926ef`](https://github.com/mastra-ai/mastra/commit/61926ef40d415b805a63527cffe27a50542e15e5)]:
|
|
21
|
+
- @mastra/core@0.16.2
|
|
22
|
+
- @mastra/server@0.16.2
|
|
23
|
+
|
|
3
24
|
## 0.16.2-alpha.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
|
+
export declare const sharedBodyOptions: any;
|
|
2
3
|
export declare const vNextBodyOptions: any;
|
|
3
4
|
export declare function getAgentsHandler(c: Context): Promise<Response & import("hono").TypedResponse<{
|
|
4
5
|
[x: string]: {
|
|
6
|
+
agents: {};
|
|
5
7
|
workflows: {};
|
|
6
|
-
name:
|
|
8
|
+
name: string;
|
|
7
9
|
tools: any;
|
|
8
10
|
provider: string;
|
|
9
11
|
instructions: string;
|
|
@@ -13,17 +15,7 @@ export declare function getAgentsHandler(c: Context): Promise<Response & import(
|
|
|
13
15
|
defaultStreamOptions: any;
|
|
14
16
|
};
|
|
15
17
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
16
|
-
export declare function getAgentByIdHandler(c: Context): Promise<Response & import("hono").TypedResponse<
|
|
17
|
-
name: any;
|
|
18
|
-
instructions: string;
|
|
19
|
-
tools: any;
|
|
20
|
-
workflows: {};
|
|
21
|
-
provider: string;
|
|
22
|
-
modelId: string;
|
|
23
|
-
modelVersion: "v2" | "v1";
|
|
24
|
-
defaultGenerateOptions: any;
|
|
25
|
-
defaultStreamOptions: any;
|
|
26
|
-
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
18
|
+
export declare function getAgentByIdHandler(c: Context): Promise<Response & import("hono").TypedResponse<never, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
27
19
|
export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response & import("hono").TypedResponse<{
|
|
28
20
|
id: string;
|
|
29
21
|
name: any;
|
|
@@ -80,6 +72,7 @@ export declare function generateVNextHandler(c: Context): Promise<Response>;
|
|
|
80
72
|
export declare function streamGenerateLegacyHandler(c: Context): Promise<Response | undefined>;
|
|
81
73
|
export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
82
74
|
export declare function streamVNextGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
75
|
+
export declare function streamNetworkHandler(c: Context): Promise<Response>;
|
|
83
76
|
export declare function streamVNextUIMessageHandler(c: Context): Promise<Response | undefined>;
|
|
84
77
|
export declare function setAgentInstructionsHandler(c: Context): Promise<Response>;
|
|
85
78
|
export declare function updateAgentModelHandler(c: Context): Promise<Response>;
|
|
@@ -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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AE,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;AAwBvD,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,8EAsiC9D;AAED,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,8EAyHjE"}
|
package/dist/server/index.cjs
CHANGED
|
@@ -2132,39 +2132,21 @@ var AllowedProviderKeys = {
|
|
|
2132
2132
|
};
|
|
2133
2133
|
|
|
2134
2134
|
// src/server/handlers/routes/agents/handlers.ts
|
|
2135
|
-
var
|
|
2135
|
+
var sharedBodyOptions = {
|
|
2136
2136
|
messages: {
|
|
2137
2137
|
type: "array",
|
|
2138
2138
|
items: { type: "object" }
|
|
2139
2139
|
},
|
|
2140
|
-
threadId: { type: "string" },
|
|
2141
|
-
resourceId: { type: "string", description: "The resource ID for the conversation" },
|
|
2142
2140
|
runId: { type: "string" },
|
|
2143
|
-
output: { type: "object" },
|
|
2144
|
-
instructions: { type: "string", description: "Optional instructions to override the agent's default instructions" },
|
|
2145
|
-
context: {
|
|
2146
|
-
type: "array",
|
|
2147
|
-
items: { type: "object" },
|
|
2148
|
-
description: "Additional context messages to include"
|
|
2149
|
-
},
|
|
2150
2141
|
memory: {
|
|
2151
2142
|
type: "object",
|
|
2152
2143
|
properties: {
|
|
2153
|
-
|
|
2154
|
-
|
|
2144
|
+
thread: { type: "string" },
|
|
2145
|
+
resource: { type: "string", description: "The resource ID for the conversation" },
|
|
2155
2146
|
options: { type: "object", description: "Memory configuration options" }
|
|
2156
2147
|
},
|
|
2157
2148
|
description: "Memory options for the conversation"
|
|
2158
2149
|
},
|
|
2159
|
-
savePerStep: { type: "boolean", description: "Whether to save messages incrementally on step finish" },
|
|
2160
|
-
format: { type: "string", enum: ["mastra", "aisdk"], description: "Response format" },
|
|
2161
|
-
toolChoice: {
|
|
2162
|
-
oneOf: [
|
|
2163
|
-
{ type: "string", enum: ["auto", "none", "required"] },
|
|
2164
|
-
{ type: "object", properties: { type: { type: "string" }, toolName: { type: "string" } } }
|
|
2165
|
-
],
|
|
2166
|
-
description: "Controls how tools are selected during generation"
|
|
2167
|
-
},
|
|
2168
2150
|
modelSettings: {
|
|
2169
2151
|
type: "object",
|
|
2170
2152
|
properties: {
|
|
@@ -2182,6 +2164,27 @@ var vNextBodyOptions = {
|
|
|
2182
2164
|
description: "Model settings for generation"
|
|
2183
2165
|
}
|
|
2184
2166
|
};
|
|
2167
|
+
var vNextBodyOptions = {
|
|
2168
|
+
threadId: { type: "string" },
|
|
2169
|
+
resourceId: { type: "string", description: "The resource ID for the conversation" },
|
|
2170
|
+
output: { type: "object" },
|
|
2171
|
+
instructions: { type: "string", description: "Optional instructions to override the agent's default instructions" },
|
|
2172
|
+
context: {
|
|
2173
|
+
type: "array",
|
|
2174
|
+
items: { type: "object" },
|
|
2175
|
+
description: "Additional context messages to include"
|
|
2176
|
+
},
|
|
2177
|
+
savePerStep: { type: "boolean", description: "Whether to save messages incrementally on step finish" },
|
|
2178
|
+
toolChoice: {
|
|
2179
|
+
oneOf: [
|
|
2180
|
+
{ type: "string", enum: ["auto", "none", "required"] },
|
|
2181
|
+
{ type: "object", properties: { type: { type: "string" }, toolName: { type: "string" } } }
|
|
2182
|
+
],
|
|
2183
|
+
description: "Controls how tools are selected during generation"
|
|
2184
|
+
},
|
|
2185
|
+
format: { type: "string", enum: ["mastra", "aisdk"], description: "Response format" },
|
|
2186
|
+
...sharedBodyOptions
|
|
2187
|
+
};
|
|
2185
2188
|
async function getAgentsHandler(c2) {
|
|
2186
2189
|
const serializedAgents = await agents.getAgentsHandler({
|
|
2187
2190
|
mastra: c2.get("mastra"),
|
|
@@ -2357,6 +2360,49 @@ async function streamVNextGenerateHandler(c2) {
|
|
|
2357
2360
|
return handleError(error, "Error streaming from agent");
|
|
2358
2361
|
}
|
|
2359
2362
|
}
|
|
2363
|
+
async function streamNetworkHandler(c2) {
|
|
2364
|
+
try {
|
|
2365
|
+
const mastra = c2.get("mastra");
|
|
2366
|
+
const agentId = c2.req.param("agentId");
|
|
2367
|
+
const runtimeContext = c2.get("runtimeContext");
|
|
2368
|
+
const body = await c2.req.json();
|
|
2369
|
+
const logger2 = mastra.getLogger();
|
|
2370
|
+
c2.header("Transfer-Encoding", "chunked");
|
|
2371
|
+
return streaming.stream(
|
|
2372
|
+
c2,
|
|
2373
|
+
async (stream7) => {
|
|
2374
|
+
try {
|
|
2375
|
+
const streamResponse = await agents.streamNetworkHandler({
|
|
2376
|
+
mastra,
|
|
2377
|
+
agentId,
|
|
2378
|
+
runtimeContext,
|
|
2379
|
+
body
|
|
2380
|
+
// abortSignal: c.req.raw.signal,
|
|
2381
|
+
});
|
|
2382
|
+
const reader = streamResponse.getReader();
|
|
2383
|
+
stream7.onAbort(() => {
|
|
2384
|
+
void reader.cancel("request aborted");
|
|
2385
|
+
});
|
|
2386
|
+
let chunkResult;
|
|
2387
|
+
while ((chunkResult = await reader.read()) && !chunkResult.done) {
|
|
2388
|
+
await stream7.write(`data: ${JSON.stringify(chunkResult.value)}
|
|
2389
|
+
|
|
2390
|
+
`);
|
|
2391
|
+
}
|
|
2392
|
+
await stream7.write("data: [DONE]\n\n");
|
|
2393
|
+
} catch (err) {
|
|
2394
|
+
logger2.error("Error in streamNetwork generate: " + (err?.message ?? "Unknown error"));
|
|
2395
|
+
}
|
|
2396
|
+
await stream7.close();
|
|
2397
|
+
},
|
|
2398
|
+
async (err) => {
|
|
2399
|
+
logger2.error("Error in watch stream: " + err?.message);
|
|
2400
|
+
}
|
|
2401
|
+
);
|
|
2402
|
+
} catch (error) {
|
|
2403
|
+
return handleError(error, "Error streaming from agent in network mode");
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2360
2406
|
async function streamVNextUIMessageHandler(c2) {
|
|
2361
2407
|
try {
|
|
2362
2408
|
const mastra = c2.get("mastra");
|
|
@@ -2888,6 +2934,35 @@ function agentsRouter(bodyLimitOptions) {
|
|
|
2888
2934
|
}),
|
|
2889
2935
|
generateHandler
|
|
2890
2936
|
);
|
|
2937
|
+
router.post(
|
|
2938
|
+
"/:agentId/network",
|
|
2939
|
+
bodyLimit.bodyLimit(bodyLimitOptions),
|
|
2940
|
+
w({
|
|
2941
|
+
description: "Execute an agent as a Network",
|
|
2942
|
+
tags: ["agents"],
|
|
2943
|
+
parameters: [
|
|
2944
|
+
{
|
|
2945
|
+
name: "agentId",
|
|
2946
|
+
in: "path",
|
|
2947
|
+
required: true,
|
|
2948
|
+
schema: { type: "string" }
|
|
2949
|
+
}
|
|
2950
|
+
],
|
|
2951
|
+
requestBody: {
|
|
2952
|
+
required: true,
|
|
2953
|
+
content: {
|
|
2954
|
+
"application/json": {
|
|
2955
|
+
schema: {
|
|
2956
|
+
type: "object",
|
|
2957
|
+
properties: sharedBodyOptions,
|
|
2958
|
+
required: ["messages"]
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
}),
|
|
2964
|
+
streamNetworkHandler
|
|
2965
|
+
);
|
|
2891
2966
|
router.post(
|
|
2892
2967
|
"/:agentId/generate/vnext",
|
|
2893
2968
|
bodyLimit.bodyLimit(bodyLimitOptions),
|