@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.
@@ -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.63.3-alpha.0"
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 and call remote Mastra agents over the Agent-to-Agent protocol.
20
- - [Custom adapters](references/docs-server-custom-adapters.md) - Create a custom server adapter for frameworks other than Hono or Express.
21
- - [Custom API routes](references/docs-server-custom-api-routes.md) - Expose additional HTTP endpoints from your Mastra server.
22
- - [Middleware](references/docs-server-middleware.md) - Apply custom middleware functions to intercept requests.
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) - API reference for createRoute() function used to define type-safe routes with validation and OpenAPI generation.
27
- - [Reference: MastraServer](references/reference-server-mastra-server.md) - API reference for the MastraServer abstract class used to create server adapters.
28
- - [Reference: Server routes](references/reference-server-routes.md) - API reference for HTTP routes registered by Mastra server adapters.
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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.63.3-alpha.0",
2
+ "version": "1.64.0-alpha.2",
3
3
  "package": "@mastra/server",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -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`. The adapter registers them with runtime validation, typed handler parameters, and generated OpenAPI metadata. See [Custom API routes](https://mastra.ai/docs/server/custom-api-routes) for details.
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-fQ5zEP_z.cjs")).then((mod) => mod.agentBuilderWorkflows);
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-DmVdNrSg.js").then((mod) => mod.agentBuilderWorkflows);
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
- await (await getSession(getAgentControllerOrThrow(mastra, controllerId), resourceId, { scope: sessionScope }, requestContext)).respondToToolSuspension({
618
- toolCallId,
619
- resumeData,
620
- requestContext
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) {