@mastra/core 0.4.2-alpha.1 → 0.4.2-alpha.2

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 (58) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +1 -1
  3. package/dist/{base-eWkcLLSb.d.ts → base-D90KQ4XI.d.ts} +1 -1
  4. package/dist/{base-HowPMmsb.d.ts → base-hk-xmLC1.d.ts} +8 -6
  5. package/dist/base.d.ts +3 -3
  6. package/dist/base.js +1 -1
  7. package/dist/bundler/index.d.ts +3 -3
  8. package/dist/bundler/index.js +1 -1
  9. package/dist/{chunk-LKOVXFLE.js → chunk-33GSTUNK.js} +4 -4
  10. package/dist/{chunk-Z735LDV7.js → chunk-4YRYBCOZ.js} +1 -1
  11. package/dist/chunk-55NFNRKO.js +10 -0
  12. package/dist/chunk-5XPCMNGW.js +215 -0
  13. package/dist/{chunk-T5B2DATI.js → chunk-7TG2Y45H.js} +8 -8
  14. package/dist/{chunk-HPIB5X7E.js → chunk-KM7PRKJ2.js} +5 -5
  15. package/dist/{chunk-XD7K4XPP.js → chunk-M626YCHO.js} +106 -6
  16. package/dist/{chunk-6RDA4JYW.js → chunk-OZ4XVJ6F.js} +1 -1
  17. package/dist/{chunk-KP5SHTKA.js → chunk-PHMSPCTC.js} +2 -2
  18. package/dist/{chunk-VGVST36A.js → chunk-PL6URKH2.js} +1 -1
  19. package/dist/{chunk-NDQR6IPC.js → chunk-QAAJAHDB.js} +2 -2
  20. package/dist/{chunk-YUOADWSP.js → chunk-SVEAENO7.js} +2 -2
  21. package/dist/{chunk-4ZRHVG25.js → chunk-W5HVJX45.js} +5 -5
  22. package/dist/{chunk-TCMOYQ74.js → chunk-XVS6QFTX.js} +20 -4
  23. package/dist/{chunk-JIV6PDIN.js → chunk-YLCBP7MP.js} +7 -217
  24. package/dist/deployer/index.d.ts +3 -3
  25. package/dist/deployer/index.js +1 -1
  26. package/dist/eval/index.d.ts +4 -4
  27. package/dist/{index-C5uPdbs4.d.ts → index-mKY1XrpK.d.ts} +2 -2
  28. package/dist/index.d.ts +11 -19
  29. package/dist/index.js +15 -26
  30. package/dist/integration/index.d.ts +5 -5
  31. package/dist/llm/index.d.ts +4 -4
  32. package/dist/logger/index.d.ts +2 -2
  33. package/dist/logger/index.js +1 -1
  34. package/dist/mastra/index.d.ts +5 -5
  35. package/dist/mastra/index.js +1 -1
  36. package/dist/memory/index.d.ts +4 -4
  37. package/dist/memory/index.js +1 -1
  38. package/dist/relevance/index.js +1 -1
  39. package/dist/storage/index.d.ts +7 -76
  40. package/dist/storage/index.js +1 -2
  41. package/dist/storage/libsql/index.d.ts +81 -0
  42. package/dist/storage/libsql/index.js +1 -0
  43. package/dist/telemetry/index.d.ts +4 -4
  44. package/dist/telemetry/index.js +1 -1
  45. package/dist/tools/index.d.ts +6 -6
  46. package/dist/tts/index.d.ts +3 -3
  47. package/dist/tts/index.js +1 -1
  48. package/dist/vector/index.d.ts +4 -7
  49. package/dist/vector/index.js +1 -1
  50. package/dist/vector/libsql/index.d.ts +5 -6
  51. package/dist/vector/libsql/index.js +1 -1
  52. package/dist/voice/index.d.ts +3 -3
  53. package/dist/voice/index.js +2 -2
  54. package/dist/{workflow-CPz2D0Wz.d.ts → workflow-BxyFP9Wv.d.ts} +3 -3
  55. package/dist/workflows/index.d.ts +6 -6
  56. package/dist/workflows/index.js +1 -1
  57. package/package.json +9 -12
  58. package/dist/chunk-7NPRQT5A.js +0 -111
