@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.
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -1,4 +1,4 @@
1
- import { JSONValue, JSONParseError, TypeValidationError, APICallError } from '../../@ai-sdk_provider/dist/index.d.ts';
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.d.ts';
2
- import { FetchFunction, ToolCall, ToolResult, Validator } from '../../@ai-sdk_provider-utils/dist/index.d.ts';
3
- export { generateId } from '../../@ai-sdk_provider-utils/dist/index.d.ts';
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"}
@@ -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.1"
6
+ version: "1.47.0-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.47.0-alpha.1",
2
+ "version": "1.47.0-alpha.2",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -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
- Existing `A2AAgent` and `MastraClient.getA2A()` integrations continue to use v0.3. Use `MastraClient.getA2AV1()` for v1.0 requests. The v1 client sends `A2A-Version: 1.0` automatically and adds the `tasks/list` operation.
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` for non-streaming runs or `message/stream` when streaming is supported.
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
- * @returns Promise containing the result of the tool execution.
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