@mastra/server 1.59.0-alpha.0 → 1.59.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/CHANGELOG.md +14 -0
- package/dist/{dist-7r8jzEWH.js → dist-ByXtFaHm.js} +59 -15
- package/dist/dist-ByXtFaHm.js.map +1 -0
- package/dist/{dist-DEgLyP8h.cjs → dist-RYanMda7.cjs} +59 -15
- package/dist/dist-RYanMda7.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-a2a.md +1 -1
- package/dist/docs/references/docs-server-custom-adapters.md +2 -2
- package/dist/docs/references/docs-server-custom-api-routes.md +1 -1
- package/dist/route-builder-BAAedfru.cjs.map +1 -1
- package/dist/route-builder-YQ_gLIvW.js.map +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/package.json +5 -5
- package/dist/dist-7r8jzEWH.js.map +0 -1
- package/dist/dist-DEgLyP8h.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# A2A (Agent-to-Agent)
|
|
4
4
|
|
|
5
|
-
Mastra supports version 0.3.0 of the [Agent-to-Agent (A2A) protocol](https://a2a-protocol.org/latest/) for cross-platform multi-agent systems. Use A2A to expose Mastra agents as remote agents
|
|
5
|
+
Mastra supports version 0.3.0 of the [Agent-to-Agent (A2A) protocol](https://a2a-protocol.org/latest/) for cross-platform multi-agent systems. Use A2A to expose Mastra agents as remote agents or consume remote A2A agents as Mastra subagents. You can also call A2A endpoints with the JavaScript client SDK.
|
|
6
6
|
|
|
7
7
|
A2A is an open protocol for delegating work to agents across network, framework, vendor, and language boundaries. A remote agent keeps its own tools, prompts, memory, workflows, and infrastructure private while exposing a protocol endpoint that other systems can discover and call.
|
|
8
8
|
|
|
@@ -176,7 +176,7 @@ async getParams(
|
|
|
176
176
|
|
|
177
177
|
### `sendResponse()`
|
|
178
178
|
|
|
179
|
-
Send the response back to the client based on the route's response type. Mastra routes can return different response types: JSON for most API responses
|
|
179
|
+
Send the response back to the client based on the route's response type. Mastra routes can return different response types: JSON for most API responses and streams for agent generation, plus special types for MCP transports. Your implementation should handle each type appropriately for your framework.
|
|
180
180
|
|
|
181
181
|
```typescript
|
|
182
182
|
async sendResponse(
|
|
@@ -211,7 +211,7 @@ async sendResponse(
|
|
|
211
211
|
|
|
212
212
|
### `stream()`
|
|
213
213
|
|
|
214
|
-
Handle streaming responses for agent generation. When an agent generates a response, it produces a stream of chunks that should be sent to the client as they become available. This method reads from the stream
|
|
214
|
+
Handle streaming responses for agent generation. When an agent generates a response, it produces a stream of chunks that should be sent to the client as they become available. This method reads from the stream and optionally applies redaction to hide sensitive data before writing chunks to the response in the appropriate format (SSE or newline-delimited JSON).
|
|
215
215
|
|
|
216
216
|
```typescript
|
|
217
217
|
async stream(
|
|
@@ -37,7 +37,7 @@ Each route's handler receives the Hono `Context`. Within the handler you can acc
|
|
|
37
37
|
|
|
38
38
|
## Schema validation
|
|
39
39
|
|
|
40
|
-
Use [`createRoute()`](https://mastra.ai/reference/server/create-route) in `apiRoutes` to parse and validate path
|
|
40
|
+
Use [`createRoute()`](https://mastra.ai/reference/server/create-route) in `apiRoutes` to parse and validate path and query parameters, along with request bodies, using Zod. The schemas also infer the handler parameters and generate OpenAPI metadata.
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
43
|
import { Mastra } from '@mastra/core'
|