@@ -1,84 +1,15 @@
1
- import { M as MastraStorage, ag as TABLE_NAMES, k as StorageColumn, J as StorageThreadType, H as MessageType, m as StorageGetMessagesArg, E as EvalRow } from '../base-HowPMmsb.js';
2
- export { ai as TABLE_EVALS, aj as TABLE_MESSAGES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, l as WorkflowRow } from '../base-HowPMmsb.js';
3
- import '../base-eWkcLLSb.js';
4
- export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../vector/libsql/index.js';
1
+ export { E as EvalRow, M as MastraStorage, S as StorageColumn, d as StorageGetMessagesArg, ai as TABLE_EVALS, aj as TABLE_MESSAGES, T as TABLE_NAMES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, p as WorkflowRow } from '../base-hk-xmLC1.js';
5
2
  import 'ai';
3
+ import '../base-D90KQ4XI.js';
4
+ import '@opentelemetry/api';
5
+ import '../index-mKY1XrpK.js';
6
+ import 'stream';
7
+ import 'pino';
8
+ import '@opentelemetry/sdk-trace-base';
6
9
  import '../types-m9RryK9a.js';
7
10
  import 'sift';
8
11
  import 'zod';
9
12
  import 'json-schema';
10
13
  import '../vector/index.js';
11
- import '@opentelemetry/api';
12
- import '../index-C5uPdbs4.js';
13
- import 'pino';
14
- import 'stream';
15
- import '@opentelemetry/sdk-trace-base';
16
14
  import '../voice/index.js';
17
15
  import '../tts/index.js';
18
- import '../filter/index.js';
19
-
20
- interface LibSQLConfig {
21
- url: string;
22
- authToken?: string;
23
- }
24
- declare class DefaultStorage extends MastraStorage {
25
- private client;
26
- constructor({ config }: {
27
- config: LibSQLConfig;
28
- });
29
- protected rewriteDbUrl(url: string): string;
30
- private getCreateTableSQL;
31
- createTable({ tableName, schema, }: {
32
- tableName: TABLE_NAMES;
33
- schema: Record<string, StorageColumn>;
34
- }): Promise<void>;
35
- clearTable({ tableName }: {
36
- tableName: TABLE_NAMES;
37
- }): Promise<void>;
38
- private prepareStatement;
39
- insert({ tableName, record }: {
40
- tableName: TABLE_NAMES;
41
- record: Record<string, any>;
42
- }): Promise<void>;
43
- batchInsert({ tableName, records }: {
44
- tableName: TABLE_NAMES;
45
- records: Record<string, any>[];
46
- }): Promise<void>;
47
- load<R>({ tableName, keys }: {
48
- tableName: TABLE_NAMES;
49
- keys: Record<string, string>;
50
- }): Promise<R | null>;
51
- getThreadById({ threadId }: {
52
- threadId: string;
53
- }): Promise<StorageThreadType | null>;
54
- getThreadsByResourceId({ resourceId }: {
55
- resourceId: string;
56
- }): Promise<StorageThreadType[]>;
57
- saveThread({ thread }: {
58
- thread: StorageThreadType;
59
- }): Promise<StorageThreadType>;
60
- updateThread({ id, title, metadata, }: {
61
- id: string;
62
- title: string;
63
- metadata: Record<string, unknown>;
64
- }): Promise<StorageThreadType>;
65
- deleteThread({ threadId }: {
66
- threadId: string;
67
- }): Promise<void>;
68
- private parseRow;
69
- getMessages<T extends MessageType[]>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
70
- saveMessages({ messages }: {
71
- messages: MessageType[];
72
- }): Promise<MessageType[]>;
73
- private transformEvalRow;
74
- getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
75
- getTraces({ name, scope, page, perPage, attributes, }?: {
76
- name?: string;
77
- scope?: string;
78
- page: number;
79
- perPage: number;
80
- attributes?: Record<string, string>;
81
- }): Promise<any[]>;
82
- }
83
-
84
- export { DefaultStorage, EvalRow, type LibSQLConfig, MastraStorage, DefaultStorage as MastraStorageLibSql, StorageColumn, StorageGetMessagesArg, TABLE_NAMES };
@@ -1,3 +1,2 @@
1
- export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-JIV6PDIN.js';
2
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-LKOVXFLE.js';
1
+ export { MastraStorage } from '../chunk-5XPCMNGW.js';
3
2
  export { TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT } from '../chunk-RG66XEJT.js';
