@mastra/client-js 1.47.0-alpha.1 → 1.47.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/_types/@ai-sdk_provider/package.json +1 -0
- package/dist/_types/@ai-sdk_provider-utils/dist/index.d.ts +1 -1
- package/dist/_types/@ai-sdk_provider-utils/package.json +1 -0
- package/dist/_types/@ai-sdk_ui-utils/dist/index.d.ts +3 -3
- package/dist/_types/@ai-sdk_ui-utils/package.json +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-connections-a2a.md +4 -3
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +2 -2
- package/dist/resources/mcp-tool.d.ts +8 -3
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/route-types.generated.d.ts +21 -10
- package/dist/route-types.generated.d.ts.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONValue, JSONParseError, TypeValidationError, APICallError } from '../../@ai-sdk_provider/dist/index.
|
|
1
|
+
import { JSONValue, JSONParseError, TypeValidationError, APICallError } from '../../@ai-sdk_provider/dist/index.js';
|
|
2
2
|
import { z, ZodSchema } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare function combineHeaders(...headers: Array<Record<string, string | undefined> | undefined>): Record<string, string | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LanguageModelV1Source, LanguageModelV1FinishReason, JSONValue as JSONValue$1 } from '../../@ai-sdk_provider/dist/index.
|
|
2
|
-
import { FetchFunction, ToolCall, ToolResult, Validator } from '../../@ai-sdk_provider-utils/dist/index.
|
|
3
|
-
export { generateId } from '../../@ai-sdk_provider-utils/dist/index.
|
|
1
|
+
import { LanguageModelV1Source, LanguageModelV1FinishReason, JSONValue as JSONValue$1 } from '../../@ai-sdk_provider/dist/index.js';
|
|
2
|
+
import { FetchFunction, ToolCall, ToolResult, Validator } from '../../@ai-sdk_provider-utils/dist/index.js';
|
|
3
|
+
export { generateId } from '../../@ai-sdk_provider-utils/dist/index.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { JSONSchema7 } from 'json-schema';
|
|
6
6
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-client-js
|
|
|
3
3
|
description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/client-js"
|
|
6
|
-
version: "1.47.0-alpha.
|
|
6
|
+
version: "1.47.0-alpha.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -67,7 +67,7 @@ Mastra supports A2A Protocol v0.3 and v1.0 on the same agent card and execution
|
|
|
67
67
|
- `1.0`: Uses the v1.0 API.
|
|
68
68
|
- Any other value: Returns a `VersionNotSupported` protocol error.
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
`A2AAgent` and `MastraClient.getA2A()` use v0.3 by default. Set `protocolVersion: '1.0'` on `A2AAgent` for v1.0 subagent delegation, or use `MastraClient.getA2AV1()` for direct v1.0 requests. Both v1.0 clients send `A2A-Version: 1.0` automatically. The direct v1.0 client also adds the `tasks/list` operation.
|
|
71
71
|
|
|
72
72
|
Import v1.0 protocol types and codecs from `@mastra/core/a2a/v1`. The existing `@mastra/core/a2a/client` export remains on v0.3.
|
|
73
73
|
|
|
@@ -82,7 +82,7 @@ Use `A2AAgent` when another Mastra agent should delegate work to a remote agent.
|
|
|
82
82
|
|
|
83
83
|
## Consume A2A agents as subagents
|
|
84
84
|
|
|
85
|
-
Use `A2AAgent` to wrap a remote A2A agent, then add it to a parent agent with the [supervisor agents](https://mastra.ai/docs/subagents) pattern. Pass an explicit agent card URL when the remote server hosts multiple agents or uses a custom well-known path.
|
|
85
|
+
Use `A2AAgent` to wrap a remote A2A agent, then add it to a parent agent with the [supervisor agents](https://mastra.ai/docs/subagents) pattern. Pass an explicit agent card URL when the remote server hosts multiple agents or uses a custom well-known path. Set `protocolVersion: '1.0'` when the remote agent requires A2A v1.0. Omit it to use v0.3.
|
|
86
86
|
|
|
87
87
|
```typescript
|
|
88
88
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -90,6 +90,7 @@ import { A2AAgent } from '@mastra/core/a2a'
|
|
|
90
90
|
|
|
91
91
|
const remoteWeatherAgent = new A2AAgent({
|
|
92
92
|
url: 'https://weather.example.com/api/.well-known/weather-agent/agent-card.json',
|
|
93
|
+
protocolVersion: '1.0',
|
|
93
94
|
headers: {
|
|
94
95
|
Authorization: `Bearer ${process.env.WEATHER_AGENT_TOKEN}`,
|
|
95
96
|
},
|
|
@@ -112,7 +113,7 @@ During execution, `A2AAgent`:
|
|
|
112
113
|
|
|
113
114
|
- Fetches and caches the remote agent card.
|
|
114
115
|
- Reads the execution URL and capabilities from the card.
|
|
115
|
-
- Calls `message/send`
|
|
116
|
+
- Calls `message/send` or `message/stream` with v0.3, and `SendMessage` or `SendStreamingMessage` with v1.0.
|
|
116
117
|
- Converts remote messages, tasks, artifacts, and status updates into Mastra subagent results.
|
|
117
118
|
- Supports `resumeGenerate()` and `resumeStream()` when the remote task requires follow-up input or resubscription.
|
|
118
119
|
|
package/dist/index.cjs
CHANGED
|
@@ -4017,12 +4017,17 @@ var MCPTool = class extends BaseResource {
|
|
|
4017
4017
|
/**
|
|
4018
4018
|
* Executes this specific tool on the MCP server.
|
|
4019
4019
|
* @param params - Parameters for tool execution, including data/args and optional requestContext.
|
|
4020
|
-
*
|
|
4020
|
+
* On a 2026-07-28 server a tool can answer `{ status: 'suspended', suspendPayload, resumeSchema }`;
|
|
4021
|
+
* call again with the same `data` plus `resumeData` (matching `resumeSchema`) and the echoed
|
|
4022
|
+
* `suspendPayload` to continue it.
|
|
4023
|
+
* @returns Promise containing `{ result }`, or the suspended shape described above.
|
|
4021
4024
|
*/
|
|
4022
4025
|
execute(params) {
|
|
4023
4026
|
const body = {};
|
|
4024
4027
|
if (params.data !== void 0) body.data = params.data;
|
|
4025
4028
|
if (params.requestContext !== void 0) body.requestContext = params.requestContext;
|
|
4029
|
+
if (params.resumeData !== void 0) body.resumeData = params.resumeData;
|
|
4030
|
+
if (params.suspendPayload !== void 0) body.suspendPayload = params.suspendPayload;
|
|
4026
4031
|
return this.request(`/mcp/${encodeURIComponent(this.serverId)}/tools/${encodeURIComponent(this.toolId)}/execute`, {
|
|
4027
4032
|
method: "POST",
|
|
4028
4033
|
body
|