@mastra/server 1.63.3-alpha.0 → 1.64.0-alpha.2
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/{dist-fQ5zEP_z.cjs → dist-BuyLBfu3.cjs} +100 -21
- package/dist/dist-BuyLBfu3.cjs.map +1 -0
- package/dist/{dist-DmVdNrSg.js → dist-JaHKn7NU.js} +100 -21
- package/dist/dist-JaHKn7NU.js.map +1 -0
- package/dist/docs/SKILL.md +8 -8
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-server-create-route.md +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-controller.cjs +10 -4
- package/dist/server/handlers/agent-controller.cjs.map +1 -1
- package/dist/server/handlers/agent-controller.d.ts.map +1 -1
- package/dist/server/handlers/agent-controller.js +10 -4
- package/dist/server/handlers/agent-controller.js.map +1 -1
- package/package.json +4 -6
- package/CHANGELOG.md +0 -16522
- package/dist/dist-DmVdNrSg.js.map +0 -1
- package/dist/dist-fQ5zEP_z.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-server
|
|
|
3
3
|
description: Documentation for @mastra/server. Use when working with @mastra/server APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/server"
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.64.0-alpha.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -16,16 +16,16 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
16
16
|
|
|
17
17
|
### Docs
|
|
18
18
|
|
|
19
|
-
- [A2A (Agent-to-Agent)](references/docs-connections-a2a.md) - Expose
|
|
20
|
-
- [Custom adapters](references/docs-server-custom-adapters.md) -
|
|
21
|
-
- [Custom API routes](references/docs-server-custom-api-routes.md) -
|
|
22
|
-
- [Middleware](references/docs-server-middleware.md) -
|
|
19
|
+
- [A2A (Agent-to-Agent)](references/docs-connections-a2a.md) - Expose Mastra agents through the Agent-to-Agent protocol and consume remote A2A agents as subagents or call them directly with the client SDK.
|
|
20
|
+
- [Custom adapters](references/docs-server-custom-adapters.md) - Implement a custom Mastra server adapter for unsupported web frameworks by mapping routes, middleware, request parameters, responses, and streams.
|
|
21
|
+
- [Custom API routes](references/docs-server-custom-api-routes.md) - Add custom HTTP endpoints to a Mastra server with schema validation, middleware, authentication, OpenAPI documentation, and control over disconnect behavior.
|
|
22
|
+
- [Middleware](references/docs-server-middleware.md) - Add Mastra server middleware for authentication, authorization, CORS, request logging, route blocking, and request-specific context injection.
|
|
23
23
|
|
|
24
24
|
### Reference
|
|
25
25
|
|
|
26
|
-
- [Reference: createRoute()](references/reference-server-create-route.md) -
|
|
27
|
-
- [Reference: MastraServer](references/reference-server-mastra-server.md) -
|
|
28
|
-
- [Reference: Server routes](references/reference-server-routes.md) -
|
|
26
|
+
- [Reference: createRoute()](references/reference-server-create-route.md) - Use createRoute() to define type-safe Mastra server routes with Zod validation for requests and responses, plus handler context and OpenAPI metadata.
|
|
27
|
+
- [Reference: MastraServer](references/reference-server-mastra-server.md) - The MastraServer abstract class is the base for all server adapters. Extend this class to create adapters for frameworks other than Hono or Express.
|
|
28
|
+
- [Reference: Server routes](references/reference-server-routes.md) - Server adapters register these routes when you call server.init(). All routes are prefixed with the prefix option if configured.
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
|
|
@@ -80,7 +80,7 @@ Returns a `ServerRoute` object that can be registered with an adapter or passed
|
|
|
80
80
|
|
|
81
81
|
### Register through `server.apiRoutes`
|
|
82
82
|
|
|
83
|
-
Routes created with `createRoute()` can be passed to `server.apiRoutes
|
|
83
|
+
Routes created with `createRoute()` can be passed to `server.apiRoutes`, where the adapter adds runtime validation and typed handler parameters while generating OpenAPI metadata. See [Custom API routes](https://mastra.ai/docs/server/custom-api-routes) for details.
|
|
84
84
|
|
|
85
85
|
```typescript
|
|
86
86
|
import { Mastra } from '@mastra/core'
|
|
@@ -30,7 +30,7 @@ var agent_builder_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll
|
|
|
30
30
|
});
|
|
31
31
|
let agentBuilderWorkflowsPromise;
|
|
32
32
|
async function loadAgentBuilderWorkflows() {
|
|
33
|
-
agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("../../dist-
|
|
33
|
+
agentBuilderWorkflowsPromise ??= Promise.resolve().then(() => require("../../dist-BuyLBfu3.cjs")).then((mod) => mod.agentBuilderWorkflows);
|
|
34
34
|
return agentBuilderWorkflowsPromise;
|
|
35
35
|
}
|
|
36
36
|
async function registerAgentBuilderWorkflows(mastra) {
|
|
@@ -29,7 +29,7 @@ var agent_builder_exports = /* @__PURE__ */ __exportAll({
|
|
|
29
29
|
});
|
|
30
30
|
let agentBuilderWorkflowsPromise;
|
|
31
31
|
async function loadAgentBuilderWorkflows() {
|
|
32
|
-
agentBuilderWorkflowsPromise ??= import("../../dist-
|
|
32
|
+
agentBuilderWorkflowsPromise ??= import("../../dist-JaHKn7NU.js").then((mod) => mod.agentBuilderWorkflows);
|
|
33
33
|
return agentBuilderWorkflowsPromise;
|
|
34
34
|
}
|
|
35
35
|
async function registerAgentBuilderWorkflows(mastra) {
|
|
@@ -614,10 +614,16 @@ const AGENT_CONTROLLER_TOOL_SUSPENSION_ROUTE = require_route_builder.createRoute
|
|
|
614
614
|
requiresPermission: "agent-controller:execute",
|
|
615
615
|
handler: async ({ mastra, controllerId, resourceId, sessionScope, toolCallId, resumeData, requestContext }) => {
|
|
616
616
|
try {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
const session = await getSession(getAgentControllerOrThrow(mastra, controllerId), resourceId, { scope: sessionScope }, requestContext);
|
|
618
|
+
ackBackgroundSessionWork({
|
|
619
|
+
work: session.respondToToolSuspension({
|
|
620
|
+
toolCallId,
|
|
621
|
+
resumeData,
|
|
622
|
+
requestContext
|
|
623
|
+
}),
|
|
624
|
+
session,
|
|
625
|
+
mastra,
|
|
626
|
+
operation: "respondToToolSuspension"
|
|
621
627
|
});
|
|
622
628
|
return { ok: true };
|
|
623
629
|
} catch (error) {
|