@@ -0,0 +1,81 @@
1
+ import { M as MastraStorage, T as TABLE_NAMES, S as StorageColumn, b as StorageThreadType, c as MessageType, d as StorageGetMessagesArg, E as EvalRow } from '../../base-hk-xmLC1.js';
2
+ import 'ai';
3
+ import '../../base-D90KQ4XI.js';
4
+ import '@opentelemetry/api';
5
+ import '../../index-mKY1XrpK.js';
6
+ import 'stream';
7
+ import 'pino';
8
+ import '@opentelemetry/sdk-trace-base';
9
+ import '../../types-m9RryK9a.js';
10
+ import 'sift';
11
+ import 'zod';
12
+ import 'json-schema';
13
+ import '../../vector/index.js';
14
+ import '../../voice/index.js';
15
+ import '../../tts/index.js';
16
+
17
+ interface LibSQLConfig {
18
+ url: string;
19
+ authToken?: string;
20
+ }
21
+ declare class LibSQLStore extends MastraStorage {
22
+ private client;
23
+ constructor({ config }: {
24
+ config: LibSQLConfig;
25
+ });
26
+ protected rewriteDbUrl(url: string): string;
27
+ private getCreateTableSQL;
28
+ createTable({ tableName, schema, }: {
29
+ tableName: TABLE_NAMES;
30
+ schema: Record<string, StorageColumn>;
31
+ }): Promise<void>;
32
+ clearTable({ tableName }: {
33
+ tableName: TABLE_NAMES;
34
+ }): Promise<void>;
35
+ private prepareStatement;
36
+ insert({ tableName, record }: {
37
+ tableName: TABLE_NAMES;
38
+ record: Record<string, any>;
39
+ }): Promise<void>;
40
+ batchInsert({ tableName, records }: {
41
+ tableName: TABLE_NAMES;
42
+ records: Record<string, any>[];
43
+ }): Promise<void>;
44
+ load<R>({ tableName, keys }: {
45
+ tableName: TABLE_NAMES;
46
+ keys: Record<string, string>;
47
+ }): Promise<R | null>;
48
+ getThreadById({ threadId }: {
49
+ threadId: string;
50
+ }): Promise<StorageThreadType | null>;
51
+ getThreadsByResourceId({ resourceId }: {
52
+ resourceId: string;
53
+ }): Promise<StorageThreadType[]>;
54
+ saveThread({ thread }: {
55
+ thread: StorageThreadType;
56
+ }): Promise<StorageThreadType>;
57
+ updateThread({ id, title, metadata, }: {
58
+ id: string;
59
+ title: string;
60
+ metadata: Record<string, unknown>;
61
+ }): Promise<StorageThreadType>;
62
+ deleteThread({ threadId }: {
63
+ threadId: string;
64
+ }): Promise<void>;
65
+ private parseRow;
66
+ getMessages<T extends MessageType[]>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
67
+ saveMessages({ messages }: {
68
+ messages: MessageType[];
69
+ }): Promise<MessageType[]>;
70
+ private transformEvalRow;
71
+ getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
72
+ getTraces({ name, scope, page, perPage, attributes, }?: {
73
+ name?: string;
74
+ scope?: string;
75
+ page: number;
76
+ perPage: number;
77
+ attributes?: Record<string, string>;
78
+ }): Promise<any[]>;
79
+ }
80
+
81
+ export { LibSQLStore as DefaultStorage, type LibSQLConfig, LibSQLStore };
@@ -0,0 +1 @@
1
+ export { LibSQLStore as DefaultStorage, LibSQLStore } from '../../chunk-YLCBP7MP.js';
@@ -1,11 +1,11 @@
1
- export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from '../base-eWkcLLSb.js';
1
+ export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from '../base-D90KQ4XI.js';
2
2
  import { SpanKind } from '@opentelemetry/api';
