@mastra/client-js 1.61.0 → 1.61.1-alpha.0

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.
@@ -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.61.0"
6
+ version: "1.61.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.61.0",
2
+ "version": "1.61.1-alpha.0",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {
5
5
  "ClientTool": {
@@ -126,6 +126,8 @@ Subscribes to the session's event stream over SSE. The promise resolves once the
126
126
 
127
127
  **idleTimeoutMs** (`number`): Treats the stream as dropped after this many milliseconds without receiving any data. Server heartbeats, sent every 25 seconds, reset the timer, so only a silent connection, such as one left half-open by laptop sleep or a proxy timeout, trips it. A timeout is handled like any other drop: it triggers reconnect and onReconnect when reconnect is enabled, otherwise onError. Also bounds opening the stream: subscribe() rejects, and a reconnect attempt counts as failed, when no response arrives in time. Set to 0 to disable. (Default: `60000`)
128
128
 
129
+ **displayState** (`boolean`): Set to false to receive no display_state_changed snapshots, including the one that opens the stream. The stream then opens with the session state as ordinary events instead: a message_start for the reply in flight, the latest om_status, and a usage_update carrying the token total. Use this when the client keeps its own state from events, since each snapshot carries the whole display state. (Default: `true`)
130
+
129
131
  Returns: `Promise<AgentControllerSubscription>`, an object with an `unsubscribe()` method that stops reading and releases the stream.
130
132
 
131
133
  ### `sendMessage(message, options?)`
@@ -261,6 +263,8 @@ Returns: `Promise<SendNotificationResult>`
261
263
  | Workspace | `workspace_ready`, `workspace_error`, `workspace_status_changed` |
262
264
  | Diagnostics | `info`, `error` |
263
265
 
266
+ `usage_update` carries the step's `usage` and, from servers that send it, `total`: the thread's running token total after that step.
267
+
264
268
  Notifications are delivered as agent signals carried on messages rather than as `notification` or `notification_summary` controller events.
265
269
 
266
270
  A message lifecycle uses three event shapes: