@mastra/client-js 1.39.1-alpha.0 → 1.40.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 CHANGED
@@ -1,5 +1,33 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.40.0-alpha.2
4
+
5
+ ### Minor Changes
6
+
7
+ - Declared `bufferingMessages` and `bufferingObservations` on the `display_state_changed` event, which the server has been sending all along. They say which memory budget a background pass is working on, so a client can show that work on the budget it acts on instead of as one shared label. ([#21366](https://github.com/mastra-ai/mastra/pull/21366))
8
+
9
+ ```ts
10
+ client.agentController(id).streamSession(resourceId, event => {
11
+ if (event.type !== 'display_state_changed') return;
12
+ // A buffered observation is running: the message window is being read into memory.
13
+ // A buffered reflection is running: observations are being consolidated.
14
+ const { bufferingMessages, bufferingObservations } = event.displayState;
15
+ });
16
+ ```
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [[`898bba4`](https://github.com/mastra-ai/mastra/commit/898bba46d4806dd255a44e5dc3a3d5827eaefdfe), [`f9aab1c`](https://github.com/mastra-ai/mastra/commit/f9aab1cfc3fda03238a7fd7bd8b794e07497878c), [`e31421b`](https://github.com/mastra-ai/mastra/commit/e31421bc9c11c03c6e74f447ecb5820000e2b9d7), [`aece0e7`](https://github.com/mastra-ai/mastra/commit/aece0e7cb124ae1eb1230689b887f5554b9a0bf0)]:
21
+ - @mastra/core@1.59.0-alpha.2
22
+
23
+ ## 1.39.1-alpha.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [[`aa3e7be`](https://github.com/mastra-ai/mastra/commit/aa3e7be30f8addb0278ea74429f4df054517a287), [`90822db`](https://github.com/mastra-ai/mastra/commit/90822dba08fb2169c518e4a6d7f127c098eb46b8), [`3700208`](https://github.com/mastra-ai/mastra/commit/37002080c7838267803a7e579a7d58b908d62f36), [`8b7131e`](https://github.com/mastra-ai/mastra/commit/8b7131eb0407f58f5205e68fb27b81f026488f28), [`cf418b6`](https://github.com/mastra-ai/mastra/commit/cf418b65efb81997e9b8dc7638eee363c5d96c96), [`79c4f82`](https://github.com/mastra-ai/mastra/commit/79c4f8295f568752eeadf8a9b50010a7d9ec06ae)]:
28
+ - @mastra/core@1.59.0-alpha.1
29
+ - @mastra/schema-compat@1.3.7-alpha.0
30
+
3
31
  ## 1.39.1-alpha.0
4
32
 
5
33
  ### Patch Changes
@@ -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.39.1-alpha.0"
6
+ version: "1.40.0-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -37,7 +37,7 @@ Read the individual reference documents for detailed explanations and code examp
37
37
  - [Reference: toAISdkStream()](references/reference-ai-sdk-to-ai-sdk-stream.md) - API reference for toAISdkStream(), a function to convert Mastra streams to AI SDK-compatible streams.
38
38
  - [Reference: toAISdkV4Messages()](references/reference-ai-sdk-to-ai-sdk-v4-messages.md) - API reference for toAISdkV4Messages(), a function to convert Mastra messages to AI SDK v4 UI messages.
39
39
  - [Reference: toAISdkV5Messages()](references/reference-ai-sdk-to-ai-sdk-v5-messages.md) - API reference for toAISdkV5Messages(), a function to convert Mastra messages to AI SDK v5 UI messages.
40
- - [Reference: Agents API](references/reference-client-js-agents.md) - Learn how to interact with Mastra AI agents, including generating responses, streaming interactions, and managing agent tools using the client-js SDK.
40
+ - [Reference: Agents API](references/reference-client-js-agents.md) - Learn how to interact with Mastra AI agents, including response generation and streamed interactions, along with agent-tool management using the client-js SDK.
41
41
  - [Reference: OpenAI Responses API Conversations](references/reference-client-js-conversations.md) - API reference for the client-js helpers that call Mastra's OpenAI-compatible `/v1/conversations` routes.
42
42
  - [Reference: Error handling](references/reference-client-js-error-handling.md) - Learn about the built-in retry mechanism and error handling capabilities in the Mastra client-js SDK.
43
43
  - [Reference: Logs API](references/reference-client-js-logs.md) - Learn how to access and query system logs and debugging information in Mastra using the client-js SDK.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.39.1-alpha.0",
2
+ "version": "1.40.0-alpha.2",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -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, consume remote A2A agents as Mastra subagents, or call A2A endpoints with the JavaScript client SDK.
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
 
@@ -14,6 +14,8 @@ A [deployed Studio](https://mastra.ai/docs/studio/deployment) makes Editor avail
14
14
 
15
15
  Use Editor when an agent is defined in code but the people responsible for its behavior shouldn't edit the codebase. It works well when instructions or tools change often and need testing before they reach users. If developers own every change and release agent configuration with the application, keep the [agent configuration in code](https://mastra.ai/docs/agents/overview) instead.
16
16
 
17
+ Use [Agent Builder](https://agent-builder.mastra.ai) instead when collaborators need to create and manage fully stored agents in a browser rather than start from agents defined in code.
18
+
17
19
  ## Quickstart
18
20
 
19
21
  Install `@mastra/editor`. This quickstart uses LibSQL to store Editor changes:
@@ -304,7 +306,7 @@ Version selection supports:
304
306
  - Compare two versions in an A/B test.
305
307
  - Give a draft to a small group before publishing it for everyone.
306
308
  - Keep production on the published version while staging uses the latest draft.
307
- - Pin a customer to a particular version.
309
+ - Pin a customer to a specific version.
308
310
 
309
311
  The same version controls work when a supervisor calls sub-agents. Developers can test a draft sub-agent without changing the rest of the system.
310
312
 
@@ -151,7 +151,7 @@ Notification inbox storage is available in the storage adapters that support ric
151
151
 
152
152
  ### Send processor context
153
153
 
154
- Processors can send reactive signals during a run. A processor should inspect the chat history, react to a specific trigger, and avoid sending the same context more than once.
154
+ Processors can send reactive signals during a run. A processor should inspect the chat history and react to a specific trigger without sending the same context more than once.
155
155
 
156
156
  The following example demonstrates a processor that injects `AGENTS.md` instructions after a tool call reads an `AGENTS.md` file.
157
157
 
@@ -350,7 +350,7 @@ Mastra still accepts legacy signal payloads such as `type: 'user-message'` and `
350
350
  - `type: 'user-message'`: Normalizes to `type: 'user'` and `tagName: 'user'`
351
351
  - `type: 'system-reminder'`: Normalizes to `type: 'reactive'` and `tagName: 'system-reminder'`
352
352
 
353
- Existing stored signal rows and older clients continue to load through the compatibility layer. New clients call the message routes when the server supports them; React's thread signal path falls back to the legacy `/signals` route when it detects an older server. Visit [Agent signals reference](https://mastra.ai/reference/agents/agent) for the full message, signal, and subscription types.
353
+ Existing stored signal rows and older clients continue to load through the compatibility layer. New clients call the message routes when the server supports them. React's thread signal path falls back to the legacy `/signals` route when it detects an older server. Visit [Agent signals reference](https://mastra.ai/reference/agents/agent) for the full message, signal, and subscription types.
354
354
 
355
355
  ### Approve tool calls
356
356
 
@@ -71,7 +71,7 @@ The Mastra Client SDK exposes all resources served by the Mastra Server.
71
71
 
72
72
  ## Create and run dynamic workflows
73
73
 
74
- Use `upsertDynamicWorkflow()` to create or replace a persisted workflow definition. A successful upsert validates the complete definition, registers it with the running Mastra instance, and makes it available through the standard workflow execution API.
74
+ Use `upsertDynamicWorkflow()` to create or replace a persisted workflow definition. A successful upsert validates the complete definition and registers it with the running Mastra instance. The workflow then becomes available through the standard execution API.
75
75
 
76
76
  The following example shows the full lifecycle of a mapping workflow, from creation and inspection through execution and deletion:
77
77
 
@@ -148,7 +148,7 @@ client.memory.listMessages({
148
148
 
149
149
  ### `getMemoryThread` parameter structure
150
150
 
151
- The `getMemoryThread` method parameter structure has been updated. This change provides a more consistent API across memory methods.
151
+ The `getMemoryThread` method parameter structure has been updated. The new structure aligns the API across memory methods.
152
152
 
153
153
  To migrate, update the method call with the new parameter structure. Check the updated API documentation for the specific changes.
154
154