@mastra/core 0.2.0-alpha.83 → 0.2.0-alpha.84

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.
Files changed (60) hide show
  1. package/dist/action/index.d.ts +4 -4
  2. package/dist/agent/index.d.ts +5 -5
  3. package/dist/agent/index.js +6 -6
  4. package/dist/base.d.ts +3 -3
  5. package/dist/base.js +2 -2
  6. package/dist/bundler/index.d.ts +21 -0
  7. package/dist/bundler/index.js +4 -0
  8. package/dist/{chunk-AO76Z4K3.js → chunk-3IV6WDJY.js} +1 -1
  9. package/dist/{chunk-BWEOV64I.js → chunk-3THCTISX.js} +1 -1
  10. package/dist/{chunk-LYNJHHQX.js → chunk-42THOFKJ.js} +1 -1
  11. package/dist/{chunk-K7KUCZT2.js → chunk-6WJREZ5F.js} +2 -2
  12. package/dist/chunk-CQYUMNLZ.js +28 -0
  13. package/dist/{chunk-FCRDS4YS.js → chunk-EH2PG7Q6.js} +10 -4
  14. package/dist/{chunk-27EL4TRB.js → chunk-JCRGAEY6.js} +1 -1
  15. package/dist/{chunk-BQMCLBCR.js → chunk-OOZGW5CY.js} +1 -1
  16. package/dist/{chunk-OJJ6QGX4.js → chunk-PRYZIZXD.js} +6 -6
  17. package/dist/{chunk-FROFMREE.js → chunk-RZYBOMIG.js} +7 -0
  18. package/dist/{chunk-RPBNMIV7.js → chunk-SAXFXAKK.js} +43 -28
  19. package/dist/{chunk-Q5JF3TKZ.js → chunk-SLWM3SEH.js} +1 -1
  20. package/dist/{chunk-NLQVQJOD.js → chunk-TJK6TGSR.js} +1 -0
  21. package/dist/{chunk-S45F6AHA.js → chunk-U25DBVJZ.js} +1 -1
  22. package/dist/chunk-XD5IQZRB.js +16 -0
  23. package/dist/deployer/index.d.ts +8 -25
  24. package/dist/deployer/index.js +4 -3
  25. package/dist/engine/index.d.ts +2 -2
  26. package/dist/engine/index.js +3 -3
  27. package/dist/eval/index.d.ts +4 -4
  28. package/dist/filter/index.d.ts +1 -0
  29. package/dist/filter/index.js +1 -1
  30. package/dist/{index-CA9EWqaj.d.ts → index-62DyKJRU.d.ts} +275 -270
  31. package/dist/{index-B9i6dmc0.d.ts → index-B0-NXUYv.d.ts} +1 -0
  32. package/dist/index.d.ts +13 -11
  33. package/dist/index.js +21 -20
  34. package/dist/integration/index.d.ts +9 -9
  35. package/dist/llm/index.d.ts +5 -5
  36. package/dist/llm/index.js +3 -3
  37. package/dist/logger/index.d.ts +1 -1
  38. package/dist/logger/index.js +1 -1
  39. package/dist/mastra/index.d.ts +6 -5
  40. package/dist/mastra/index.js +5 -5
  41. package/dist/memory/index.d.ts +3 -3
  42. package/dist/memory/index.js +3 -3
  43. package/dist/relevance/index.d.ts +4 -4
  44. package/dist/relevance/index.js +7 -7
  45. package/dist/storage/index.d.ts +5 -5
  46. package/dist/storage/index.js +3 -3
  47. package/dist/telemetry/index.d.ts +5 -103
  48. package/dist/telemetry/index.js +1 -1
  49. package/dist/telemetry-oCUM52DG.d.ts +104 -0
  50. package/dist/tools/index.d.ts +5 -5
  51. package/dist/tts/index.d.ts +2 -2
  52. package/dist/tts/index.js +4 -4
  53. package/dist/vector/index.d.ts +2 -2
  54. package/dist/vector/index.js +3 -3
  55. package/dist/{workflow-Dam5GtdA.d.ts → workflow-DGktrYAL.d.ts} +1 -1
  56. package/dist/workflows/index.d.ts +6 -6
  57. package/dist/workflows/index.js +3 -3
  58. package/package.json +1 -2
  59. package/dist/chunk-5R6DBXQM.js +0 -57
  60. /package/dist/{chunk-OZZS5Y3C.js → chunk-SDKEPBBH.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import 'zod';
2
- export { I as IAction, aR as IExecutionContext, d as MastraPrimitives } from '../index-CA9EWqaj.js';
2
+ export { I as IAction, aR as IExecutionContext, d as MastraPrimitives } from '../index-62DyKJRU.js';
3
3
  import '../engine-EwEG-4Iv.js';
4
- import '../index-B9i6dmc0.js';
5
- import '../telemetry/index.js';
4
+ import '../index-B0-NXUYv.js';
5
+ import '../telemetry-oCUM52DG.js';
6
6
  import '../tts/index.js';
7
7
  import '../vector/index.js';
8
8
  import 'ai';
@@ -14,5 +14,5 @@ import 'stream';
14
14
  import '@opentelemetry/sdk-node';
15
15
  import '@opentelemetry/sdk-trace-base';
16
16
  import '../metric-D2V4CR8D.js';
17
- import 'sift';
18
17
  import '../types-M16hSruO.js';
18
+ import 'sift';
@@ -1,18 +1,18 @@
1
1
  import 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent } from '../index-CA9EWqaj.js';
