@mastra/client-js 1.35.1-alpha.0 → 1.35.1-alpha.1

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,12 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.35.1-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`ba369f2`](https://github.com/mastra-ai/mastra/commit/ba369f2a0aaf998da0d6aa033d26f64f96bef8ac), [`dcfed93`](https://github.com/mastra-ai/mastra/commit/dcfed93e1e256c6abfa792cbb7ca836f5d0e8638), [`2876e15`](https://github.com/mastra-ai/mastra/commit/2876e15b4d2f616a3bc1ed3af57d546c268384ce), [`598080f`](https://github.com/mastra-ai/mastra/commit/598080f224edb3f0f5b801035b067fac50a56a03)]:
8
+ - @mastra/core@1.55.0-alpha.1
9
+
3
10
  ## 1.35.1-alpha.0
4
11
 
5
12
  ### 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.35.1-alpha.0"
6
+ version: "1.35.1-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.35.1-alpha.0",
2
+ "version": "1.35.1-alpha.1",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -53,7 +53,9 @@ An agent card includes fields like the agent name, description, endpoint URL, pr
53
53
  }
54
54
  ```
55
55
 
56
- A2A represents work as messages and tasks. Messages carry text, file, or structured data parts. Tasks are stateful units of work with IDs and lifecycle states, so clients can follow long-running work, send follow-up turns, cancel work, or resubscribe after a disconnect.
56
+ A2A represents work as messages and tasks. Messages carry text, file, or structured data parts.
57
+
58
+ Tasks are stateful units of work with IDs and lifecycle states. Clients can follow long-running work and send follow-up turns. They can also cancel work or resubscribe after a disconnect.
57
59
 
58
60
  ## Get started
59
61
 
@@ -83,7 +85,7 @@ export const supportAgent = new Agent({
83
85
  id: 'support-agent',
84
86
  name: 'Support Agent',
85
87
  instructions: 'Answer user questions and delegate weather questions when needed.',
86
- model: 'openai/gpt-5.5',
88
+ model: 'openai/gpt-5.6-sol',
87
89
  agents: {
88
90
  remoteWeatherAgent,
89
91
  },
@@ -14,9 +14,9 @@ The editor manages two types of resources alongside agents:
14
14
  Use the editor when you want to:
15
15
 
16
16
  - **Let non-developers iterate**: Give subject-matter experts and prompt engineers a way to tune agent behavior without touching code or waiting for deploys.
17
- - **Version everything**: Every save creates a snapshot so you can compare changes, roll back instantly, and audit what changed and when.
18
- - **Run experiments**: Route different users or requests to different agent versions for A/B testing, canary rollouts, or prompt experimentation.
19
- - **Target specific versions**: Pin a version per request, per user, or per environment so production stays stable while new versions are tested.
17
+ - **Version everything**: Every save creates a snapshot so you can compare changes and roll back instantly, plus audit what changed and when.
18
+ - **Run experiments**: Route different users or requests to different agent versions for A/B testing or canary rollouts, or alternatively prompt experimentation.
19
+ - **Target specific versions**: Pin a version per request or per user, or alternatively per environment so production stays stable while new versions are tested.
20
20
  - **Manage tools at runtime**: Add integration tools from Composio or Arcade, or connect MCP servers, without updating code.
21
21
  - **Override code agents**: Change the instructions, tools, or variables of a code-defined agent while keeping the original code as the baseline.
22
22
 
@@ -95,7 +95,7 @@ When `source` is `'code'`, the editor writes each override to a deterministic JS
95
95
 
96
96
  The code source uses the Git history of each per-agent JSON file as its version history. Each commit that changes a file is shown as a read-only version in Studio, labeled with the commit message. Saving in Studio updates the working file in place rather than creating a database draft, so the version dropdown reflects your actual commit history.
97
97
 
98
- This means versions and rollbacks are managed through Git rather than through draft and publish actions.
98
+ As a result, versions and rollbacks are managed through Git rather than through draft and publish actions.
99
99
 
100
100
  ## Studio
101
101
 
@@ -105,7 +105,7 @@ Modify the system prompt and save a new draft version. Afterwards, publish the d
105
105
 
106
106
  ## Programmatic control
107
107
 
108
- Everything you can do in Studio is also available programmatically through [`mastra.getEditor()`](https://mastra.ai/reference/core/getEditor). This is useful for scripting bulk updates, seeding stored configurations from code, or building automation that tunes agents based on evaluation results.
108
+ Everything you can do in Studio is also available programmatically through [`mastra.getEditor()`](https://mastra.ai/reference/core/getEditor). This is useful for scripting bulk updates or seeding stored configurations from code, or alternatively building automation that tunes agents based on evaluation results.
109
109
 
110
110
  Call `mastra.getEditor()` from anywhere you have access to the `Mastra` instance. It returns the `MastraEditor` instance you registered, with namespaces for each resource type:
111
111
 
@@ -167,7 +167,7 @@ Because stored agents are data, you can build automation loops that tune agents
167
167
  - Re-run the experiment against the draft and compare scores to the baseline.
168
168
  - Promote the draft to the published version when the scores improve.
169
169
 
170
- This turns agent tuning into a closed feedback loop. One agent owns the production configuration, another agent iterates on it, and every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested. See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
170
+ This turns agent tuning into a closed feedback loop. One agent owns the production configuration and another agent iterates on it, plus every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested. See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
171
171
 
172
172
  ## What can be overridden
173
173
 
@@ -190,7 +190,7 @@ import { Agent } from '@mastra/core/agent'
190
190
  export const supportAgent = new Agent({
191
191
  id: 'support-agent',
192
192
  name: 'support-agent',
193
- model: 'openai/gpt-5.5',
193
+ model: 'openai/gpt-5.6-sol',
194
194
  editor: { instructions: true, tools: { description: true } },
195
195
  })
196
196
  ```
