@mastra/core 0.2.0-alpha.95 → 0.2.0-alpha.98

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 (37) hide show
  1. package/dist/agent/index.d.ts +2 -2
  2. package/dist/agent/index.js +2 -2
  3. package/dist/chunk-C55JWGDU.js +76 -0
  4. package/dist/{chunk-G4LP2IJU.js → chunk-HPXWJBQK.js} +23 -2
  5. package/dist/{chunk-QLN26TPI.js → chunk-JP37ODNX.js} +3 -2
  6. package/dist/{chunk-E3TBVBIO.js → chunk-MDM2JS2U.js} +54 -58
  7. package/dist/{chunk-N44BCOWP.js → chunk-MG3WAQV7.js} +1 -1
  8. package/dist/{chunk-JY322VLW.js → chunk-QXH6EK72.js} +21 -7
  9. package/dist/{chunk-EULBQ77C.js → chunk-Z7JFMQZZ.js} +44 -1
  10. package/dist/{chunk-5DZIXJRV.js → chunk-ZJOMHCWE.js} +16 -2
  11. package/dist/eval/index.d.ts +4 -3
  12. package/dist/eval/index.js +1 -1
  13. package/dist/hooks/index.d.ts +6 -1
  14. package/dist/{index-CBxGSZZE.d.ts → index-Cwb-5AzX.d.ts} +20 -12
  15. package/dist/index.d.ts +7 -7
  16. package/dist/index.js +13 -12
  17. package/dist/integration/index.d.ts +3 -3
  18. package/dist/llm/index.d.ts +2 -2
  19. package/dist/mastra/index.d.ts +3 -3
  20. package/dist/memory/index.d.ts +2 -2
  21. package/dist/memory/index.js +5 -1
  22. package/dist/{metric-D2V4CR8D.d.ts → metric-BWeQNZt6.d.ts} +1 -1
  23. package/dist/relevance/index.js +3 -3
  24. package/dist/storage/index.d.ts +6 -4
  25. package/dist/storage/index.js +4 -4
  26. package/dist/tools/index.d.ts +3 -3
  27. package/dist/vector/index.d.ts +4 -1
  28. package/dist/vector/index.js +1 -1
  29. package/dist/vector/libsql/index.d.ts +2 -0
  30. package/dist/vector/libsql/index.js +3 -3
  31. package/dist/{workflow-BA2Pnq90.d.ts → workflow-DTtv7_Eq.d.ts} +1 -1
  32. package/dist/workflows/index.d.ts +4 -4
  33. package/dist/workflows/index.js +1 -1
  34. package/package.json +7 -3
  35. package/dist/action/index.d.ts +0 -16
  36. package/dist/action/index.js +0 -1
  37. package/dist/chunk-MBOUQZQT.js +0 -16
@@ -1,7 +1,8 @@
1
- import { MastraVector } from './chunk-MBOUQZQT.js';
1
+ import { MastraVector } from './chunk-C55JWGDU.js';
2
2
  import { BaseFilterTranslator } from './chunk-4LJFWC2Q.js';
3
3
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
4
4
  import { createClient } from '@libsql/client';
5
+ import { join } from 'path';
5
6
 
6
7
  // src/vector/libsql/filter.ts
