@mastra/agent-builder 0.1.1-alpha.1 → 0.1.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,28 @@
1
1
  # @mastra/agent-builder
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added model router support to agent builder ([#8590](https://github.com/mastra-ai/mastra/pull/8590))
8
+
9
+ - Fix TypeScript errors with provider-defined tools by updating ai-v5 and openai-v5 to matching provider-utils versions. This ensures npm deduplicates to a single provider-utils instance, resolving type incompatibility issues when passing provider tools to Agent. ([#8584](https://github.com/mastra-ai/mastra/pull/8584))
10
+
11
+ Also adds deprecation warning to Agent import from root path to encourage using the recommended subpath import.
12
+
13
+ - Updated dependencies [[`c621613`](https://github.com/mastra-ai/mastra/commit/c621613069173c69eb2c3ef19a5308894c6549f0), [`12b1189`](https://github.com/mastra-ai/mastra/commit/12b118942445e4de0dd916c593e33ec78dc3bc73), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`076b092`](https://github.com/mastra-ai/mastra/commit/076b0924902ff0f49d5712d2df24c4cca683713f), [`2aee9e7`](https://github.com/mastra-ai/mastra/commit/2aee9e7d188b8b256a4ddc203ccefb366b4867fa), [`c582906`](https://github.com/mastra-ai/mastra/commit/c5829065a346260f96c4beb8af131b94804ae3ad), [`fa2eb96`](https://github.com/mastra-ai/mastra/commit/fa2eb96af16c7d433891a73932764960d3235c1d), [`ee9108f`](https://github.com/mastra-ai/mastra/commit/ee9108fa29bb8368fc23df158c9f0645b2d7b65c), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`a739d0c`](https://github.com/mastra-ai/mastra/commit/a739d0c8b37cd89569e04a6ca0827083c6167e19), [`603e927`](https://github.com/mastra-ai/mastra/commit/603e9279db8bf8a46caf83881c6b7389ccffff7e), [`cd45982`](https://github.com/mastra-ai/mastra/commit/cd4598291cda128a88738734ae6cbef076ebdebd), [`874f74d`](https://github.com/mastra-ai/mastra/commit/874f74da4b1acf6517f18132d035612c3ecc394a), [`b728a45`](https://github.com/mastra-ai/mastra/commit/b728a45ab3dba59da0f5ee36b81fe246659f305d), [`0baf2ba`](https://github.com/mastra-ai/mastra/commit/0baf2bab8420277072ef1f95df5ea7b0a2f61fe7), [`0ec8b4a`](https://github.com/mastra-ai/mastra/commit/0ec8b4a358db917016f45f1b5df3c81831c51834), [`10e633a`](https://github.com/mastra-ai/mastra/commit/10e633a07d333466d9734c97acfc3dbf757ad2d0), [`a6d69c5`](https://github.com/mastra-ai/mastra/commit/a6d69c5fb50c0875b46275811fece5862f03c6a0), [`84199af`](https://github.com/mastra-ai/mastra/commit/84199af8673f6f9cb59286ffb5477a41932775de), [`7f431af`](https://github.com/mastra-ai/mastra/commit/7f431afd586b7d3265075e73106eb73167edbb86), [`26e968d`](https://github.com/mastra-ai/mastra/commit/26e968db2171ded9e4d47aa1b4f19e1e771158d0), [`cbd3fb6`](https://github.com/mastra-ai/mastra/commit/cbd3fb65adb03a7c0df193cb998aed5ac56675ee)]:
14
+ - @mastra/core@0.20.1
15
+ - @mastra/memory@0.15.6
16
+
17
+ ## 0.1.1-alpha.2
18
+
19
+ ### Patch Changes
20
+
21
+ - Added model router support to agent builder ([#8590](https://github.com/mastra-ai/mastra/pull/8590))
22
+
23
+ - Updated dependencies [[`b728a45`](https://github.com/mastra-ai/mastra/commit/b728a45ab3dba59da0f5ee36b81fe246659f305d)]:
24
+ - @mastra/core@0.20.1-alpha.4
25
+
3
26
  ## 0.1.1-alpha.1
4
27
 
5
28
  ### Patch Changes
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { z } from 'zod';
10
10
  import { existsSync, readFileSync } from 'fs';
11
11
  import { createRequire } from 'module';
12
12
  import { promisify } from 'util';
13
- import { openai as openai$1 } from '@ai-sdk/openai-v5';
13
+ import { ModelRouterLanguageModel } from '@mastra/core/llm';
14
14
  import { MemoryProcessor } from '@mastra/core/memory';
15
15
  import { tmpdir } from 'os';
16
16
  import { openai } from '@ai-sdk/openai';
@@ -658,31 +658,9 @@ var createModelInstance = async (provider, modelId, version = "v2") => {
658
658
  const { google } = await import('@ai-sdk/google');
659
659
  return google(modelId);
660
660
  }
661
- },
662
- v2: {
663
- openai: async () => {
664
- const { openai: openai2 } = await import('@ai-sdk/openai-v5');
665
- return openai2(modelId);
666
- },
667
- anthropic: async () => {
668
- const { anthropic } = await import('@ai-sdk/anthropic-v5');
669
- return anthropic(modelId);
670
- },
671
- groq: async () => {
672
- const { groq } = await import('@ai-sdk/groq-v5');
673
- return groq(modelId);
674
- },
675
- xai: async () => {
676
- const { xai } = await import('@ai-sdk/xai-v5');
677
- return xai(modelId);
678
- },
679
- google: async () => {
680
- const { google } = await import('@ai-sdk/google-v5');
681
- return google(modelId);
682
- }
683
661
  }
684
662
  };
685
- const providerFn = providerMap[version][provider];
663
+ const providerFn = version === `v1` ? providerMap[version][provider] : () => new ModelRouterLanguageModel(`${provider}/${modelId}`);
686
664
  if (!providerFn) {
687
665
  console.error(`Unsupported provider: ${provider}`);
688
666
  return null;
@@ -697,7 +675,7 @@ var createModelInstance = async (provider, modelId, version = "v2") => {
697
675
  };
698
676
  var resolveModel = async ({
699
677
  runtimeContext,
700
- defaultModel = openai$1("gpt-4.1"),
678
+ defaultModel = "openai/gpt-4.1",
701
679
  projectPath
702
680
  }) => {
703
681
  const modelFromContext = runtimeContext.get("model");
@@ -721,7 +699,7 @@ var resolveModel = async ({
721
699
  }
722
700
  }
723
701
  console.info("Using default model");
724
- return defaultModel;
702
+ return typeof defaultModel === `string` ? new ModelRouterLanguageModel(defaultModel) : defaultModel;
725
703
  };
726
704
 
727
705
  // src/defaults.ts