@@ -209,7 +209,7 @@ When a field is owned by code, Studio shows it as read-only and the server strip
209
209
 
210
210
  ## Versioning
211
211
 
212
- Every time you save changes to an agent or prompt block, a new version snapshot is created. Versions give you a full history of your agent's configuration. You can roll back to any previous state, compare what changed between two snapshots, and target specific versions per request for A/B testing or gradual rollouts.
212
+ Every time you save changes to an agent or prompt block, a new version snapshot is created. Versions give you a full history of your agent's configuration. You can roll back to any previous state and compare what changed between two snapshots, plus target specific versions per request for A/B testing or gradual rollouts.
213
213
 
214
214
  Version management is available through the server Studio, REST API, the Client SDK, and the React SDK. See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for endpoints, SDK methods, and code examples.
215
215
 
@@ -223,7 +223,9 @@ Each version has one of three statuses:
223
223
  | Published | The active version used in production. Only one version can be published at a time. |
224
224
  | Archived | A previous version that's no longer active. You can restore any archived version. |
225
225
 
226
- The typical flow is: Edit the draft, test it, then activate it to make it the published version. The previously published version becomes archived so you can restore it if needed. You can do this through Studio or programmatically through the API.
226
+ The typical flow is: Edit the draft and test it, plus then activate it to make it the published version.
227
+
228
+ The previously published version becomes archived so you can restore it if needed. You can do this through Studio or programmatically through the API.
227
229
 
228
230
  This lifecycle makes it safe to experiment. Non-technical team members can iterate on a draft without affecting production traffic, then publish when ready. If something goes wrong, restoring a previous version is a single API call.
229
231
 
@@ -240,7 +242,9 @@ Pass a `versionId` or `status` when calling the agent through the Client SDK, se
240
242
 
241
243
  ### Version selection
242
244
 