4
+ export { A as Agent } from '../index-62DyKJRU.js';
5
5
  import '../base.js';
6
6
  import '../metric-D2V4CR8D.js';
7
- import '../telemetry/index.js';
7
+ import '../types-M16hSruO.js';
8
+ import '../telemetry-oCUM52DG.js';
8
9
  import '@opentelemetry/api';
9
10
  import '@opentelemetry/sdk-node';
10
11
  import '@opentelemetry/sdk-trace-base';
11
- import '../index-B9i6dmc0.js';
12
+ import 'sift';
13
+ import '../index-B0-NXUYv.js';
12
14
  import 'pino';
13
15
  import 'stream';
14
- import 'sift';
15
- import '../types-M16hSruO.js';
16
16
  import '../vector/index.js';
17
17
  import '../engine-EwEG-4Iv.js';
18
18
  import '../tts/index.js';
@@ -1,9 +1,9 @@
1
- export { Agent } from '../chunk-RPBNMIV7.js';
2
- import '../chunk-OZZS5Y3C.js';
3
- import '../chunk-K7KUCZT2.js';
1
+ export { Agent } from '../chunk-SAXFXAKK.js';
2
+ import '../chunk-HBTQNIAX.js';
3
+ import '../chunk-SDKEPBBH.js';
4
+ import '../chunk-6WJREZ5F.js';
4
5
  import '../chunk-6ZVFVYLE.js';
5
6
  import '../chunk-LUULSM4U.js';
6
- import '../chunk-27EL4TRB.js';
7
- import '../chunk-NLQVQJOD.js';
8
- import '../chunk-HBTQNIAX.js';
7
+ import '../chunk-JCRGAEY6.js';
8
+ import '../chunk-TJK6TGSR.js';
9
9
  import '../chunk-AJJZUHB4.js';
package/dist/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _opentelemetry_api from '@opentelemetry/api';
2
- import { R as RegisteredLogger, L as Logger, a as LogLevel } from './index-B9i6dmc0.js';
3
- import { Telemetry } from './telemetry/index.js';
2
+ import { R as RegisteredLogger, L as Logger, a as LogLevel } from './index-B0-NXUYv.js';
3
+ import { T as Telemetry } from './telemetry-oCUM52DG.js';
4
4
  import 'pino';
5
5
  import 'stream';
6
6
  import '@opentelemetry/sdk-node';
@@ -8,7 +8,7 @@ import '@opentelemetry/sdk-trace-base';
8
8
 