7
8
  var _LibSQLFilterTranslator = class _LibSQLFilterTranslator extends BaseFilterTranslator {
@@ -472,12 +473,25 @@ var _DefaultVectorDB = class _DefaultVectorDB extends MastraVector {
472
473
  super();
473
474
  __publicField(this, "turso");
474
475
  this.turso = createClient({
475
- url: connectionUrl,
476
+ url: this.rewriteDbUrl(connectionUrl),
476
477
  syncUrl,
477
478
  authToken,
478
479
  syncInterval
479
480
  });
480
481
  }
482
+ rewriteDbUrl(url) {
483
+ if (url.startsWith("file:") && !url.startsWith("file:/")) {
484
+ const cwd = process.cwd();
485
+ const relativePath = url.slice("file:".length);
486
+ if (cwd.endsWith(".mastra") || cwd.endsWith(".mastra/")) {
487
+ const baseDir = join(cwd, `..`);
488
+ const fullPath = join(baseDir, relativePath);
489
+ this.logger.debug(`Initializing LibSQL db with url ${url} with relative file path from inside .mastra directory. Rewriting relative file url to "file:${fullPath}". This ensures it's outside the .mastra directory. If the db is stored inside .mastra it will be deleted when Mastra re-bundles code.`);
490
+ return `file:${fullPath}`;
491
+ }
492
+ }
493
+ return url;
494
+ }
481
495
  transformFilter(filter) {
482
496
  const libsqlFilter = new LibSQLFilterTranslator();
483
497
  const translatedFilter = libsqlFilter.translate(filter ?? {});
@@ -1,5 +1,5 @@
1
- import { M as Metric, a as MetricResult } from '../metric-D2V4CR8D.js';
2
- import { A as Agent } from '../index-CBxGSZZE.js';
1
+ import { a as Metric, M as MetricResult } from '../metric-BWeQNZt6.js';
2
+ import { A as Agent } from '../index-Cwb-5AzX.js';
3
3
  import 'ai';
4
4
  import 'json-schema';
5
5
  import 'zod';
@@ -15,7 +15,7 @@ import 'sift';
15
15
  import '../vector/index.js';
16
16
  import '../tts/index.js';
17
17
 
18
- declare function evaluate<T extends Agent>({ agentName, input, metric, output, runId, globalRunId, testInfo, }: {
18
+ declare function evaluate<T extends Agent>({ agentName, input, metric, output, runId, globalRunId, testInfo, instructions, }: {
19
19
  agentName: string;
20
20
  input: Parameters<T['generate']>[0];
21
21
  metric: Metric;
@@ -26,6 +26,7 @@ declare function evaluate<T extends Agent>({ agentName, input, metric, output, r
26
26
  testName?: string;
27
27
  testPath?: string;
28
28
  } | null;
29
+ instructions: string;
29
30
  }): Promise<MetricResult>;
30
31
 
31
32
  export { Metric, MetricResult, evaluate };
@@ -1,3 +1,3 @@
1
- export { Metric, evaluate } from '../chunk-QLN26TPI.js';
1
+ export { Metric, evaluate } from '../chunk-JP37ODNX.js';
2
2
  import '../chunk-HBTQNIAX.js';
3
3
  import '../chunk-AJJZUHB4.js';
@@ -1,4 +1,4 @@
1
- import { M as Metric, a as MetricResult } from '../metric-D2V4CR8D.js';
1
+ import { M as MetricResult, a as Metric } from '../metric-BWeQNZt6.js';
2
2
 
3
3
  type Handler<T = unknown> = (event: T) => void;
4
4
 
@@ -9,6 +9,8 @@ declare enum AvailableHooks {
9
9
  declare function registerHook(hook: AvailableHooks.ON_EVALUATION, action: Handler<{
10
10
  input: string;
11
11
  output: string;
12
+ result: MetricResult;
13
+ meta: Record<string, any>;
12
14
  }>): void;
13
15
  declare function registerHook(hook: AvailableHooks.ON_GENERATION, action: Handler<{
14
16
  input: string;
@@ -16,11 +18,13 @@ declare function registerHook(hook: AvailableHooks.ON_GENERATION, action: Handle
16
18
  metric: Metric;
17
19
  runId: string;
18
20
  agentName: string;
21
+ instructions: string;
19
22
  }>): void;
20
23
  declare function executeHook(hook: AvailableHooks.ON_EVALUATION, action: {
21
24
  input: string;
22
25
  output: string;
23
26
  result: MetricResult;
27
+ meta: Record<string, any>;
24
28
  }): void;
25
29
  declare function executeHook(hook: AvailableHooks.ON_GENERATION, action: {
26
30
  input: string;
@@ -28,6 +32,7 @@ declare function executeHook(hook: AvailableHooks.ON_GENERATION, action: {
28
32
  metric: Metric;
29
33
  runId: string;
30
34
  agentName: string;
35
+ instructions: string;
31
36
  }): void;
32
37
 
33
38
  export { AvailableHooks, executeHook, registerHook };
@@ -2,7 +2,7 @@ import { Message, UserContent, AssistantContent, ToolContent, CoreMessage as Cor
2
2
  import { JSONSchema7 } from 'json-schema';
3
3
  import { z, ZodSchema } from 'zod';
4
4
  import { MastraBase } from './base.js';
5
- import { M as Metric } from './metric-D2V4CR8D.js';
5
+ import { a as Metric } from './metric-BWeQNZt6.js';
6
6
  import { T as Telemetry } from './telemetry-oCUM52DG.js';
7
7
  import { Query } from 'sift';
8
8
  import { B as BaseLogMessage, R as RegisteredLogger, L as Logger, b as Run } from './index-CBZ2mk2H.js';
@@ -96,7 +96,7 @@ interface StepConfig<TStep extends IAction<any, any, any, any>, CondStep extends
96
96
  }
97
97
  type StepSuccess<T> = {
98
98
  status: 'success';
99
- payload: T;
99
+ output: T;
100
100
  };
101
101
  type StepSuspended = {
102
102
  status: 'suspended';
@@ -110,7 +110,7 @@ type StepFailure = {
110
110
  };
111
111
  type StepResult<T> = StepSuccess<T> | StepFailure | StepSuspended | StepWaiting;
112
112
  interface WorkflowContext<TTrigger extends z.ZodType<any> = any> {
113
- stepResults: Record<string, StepResult<any>>;
113
+ steps: Record<string, StepResult<any>>;
114
114
  triggerData: z.infer<TTrigger>;
115
115
  attempts: Record<string, number>;
116
116
  getStepPayload: <T = unknown>(stepId: string) => T | undefined;
@@ -271,7 +271,7 @@ type PathsToStringProps<T> = T extends object ? {
271
271
  interface WorkflowRunState {
272
272
  value: Record<string, string>;
273
273
  context: {
274
- stepResults: Record<string, {
274
+ steps: Record<string, {
275
275
  status: 'success' | 'failed' | 'suspended' | 'waiting';
276
276
  payload?: any;
277
277
  error?: string;
@@ -317,6 +317,13 @@ type StorageGetMessagesArg = {
317
317
  };
318
318
  threadConfig?: MemoryConfig;
319
319
  };
320
+ type EvalRow = {
321
+ result: string;
322
+ meta: string;
323
+ input: string;
324
+ output: string;
325
+ createdAt: string;
326
+ };
320
327
 
321
328
  type TABLE_NAMES = typeof MastraStorage.TABLE_WORKFLOW_SNAPSHOT | typeof MastraStorage.TABLE_EVALS | typeof MastraStorage.TABLE_MESSAGES | typeof MastraStorage.TABLE_THREADS;
322
329
  declare abstract class MastraStorage extends MastraBase {
@@ -436,7 +443,7 @@ type MemoryConfig = {
436
443
  };
437
444
  };
438
445
  type SharedMemoryConfig = {
439
- storage: MastraStorage;
446
+ storage?: MastraStorage;
440
447
  options?: MemoryConfig;
441
448
  vector?: MastraVector;
442
449
  embedder?: EmbeddingModel<string>;
@@ -463,6 +470,9 @@ declare abstract class MastraMemory extends MastraBase {
463
470
  threadId: string;
464
471
  memoryConfig?: MemoryConfig;
465
472
  }): Promise<string | null>;
473
+ protected createEmbeddingIndex(): Promise<{
474
+ indexName: string;
475
+ }>;
466
476
  protected getEmbedder(): EmbeddingModel<string>;
467
477
  protected getMergedThreadConfig(config?: MemoryConfig): MemoryConfig;
468
478
  abstract rememberMessages({ threadId, vectorMessageSearch, config, }: {
@@ -570,11 +580,7 @@ type MastraPrimitives = {
570
580
  memory?: MastraMemory;
571
581
  };
572
582
  interface IExecutionContext<TSchemaIn extends z.ZodSchema | undefined = undefined, TContext extends WorkflowContext = WorkflowContext> {
573
- context: TSchemaIn extends z.ZodSchema ? z.infer<TSchemaIn> & {
574
- machineContext?: TContext;
575
- } : {
576
- machineContext?: TContext;
577
- };
583
+ context: TSchemaIn extends z.ZodSchema ? z.infer<TSchemaIn> & TContext : TContext;
578
584
  runId?: string;
579
585
  mastra?: MastraPrimitives;
580
586
  suspend: () => Promise<void>;
@@ -712,6 +718,7 @@ declare class MastraLLMBase extends MastraBase {
712
718
  model: LanguageModel$1;
713
719
  });
714
720
  getProvider(): string;
721
+ getModelId(): string;
715
722
  convertToMessages(messages: string | string[] | CoreMessage$1[]): CoreMessage$1[];
716
723
  __registerPrimitives(p: MastraPrimitives): void;
717
724
  __text(input: LLMTextOptions): Promise<GenerateTextResult<any, any>>;
@@ -726,13 +733,14 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
726
733
  #private;
727
734
  name: string;
728
735
  readonly llm: MastraLLMBase;
729
- readonly instructions: string;
736
+ instructions: string;
730
737
  readonly model?: LanguageModelV1;
731
738
  tools: TTools;
732
739
  metrics: TMetrics;
733
740
  constructor(config: AgentConfig<TTools, TMetrics>);
734
741
  hasOwnMemory(): boolean;
735
742
  getMemory(): MastraMemory | undefined;
743
+ __updateInstructions(newInstructions: string): void;
736
744
  __registerPrimitives(p: MastraPrimitives): void;
737
745
  /**
738
746
  * Set the concrete tools for the agent
@@ -805,4 +813,4 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
805
813
  stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps, onFinish, onStepFinish, runId, toolsets, output, temperature, toolChoice, }?: AgentStreamOptions<Z>): Promise<StreamReturn<Z>>;
806
814
  }
807
815
 
808
- export { type StepCondition as $, Agent as A, type BaseStructuredOutputType as B, type CoreMessage as C, type LLMInnerStreamOptions as D, type EmbedResult as E, type LLMStreamObjectOptions as F, type GenerateReturn as G, type AiMessageType as H, type IAction as I, type MessageType as J, type StorageThreadType as K, type LanguageModel as L, MastraStorage as M, type MessageResponse as N, type OutputType as O, type MemoryConfig as P, type SharedMemoryConfig as Q, type RetryConfig as R, type StepExecutionContext as S, type ToolAction as T, type CoreTool as U, type StepNode as V, type WorkflowOptions as W, type VariableReference as X, type BaseCondition as Y, type ActionContext as Z, type StepDef as _, MastraMemory as a, type WorkflowContext as a0, type WorkflowLogMessage as a1, type WorkflowEvent as a2, type ResolverFunctionInput as a3, type ResolverFunctionOutput as a4, type SubscriberFunctionOutput as a5, type DependencyCheckOutput as a6, type WorkflowActors as a7, type WorkflowActionParams as a8, type WorkflowActions as a9, type WorkflowState as aa, type StepId as ab, type ExtractSchemaFromStep as ac, type ExtractStepResult as ad, type StepInputType as ae, type ExtractSchemaType as af, type PathsToStringProps as ag, type IExecutionContext as ah, type StepAction as b, type MastraPrimitives as c, type StepVariableType as d, type StepConfig as e, type StepResult as f, type WorkflowRunState as g, type StepGraph as h, type AgentConfig as i, type ToolExecutionContext as j, type TABLE_NAMES as k, type StorageColumn as l, type WorkflowRow as m, type StorageGetMessagesArg as n, type CoreSystemMessage as o, type CoreAssistantMessage as p, type CoreUserMessage as q, type CoreToolMessage as r, type EmbedManyResult as s, type StructuredOutputType as t, type StructuredOutputArrayItem as u, type StructuredOutput as v, type StreamReturn as w, type LLMStreamOptions as x, type LLMTextOptions as y, type LLMTextObjectOptions as z };
816
+ export { type StepDef as $, Agent as A, type BaseStructuredOutputType as B, type CoreMessage as C, type LLMTextObjectOptions as D, type EvalRow as E, type LLMInnerStreamOptions as F, type GenerateReturn as G, type LLMStreamObjectOptions as H, type IAction as I, type AiMessageType as J, type MessageType as K, type LanguageModel as L, MastraStorage as M, type StorageThreadType as N, type OutputType as O, type MessageResponse as P, type MemoryConfig as Q, type RetryConfig as R, type StepExecutionContext as S, type ToolAction as T, type SharedMemoryConfig as U, type CoreTool as V, type WorkflowOptions as W, type StepNode as X, type VariableReference as Y, type BaseCondition as Z, type ActionContext as _, MastraMemory as a, type StepCondition as a0, type WorkflowContext as a1, type WorkflowLogMessage as a2, type WorkflowEvent as a3, type ResolverFunctionInput as a4, type ResolverFunctionOutput as a5, type SubscriberFunctionOutput as a6, type DependencyCheckOutput as a7, type WorkflowActors as a8, type WorkflowActionParams as a9, type WorkflowActions as aa, type WorkflowState as ab, type StepId as ac, type ExtractSchemaFromStep as ad, type ExtractStepResult as ae, type StepInputType as af, type ExtractSchemaType as ag, type PathsToStringProps as ah, type StepAction as b, type MastraPrimitives as c, type StepVariableType as d, type StepConfig as e, type StepResult as f, type WorkflowRunState as g, type StepGraph as h, type AgentConfig as i, type ToolExecutionContext as j, type TABLE_NAMES as k, type StorageColumn as l, type WorkflowRow as m, type StorageGetMessagesArg as n, type CoreSystemMessage as o, type CoreAssistantMessage as p, type CoreUserMessage as q, type CoreToolMessage as r, type EmbedResult as s, type EmbedManyResult as t, type StructuredOutputType as u, type StructuredOutputArrayItem as v, type StructuredOutput as w, type StreamReturn as x, type LLMStreamOptions as y, type LLMTextOptions as z };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { M as Metric } from './metric-D2V4CR8D.js';
2
- export { a as MetricResult } from './metric-D2V4CR8D.js';
3
- import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './index-CBxGSZZE.js';
4
- export { Z as ActionContext, H as AiMessageType, Y as BaseCondition, B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, U as CoreTool, r as CoreToolMessage, q as CoreUserMessage, a6 as DependencyCheckOutput, s as EmbedManyResult, E as EmbedResult, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, P as MemoryConfig, N as MessageResponse, J as MessageType, O as OutputType, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, Q as SharedMemoryConfig, b as StepAction, $ as StepCondition, e as StepConfig, _ as StepDef, S as StepExecutionContext, h as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, f as StepResult, d as StepVariableType, l as StorageColumn, n as StorageGetMessagesArg, K as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a5 as SubscriberFunctionOutput, k as TABLE_NAMES, X as VariableReference, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, m as WorkflowRow, g as WorkflowRunState, aa as WorkflowState } from './index-CBxGSZZE.js';
1
+ import { a as Metric } from './metric-BWeQNZt6.js';
2
+ export { M as MetricResult } from './metric-BWeQNZt6.js';
3
+ import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './index-Cwb-5AzX.js';
4
+ export { _ as ActionContext, J as AiMessageType, Z as BaseCondition, B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, V as CoreTool, r as CoreToolMessage, q as CoreUserMessage, a7 as DependencyCheckOutput, t as EmbedManyResult, s as EmbedResult, E as EvalRow, ad as ExtractSchemaFromStep, ag as ExtractSchemaType, ae as ExtractStepResult, G as GenerateReturn, F as LLMInnerStreamOptions, H as LLMStreamObjectOptions, y as LLMStreamOptions, D as LLMTextObjectOptions, z as LLMTextOptions, L as LanguageModel, Q as MemoryConfig, P as MessageResponse, K as MessageType, O as OutputType, ah as PathsToStringProps, a4 as ResolverFunctionInput, a5 as ResolverFunctionOutput, R as RetryConfig, U as SharedMemoryConfig, b as StepAction, a0 as StepCondition, e as StepConfig, $ as StepDef, S as StepExecutionContext, h as StepGraph, ac as StepId, af as StepInputType, X as StepNode, f as StepResult, d as StepVariableType, l as StorageColumn, n as StorageGetMessagesArg, N as StorageThreadType, x as StreamReturn, w as StructuredOutput, v as StructuredOutputArrayItem, u as StructuredOutputType, a6 as SubscriberFunctionOutput, k as TABLE_NAMES, Y as VariableReference, a9 as WorkflowActionParams, aa as WorkflowActions, a8 as WorkflowActors, a1 as WorkflowContext, a3 as WorkflowEvent, a2 as WorkflowLogMessage, m as WorkflowRow, g as WorkflowRunState, ab as WorkflowState } from './index-Cwb-5AzX.js';
5
5
  export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './telemetry-oCUM52DG.js';
6
6
  import { MastraBase as MastraBase$1 } from './base.js';
7
7
  import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-CBZ2mk2H.js';
@@ -19,9 +19,9 @@ export { createTool } from './tools/index.js';
19
19
  import { MastraTTS as MastraTTS$1, TTSConfig } from './tts/index.js';
20
20
  export { TagMaskOptions, deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './utils.js';
21
21
  import { MastraVector as MastraVector$1 } from './vector/index.js';
22
- export { IndexStats, QueryResult } from './vector/index.js';
23
- import { S as Step, W as Workflow$1 } from './workflow-BA2Pnq90.js';
24
- export { c as createStep } from './workflow-BA2Pnq90.js';
22
+ export { IndexStats, QueryResult, localEmbedder } from './vector/index.js';
23
+ import { S as Step, W as Workflow$1 } from './workflow-DTtv7_Eq.js';
24
+ export { c as createStep } from './workflow-DTtv7_Eq.js';
25
25
  export { getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './workflows/index.js';
26
26
  export { AvailableHooks, executeHook, registerHook } from './hooks/index.js';
27
27
  export { ArrayOperator, BaseFilterTranslator, BasicOperator, ElementOperator, FieldCondition, Filter, LogicalOperator, NumericOperator, OperatorCondition, OperatorSupport, QueryOperator, RegexOperator } from './filter/index.js';
package/dist/index.js CHANGED
@@ -1,28 +1,29 @@
1
- import { MastraStorage, DefaultStorage } from './chunk-EULBQ77C.js';
2
- export { DefaultStorage } from './chunk-EULBQ77C.js';
3
1
  import { MastraTTS } from './chunk-K3N7KJHH.js';
4
- import { Workflow } from './chunk-E3TBVBIO.js';
5
- export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-E3TBVBIO.js';
6
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-5DZIXJRV.js';
7
- import { MastraVector } from './chunk-MBOUQZQT.js';
8
- export { BaseFilterTranslator } from './chunk-4LJFWC2Q.js';
2
+ import { Workflow } from './chunk-MDM2JS2U.js';
3
+ export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-MDM2JS2U.js';
9
4
  import { Integration, OpenAPIToolset } from './chunk-42DYOLDV.js';
10
5
  import { Tool } from './chunk-VOUPGVRD.js';
11
6
  export { createTool } from './chunk-VOUPGVRD.js';
12
7
  import './chunk-AE3H2QEY.js';
13
8
  export { Mastra } from './chunk-TYIBRZOY.js';
14
- import { MastraMemory } from './chunk-G4LP2IJU.js';
15
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-N44BCOWP.js';
16
- import { Agent } from './chunk-JY322VLW.js';
9
+ import { MastraMemory } from './chunk-HPXWJBQK.js';
10
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-MG3WAQV7.js';
11
+ import { MastraStorage, DefaultStorage } from './chunk-Z7JFMQZZ.js';
12
+ export { DefaultStorage } from './chunk-Z7JFMQZZ.js';
13
+ export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-ZJOMHCWE.js';
14
+ import { MastraVector } from './chunk-C55JWGDU.js';
15
+ export { localEmbedder } from './chunk-C55JWGDU.js';
16
+ import { Agent } from './chunk-QXH6EK72.js';
17
17
  export { InstrumentClass, Telemetry, hasActiveTelemetry, withSpan } from './chunk-4ZUSEHLH.js';
18
18
  export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-KNPBNSJ7.js';
19
19
  import { MastraDeployer } from './chunk-JJ57BXQR.js';
20
- export { Metric, evaluate } from './chunk-QLN26TPI.js';
21
- export { AvailableHooks, executeHook, registerHook } from './chunk-HBTQNIAX.js';
22
20
  import './chunk-MCB4M5W4.js';
23
21
  import { MastraBase } from './chunk-G4MCO7XF.js';
24
22
  import { createLogger } from './chunk-ICMEXHKD.js';
25
23
  export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-ICMEXHKD.js';
24
+ export { BaseFilterTranslator } from './chunk-4LJFWC2Q.js';
25
+ export { Metric, evaluate } from './chunk-JP37ODNX.js';
26
+ export { AvailableHooks, executeHook, registerHook } from './chunk-HBTQNIAX.js';
26
27
  import { __name } from './chunk-AJJZUHB4.js';
27
28
 
28
29
  // src/agent/index.warning.ts
@@ -1,6 +1,6 @@
1
1
  import '../telemetry-oCUM52DG.js';
2
- import { W as Workflow } from '../workflow-BA2Pnq90.js';
3
- import { T as ToolAction } from '../index-CBxGSZZE.js';
2
+ import { W as Workflow } from '../workflow-DTtv7_Eq.js';
3
+ import { T as ToolAction } from '../index-Cwb-5AzX.js';
4
4
  import '@opentelemetry/api';
5
5
  import '@opentelemetry/sdk-node';
6
6
  import '@opentelemetry/sdk-trace-base';
@@ -12,7 +12,7 @@ import 'pino';
12
12
  import 'stream';
13
13
  import 'ai';
14
14
  import 'json-schema';
15
- import '../metric-D2V4CR8D.js';
15
+ import '../metric-BWeQNZt6.js';
16
16
  import 'sift';
17
17
  import '../vector/index.js';
18
18
  import '../tts/index.js';
@@ -1,7 +1,7 @@
1
1
  import 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, r as CoreToolMessage, q as CoreUserMessage, s as EmbedManyResult, E as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../index-CBxGSZZE.js';
4
+ export { B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, r as CoreToolMessage, q as CoreUserMessage, t as EmbedManyResult, s as EmbedResult, G as GenerateReturn, F as LLMInnerStreamOptions, H as LLMStreamObjectOptions, y as LLMStreamOptions, D as LLMTextObjectOptions, z as LLMTextOptions, L as LanguageModel, O as OutputType, x as StreamReturn, w as StructuredOutput, v as StructuredOutputArrayItem, u as StructuredOutputType } from '../index-Cwb-5AzX.js';
5
5
  import '../index-CBZ2mk2H.js';
6
6
  import '../base.js';
7
7
  import '@opentelemetry/api';
@@ -10,7 +10,7 @@ import '@opentelemetry/sdk-node';
10
10
  import '@opentelemetry/sdk-trace-base';
11
11
  import 'pino';
12
12
  import 'stream';
13
- import '../metric-D2V4CR8D.js';
13
+ import '../metric-BWeQNZt6.js';
14
14
  import 'sift';
15
15
  import '../vector/index.js';
16
16
  import '../tts/index.js';
@@ -1,6 +1,6 @@
1
- import { A as Agent, M as MastraStorage, a as MastraMemory } from '../index-CBxGSZZE.js';
1
+ import { A as Agent, M as MastraStorage, a as MastraMemory } from '../index-Cwb-5AzX.js';
2
2
  import { L as Logger, B as BaseLogMessage } from '../index-CBZ2mk2H.js';
3
- import { W as Workflow } from '../workflow-BA2Pnq90.js';
3
+ import { W as Workflow } from '../workflow-DTtv7_Eq.js';
4
4
  import { MastraVector } from '../vector/index.js';
5
5
  import { O as OtelConfig, T as Telemetry } from '../telemetry-oCUM52DG.js';
6
6
  import { MastraTTS } from '../tts/index.js';
@@ -10,7 +10,7 @@ import 'json-schema';
10
10
  import 'zod';
11
11
  import '../base.js';
12
12
  import '@opentelemetry/api';
13
- import '../metric-D2V4CR8D.js';
13
+ import '../metric-BWeQNZt6.js';
14
14
  import 'sift';
15
15
  import 'pino';
16
16
  import 'stream';
@@ -1,6 +1,6 @@
1
1
  import 'ai';
2
2
  import '../base.js';
3
- export { H as AiMessageType, a as MastraMemory, P as MemoryConfig, N as MessageResponse, J as MessageType, Q as SharedMemoryConfig, K as StorageThreadType } from '../index-CBxGSZZE.js';
3
+ export { J as AiMessageType, a as MastraMemory, Q as MemoryConfig, P as MessageResponse, K as MessageType, U as SharedMemoryConfig, N as StorageThreadType } from '../index-Cwb-5AzX.js';
4
4
  import '../vector/index.js';
5
5
  import '@opentelemetry/api';
6
6
  import '../index-CBZ2mk2H.js';
@@ -11,6 +11,6 @@ import '@opentelemetry/sdk-node';
11
11
  import '@opentelemetry/sdk-trace-base';
12
12
  import 'json-schema';
13
13
  import 'zod';
14
- import '../metric-D2V4CR8D.js';
14
+ import '../metric-BWeQNZt6.js';
15
15
  import 'sift';
16
16
  import '../tts/index.js';
@@ -1,5 +1,9 @@
1
- export { MastraMemory } from '../chunk-G4LP2IJU.js';
1
+ export { MastraMemory } from '../chunk-HPXWJBQK.js';
2
+ import '../chunk-Z7JFMQZZ.js';
3
+ import '../chunk-ZJOMHCWE.js';
4
+ import '../chunk-C55JWGDU.js';
2
5
  import '../chunk-KNPBNSJ7.js';
3
6
  import '../chunk-G4MCO7XF.js';
4
7
  import '../chunk-ICMEXHKD.js';
8
+ import '../chunk-4LJFWC2Q.js';
5
9
  import '../chunk-AJJZUHB4.js';
@@ -6,4 +6,4 @@ declare abstract class Metric {
6
6
  abstract measure(input: string, output: string): Promise<MetricResult>;
7
7
  }
8
8
 
9
- export { Metric as M, type MetricResult as a };
9
+ export { type MetricResult as M, Metric as a };
@@ -1,8 +1,8 @@
1
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-N44BCOWP.js';
2
- import '../chunk-JY322VLW.js';
1
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-MG3WAQV7.js';
2
+ import '../chunk-QXH6EK72.js';
3
3
  import '../chunk-4ZUSEHLH.js';
4
4
  import '../chunk-KNPBNSJ7.js';
5
- import '../chunk-HBTQNIAX.js';
6
5
  import '../chunk-G4MCO7XF.js';
7
6
  import '../chunk-ICMEXHKD.js';
7
+ import '../chunk-HBTQNIAX.js';
8
8
  import '../chunk-AJJZUHB4.js';
@@ -1,5 +1,5 @@
1
- import { M as MastraStorage, k as TABLE_NAMES, l as StorageColumn, K as StorageThreadType, J as MessageType, n as StorageGetMessagesArg } from '../index-CBxGSZZE.js';
2
- export { m as WorkflowRow } from '../index-CBxGSZZE.js';
1
+ import { M as MastraStorage, k as TABLE_NAMES, l as StorageColumn, N as StorageThreadType, K as MessageType, n as StorageGetMessagesArg, E as EvalRow } from '../index-Cwb-5AzX.js';
2
+ export { m as WorkflowRow } from '../index-Cwb-5AzX.js';
3
3
  import '../telemetry-oCUM52DG.js';
4
4
  export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../vector/libsql/index.js';
5
5
  import 'ai';
@@ -12,7 +12,7 @@ import 'pino';
12
12
  import 'stream';
13
13
  import '@opentelemetry/sdk-node';
14
14
  import '@opentelemetry/sdk-trace-base';
15
- import '../metric-D2V4CR8D.js';
15
+ import '../metric-BWeQNZt6.js';
16
16
  import 'sift';
17
17
  import '../vector/index.js';
18
18
  import '../tts/index.js';
@@ -27,6 +27,7 @@ declare class DefaultStorage extends MastraStorage {
27
27
  constructor({ config }: {
28
28
  config: LibSQLConfig;
29
29
  });
30
+ protected rewriteDbUrl(url: string): string;
30
31
  private getCreateTableSQL;
31
32
  createTable({ tableName, schema, }: {
32
33
  tableName: TABLE_NAMES;
@@ -65,6 +66,7 @@ declare class DefaultStorage extends MastraStorage {
65
66
  saveMessages({ messages }: {
66
67
  messages: MessageType[];
67
68
  }): Promise<MessageType[]>;
69
+ getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
68
70
  }
69
71
 
70
- export { DefaultStorage, type LibSQLConfig, MastraStorage, DefaultStorage as MastraStorageLibSql, StorageColumn, StorageGetMessagesArg, TABLE_NAMES };
72
+ export { DefaultStorage, EvalRow, type LibSQLConfig, MastraStorage, DefaultStorage as MastraStorageLibSql, StorageColumn, StorageGetMessagesArg, TABLE_NAMES };
@@ -1,7 +1,7 @@
1
- export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-EULBQ77C.js';
2
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-5DZIXJRV.js';
3
- import '../chunk-MBOUQZQT.js';
4
- import '../chunk-4LJFWC2Q.js';
1
+ export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-Z7JFMQZZ.js';
2
+ export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-ZJOMHCWE.js';
3
+ import '../chunk-C55JWGDU.js';
5
4
  import '../chunk-G4MCO7XF.js';
6
5
  import '../chunk-ICMEXHKD.js';
6
+ import '../chunk-4LJFWC2Q.js';
7
7
  import '../chunk-AJJZUHB4.js';
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../index-CBxGSZZE.js';
3
- export { U as CoreTool } from '../index-CBxGSZZE.js';
2
+ import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../index-Cwb-5AzX.js';
3
+ export { V as CoreTool } from '../index-Cwb-5AzX.js';
4
4
  import 'ai';
5
5
  import 'json-schema';
6
6
  import '../base.js';
@@ -11,7 +11,7 @@ import 'stream';
11
11
  import '../telemetry-oCUM52DG.js';
12
12
  import '@opentelemetry/sdk-node';
13
13
  import '@opentelemetry/sdk-trace-base';
14
- import '../metric-D2V4CR8D.js';
14
+ import '../metric-BWeQNZt6.js';
15
15
  import 'sift';
16
16
  import '../vector/index.js';
17
17
  import '../tts/index.js';
@@ -1,4 +1,5 @@
1
1
  import { MastraBase } from '../base.js';
2
+ import * as ai from 'ai';
2
3
  import '@opentelemetry/api';
3
4
  import '../index-CBZ2mk2H.js';
4
5
  import 'pino';
@@ -7,6 +8,8 @@ import '../telemetry-oCUM52DG.js';
7
8
  import '@opentelemetry/sdk-node';
8
9
  import '@opentelemetry/sdk-trace-base';
9
10
 
11
+ declare const localEmbedder: (modelId: string) => ai.EmbeddingModel<string>;
12
+
10
13
  interface QueryResult {
11
14
  id: string;
12
15
  score: number;
@@ -28,4 +31,4 @@ declare abstract class MastraVector extends MastraBase {
28
31
  abstract deleteIndex(indexName: string): Promise<void>;
29
32
  }
30
33
 
31
- export { type IndexStats, MastraVector, type QueryResult };
34
+ export { type IndexStats, MastraVector, type QueryResult, localEmbedder };
@@ -1,4 +1,4 @@
1
- export { MastraVector } from '../chunk-MBOUQZQT.js';
1
+ export { MastraVector, localEmbedder } from '../chunk-C55JWGDU.js';
2
2
  import '../chunk-G4MCO7XF.js';
3
3
  import '../chunk-ICMEXHKD.js';
4
4
  import '../chunk-AJJZUHB4.js';
@@ -8,6 +8,7 @@ import 'stream';
8
8
  import '../../telemetry-oCUM52DG.js';
9
9
  import '@opentelemetry/sdk-node';
10
10
  import '@opentelemetry/sdk-trace-base';
11
+ import 'ai';
11
12
 
12
13
  declare class DefaultVectorDB extends MastraVector {
13
14
  private turso;
@@ -17,6 +18,7 @@ declare class DefaultVectorDB extends MastraVector {
17
18
  syncUrl?: string;
18
19
  syncInterval?: number;
19
20
  });
21
+ protected rewriteDbUrl(url: string): string;
20
22
  transformFilter(filter?: Filter): Filter;
21
23
  query(indexName: string, queryVector: number[], topK?: number, filter?: Filter, includeVector?: boolean, minScore?: number): Promise<QueryResult[]>;
22
24
  upsert(indexName: string, vectors: number[][], metadata?: Record<string, any>[], ids?: string[]): Promise<string[]>;
@@ -1,6 +1,6 @@
1
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-5DZIXJRV.js';
2
- import '../../chunk-MBOUQZQT.js';
3
- import '../../chunk-4LJFWC2Q.js';
1
+ export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-ZJOMHCWE.js';
2
+ import '../../chunk-C55JWGDU.js';
4
3
  import '../../chunk-G4MCO7XF.js';
5
4
  import '../../chunk-ICMEXHKD.js';
5
+ import '../../chunk-4LJFWC2Q.js';
6
6
  import '../../chunk-AJJZUHB4.js';
@@ -1,6 +1,6 @@
1
1
  import { Snapshot } from 'xstate';
2
2
  import { z } from 'zod';
3
- import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './index-CBxGSZZE.js';
3
+ import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './index-Cwb-5AzX.js';
4
4
  import { MastraBase } from './base.js';
5
5
 
6
6
  declare class Step<TStepId extends string = any, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends StepExecutionContext<TSchemaIn> = StepExecutionContext<TSchemaIn>> implements StepAction<TStepId, TSchemaIn, TSchemaOut, TContext> {
@@ -1,6 +1,6 @@
1
- export { S as Step, W as Workflow, c as createStep } from '../workflow-BA2Pnq90.js';
2
- import { X as VariableReference, f as StepResult } from '../index-CBxGSZZE.js';
3
- export { Z as ActionContext, Y as BaseCondition, a6 as DependencyCheckOutput, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, $ as StepCondition, e as StepConfig, _ as StepDef, S as StepExecutionContext, h as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, d as StepVariableType, a5 as SubscriberFunctionOutput, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, aa as WorkflowState } from '../index-CBxGSZZE.js';
1
+ export { S as Step, W as Workflow, c as createStep } from '../workflow-DTtv7_Eq.js';
2
+ import { Y as VariableReference, f as StepResult } from '../index-Cwb-5AzX.js';
3
+ export { _ as ActionContext, Z as BaseCondition, a7 as DependencyCheckOutput, ad as ExtractSchemaFromStep, ag as ExtractSchemaType, ae as ExtractStepResult, ah as PathsToStringProps, a4 as ResolverFunctionInput, a5 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, a0 as StepCondition, e as StepConfig, $ as StepDef, S as StepExecutionContext, h as StepGraph, ac as StepId, af as StepInputType, X as StepNode, d as StepVariableType, a6 as SubscriberFunctionOutput, a9 as WorkflowActionParams, aa as WorkflowActions, a8 as WorkflowActors, a1 as WorkflowContext, a3 as WorkflowEvent, a2 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, ab as WorkflowState } from '../index-Cwb-5AzX.js';
4
4
  import 'xstate';
5
5
  import 'zod';
6
6
  import '../base.js';
@@ -13,7 +13,7 @@ import '@opentelemetry/sdk-node';
13
13
  import '@opentelemetry/sdk-trace-base';
14
14
  import 'ai';
15
15
  import 'json-schema';
16
- import '../metric-D2V4CR8D.js';
16
+ import '../metric-BWeQNZt6.js';
17
17
  import 'sift';
18
18
  import '../vector/index.js';
19
19
  import '../tts/index.js';
@@ -1,4 +1,4 @@
1
- export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-E3TBVBIO.js';
1
+ export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-MDM2JS2U.js';
2
2
  import '../chunk-G4MCO7XF.js';
3
3
  import '../chunk-ICMEXHKD.js';
4
4
  import '../chunk-AJJZUHB4.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.2.0-alpha.95",
3
+ "version": "0.2.0-alpha.98",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/core.esm.js",
@@ -58,7 +58,10 @@
58
58
  "@opentelemetry/semantic-conventions": "^1.28.0",
59
59
  "cohere-ai": "^7.15.4",
60
60
  "date-fns": "^3.0.5",
61
+ "dotenv": "^16.4.7",
62
+ "fastembed": "^1.14.1",
61
63
  "json-schema": "^0.4.0",
64
+ "node_modules-path": "^2.0.8",
62
65
  "pino": "^9.6.0",
63
66
  "pino-pretty": "^13.0.0",
64
67
  "radash": "^12.1.0",
@@ -121,8 +124,9 @@
121
124
  "scripts": {
122
125
  "check": "tsc --noEmit",
123
126
  "analyze": "size-limit --why",
124
- "build": "tsup-node src/index.ts src/base.ts src/utils.ts src/*/index.ts src/vector/libsql/index.ts --format esm --clean --dts --treeshake",
125
- "build:dev": "pnpm build --watch",
127
+ "prebuild": "pnpm check",
128
+ "build": "tsup src/index.ts src/base.ts src/utils.ts !src/action/index.ts src/*/index.ts src/vector/libsql/index.ts --format esm --clean --dts --treeshake",
129
+ "build:watch": "pnpm build --watch",
126
130
  "size": "size-limit",
127
131
  "test": "vitest run"
128
132
  }
@@ -1,16 +0,0 @@
1
- import 'zod';
2
- export { I as IAction, ah as IExecutionContext, c as MastraPrimitives } from '../index-CBxGSZZE.js';
3
- import '../index-CBZ2mk2H.js';
4
- import '../telemetry-oCUM52DG.js';
5
- import '../vector/index.js';
6
- import '../tts/index.js';
7
- import 'ai';
8
- import 'json-schema';
9
- import '../base.js';
10
- import '@opentelemetry/api';
11
- import 'pino';
12
- import 'stream';
13
- import '@opentelemetry/sdk-node';
14
- import '@opentelemetry/sdk-trace-base';
15
- import '../metric-D2V4CR8D.js';
16
- import 'sift';
@@ -1 +0,0 @@
1
-