@mastra/playground-ui 7.0.0-beta.24 → 7.0.0-beta.25

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,68 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 7.0.0-beta.25
4
+
5
+ ### Patch Changes
6
+
7
+ - Added human-in-the-loop (HITL) tool approval support for `generate()` method. ([#12056](https://github.com/mastra-ai/mastra/pull/12056))
8
+
9
+ **Why:** This provides parity between `stream()` and `generate()` for tool approval flows, allowing non-streaming use cases to leverage `requireToolApproval` without needing to switch to streaming.
10
+
11
+ Previously, tool approval with `requireToolApproval` only worked with `stream()`. Now you can use the same approval flow with `generate()` for non-streaming use cases.
12
+
13
+ **Using tool approval with generate()**
14
+
15
+ ```typescript
16
+ const output = await agent.generate('Find user John', {
17
+ requireToolApproval: true,
18
+ });
19
+
20
+ // Check if a tool is waiting for approval
21
+ if (output.finishReason === 'suspended') {
22
+ console.log('Tool requires approval:', output.suspendPayload.toolName);
23
+
24
+ // Approve the tool call
25
+ const result = await agent.approveToolCallGenerate({
26
+ runId: output.runId,
27
+ toolCallId: output.suspendPayload.toolCallId,
28
+ });
29
+
30
+ console.log(result.text);
31
+ }
32
+ ```
33
+
34
+ **Declining a tool call**
35
+
36
+ ```typescript
37
+ if (output.finishReason === 'suspended') {
38
+ const result = await agent.declineToolCallGenerate({
39
+ runId: output.runId,
40
+ toolCallId: output.suspendPayload.toolCallId,
41
+ });
42
+ }
43
+ ```
44
+
45
+ **New methods added:**
46
+ - `agent.approveToolCallGenerate({ runId, toolCallId })` - Approves a pending tool call and returns the complete result
47
+ - `agent.declineToolCallGenerate({ runId, toolCallId })` - Declines a pending tool call and returns the complete result
48
+
49
+ **Server routes added:**
50
+ - `POST /api/agents/:agentId/approve-tool-call-generate`
51
+ - `POST /api/agents/:agentId/decline-tool-call-generate`
52
+
53
+ The playground UI now also supports tool approval when using generate mode.
54
+
55
+ - Fix navigation for processors Studio tab ([#12062](https://github.com/mastra-ai/mastra/pull/12062))
56
+
57
+ - Added Processors tab to Mastra Studio. You can now view all configured processors, see which agents use them, and test processors directly from the UI. Processor workflows automatically redirect to the workflow graph view with a simplified input mode for testing. ([#12059](https://github.com/mastra-ai/mastra/pull/12059))
58
+
59
+ - Updated dependencies [[`ed3e3dd`](https://github.com/mastra-ai/mastra/commit/ed3e3ddec69d564fe2b125e083437f76331f1283), [`6833c69`](https://github.com/mastra-ai/mastra/commit/6833c69607418d257750bbcdd84638993d343539), [`47b1c16`](https://github.com/mastra-ai/mastra/commit/47b1c16a01c7ffb6765fe1e499b49092f8b7eba3), [`47b1c16`](https://github.com/mastra-ai/mastra/commit/47b1c16a01c7ffb6765fe1e499b49092f8b7eba3), [`3a76a80`](https://github.com/mastra-ai/mastra/commit/3a76a80284cb71a0faa975abb3d4b2a9631e60cd), [`8538a0d`](https://github.com/mastra-ai/mastra/commit/8538a0d232619bf55dad7ddc2a8b0ca77c679a87), [`9312dcd`](https://github.com/mastra-ai/mastra/commit/9312dcd1c6f5b321929e7d382e763d95fdc030f5), [`7691bb3`](https://github.com/mastra-ai/mastra/commit/7691bb317f62d43b0733209aaa83b428414c8dd1)]:
60
+ - @mastra/core@1.0.0-beta.25
61
+ - @mastra/client-js@1.0.0-beta.25
62
+ - @mastra/react@1.0.0-beta.25
63
+ - @mastra/schema-compat@1.0.0-beta.8
64
+ - @mastra/ai-sdk@1.0.0-beta.16
65
+
3
66
  ## 7.0.0-beta.24
4
67
 
5
68
  ### Minor Changes