@mastra/core 0.2.0-alpha.91 → 0.2.0-alpha.92

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.
@@ -1,7 +1,7 @@
1
- export { Agent } from '../chunk-MMJCCJNP.js';
1
+ export { Agent } from '../chunk-DINPURQT.js';
2
2
  import '../chunk-HBTQNIAX.js';
3
3
  import '../chunk-SDKEPBBH.js';
4
- import '../chunk-YPMAHKBC.js';
4
+ import '../chunk-RI3ECMVF.js';
5
5
  import '../chunk-6ZVFVYLE.js';
6
6
  import '../chunk-KNPBNSJ7.js';
7
7
  import '../chunk-G4MCO7XF.js';
@@ -7,15 +7,23 @@ import '../telemetry-oCUM52DG.js';
7
7
  import '@opentelemetry/sdk-node';
8
8
  import '@opentelemetry/sdk-trace-base';
9
9
 
10
- declare abstract class MastraBundler extends MastraBase {
10
+ interface IBundler {
11
+ loadEnvVars(): Promise<Map<string, string>>;
12
+ getEnvFiles(): Promise<string[]>;
13
+ bundle(entryFile: string, outputDirectory: string): Promise<void>;
14
+ prepare(outputDirectory: string): Promise<void>;
15
+ writePackageJson(outputDirectory: string, dependencies: Map<string, string>): Promise<void>;
16
+ }
17
+ declare abstract class MastraBundler extends MastraBase implements IBundler {
11
18
  constructor({ name, component }: {
12
19
  name: string;
13
20
  component?: 'BUNDLER' | 'DEPLOYER';
14
21
  });
15
22
  loadEnvVars(): Promise<Map<string, string>>;
16
23
  abstract prepare(outputDirectory: string): Promise<void>;
24
+ abstract writePackageJson(outputDirectory: string, dependencies: Map<string, string>): Promise<void>;
17
25
  abstract getEnvFiles(): Promise<string[]>;
18
- abstract bundle(mastraDir: string, outputDirectory: string): Promise<void>;
26
+ abstract bundle(entryFile: string, outputDirectory: string): Promise<void>;
19
27
  }
20
28
 
21
- export { MastraBundler };
29
+ export { type IBundler, MastraBundler };
@@ -1,4 +1,4 @@
1
- export { MastraBundler } from '../chunk-RDEXABVY.js';
1
+ export { MastraBundler } from '../chunk-MCB4M5W4.js';
2
2
  import '../chunk-G4MCO7XF.js';
3
3
  import '../chunk-ICMEXHKD.js';
4
4
  import '../chunk-AJJZUHB4.js';
@@ -6,7 +6,6 @@ import { createMistral } from '@ai-sdk/mistral';
6
6
  import { createOpenAI } from '@ai-sdk/openai';
7
7
  import { embed as embed$1, embedMany as embedMany$1 } from 'ai';
8
8
  import { createVoyage } from 'voyage-ai-provider';
9
- import 'dotenv/config';
10
9
 
11
10
  function getEmbeddingModel(embedding) {
12
11
  let embeddingModel;
@@ -1,12 +1,11 @@
1
1
  import { executeHook, AvailableHooks } from './chunk-HBTQNIAX.js';
2
- import { LLM } from './chunk-YPMAHKBC.js';
2
+ import { LLM } from './chunk-RI3ECMVF.js';
3
3
  import { InstrumentClass } from './chunk-6ZVFVYLE.js';
4
4
  import { MastraBase } from './chunk-G4MCO7XF.js';
5
5
  import { RegisteredLogger, LogLevel } from './chunk-ICMEXHKD.js';
6
6
  import { __name, __publicField, __privateAdd, __privateSet, __privateGet } from './chunk-AJJZUHB4.js';
7
7
  import { randomUUID } from 'crypto';
8
8
  import { z } from 'zod';
9
- import 'dotenv/config';
10
9
 
11
10
  function _ts_decorate(decorators, target, key, desc) {
12
11
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1,4 +1,4 @@
1
- import { MastraBundler } from './chunk-RDEXABVY.js';
1
+ import { MastraBundler } from './chunk-MCB4M5W4.js';
2
2
  import { __name } from './chunk-AJJZUHB4.js';
3
3
 
4
4
  // src/deployer/index.ts
@@ -1,6 +1,6 @@
1
1
  import { MastraBase } from './chunk-G4MCO7XF.js';
2
2
  import { __name } from './chunk-AJJZUHB4.js';
3
- import dotenv from 'dotenv';
3
+ import { parse } from 'dotenv';
4
4
  import { readFile } from 'fs/promises';
5
5
 
6
6
  var _MastraBundler = class _MastraBundler extends MastraBase {
@@ -14,7 +14,7 @@ var _MastraBundler = class _MastraBundler extends MastraBase {
14
14
  const envVars = /* @__PURE__ */ new Map();
15
15
  for (const file of await this.getEnvFiles()) {
16
16
  const content = await readFile(file, "utf-8");
17
- const config = dotenv.parse(content);
17
+ const config = parse(content);
18
18
  Object.entries(config).forEach(([key, value]) => {
19
19
  envVars.set(key, value);
20
20
  });
@@ -14,7 +14,6 @@ import { createXai } from '@ai-sdk/xai';
14
14
  import { tool, generateText, jsonSchema, generateObject, streamText, streamObject } from 'ai';
15
15
  import { createAnthropicVertex } from 'anthropic-vertex-ai';
16
16
  import { z } from 'zod';
17
- import 'dotenv/config';
18
17
 
19
18
  function _ts_decorate(decorators, target, key, desc) {
20
19
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-MMJCCJNP.js';
1
+ import { Agent } from './chunk-DINPURQT.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
  import { CohereClient } from 'cohere-ai';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { MastraBase } from './chunk-G4MCO7XF.js';
2
- import { embed, embedMany } from './chunk-5NQ3MEZM.js';
2
+ import { embed, embedMany } from './chunk-BOS3IA23.js';
3
3
  import { __name } from './chunk-AJJZUHB4.js';
4
4
 
5
5
  // src/vector/index.ts
@@ -1,10 +1,10 @@
1
1
  import { Telemetry } from './chunk-SDKEPBBH.js';
2
- import { LLM } from './chunk-YPMAHKBC.js';
2
+ import { LLM } from './chunk-RI3ECMVF.js';
3
3
  import { InstrumentClass } from './chunk-6ZVFVYLE.js';
4
4
  import { LogLevel, createLogger, noopLogger } from './chunk-ICMEXHKD.js';
5
5
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
6
- import 'dotenv/config';
7
6
 
7
+ // src/mastra/index.ts
8
8
  function _ts_decorate(decorators, target, key, desc) {
9
9
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
10
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -224,13 +224,7 @@ var _Mastra = class _Mastra {
224
224
  this.logger = logger;
225
225
  if (this.agents) {
226
226
  Object.keys(this.agents).forEach((key) => {
227
- const agent = this.agents?.[key];
228
- if (agent) {
229
- agent.__setLogger(this.logger);
230
- if (agent.hasOwnMemory()) {
231
- agent.getMemory()?.__setLogger(this.logger);
232
- }
233
- }
227
+ this.agents?.[key]?.__setLogger(this.logger);
234
228
  });
235
229
  }
236
230
  if (this.workflows) {
@@ -1,4 +1,4 @@
1
- import { MastraBundler } from '../bundler/index.js';
1
+ import { IBundler, MastraBundler } from '../bundler/index.js';
2
2
  import '../base.js';
3
3
  import '@opentelemetry/api';
4
4
  import '../index-CBZ2mk2H.js';
@@ -8,11 +8,14 @@ import '../telemetry-oCUM52DG.js';
8
8
  import '@opentelemetry/sdk-node';
9
9
  import '@opentelemetry/sdk-trace-base';
10
10
 
11
- declare abstract class MastraDeployer extends MastraBundler {
11
+ interface IDeployer extends IBundler {
12
+ deploy(outputDirectory: string): Promise<void>;
13
+ }
14
+ declare abstract class MastraDeployer extends MastraBundler implements IDeployer {
12
15
  constructor({ name }: {
13
16
  name: string;
14
17
  });
15
18
  abstract deploy(outputDirectory: string): Promise<void>;
16
19
  }
17
20
 
18
- export { MastraDeployer };
21
+ export { type IDeployer, MastraDeployer };
@@ -1,5 +1,5 @@
1
- export { MastraDeployer } from '../chunk-YKASGA6R.js';
2
- import '../chunk-RDEXABVY.js';
1
+ export { MastraDeployer } from '../chunk-JJ57BXQR.js';
2
+ import '../chunk-MCB4M5W4.js';
3
3
  import '../chunk-G4MCO7XF.js';
4
4
  import '../chunk-ICMEXHKD.js';
5
5
  import '../chunk-AJJZUHB4.js';
@@ -1,2 +1,2 @@
1
- export { embed, embedMany } from '../chunk-5NQ3MEZM.js';
1
+ export { embed, embedMany } from '../chunk-BOS3IA23.js';
2
2
  import '../chunk-AJJZUHB4.js';
package/dist/index.js CHANGED
@@ -1,28 +1,28 @@
1
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-WGUGRCAP.js';
2
- import { MastraMemory } from './chunk-IE37CBXB.js';
1
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-U7WDR4WO.js';
2
+ import { MastraStorage, MastraStorageLibSql } from './chunk-XDXRDRTQ.js';
3
3
  import { MastraTTS } from './chunk-ECUVL2G5.js';
4
- import { MastraVector } from './chunk-FD4KOA4T.js';
4
+ import { MastraVector } from './chunk-UCOTMN3J.js';
5
5
  import { Workflow } from './chunk-E3TBVBIO.js';
6
6
  export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-E3TBVBIO.js';
7
- export { BaseFilterTranslator } from './chunk-4LJFWC2Q.js';
8
7
  export { Metric, evaluate } from './chunk-QLN26TPI.js';
8
+ export { BaseFilterTranslator } from './chunk-4LJFWC2Q.js';
9
9
  import { Integration, OpenAPIToolset } from './chunk-42DYOLDV.js';
10
10
  import { Tool } from './chunk-VOUPGVRD.js';
11
11
  export { createTool } from './chunk-VOUPGVRD.js';
12
- export { Mastra } from './chunk-ECXV3EAT.js';
13
- import { MastraStorage, MastraStorageLibSql } from './chunk-XDXRDRTQ.js';
14
- import { Agent } from './chunk-MMJCCJNP.js';
12
+ export { Mastra } from './chunk-WBPDZBUT.js';
13
+ import { MastraMemory } from './chunk-IE37CBXB.js';
14
+ import { Agent } from './chunk-DINPURQT.js';
15
15
  export { AvailableHooks, executeHook, registerHook } from './chunk-HBTQNIAX.js';
16
16
  export { Telemetry } from './chunk-SDKEPBBH.js';
17
- import './chunk-YPMAHKBC.js';
17
+ import './chunk-RI3ECMVF.js';
18
18
  export { InstrumentClass, hasActiveTelemetry, withSpan } from './chunk-6ZVFVYLE.js';
19
19
  export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-KNPBNSJ7.js';
20
- import { MastraDeployer } from './chunk-YKASGA6R.js';
21
- import './chunk-RDEXABVY.js';
20
+ import { MastraDeployer } from './chunk-JJ57BXQR.js';
21
+ import './chunk-MCB4M5W4.js';
22
22
  import { MastraBase } from './chunk-G4MCO7XF.js';
23
23
  import { createLogger } from './chunk-ICMEXHKD.js';
24
24
  export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-ICMEXHKD.js';
25
- import { embed, embedMany } from './chunk-5NQ3MEZM.js';
25
+ import { embed, embedMany } from './chunk-BOS3IA23.js';
26
26
  import { __name } from './chunk-AJJZUHB4.js';
27
27
 
28
28
  // src/agent/index.warning.ts
package/dist/llm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { LLM } from '../chunk-YPMAHKBC.js';
1
+ export { LLM } from '../chunk-RI3ECMVF.js';
2
2
  import '../chunk-6ZVFVYLE.js';
3
3
  import '../chunk-KNPBNSJ7.js';
4
4
  import '../chunk-G4MCO7XF.js';
@@ -1,6 +1,6 @@
1
- export { Mastra } from '../chunk-ECXV3EAT.js';
1
+ export { Mastra } from '../chunk-WBPDZBUT.js';
2
2
  import '../chunk-SDKEPBBH.js';
3
- import '../chunk-YPMAHKBC.js';
3
+ import '../chunk-RI3ECMVF.js';
4
4
  import '../chunk-6ZVFVYLE.js';
5
5
  import '../chunk-KNPBNSJ7.js';
6
6
  import '../chunk-G4MCO7XF.js';
@@ -1,8 +1,8 @@
1
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-WGUGRCAP.js';
2
- import '../chunk-MMJCCJNP.js';
1
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-U7WDR4WO.js';
2
+ import '../chunk-DINPURQT.js';
3
3
  import '../chunk-HBTQNIAX.js';
4
4
  import '../chunk-SDKEPBBH.js';
5
- import '../chunk-YPMAHKBC.js';
5
+ import '../chunk-RI3ECMVF.js';
6
6
  import '../chunk-6ZVFVYLE.js';
7
7
  import '../chunk-KNPBNSJ7.js';
8
8
  import '../chunk-G4MCO7XF.js';
@@ -1,5 +1,5 @@
1
- export { MastraVector } from '../chunk-FD4KOA4T.js';
1
+ export { MastraVector } from '../chunk-UCOTMN3J.js';
2
2
  import '../chunk-G4MCO7XF.js';
3
3
  import '../chunk-ICMEXHKD.js';
4
- import '../chunk-5NQ3MEZM.js';
4
+ import '../chunk-BOS3IA23.js';
5
5
  import '../chunk-AJJZUHB4.js';
@@ -1,8 +1,8 @@
1
- import { MastraVector } from '../../chunk-FD4KOA4T.js';
1
+ import { MastraVector } from '../../chunk-UCOTMN3J.js';
2
2
  import { BaseFilterTranslator } from '../../chunk-4LJFWC2Q.js';
3
3
  import '../../chunk-G4MCO7XF.js';
4
4
  import '../../chunk-ICMEXHKD.js';
5
- import '../../chunk-5NQ3MEZM.js';
5
+ import '../../chunk-BOS3IA23.js';
6
6
  import { __name, __publicField } from '../../chunk-AJJZUHB4.js';
7
7
  import { createClient } from '@libsql/client';
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.2.0-alpha.91",
3
+ "version": "0.2.0-alpha.92",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/core.esm.js",