3
3
  import { ExportResult } from '@opentelemetry/core';
4
4
  import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
5
- import { L as Logger } from '../index-C5uPdbs4.js';
6
- import { M as MastraStorage } from '../base-HowPMmsb.js';
7
- import 'pino';
5
+ import { L as Logger } from '../index-mKY1XrpK.js';
6
+ import { M as MastraStorage } from '../base-hk-xmLC1.js';
8
7
  import 'stream';
8
+ import 'pino';
9
9
  import 'ai';
10
10
  import '../types-m9RryK9a.js';
11
11
  import 'sift';
@@ -1 +1 @@
1
- export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from '../chunk-4ZRHVG25.js';
1
+ export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from '../chunk-W5HVJX45.js';
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../base-HowPMmsb.js';
3
- export { Q as CoreTool } from '../base-HowPMmsb.js';
2
+ import { o as ToolExecutionContext, m as ToolAction, g as MastraPrimitives } from '../base-hk-xmLC1.js';
3
+ export { U as CoreTool } from '../base-hk-xmLC1.js';
4
4
  import 'ai';
5
- import '../base-eWkcLLSb.js';
5
+ import '../base-D90KQ4XI.js';
6
6
  import '@opentelemetry/api';
7
- import '../index-C5uPdbs4.js';
8
- import 'pino';
7
+ import '../index-mKY1XrpK.js';
9
8
  import 'stream';
9
+ import 'pino';
10
10
  import '@opentelemetry/sdk-trace-base';
11
11
  import '../types-m9RryK9a.js';
12
12
  import 'sift';
@@ -20,7 +20,7 @@ declare class Tool<TId extends string, TSchemaIn extends z.ZodSchema | undefined
20
20
  description?: string;
21
21
  inputSchema?: TSchemaIn;
22
22
  outputSchema?: TSchemaOut;
23
- execute: (context: TContext) => Promise<TSchemaOut extends z.ZodSchema ? z.infer<TSchemaOut> : unknown>;
23
+ execute?: (context: TContext) => Promise<TSchemaOut extends z.ZodSchema ? z.infer<TSchemaOut> : unknown>;
24
24
  mastra?: MastraPrimitives;
25
25
  constructor(opts: ToolAction<TId, TSchemaIn, TSchemaOut, TContext>);
26
26
  }
@@ -1,8 +1,8 @@
1
- import { M as MastraBase } from '../base-eWkcLLSb.js';
1
+ import { M as MastraBase } from '../base-D90KQ4XI.js';
2
2
  import '@opentelemetry/api';
3
- import '../index-C5uPdbs4.js';
4
- import 'pino';
3
+ import '../index-mKY1XrpK.js';
5
4
  import 'stream';
5
+ import 'pino';
6
6
  import '@opentelemetry/sdk-trace-base';
7
7
 
