@mastra/agent-builder 1.0.0-beta.7 → 1.0.0-beta.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,45 @@
1
1
  # @mastra/agent-builder
2
2
 
3
+ ## 1.0.0-beta.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`b5dc973`](https://github.com/mastra-ai/mastra/commit/b5dc9733a5158850298dfb103acb3babdba8a318)]:
8
+ - @mastra/core@1.0.0-beta.17
9
+ - @mastra/memory@1.0.0-beta.9
10
+
11
+ ## 1.0.0-beta.8
12
+
13
+ ### Patch Changes
14
+
15
+ - Fixed inline type narrowing for `tool.execute()` return type when using `outputSchema`. ([#11420](https://github.com/mastra-ai/mastra/pull/11420))
16
+
17
+ **Problem:** When calling `tool.execute()`, TypeScript couldn't narrow the `ValidationError | OutputType` union after checking `'error' in result && result.error`, causing type errors when accessing output properties.
18
+
19
+ **Solution:**
20
+ - Added `{ error?: never }` to the success type, enabling proper discriminated union narrowing
21
+ - Simplified `createTool` generics so `inputData` is correctly typed based on `inputSchema`
22
+
23
+ **Note:** Tool output schemas should not use `error` as a field name since it's reserved for ValidationError discrimination. Use `errorMessage` or similar instead.
24
+
25
+ **Usage:**
26
+
27
+ ```typescript
28
+ const result = await myTool.execute({ firstName: 'Hans' });
29
+
30
+ if ('error' in result && result.error) {
31
+ console.error('Validation failed:', result.message);
32
+ return;
33
+ }
34
+
35
+ // ✅ TypeScript now correctly narrows result
36
+ return { fullName: result.fullName };
37
+ ```
38
+
39
+ - Updated dependencies [[`3d93a15`](https://github.com/mastra-ai/mastra/commit/3d93a15796b158c617461c8b98bede476ebb43e2), [`efe406a`](https://github.com/mastra-ai/mastra/commit/efe406a1353c24993280ebc2ed61dd9f65b84b26), [`119e5c6`](https://github.com/mastra-ai/mastra/commit/119e5c65008f3e5cfca954eefc2eb85e3bf40da4), [`74e504a`](https://github.com/mastra-ai/mastra/commit/74e504a3b584eafd2f198001c6a113bbec589fd3), [`e33fdbd`](https://github.com/mastra-ai/mastra/commit/e33fdbd07b33920d81e823122331b0c0bee0bb59), [`929f69c`](https://github.com/mastra-ai/mastra/commit/929f69c3436fa20dd0f0e2f7ebe8270bd82a1529), [`8a73529`](https://github.com/mastra-ai/mastra/commit/8a73529ca01187f604b1f3019d0a725ac63ae55f)]:
40
+ - @mastra/core@1.0.0-beta.16
41
+ - @mastra/memory@1.0.0-beta.8
42
+
3
43
  ## 1.0.0-beta.7
4
44
 
5
45
  ### Patch Changes