243
- By default, [`mastra.getAgentById()`](https://mastra.ai/reference/core/getAgentById) loads the published (active) version of the stored override. You can request a specific version, which is useful for testing a draft before publishing, running A/B experiments, or pinning a user to a known-good configuration:
245
+ By default, [`mastra.getAgentById()`](https://mastra.ai/reference/core/getAgentById) loads the published (active) version of the stored override.
246
+
247
+ Use a specific version to test a draft before publishing or run an A/B experiment. You can also pin a user to a known-good configuration:
244
248
 
245
249
  ```typescript
246
250
  // Load the published version (default)
@@ -278,9 +282,9 @@ When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) deleg
278
282
 
279
283
  Set version overrides at three levels, with later levels taking priority:
280
284
 
281
- 1. **Mastra instance config** global defaults that apply to every `generate()` and `stream()` call.
282
- 2. **Per-invocation options** overrides passed directly to `generate()` or `stream()`.
283
- 3. **Server request body** overrides sent in the `versions` field of an API request.
285
+ 1. **Mastra instance config**: global defaults that apply to every `generate()` and `stream()` call.
286
+ 2. **Per-invocation options**: overrides passed directly to `generate()` or `stream()`.
287
+ 3. **Server request body**: overrides sent in the `versions` field of an API request.
284
288
 
285
289
  Resolution order: **per-invocation > request body > Mastra instance defaults > code-defined agent**.
286
290
 
@@ -25,7 +25,7 @@ const pinger = new Agent({
25
25
  id: 'pinger',
26
26
  name: 'Pinger',
27
27
  instructions: 'Report the current system status in one sentence.',
28
- model: 'openai/gpt-5.5',
28
+ model: 'openai/gpt-5.6-sol',
29
29
  })
30
30
 
31
31
  const mastra = new Mastra({
@@ -136,7 +136,7 @@ await mastra.schedules.create({
136
136
  })
137
137
  ```
138
138
 
139
- Workflow schedules created this way are independent of the declarative `schedule` field on `createWorkflow` see [scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows) for the declarative form and Studio views.
139
+ Workflow schedules created this way are independent of the declarative `schedule` field on `createWorkflow`, see [scheduled workflows](https://mastra.ai/docs/workflows/scheduled-workflows) for the declarative form and Studio views.
140
140
 
141
141
  ### Custom IDs
142
142
 
@@ -187,7 +187,7 @@ The hooks are:
187
187
 
188
188
  - `prepare`: runs before the fire. Return an object to override fire-time parameters such as `prompt` or `threadId`, `null` to skip the fire, or `undefined` to use the stored defaults.
189
189
  - `onFinish`: runs once per trigger that reached a non-error, non-abort terminal state.
190
- - `onError`: runs when `prepare`, the signal, or the agent run threw.
190
+ - `onError`: runs after a failure in `prepare` or the signal. It also runs when the agent run fails.
191
191
  - `onAbort`: runs when the run was aborted mid-stream.
192
192
 
193
193
  Every hook context includes `agentId` (the agent the schedule fired for) alongside `schedule` and `trigger`.
@@ -6,7 +6,7 @@
6
6
 
7
7
  > **Beta:** This feature is in beta. Breaking changes may occur without a major version bump until the API is stable.
8
8
 
9
- Signals are a way to interact with an agent through a thread. Instead of starting every interaction with `agent.stream()`, subscribe to a thread and send messages or signals. Mastra either wakes the agent when the thread is idle, drops input into the running agent loop, or queues input for the next turn.
9
+ Signals are a way to interact with an agent through a thread. Instead of starting every interaction with `agent.stream()`, subscribe to a thread and send messages or signals. Mastra either wakes the agent when the thread is idle or drops input into the running agent loop, or alternatively queues input for the next turn.
10
10
 
11
11
  Use message APIs for user-authored input. Use `sendSignal()` for lower-level system context, such as background task notifications, policy reminders, or processor-generated context.
12
12
 
@@ -29,7 +29,7 @@ const agent = new Agent({
29
29
  id: 'support-agent',
30
30
  name: 'Support Agent',
31
31
  instructions: 'Help the user compare options.',
32
- model: 'openai/gpt-5.5',
32
+ model: 'openai/gpt-5.6-sol',
33
33
  })
34
34
 
35
35
  const thread = {
@@ -143,7 +143,7 @@ The model receives the signal as context like this:
143
143
  <notification source="github" pr="123">PR #123 has a new review comment from User X about the API surface.</notification>
144
144
  ```
145
145
 
146
- Use XML-safe `tagName` and attribute names. They can contain letters, numbers, underscores, periods, and hyphens. They must start with a letter or underscore.
146
+ Use XML-safe `tagName` and attribute names. They can contain letters, numbers, shows, periods, and hyphens. They must start with a letter or underscore.
147
147
 
148
148
  #### Storage support
149
149
 
@@ -320,7 +320,9 @@ Use `createNotificationInboxTool()` to give agents one tool for inbox actions in
320
320
 
321
321
  Signals coordinate runs through a pub/sub backend. When a signal arrives on a backend that implements `LeaseProvider`, Mastra acquires a lease on the target thread so a single process owns the conversation at a time, then either wakes the agent or routes the input into the running loop. Backends without leasing fall back to a no-op that always grants ownership, which is fine in a single process but not across instances.
322
322
 
323
- The default in-memory pub/sub can't cross instance boundaries. On serverless platforms like Vercel, or any multi-instance deployment, a follow-up signal can land on a different instance than the one running the agent. Without a shared pub/sub, that instance can't reach the active run and starts its own, leaving the original run untouched and the thread processed twice.
323
+ The default in-memory pub/sub can't cross instance boundaries. On serverless platforms like Vercel, or any multi-instance deployment, a follow-up signal can be routed to a different instance than the one running the agent.
324
+
325
+ Without a shared pub/sub, that instance can't reach the active run and starts its own, leaving the original run untouched and the thread processed twice.
324
326
 
325
327
  Configure a shared pub/sub backed by Redis Streams on the `Mastra` instance so leases and signals coordinate across instances:
326
328
 
@@ -360,7 +362,9 @@ If you call Mastra over HTTP directly, use `POST /api/agents/:agentId/send-messa
360
362
 
361
363
  ### Use the client SDK
362
364
 
363
- The JavaScript client exposes thread signal APIs. Use `subscribeToThread()` before sending thread input so the client can render the stream that wakes from, or receives, the input.
365
+ The JavaScript client exposes thread signal APIs.
366
+
367
+ Use `subscribeToThread()` before sending thread input so the client can render the stream that receives the input or wakes in response to it.
364
368
 
365
369
  ```typescript
366
370
  const agent = client.getAgent('supportAgent')
@@ -93,11 +93,11 @@ The `MastraAuthFirebase` class can be configured through constructor options or
93
93
  - `FIREBASE_SERVICE_ACCOUNT`: Path to Firebase service account JSON file
94
94
  - `FIRESTORE_DATABASE_ID` or `FIREBASE_DATABASE_ID`: Firestore database ID
95
95
 
96
- > **Note:** When constructor options aren't provided, the class automatically reads these environment variables. This means you can call `new MastraAuthFirebase()` without any arguments if your environment variables are properly configured.
96
+ > **Note:** When constructor options aren't provided, the class automatically reads these environment variables. As a result, you can call `new MastraAuthFirebase()` without any arguments if your environment variables are properly configured.
97
97
 
98
98
  ### User Authorization
99
99
 
100
- By default, `MastraAuthFirebase` uses Firestore to manage user access. It expects a collection named `user_access` with documents keyed by user UIDs. The presence of a document in this collection determines whether a user is authorized.
100
+ By default, `MastraAuthFirebase` uses Firestore to manage user access. It expects a `user_access` collection with documents keyed by user UIDs. The presence of a document in this collection determines whether a user is authorized.
101
101
 
102
102
  ```text
103
103
  user_access/
@@ -138,7 +138,7 @@ Visit [MastraClient](https://mastra.ai/reference/client-js/mastra-client) for mo
138
138
 
139
139
  ## Credentials and session cookies
140
140
 
141
- **Authenticate Mastra API calls with session cookies** when your UI and Mastra API aren't on the same origindifferent host, subdomain, or port (for example Mastra Studio on one port and a custom server on another). Add **`credentials: 'include'`** to `MastraClient` so each request carries the cookies the user already has after sign-in. Skip this and you will often get **`401`** responses from Mastra even though login succeeded in the browser.
141
+ **Authenticate Mastra API calls with session cookies** when your UI and Mastra API aren't on the same origin, different host, subdomain, or port (for example Mastra Studio on one port and a custom server on another). Add **`credentials: 'include'`** to `MastraClient` so each request carries the cookies the user already has after sign-in. Skip this and you will often get **`401`** responses from Mastra even though login succeeded in the browser.
142
142
 
143
143
  ```typescript
144
144
  import { MastraClient } from '@mastra/client-js'
@@ -149,7 +149,7 @@ export const mastraClient = new MastraClient({
149
149
  })
150
150
  ```
151
151
 
152
- **Allow credentialed cross-origin requests on your server**—see [CORS: requests with credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#requests_with_credentials). You need a concrete `Access-Control-Allow-Origin` (not `*`) and `Access-Control-Allow-Credentials: true`, or the browser will block the call before it reaches Mastra.
152
+ **Allow credentialed cross-origin requests on your server**, see [CORS: requests with credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#requests_with_credentials). You need a concrete `Access-Control-Allow-Origin` (not `*`) and `Access-Control-Allow-Credentials: true`, or the browser will block the call before it reaches Mastra.
153
153
 
154
154
  **Using `@mastra/react`?** Wrap your app with `MastraReactProvider`, set `baseUrl` and `apiPrefix` to match your server, and rely on the default `credentials: 'include'`. Change `credentials` only when you want `same-origin` or `omit` behavior.
155
155
 
@@ -237,7 +237,7 @@ export const colorAgent = new Agent({
237
237
  instructions: `You are a helpful CSS assistant.
238
238
  You can change the background color of web pages.
239
239
  Respond with a hex reference for the color requested by the user`,
240
- model: 'openai/gpt-5.5',
240
+ model: 'openai/gpt-5.6-sol',
241
241
  })
242
242
  ```
243
243
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/client-js",
3
- "version": "1.35.1-alpha.0",
3
+ "version": "1.35.1-alpha.1",
4
4
  "description": "The official TypeScript library for the Mastra Client API",
5
5
  "author": "",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "canonicalize": "^1.0.8",
40
40
  "jose": "^6.2.1",
41
41
  "json-schema": "^0.4.0",
42
- "@mastra/core": "1.55.0-alpha.0",
42
+ "@mastra/core": "1.55.0-alpha.1",
43
43
  "@mastra/schema-compat": "1.3.4"
44
44
  },
45
45
  "peerDependencies": {