8
8
  interface BuiltInModelConfig {
package/dist/tts/index.js CHANGED
@@ -1 +1 @@
1
- export { MastraTTS } from '../chunk-NDQR6IPC.js';
1
+ export { MastraTTS } from '../chunk-QAAJAHDB.js';
@@ -1,13 +1,10 @@
1
- import { M as MastraBase } from '../base-eWkcLLSb.js';
2
- import * as ai from 'ai';
1
+ import { M as MastraBase } from '../base-D90KQ4XI.js';
3
2
  import '@opentelemetry/api';
4
- import '../index-C5uPdbs4.js';
5
- import 'pino';
3
+ import '../index-mKY1XrpK.js';
6
4
  import 'stream';
5
+ import 'pino';
7
6
  import '@opentelemetry/sdk-trace-base';
8
7
 
9
- declare const defaultEmbedder: ((modelId: string) => ai.EmbeddingModel<string>) & ((modelId: "bge-small-en-v1.5" | "bge-base-en-v1.5") => ai.EmbeddingModel<string>);
10
-
11
8
  interface QueryResult {
12
9
  id: string;
13
10
  score: number;
@@ -29,4 +26,4 @@ declare abstract class MastraVector extends MastraBase {
29
26
  abstract deleteIndex(indexName: string): Promise<void>;
30
27
  }
31
28
 
32
- export { type IndexStats, MastraVector, type QueryResult, defaultEmbedder };
29
+ export { type IndexStats, MastraVector, type QueryResult };
@@ -1 +1 @@
1
- export { MastraVector, defaultEmbedder } from '../chunk-7NPRQT5A.js';
1
+ export { MastraVector } from '../chunk-55NFNRKO.js';
@@ -1,14 +1,13 @@
1
1
  import { Filter } from '../../filter/index.js';
2
2
  import { MastraVector, QueryResult, IndexStats } from '../index.js';
3
- import '../../base-eWkcLLSb.js';
3
+ import '../../base-D90KQ4XI.js';
4
4
  import '@opentelemetry/api';
5
- import '../../index-C5uPdbs4.js';
6
- import 'pino';
5
+ import '../../index-mKY1XrpK.js';
7
6
  import 'stream';
7
+ import 'pino';
8
8
  import '@opentelemetry/sdk-trace-base';
9
- import 'ai';
10
9
 
11
- declare class DefaultVectorDB extends MastraVector {
10
+ declare class LibSQLVector extends MastraVector {
12
11
  private turso;
13
12
  constructor({ connectionUrl, authToken, syncUrl, syncInterval, }: {
14
13
  connectionUrl: string;
@@ -27,4 +26,4 @@ declare class DefaultVectorDB extends MastraVector {
27
26
  truncateIndex(indexName: string): Promise<void>;
28
27
  }
29
28
 
30
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector };
29
+ export { LibSQLVector as DefaultVectorDB, LibSQLVector };
@@ -1 +1 @@
1
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-LKOVXFLE.js';
1
+ export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../../chunk-33GSTUNK.js';
@@ -1,8 +1,8 @@
1
- import { M as MastraBase } from '../base-eWkcLLSb.js';
1
+ import { M as MastraBase } from '../base-D90KQ4XI.js';
2
2
  import '@opentelemetry/api';
3
- import '../index-C5uPdbs4.js';
4
- import 'pino';
3
+ import '../index-mKY1XrpK.js';
5
4
  import 'stream';
5
+ import 'pino';
6
6
  import '@opentelemetry/sdk-trace-base';
7
7
 
8
8
  interface BuiltInModelConfig {
@@ -1,5 +1,5 @@
1
- import { InstrumentClass } from '../chunk-4ZRHVG25.js';
2
- import { MastraBase } from '../chunk-6RDA4JYW.js';
1
+ import { InstrumentClass } from '../chunk-W5HVJX45.js';
2
+ import { MastraBase } from '../chunk-OZ4XVJ6F.js';
3
3
  import { __decoratorStart, __decorateElement, __runInitializers } from '../chunk-C6A6W6XS.js';
4
4
 
5
5
  // src/voice/voice.ts
@@ -1,7 +1,7 @@
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 './base-HowPMmsb.js';
4
- import { M as MastraBase } from './base-eWkcLLSb.js';
3
+ import { e as StepExecutionContext, f as StepAction, R as RetryConfig, g as MastraPrimitives, W as WorkflowOptions, I as IAction, h as StepVariableType, i as StepConfig, j as StepResult, k as WorkflowRunState, l as StepGraph } from './base-hk-xmLC1.js';
4
+ import { M as MastraBase } from './base-D90KQ4XI.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> {
7
7
  id: TStepId;
@@ -9,7 +9,7 @@ declare class Step<TStepId extends string = any, TSchemaIn extends z.ZodSchema |
9
9
  inputSchema?: TSchemaIn;
10
10
  outputSchema?: TSchemaOut;
11
11
  payload?: TSchemaIn extends z.ZodSchema ? Partial<z.infer<TSchemaIn>> : unknown;
12
- execute: (context: TContext) => Promise<TSchemaOut extends z.ZodSchema ? z.infer<TSchemaOut> : unknown>;
12
+ execute?: (context: TContext) => Promise<TSchemaOut extends z.ZodSchema ? z.infer<TSchemaOut> : unknown>;
13
13
  retryConfig?: RetryConfig;
14
14
  mastra?: MastraPrimitives;
15
15
  constructor({ id, description, execute, payload, outputSchema, inputSchema, retryConfig, }: StepAction<TStepId, TSchemaIn, TSchemaOut, TContext>);
@@ -1,13 +1,13 @@
1
- export { S as Step, W as Workflow, c as createStep } from '../workflow-CPz2D0Wz.js';
2
- import { V as VariableReference, f as StepResult } from '../base-HowPMmsb.js';
3
- export { Y as ActionContext, X as BaseCondition, a5 as DependencyCheckOutput, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, d as StepVariableType, a4 as SubscriberFunctionOutput, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, a9 as WorkflowState } from '../base-HowPMmsb.js';
1
+ export { S as Step, W as Workflow, c as createStep } from '../workflow-BxyFP9Wv.js';
2
+ import { X as VariableReference, j as StepResult } from '../base-hk-xmLC1.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, f as StepAction, $ as StepCondition, i as StepConfig, _ as StepDef, e as StepExecutionContext, l as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, h 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, k as WorkflowRunState, aa as WorkflowState } from '../base-hk-xmLC1.js';
4
4
  import 'xstate';
5
5
  import 'zod';
6
- import '../base-eWkcLLSb.js';
6
+ import '../base-D90KQ4XI.js';
7
7
  import '@opentelemetry/api';
8
- import '../index-C5uPdbs4.js';
9
- import 'pino';
8
+ import '../index-mKY1XrpK.js';
10
9
  import 'stream';
10
+ import 'pino';
11
11
  import '@opentelemetry/sdk-trace-base';
12
12
  import 'ai';
13
13
  import '../types-m9RryK9a.js';
@@ -1 +1 @@
1
- export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-TCMOYQ74.js';
1
+ export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-XVS6QFTX.js';
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.4.2-alpha.1",
3
+ "version": "0.4.2-alpha.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "main": "dist/core.esm.js",
6
+ "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist"
@@ -21,6 +21,12 @@
21
21
  "default": "./dist/*/index.js"
22
22
  }
23
23
  },
24
+ "./storage/libsql": {
25
+ "import": {
26
+ "types": "./dist/storage/libsql/index.d.ts",
27
+ "default": "./dist/storage/libsql/index.js"
28
+ }
29
+ },
24
30
  "./vector/libsql": {
25
31
  "import": {
26
32
  "types": "./dist/vector/libsql/index.d.ts",
@@ -88,6 +94,7 @@
88
94
  "@types/pino": "^7.0.5",
89
95
  "@types/qs": "^6.9.15",
90
96
  "eslint": "^9.20.1",
97
+ "rollup": "^4.30.1",
91
98
  "size-limit": "^11.1.4",
92
99
  "tsup": "^8.3.6",
93
100
  "typescript": "^5.7.3",
@@ -97,16 +104,6 @@
97
104
  "engines": {
98
105
  "node": ">=20"
99
106
  },
100
- "size-limit": [
101
- {
102
- "path": "dist/mylib.cjs.production.min.js",
103
- "limit": "10 KB"
104
- },
105
- {
106
- "path": "dist/mylib.esm.js",
107
- "limit": "10 KB"
108
- }
109
- ],
110
107
  "keywords": [
111
108
  "ai",
112
109
  "llm",
@@ -1,111 +0,0 @@
1
- import { MastraBase } from './chunk-6RDA4JYW.js';
2
- import { experimental_customProvider } from 'ai';
3
- import node_modulesPath from 'node_modules-path';
4
- import path from 'path';
5
-
6
- var cachedPath = false;
7
- function getModelCachePath() {
8
- if (cachedPath) return cachedPath;
9
- const firstNodeModules = node_modulesPath().split("node_modules")[0];
10
- cachedPath = path.join(firstNodeModules, "node_modules", ".fastembed-model-cache");
11
- return cachedPath;
12
- }
13
- function unbundleableImport(name) {
14
- const nonStaticallyAnalyzableName = `${name}?d=${Date.now()}`;
15
- return import(nonStaticallyAnalyzableName.split(`?`)[0]);
16
- }
17
- async function generateEmbeddings(values, modelType) {
18
- try {
19
- let mod;
20
- const importErrors = [];
21
- {
22
- try {
23
- mod = await unbundleableImport("fastembed");
24
- } catch (e) {
25
- if (e instanceof Error) {
26
- importErrors.push(e);
27
- } else {
28
- throw e;
29
- }
30
- }
31
- }
32
- if (!mod) {
33
- throw new Error(`${importErrors.map((e) => e.message).join(`
34
- `)}
35
-
36
- This runtime does not support fastembed-js, which is the default embedder in Mastra.
37
- Scroll up to read import errors. These errors mean you can't use the default Mastra embedder on this hosting platform.
38
- You can either use Mastra Cloud which supports the default embedder, or you can configure an alternate provider.
39
-
40
- For example if you're using Memory:
41
-
42
- import { openai } from "@ai-sdk/openai";
43
-
44
- const memory = new Memory({
45
- embedder: openai.embedding("text-embedding-3-small"), // <- doesn't have to be openai
46
- })
47
-
48
- Visit https://sdk.vercel.ai/docs/foundations/overview#embedding-models to find an alternate embedding provider
49
-
50
- If you do not want to use the Memory semantic recall feature, you can disable it entirely and this error will go away.
51
-
52
- const memory = new Memory({
53
- options: {
54
- semanticRecall: false // <- an embedder will not be required with this set to false
55
- }
56
- })
57
- `);
58
- }
59
- const { FlagEmbedding, EmbeddingModel } = mod;
60
- const model = await FlagEmbedding.init({
61
- model: EmbeddingModel[modelType],
62
- cacheDir: getModelCachePath()
63
- });
64
- const embeddings = await model.embed(values);
65
- const allResults = [];
66
- for await (const result of embeddings) {
67
- allResults.push(...result.map((embedding) => Array.from(embedding)));
68
- }
69
- if (allResults.length === 0) throw new Error("No embeddings generated");
70
- return {
71
- embeddings: allResults
72
- };
73
- } catch (error) {
74
- console.error("Error generating embeddings:", error);
75
- throw error;
76
- }
77
- }
78
- var fastEmbedProvider = experimental_customProvider({
79
- textEmbeddingModels: {
80
- "bge-small-en-v1.5": {
81
- specificationVersion: "v1",
82
- provider: "fastembed",
83
- modelId: "bge-small-en-v1.5",
84
- maxEmbeddingsPerCall: 256,
85
- supportsParallelCalls: true,
86
- async doEmbed({ values }) {
87
- return generateEmbeddings(values, "BGESmallENV15");
88
- }
89
- },
90
- "bge-base-en-v1.5": {
91
- specificationVersion: "v1",
92
- provider: "fastembed",
93
- modelId: "bge-base-en-v1.5",
94
- maxEmbeddingsPerCall: 256,
95
- supportsParallelCalls: true,
96
- async doEmbed({ values }) {
97
- return generateEmbeddings(values, "BGEBaseENV15");
98
- }
99
- }
100
- }
101
- });
102
- var defaultEmbedder = fastEmbedProvider.textEmbeddingModel;
103
-
104
- // src/vector/index.ts
105
- var MastraVector = class extends MastraBase {
106
- constructor() {
107
- super({ name: "MastraVector", component: "VECTOR" });
108
- }
109
- };
110
-
111
- export { MastraVector, defaultEmbedder };