@mastra/client-js 1.39.0-alpha.7 → 1.39.0-alpha.9

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,37 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.39.0-alpha.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Added an optional `reason` when declining a tool call, so the model and your UI can see _why_ a tool call was rejected instead of always showing "Tool call was not approved by the user". ([#21085](https://github.com/mastra-ai/mastra/pull/21085))
8
+
9
+ ```ts
10
+ // Before: the model only learned the call was declined
11
+ await agent.declineToolCall({ runId, toolCallId });
12
+
13
+ // After: give the model context it can act on
14
+ await agent.declineToolCall({
15
+ runId,
16
+ toolCallId,
17
+ reason: 'Reading other users personal data is not allowed, ask the user for their own email instead',
18
+ });
19
+ ```
20
+
21
+ The reason is retained with the tool call, so it is still there when the conversation is recalled later. It is supported by `declineToolCall`, `declineToolCallGenerate` and `declineNetworkToolCall`, on both regular and durable agents. Omitting `reason` keeps the previous default message.
22
+
23
+ Closes #20495
24
+
25
+ - Updated dependencies [[`86b7b77`](https://github.com/mastra-ai/mastra/commit/86b7b777980d30f66e1fd134a37d2af4c22e54cc), [`80a3324`](https://github.com/mastra-ai/mastra/commit/80a33245d3110204de6f56d61211523ffe338692), [`d9d2881`](https://github.com/mastra-ai/mastra/commit/d9d2881ede6dd6c023d144215fc812062aed0890), [`82e3365`](https://github.com/mastra-ai/mastra/commit/82e3365ef7c9bf7bee2e7a7029035ea262d68895), [`1b482c2`](https://github.com/mastra-ai/mastra/commit/1b482c2d89244dd758c41e5f927a2b44041388d2), [`e6a2860`](https://github.com/mastra-ai/mastra/commit/e6a2860649cc51f87d32d78b766ae2126446ba07), [`7bd85ea`](https://github.com/mastra-ai/mastra/commit/7bd85ea7588b71c25ce9f4019c88f8539be5dcbc)]:
26
+ - @mastra/core@1.58.0-alpha.9
27
+
28
+ ## 1.39.0-alpha.8
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [[`1c75e32`](https://github.com/mastra-ai/mastra/commit/1c75e32f7fc0b9fb6f548b4407feaec8a1440212), [`c47165c`](https://github.com/mastra-ai/mastra/commit/c47165c983c87594c6952f1fd2fa51a90205034c), [`e08e789`](https://github.com/mastra-ai/mastra/commit/e08e789c1bf4cd2fe46363f7a4728536ceccc9bd), [`35cc901`](https://github.com/mastra-ai/mastra/commit/35cc90102cf834a84827acaf9eee0b6d6d1e2a3b), [`a8b4cf0`](https://github.com/mastra-ai/mastra/commit/a8b4cf02823cffebc4751a53337dfacf097c1ae1), [`f33264f`](https://github.com/mastra-ai/mastra/commit/f33264f517ae603279afd5c4251e2b40f6dd3618), [`689f2c4`](https://github.com/mastra-ai/mastra/commit/689f2c4b6c0835fe455702b01d21daa8abcd9331), [`eeae63e`](https://github.com/mastra-ai/mastra/commit/eeae63e7fbe8e1f237adc69bca6e2ac13c5ca907), [`4c186a0`](https://github.com/mastra-ai/mastra/commit/4c186a017275f45e6ed4c09de0f89550e2d09e8c), [`b0fa077`](https://github.com/mastra-ai/mastra/commit/b0fa077bcbc9b08551846fe372a0d3d15b71ed72)]:
33
+ - @mastra/core@1.58.0-alpha.8
34
+
3
35
  ## 1.39.0-alpha.7
4
36
 
5
37
  ### 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.0-alpha.7"
6
+ version: "1.39.0-alpha.9"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.39.0-alpha.7",
2
+ "version": "1.39.0-alpha.9",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -421,12 +421,13 @@ Returns `{ accepted: true, runId: string, toolCallId?: string }`.
421
421
 
422
422
  ### `declineToolCall()`
423
423
 
424
- Decline a pending tool call and return a continuation stream. Use this when you are rendering the resumed chunks from the decline response.
424
+ Decline a pending tool call and return a continuation stream. Use this when you are rendering the resumed chunks from the decline response. Pass an optional `reason` to tell the model why the call was rejected. The default is `Tool call was not approved by the user`.
425
425
 
426
426
  ```typescript
427
427
  const response = await agent.declineToolCall({
428
428
  runId: 'run-123',
429
429
  toolCallId: 'tool-call-456',
430
+ reason: 'This file is outside the allowed directory', // optional
430
431
  })
431
432
 
432
433
  response.processDataStream({