9
9
  declare class MastraBase {
10
10
  component: RegisteredLogger;
11
- logger: Logger;
11
+ protected logger: Logger;
12
12
  name?: string;
13
13
  telemetry?: Telemetry;
14
14
  constructor({ component, name }: {
package/dist/base.js CHANGED
@@ -1,3 +1,3 @@
1
- export { MastraBase } from './chunk-27EL4TRB.js';
2
- import './chunk-NLQVQJOD.js';
1
+ export { MastraBase } from './chunk-JCRGAEY6.js';
2
+ import './chunk-TJK6TGSR.js';
3
3
  import './chunk-AJJZUHB4.js';
@@ -0,0 +1,21 @@
1
+ import { MastraBase } from '../base.js';
2
+ import '@opentelemetry/api';
3
+ import '../index-B0-NXUYv.js';
4
+ import 'pino';
5
+ import 'stream';
6
+ import '../telemetry-oCUM52DG.js';
7
+ import '@opentelemetry/sdk-node';
8
+ import '@opentelemetry/sdk-trace-base';
9
+
10
+ declare abstract class MastraBundler extends MastraBase {
11
+ constructor({ name, component }: {
12
+ name: string;
13
+ component?: 'BUNDLER' | 'DEPLOYER';
14
+ });
15
+ loadEnvVars(): Promise<Map<string, string>>;
16
+ abstract prepare(outputDirectory: string): Promise<void>;
17
+ abstract getEnvFiles(): Promise<string[]>;
18
+ abstract bundle(mastraDir: string, outputDirectory: string): Promise<void>;
19
+ }
20
+
21
+ export { MastraBundler };
@@ -0,0 +1,4 @@
1
+ export { MastraBundler } from '../chunk-CQYUMNLZ.js';
2
+ import '../chunk-JCRGAEY6.js';
3
+ import '../chunk-TJK6TGSR.js';
4
+ import '../chunk-AJJZUHB4.js';
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-RPBNMIV7.js';
1
+ import { Agent } from './chunk-SAXFXAKK.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
  import { CohereClient } from 'cohere-ai';
4
4
 
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-27EL4TRB.js';
1
+ import { MastraBase } from './chunk-JCRGAEY6.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
  import { createClient } from '@libsql/client';
4
4
 
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-27EL4TRB.js';
1
+ import { MastraBase } from './chunk-JCRGAEY6.js';
2
2
  import { embed, embedMany } from './chunk-Y7TKCKRI.js';
3
3
  import { __name } from './chunk-AJJZUHB4.js';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import { InstrumentClass } from './chunk-6ZVFVYLE.js';
2
2
  import { delay } from './chunk-LUULSM4U.js';
3
- import { MastraBase } from './chunk-27EL4TRB.js';
4
- import { RegisteredLogger, LogLevel } from './chunk-NLQVQJOD.js';
3
+ import { MastraBase } from './chunk-JCRGAEY6.js';
4
+ import { RegisteredLogger, LogLevel } from './chunk-TJK6TGSR.js';
5
5
  import { __name, __privateAdd, __privateSet, __privateGet } from './chunk-AJJZUHB4.js';
6
6
  import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock';
7
7
  import { createAnthropic } from '@ai-sdk/anthropic';
@@ -0,0 +1,28 @@
1
+ import { MastraBase } from './chunk-JCRGAEY6.js';
2
+ import { __name } from './chunk-AJJZUHB4.js';
3
+ import dotenv from 'dotenv';
4
+ import { readFile } from 'fs/promises';
5
+
6
+ var _MastraBundler = class _MastraBundler extends MastraBase {
7
+ constructor({ name, component = "BUNDLER" }) {
8
+ super({
9
+ component,
10
+ name
11
+ });
12
+ }
13
+ async loadEnvVars() {
14
+ const envVars = /* @__PURE__ */ new Map();
15
+ for (const file of await this.getEnvFiles()) {
16
+ const content = await readFile(file, "utf-8");
17
+ const config = dotenv.parse(content);
18
+ Object.entries(config).forEach(([key, value]) => {
19
+ envVars.set(key, value);
20
+ });
21
+ }
22
+ return envVars;
23
+ }
24
+ };
25
+ __name(_MastraBundler, "MastraBundler");
26
+ var MastraBundler = _MastraBundler;
27
+
28
+ export { MastraBundler };
@@ -1,7 +1,7 @@
1
- import { Telemetry } from './chunk-OZZS5Y3C.js';
2
- import { LLM } from './chunk-K7KUCZT2.js';
1
+ import { Telemetry } from './chunk-SDKEPBBH.js';
2
+ import { LLM } from './chunk-6WJREZ5F.js';
3
3
  import { InstrumentClass } from './chunk-6ZVFVYLE.js';
4
- import { LogLevel, createLogger, noopLogger } from './chunk-NLQVQJOD.js';
4
+ import { LogLevel, createLogger, noopLogger } from './chunk-TJK6TGSR.js';
5
5
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
6
6
  import 'dotenv/config';
7
7
 
@@ -243,7 +243,13 @@ var _Mastra = class _Mastra {
243
243
  this.logger = logger;
244
244
  if (this.agents) {
245
245
  Object.keys(this.agents).forEach((key) => {
246
- this.agents?.[key]?.__setLogger(this.logger);
246
+ const agent = this.agents?.[key];
247
+ if (agent) {
248
+ agent.__setLogger(this.logger);
249
+ if (agent.hasOwnMemory()) {
250
+ agent.getMemory()?.__setLogger(this.logger);
251
+ }
252
+ }
247
253
  });
248
254
  }
249
255
  if (this.workflows) {
@@ -1,4 +1,4 @@
1
- import { RegisteredLogger, createLogger } from './chunk-NLQVQJOD.js';
1
+ import { RegisteredLogger, createLogger } from './chunk-TJK6TGSR.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
 
4
4
  // src/base.ts
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-27EL4TRB.js';
1
+ import { MastraBase } from './chunk-JCRGAEY6.js';
2
2
  import { __name, __publicField, __privateAdd, __privateSet, __privateGet, __privateMethod } from './chunk-AJJZUHB4.js';
3
3
  import { get } from 'radash';
4
4
  import sift from 'sift';
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-27EL4TRB.js';
1
+ import { MastraBase } from './chunk-JCRGAEY6.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
 
4
4
  // src/memory/index.ts
@@ -13,19 +13,19 @@ var _MastraMemory = class _MastraMemory extends MastraBase {
13
13
  __publicField(this, "vector");
14
14
  __publicField(this, "embeddingOptions");
15
15
  __publicField(this, "threadConfig", {
16
- injectRecentMessages: 40,
17
- injectVectorHistorySearch: false
16
+ lastMessages: 40,
17
+ historySearch: false
18
18
  });
19
19
  this.storage = config.storage;
20
20
  if (config.vector) {
21
21
  this.vector = config.vector;
22
- this.threadConfig.injectVectorHistorySearch = true;
22
+ this.threadConfig.historySearch = true;
23
23
  }
24
24
  if (`embeddingOptions` in config) {
25
25
  this.embeddingOptions = config.embeddingOptions;
26
26
  }
27
- if (config.threads) {
28
- this.threadConfig = this.getMergedThreadConfig(config.threads);
27
+ if (config.options) {
28
+ this.threadConfig = this.getMergedThreadConfig(config.options);
29
29
  }
30
30
  }
31
31
  parseEmbeddingOptions() {
@@ -30,6 +30,10 @@ var BaseFilterTranslator = (_a = class {
30
30
  isFieldOperator(key) {
31
31
  return this.isOperator(key) && !this.isLogicalOperator(key);
32
32
  }
33
+ isCustomOperator(key) {
34
+ const support = this.getSupportedOperators();
35
+ return support.custom?.includes(key) ?? false;
36
+ }
33
37
  getSupportedOperators() {
34
38
  return _a.DEFAULT_OPERATORS;
35
39
  }
@@ -45,6 +49,9 @@ var BaseFilterTranslator = (_a = class {
45
49
  if (value instanceof Date) {
46
50
  return value.toISOString();
47
51
  }
52
+ if (typeof value === "number" && Object.is(value, -0)) {
53
+ return 0;
54
+ }
48
55
  return value;
49
56
  }
50
57
  /**
@@ -1,8 +1,8 @@
1
- import { LLM } from './chunk-K7KUCZT2.js';
2
- import { InstrumentClass } from './chunk-6ZVFVYLE.js';
3
- import { MastraBase } from './chunk-27EL4TRB.js';
4
- import { RegisteredLogger, LogLevel } from './chunk-NLQVQJOD.js';
5
1
  import { executeHook, AvailableHooks } from './chunk-HBTQNIAX.js';
2
+ import { LLM } from './chunk-6WJREZ5F.js';
3
+ import { InstrumentClass } from './chunk-6ZVFVYLE.js';
4
+ import { MastraBase } from './chunk-JCRGAEY6.js';
5
+ import { RegisteredLogger, LogLevel } from './chunk-TJK6TGSR.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';
@@ -19,7 +19,7 @@ function _ts_metadata(k, v) {
19
19
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
20
20
  }
21
21
  __name(_ts_metadata, "_ts_metadata");
22
- var _mastra;
22
+ var _mastra, _memory;
23
23
  var _Agent = class _Agent extends MastraBase {
24
24
  constructor(config) {
25
25
  super({
@@ -30,6 +30,7 @@ var _Agent = class _Agent extends MastraBase {
30
30
  __publicField(this, "instructions");
31
31
  __publicField(this, "model");
32
32
  __privateAdd(this, _mastra);
33
+ __privateAdd(this, _memory);
33
34
  __publicField(this, "tools");
34
35
  __publicField(this, "metrics");
35
36
  this.name = config.name;
@@ -49,6 +50,15 @@ var _Agent = class _Agent extends MastraBase {
49
50
  if (config.metrics) {
50
51
  this.metrics = config.metrics;
51
52
  }
53
+ if (config.memory) {
54
+ __privateSet(this, _memory, config.memory);
55
+ }
56
+ }
57
+ hasOwnMemory() {
58
+ return Boolean(__privateGet(this, _memory));
59
+ }
60
+ getMemory() {
61
+ return __privateGet(this, _memory) ?? __privateGet(this, _mastra)?.memory;
52
62
  }
53
63
  __registerPrimitives(p) {
54
64
  if (p.telemetry) {
@@ -117,20 +127,21 @@ var _Agent = class _Agent extends MastraBase {
117
127
  }
118
128
  async saveMemory({ threadId, memoryConfig, resourceId, userMessages, runId }) {
119
129
  const userMessage = this.getMostRecentUserMessage(userMessages);
120
- if (__privateGet(this, _mastra)?.memory) {
130
+ const memory = this.getMemory();
131
+ if (memory) {
121
132
  let thread;
122
133
  if (!threadId) {
123
134
  this.logger.debug(`No threadId, creating new thread for agent ${this.name}`, {
124
135
  runId: runId || this.name
125
136
  });
126
137
  const title = await this.genTitle(userMessage);
127
- thread = await __privateGet(this, _mastra).memory.createThread({
138
+ thread = await memory.createThread({
128
139
  threadId,
129
140
  resourceId,
130
141
  title
131
142
  });
132
143
  } else {
133
- thread = await __privateGet(this, _mastra).memory.getThreadById({
144
+ thread = await memory.getThreadById({
134
145
  threadId
135
146
  });
136
147
  if (!thread) {
@@ -138,7 +149,7 @@ var _Agent = class _Agent extends MastraBase {
138
149
  runId: runId || this.name
139
150
  });
140
151
  const title = await this.genTitle(userMessage);
141
- thread = await __privateGet(this, _mastra).memory.createThread({
152
+ thread = await memory.createThread({
142
153
  threadId,
143
154
  resourceId,
144
155
  title
@@ -151,7 +162,7 @@ var _Agent = class _Agent extends MastraBase {
151
162
  if (thread) {
152
163
  const messages = newMessages.map((u) => {
153
164
  return {
154
- id: __privateGet(this, _mastra)?.memory?.generateId(),
165
+ id: this.getMemory()?.generateId(),
155
166
  createdAt: /* @__PURE__ */ new Date(),
156
167
  threadId: thread.id,
157
168
  ...u,
@@ -194,7 +205,7 @@ var _Agent = class _Agent extends MastraBase {
194
205
  this.log(LogLevel.DEBUG, `No context found: ${e.message}`);
195
206
  }
196
207
  }
197
- const memoryMessages = threadId && __privateGet(this, _mastra).memory ? (await __privateGet(this, _mastra).memory.rememberMessages({
208
+ const memoryMessages = threadId && memory ? (await memory.rememberMessages({
198
209
  threadId,
199
210
  config: memoryConfig,
200
211
  vectorMessageSearch: messages.slice(-1).map((m) => {
@@ -205,10 +216,12 @@ var _Agent = class _Agent extends MastraBase {
205
216
  }).join(`
206
217
  `)
207
218
  })).messages : [];
208
- await __privateGet(this, _mastra).memory.saveMessages({
209
- messages,
210
- memoryConfig
211
- });
219
+ if (memory) {
220
+ await memory.saveMessages({
221
+ messages,
222
+ memoryConfig
223
+ });
224
+ }
212
225
  this.log(LogLevel.DEBUG, "Saved messages to memory", {
213
226
  threadId: thread.id,
214
227
  runId
@@ -239,12 +252,13 @@ var _Agent = class _Agent extends MastraBase {
239
252
  response.messages
240
253
  ];
241
254
  const responseMessagesWithoutIncompleteToolCalls = this.sanitizeResponseMessages(ms);
242
- if (__privateGet(this, _mastra)?.memory) {
255
+ const memory = this.getMemory();
256
+ if (memory) {
243
257
  this.log(LogLevel.DEBUG, "Saving response to memory", {
244
258
  threadId,
245
259
  runId
246
260
  });
247
- await __privateGet(this, _mastra).memory.saveMessages({
261
+ await memory.saveMessages({
248
262
  memoryConfig,
249
263
  messages: responseMessagesWithoutIncompleteToolCalls.map((message) => {
250
264
  const messageId = randomUUID();
@@ -400,7 +414,7 @@ var _Agent = class _Agent extends MastraBase {
400
414
  };
401
415
  let coreMessages = messages;
402
416
  let threadIdToUse = threadId;
403
- if (__privateGet(this, _mastra)?.memory && resourceId) {
417
+ if (this.getMemory() && resourceId) {
404
418
  const preExecuteResult = await this.preExecute({
405
419
  resourceId,
406
420
  runId,
@@ -416,7 +430,7 @@ var _Agent = class _Agent extends MastraBase {
416
430
  });
417
431
  }
418
432
  let convertedTools;
419
- if (toolsets && Object.keys(toolsets || {}).length > 0 || __privateGet(this, _mastra)?.memory && resourceId || __privateGet(this, _mastra)?.engine) {
433
+ if (toolsets && Object.keys(toolsets || {}).length > 0 || this.getMemory() && resourceId || __privateGet(this, _mastra)?.engine) {
420
434
  convertedTools = this.convertTools({
421
435
  toolsets,
422
436
  threadId: threadIdToUse,
@@ -461,7 +475,7 @@ var _Agent = class _Agent extends MastraBase {
461
475
  result: resToLog,
462
476
  threadId: threadId2
463
477
  });
464
- if (__privateGet(this, _mastra)?.memory && resourceId) {
478
+ if (this.getMemory() && resourceId) {
465
479
  try {
466
480
  this.logger.debug(`Saving assistant message in memory for agent ${this.name}`, {
467
481
  runId: runId2,
@@ -503,7 +517,7 @@ var _Agent = class _Agent extends MastraBase {
503
517
  }, "after")
504
518
  };
505
519
  }
506
- async generate(messages, { context, threadId: threadIdInFn, thread: memoryConfig, resourceId, maxSteps = 5, onStepFinish, runId, toolsets, output = "text", temperature } = {}) {
520
+ async generate(messages, { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps = 5, onStepFinish, runId, toolsets, output = "text", temperature } = {}) {
507
521
  let messagesToUse = [];
508
522
  if (typeof messages === `string`) {
509
523
  messagesToUse = [
@@ -528,7 +542,7 @@ var _Agent = class _Agent extends MastraBase {
528
542
  messages: messagesToUse,
529
543
  context,
530
544
  threadId: threadIdInFn,
531
- memoryConfig,
545
+ memoryConfig: memoryOptions,
532
546
  resourceId,
533
547
  runId: runIdToUse,
534
548
  toolsets
@@ -548,7 +562,7 @@ var _Agent = class _Agent extends MastraBase {
548
562
  await after({
549
563
  result: result2,
550
564
  threadId,
551
- memoryConfig,
565
+ memoryConfig: memoryOptions,
552
566
  outputText: outputText2,
553
567
  runId: runIdToUse
554
568
  });
@@ -568,13 +582,13 @@ var _Agent = class _Agent extends MastraBase {
568
582
  await after({
569
583
  result,
570
584
  threadId,
571
- memoryConfig,
585
+ memoryConfig: memoryOptions,
572
586
  outputText,
573
587
  runId: runIdToUse
574
588
  });
575
589
  return result;
576
590
  }
577
- async stream(messages, { context, threadId: threadIdInFn, thread: memoryConfig, resourceId, maxSteps = 5, onFinish, onStepFinish, runId, toolsets, output = "text", temperature } = {}) {
591
+ async stream(messages, { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps = 5, onFinish, onStepFinish, runId, toolsets, output = "text", temperature } = {}) {
578
592
  const runIdToUse = runId || randomUUID();
579
593
  let messagesToUse = [];
580
594
  if (typeof messages === `string`) {
@@ -599,7 +613,7 @@ var _Agent = class _Agent extends MastraBase {
599
613
  messages: messagesToUse,
600
614
  context,
601
615
  threadId: threadIdInFn,
602
- memoryConfig,
616
+ memoryConfig: memoryOptions,
603
617
  resourceId,
604
618
  runId: runIdToUse,
605
619
  toolsets
@@ -622,7 +636,7 @@ var _Agent = class _Agent extends MastraBase {
622
636
  await after({
623
637
  result: res,
624
638
  threadId,
625
- memoryConfig,
639
+ memoryConfig: memoryOptions,
626
640
  outputText,
627
641
  runId: runIdToUse
628
642
  });
@@ -655,7 +669,7 @@ var _Agent = class _Agent extends MastraBase {
655
669
  await after({
656
670
  result: res,
657
671
  threadId,
658
- memoryConfig,
672
+ memoryConfig: memoryOptions,
659
673
  outputText,
660
674
  runId: runIdToUse
661
675
  });
@@ -673,6 +687,7 @@ var _Agent = class _Agent extends MastraBase {
673
687
  }
674
688
  };
675
689
  _mastra = new WeakMap();
690
+ _memory = new WeakMap();
676
691
  __name(_Agent, "Agent");
677
692
  var Agent = _Agent;
678
693
  Agent = _ts_decorate([
@@ -1,5 +1,5 @@
1
1
  import { InstrumentClass } from './chunk-6ZVFVYLE.js';
2
- import { MastraBase } from './chunk-27EL4TRB.js';
2
+ import { MastraBase } from './chunk-JCRGAEY6.js';
3
3
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
4
4
 
5
5
  // src/tts/index.ts
@@ -9,6 +9,7 @@ var RegisteredLogger = {
9
9
  LLM: "LLM",
10
10
  TTS: "TTS",
11
11
  VECTOR: "VECTOR",
12
+ BUNDLER: "BUNDLER",
12
13
  DEPLOYER: "DEPLOYER",
13
14
  ENGINE: "ENGINE",
14
15
  MEMORY: "MEMORY",
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-27EL4TRB.js';
1
+ import { MastraBase } from './chunk-JCRGAEY6.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
 
4
4
  // src/engine/types.ts
@@ -0,0 +1,16 @@
1
+ import { MastraBundler } from './chunk-CQYUMNLZ.js';
2
+ import { __name } from './chunk-AJJZUHB4.js';
3
+
4
+ // src/deployer/index.ts
5
+ var _MastraDeployer = class _MastraDeployer extends MastraBundler {
6
+ constructor({ name }) {
7
+ super({
8
+ component: "DEPLOYER",
9
+ name
10
+ });
11
+ }
12
+ };
13
+ __name(_MastraDeployer, "MastraDeployer");
14
+ var MastraDeployer = _MastraDeployer;
15
+
16
+ export { MastraDeployer };
@@ -1,35 +1,18 @@
1
- import { MastraBase } from '../base.js';
1
+ import { MastraBundler } from '../bundler/index.js';
2
+ import '../base.js';
2
3
  import '@opentelemetry/api';
3
- import '../index-B9i6dmc0.js';
4
+ import '../index-B0-NXUYv.js';
4
5
  import 'pino';
5
6
  import 'stream';
6
- import '../telemetry/index.js';
7
+ import '../telemetry-oCUM52DG.js';
7
8
  import '@opentelemetry/sdk-node';
8
9
  import '@opentelemetry/sdk-trace-base';
9
10
 
10
- declare abstract class MastraDeployer extends MastraBase {
11
- scope: string;
12
- projectName: string;
13
- env?: Record<string, any>;
14
- constructor({ scope, env, projectName }: {
15
- projectName: string;
16
- scope: string;
17
- env?: Record<string, any>;
11
+ declare abstract class MastraDeployer extends MastraBundler {
12
+ constructor({ name }: {
13
+ name: string;
18
14
  });
19
- loadEnvVars(): void;
20
- protected getEnvFiles(): string[];
21
- protected parseEnvFile(filePath: string): string[];
22
- writeFiles({ dir }: {
23
- dir: string;
24
- }): void;
25
- writeIndex({ dir }: {
26
- dir: string;
27
- }): void;
28
- deploy({ dir, siteId }: {
29
- token: string;
30
- dir: string;
31
- siteId?: string;
32
- }): Promise<void>;
15
+ abstract deploy(outputDirectory: string): Promise<void>;
33
16
  }
34
17
 
35
18
  export { MastraDeployer };
@@ -1,4 +1,5 @@
1
- export { MastraDeployer } from '../chunk-5R6DBXQM.js';
2
- import '../chunk-27EL4TRB.js';
3
- import '../chunk-NLQVQJOD.js';
1
+ export { MastraDeployer } from '../chunk-XD5IQZRB.js';
2
+ import '../chunk-CQYUMNLZ.js';
3
+ import '../chunk-JCRGAEY6.js';
4
+ import '../chunk-TJK6TGSR.js';
4
5
  import '../chunk-AJJZUHB4.js';
@@ -2,10 +2,10 @@ import { M as MastraEngine, D as DatabaseConfig, B as BaseEntity, a as BaseRecor
2
2
  export { b as FilterCondition, F as FilterOperators, P as PropertyType, S as SortOrder } from '../engine-EwEG-4Iv.js';
3
3
  import '../base.js';
4
4
  import '@opentelemetry/api';
5
- import '../index-B9i6dmc0.js';
5
+ import '../index-B0-NXUYv.js';
6
6
  import 'pino';
7
7
  import 'stream';
8
- import '../telemetry/index.js';
8
+ import '../telemetry-oCUM52DG.js';
9
9
  import '@opentelemetry/sdk-node';
10
10
  import '@opentelemetry/sdk-trace-base';
11
11
 
@@ -1,4 +1,4 @@
1
- export { FilterOperators, MastraEngine, MockMastraEngine, PropertyType } from '../chunk-S45F6AHA.js';
2
- import '../chunk-27EL4TRB.js';
3
- import '../chunk-NLQVQJOD.js';
1
+ export { FilterOperators, MastraEngine, MockMastraEngine, PropertyType } from '../chunk-U25DBVJZ.js';
2
+ import '../chunk-JCRGAEY6.js';
3
+ import '../chunk-TJK6TGSR.js';
4
4
  import '../chunk-AJJZUHB4.js';
@@ -1,18 +1,18 @@
1
1
  import { M as Metric, a as MetricResult } from '../metric-D2V4CR8D.js';
2
- import { A as Agent } from '../index-CA9EWqaj.js';
2
+ import { A as Agent } from '../index-62DyKJRU.js';
3
3
  import 'ai';
4
4
  import 'json-schema';
5
5
  import 'zod';
6
6
  import '../base.js';
7
7
  import '@opentelemetry/api';
8
- import '../index-B9i6dmc0.js';
8
+ import '../index-B0-NXUYv.js';
9
9
  import 'pino';
10
10
  import 'stream';
11
- import '../telemetry/index.js';
11
+ import '../telemetry-oCUM52DG.js';
12
12
  import '@opentelemetry/sdk-node';
13
13
  import '@opentelemetry/sdk-trace-base';
14
- import 'sift';
15
14
  import '../types-M16hSruO.js';
15
+ import 'sift';
16
16
  import '../vector/index.js';
17
17
  import '../engine-EwEG-4Iv.js';
18
18
  import '../tts/index.js';
@@ -48,6 +48,7 @@ declare abstract class BaseFilterTranslator {
48
48
  protected isElementOperator(key: string): key is ElementOperator;
49
49
  protected isRegexOperator(key: string): key is RegexOperator;
50
50
  protected isFieldOperator(key: string): key is QueryOperator;
51
+ protected isCustomOperator(key: string): boolean;
51
52
  protected getSupportedOperators(): OperatorSupport;
52
53
  protected isValidOperator(key: string): boolean;
53
54
  /**
@@ -1,2 +1,2 @@
1
- export { BaseFilterTranslator } from '../chunk-FROFMREE.js';
1
+ export { BaseFilterTranslator } from '../chunk-RZYBOMIG.js';
2
2
  import '../chunk-AJJZUHB4.js';