@mastra/core 0.9.2 → 0.9.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.d.cts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/{base-Dq_YZkEc.d.ts → base-BCnFhShR.d.ts} +31 -11
- package/dist/{base-DT2poiVK.d.ts → base-CeEVvwRi.d.ts} +2 -2
- package/dist/{base-BihKcqDY.d.cts → base-D9APQt4V.d.cts} +2 -2
- package/dist/{base-B3g_Q3KV.d.cts → base-VMWGZau0.d.cts} +31 -11
- package/dist/base.cjs +2 -2
- package/dist/base.d.cts +1 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.cts +1 -1
- package/dist/bundler/index.d.ts +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-JTKSOVYL.cjs → chunk-37HZ77Z5.cjs} +13 -12
- package/dist/{chunk-JSKASUR2.cjs → chunk-5ENQX4BI.cjs} +9 -9
- package/dist/{chunk-HAFLSGW5.cjs → chunk-5FZR2ED6.cjs} +22 -22
- package/dist/{chunk-RZCYBC7D.cjs → chunk-6NUAJ6AB.cjs} +2 -2
- package/dist/{chunk-B7N24G5E.cjs → chunk-6YITFTRU.cjs} +2 -2
- package/dist/{chunk-KWYJUFY3.js → chunk-BFNYQFG2.js} +80 -55
- package/dist/chunk-BMSBIZKD.cjs +72 -0
- package/dist/{chunk-6FW4DXZO.cjs → chunk-CBSE7QQX.cjs} +2 -2
- package/dist/{chunk-MNGIRRFY.js → chunk-CPONI4EX.js} +1 -1
- package/dist/{chunk-WAW7QBY4.cjs → chunk-CRHH7KRS.cjs} +2 -2
- package/dist/{chunk-5TFGORLG.js → chunk-DWD7X4KB.js} +1 -1
- package/dist/{chunk-2JNVEJCM.js → chunk-EYMLOJ2Q.js} +6 -5
- package/dist/{chunk-Q6Z2YS6I.js → chunk-FVYYXFPR.js} +2 -2
- package/dist/chunk-FXAV2WYX.cjs +930 -0
- package/dist/{chunk-ZZRFVSYZ.cjs → chunk-GUMHVPHG.cjs} +4 -4
- package/dist/{chunk-2ZK5VAXE.js → chunk-IKZWOULI.js} +2 -2
- package/dist/{chunk-T3UZONPQ.cjs → chunk-ITFMXU6H.cjs} +2 -2
- package/dist/{chunk-IBKW4TJU.js → chunk-JCBDQUQY.js} +1 -1
- package/dist/{chunk-URYHOYKQ.js → chunk-KA5ISUNY.js} +6 -6
- package/dist/{chunk-QV4ZJLWA.js → chunk-KPOUHZFJ.js} +2 -2
- package/dist/{chunk-POEYDVX7.cjs → chunk-KXWR3FNX.cjs} +4 -4
- package/dist/{chunk-SIQPAONL.js → chunk-LIJBCNTU.js} +1 -1
- package/dist/{chunk-CLJQYXNM.js → chunk-NDAW47QQ.js} +6 -2
- package/dist/{chunk-XNBNJEES.cjs → chunk-OGNJRWRQ.cjs} +2 -2
- package/dist/chunk-Q6ZDDQOB.js +70 -0
- package/dist/{chunk-7IAP7VPO.js → chunk-QFJY3MEL.js} +2 -2
- package/dist/{chunk-47NGQPZI.js → chunk-R652KYQW.js} +1 -1
- package/dist/{chunk-FXUTMNQG.cjs → chunk-RE5MNHDE.cjs} +2 -2
- package/dist/{chunk-D63P5O4Q.cjs → chunk-RO52JMKQ.cjs} +6 -2
- package/dist/{chunk-52SRR7WR.js → chunk-T5V4W7WU.js} +1 -1
- package/dist/{chunk-GHK3HBWN.js → chunk-TCL7XDJL.js} +1 -1
- package/dist/{chunk-MYHX5XVW.cjs → chunk-UVRGQEMD.cjs} +79 -53
- package/dist/{chunk-ZVBLRU4W.cjs → chunk-ZMMZXEOL.cjs} +7 -7
- package/dist/chunk-ZQ7FXUGY.js +911 -0
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.d.cts +1 -1
- package/dist/deployer/index.d.ts +1 -1
- package/dist/deployer/index.js +1 -1
- package/dist/eval/index.d.cts +2 -2
- package/dist/eval/index.d.ts +2 -2
- package/dist/index.cjs +78 -74
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +15 -15
- package/dist/integration/index.cjs +3 -3
- package/dist/integration/index.d.cts +2 -2
- package/dist/integration/index.d.ts +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.d.cts +2 -2
- package/dist/llm/index.d.ts +2 -2
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.cts +2 -2
- package/dist/mastra/index.d.ts +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.d.cts +2 -2
- package/dist/memory/index.d.ts +2 -2
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +6 -6
- package/dist/network/index.d.cts +2 -2
- package/dist/network/index.d.ts +2 -2
- package/dist/network/index.js +3 -3
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +2 -2
- package/dist/relevance/index.d.ts +2 -2
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.cjs +1 -0
- package/dist/server/index.d.cts +9 -4
- package/dist/server/index.d.ts +9 -4
- package/dist/server/index.js +1 -0
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.d.cts +2 -2
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.js +1 -1
- package/dist/storage/libsql/index.cjs +2 -2
- package/dist/storage/libsql/index.d.cts +2 -2
- package/dist/storage/libsql/index.d.ts +2 -2
- package/dist/storage/libsql/index.js +1 -1
- package/dist/telemetry/index.cjs +10 -6
- package/dist/telemetry/index.d.cts +14 -4
- package/dist/telemetry/index.d.ts +14 -4
- package/dist/telemetry/index.js +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.cts +2 -2
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.d.cts +1 -1
- package/dist/tts/index.d.ts +1 -1
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +12 -12
- package/dist/utils.d.cts +8 -7
- package/dist/utils.d.ts +8 -7
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.d.cts +3 -1
- package/dist/vector/index.d.ts +3 -1
- package/dist/vector/index.js +1 -1
- package/dist/vector/libsql/index.cjs +3 -3
- package/dist/vector/libsql/index.d.cts +1 -1
- package/dist/vector/libsql/index.d.ts +1 -1
- package/dist/vector/libsql/index.js +1 -1
- package/dist/voice/index.cjs +4 -4
- package/dist/voice/index.d.cts +2 -2
- package/dist/voice/index.d.ts +2 -2
- package/dist/voice/index.js +1 -1
- package/dist/workflows/index.cjs +22 -22
- package/dist/workflows/index.d.cts +3 -3
- package/dist/workflows/index.d.ts +3 -3
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/vNext/index.cjs +175 -138
- package/dist/workflows/vNext/index.d.cts +37 -12
- package/dist/workflows/vNext/index.d.ts +37 -12
- package/dist/workflows/vNext/index.js +171 -134
- package/package.json +7 -5
- package/dist/chunk-D2Y3ET63.cjs +0 -362
- package/dist/chunk-LXIAHZ45.js +0 -37
- package/dist/chunk-YAJVZMZH.cjs +0 -39
- package/dist/chunk-ZCJJ6XOH.js +0 -344
package/dist/agent/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5FZR2ED6_cjs = require('../chunk-5FZR2ED6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Agent", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk5FZR2ED6_cjs.Agent; }
|
|
10
10
|
});
|
package/dist/agent/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export { F as Agent, G as AgentConfig, be as AgentGenerateOptions, bf as AgentStreamOptions, bd as DynamicArgument,
|
|
5
|
-
import '../base-
|
|
4
|
+
export { F as Agent, G as AgentConfig, be as AgentGenerateOptions, bf as AgentStreamOptions, bd as DynamicArgument, b1 as MastraLanguageModel, b3 as ToolsInput, bc as ToolsetsInput } from '../base-VMWGZau0.cjs';
|
|
5
|
+
import '../base-D9APQt4V.cjs';
|
|
6
6
|
import '../types-BtMyV38I.cjs';
|
|
7
7
|
import '../runtime-context/index.cjs';
|
|
8
8
|
import 'sift';
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export { F as Agent, G as AgentConfig, be as AgentGenerateOptions, bf as AgentStreamOptions, bd as DynamicArgument,
|
|
5
|
-
import '../base-
|
|
4
|
+
export { F as Agent, G as AgentConfig, be as AgentGenerateOptions, bf as AgentStreamOptions, bd as DynamicArgument, b1 as MastraLanguageModel, b3 as ToolsInput, bc as ToolsetsInput } from '../base-BCnFhShR.js';
|
|
5
|
+
import '../base-CeEVvwRi.js';
|
|
6
6
|
import '../types-BtMyV38I.js';
|
|
7
7
|
import '../runtime-context/index.js';
|
|
8
8
|
import 'sift';
|
package/dist/agent/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Agent } from '../chunk-
|
|
1
|
+
export { Agent } from '../chunk-KA5ISUNY.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { Tool as Tool$1, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
|
|
3
|
-
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-
|
|
2
|
+
import { Tool as Tool$1, Schema, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
|
|
3
|
+
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-CeEVvwRi.js';
|
|
4
4
|
import { a as Metric, M as MetricResult, T as TestInfo } from './types-BtMyV38I.js';
|
|
5
5
|
import { Query } from 'sift';
|
|
6
6
|
import { z, ZodSchema } from 'zod';
|
|
7
|
-
import { JSONSchema7 } from 'json-schema';
|
|
7
|
+
import { JSONSchema7Type, JSONSchema7 } from 'json-schema';
|
|
8
8
|
import { B as BaseLogMessage, R as RegisteredLogger, L as Logger, d as Run$1 } from './index-CquI0inB.js';
|
|
9
9
|
import { RuntimeContext } from './runtime-context/index.js';
|
|
10
10
|
import { Span } from '@opentelemetry/api';
|
|
@@ -24,7 +24,7 @@ type VercelTool = Tool$1;
|
|
|
24
24
|
type CoreTool = {
|
|
25
25
|
id?: string;
|
|
26
26
|
description?: string;
|
|
27
|
-
parameters: ZodSchema;
|
|
27
|
+
parameters: ZodSchema | JSONSchema7Type | Schema;
|
|
28
28
|
execute?: (params: any, options: ToolExecutionOptions) => Promise<any>;
|
|
29
29
|
} & ({
|
|
30
30
|
type?: 'function' | undefined;
|
|
@@ -1137,7 +1137,9 @@ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema> = (
|
|
|
1137
1137
|
steps: string[];
|
|
1138
1138
|
resumePayload: any;
|
|
1139
1139
|
};
|
|
1140
|
-
emitter:
|
|
1140
|
+
emitter: {
|
|
1141
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
1142
|
+
};
|
|
1141
1143
|
}) => Promise<TStepOutput>;
|
|
1142
1144
|
interface NewStep<TStepId extends string = string, TSchemaIn extends z.ZodType<any> = z.ZodType<any>, TSchemaOut extends z.ZodType<any> = z.ZodType<any>, TResumeSchema extends z.ZodType<any> = z.ZodType<any>, TSuspendSchema extends z.ZodType<any> = z.ZodType<any>> {
|
|
1143
1145
|
id: TStepId;
|
|
@@ -1156,7 +1158,7 @@ type StepSuccess<T> = {
|
|
|
1156
1158
|
};
|
|
1157
1159
|
type StepFailure = {
|
|
1158
1160
|
status: 'failed';
|
|
1159
|
-
error: string;
|
|
1161
|
+
error: string | Error;
|
|
1160
1162
|
};
|
|
1161
1163
|
type StepSuspended<T> = {
|
|
1162
1164
|
status: 'suspended';
|
|
@@ -1242,7 +1244,9 @@ declare abstract class ExecutionEngine extends MastraBase {
|
|
|
1242
1244
|
resumePayload: any;
|
|
1243
1245
|
resumePath: number[];
|
|
1244
1246
|
};
|
|
1245
|
-
emitter:
|
|
1247
|
+
emitter: {
|
|
1248
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
1249
|
+
};
|
|
1246
1250
|
runtimeContext: RuntimeContext;
|
|
1247
1251
|
retryConfig?: {
|
|
1248
1252
|
attempts?: number;
|
|
@@ -1283,7 +1287,7 @@ type StepFlowEntry = {
|
|
|
1283
1287
|
};
|
|
1284
1288
|
type SerializedStep = Pick<NewStep, 'id' | 'description'> & {
|
|
1285
1289
|
component?: string;
|
|
1286
|
-
|
|
1290
|
+
serializedStepFlow?: SerializedStepFlowEntry[];
|
|
1287
1291
|
};
|
|
1288
1292
|
type SerializedStepFlowEntry = {
|
|
1289
1293
|
type: 'step';
|
|
@@ -1398,6 +1402,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1398
1402
|
delay?: number;
|
|
1399
1403
|
};
|
|
1400
1404
|
constructor({ mastra, id, inputSchema, outputSchema, description, executionEngine, retryConfig, steps, }: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>);
|
|
1405
|
+
get runs(): Map<string, Run<TSteps, TInput, TOutput>>;
|
|
1401
1406
|
get mastra(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, NewWorkflow<NewStep<string, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger, Record<string, AgentNetwork>> | undefined;
|
|
1402
1407
|
__registerMastra(mastra: Mastra): void;
|
|
1403
1408
|
__registerPrimitives(p: MastraPrimitives): void;
|
|
@@ -1464,7 +1469,9 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1464
1469
|
resumePayload: any;
|
|
1465
1470
|
runId?: string;
|
|
1466
1471
|
};
|
|
1467
|
-
emitter:
|
|
1472
|
+
emitter: {
|
|
1473
|
+
emit: (event: string, data: any) => void;
|
|
1474
|
+
};
|
|
1468
1475
|
mastra: Mastra;
|
|
1469
1476
|
}): Promise<z.infer<TOutput>>;
|
|
1470
1477
|
getWorkflowRuns(args?: {
|
|
@@ -2124,13 +2131,21 @@ type AgentStreamOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefine
|
|
|
2124
2131
|
threadId: string;
|
|
2125
2132
|
}) & (Z extends undefined ? DefaultLLMStreamOptions : DefaultLLMStreamObjectOptions);
|
|
2126
2133
|
|
|
2127
|
-
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
2134
|
+
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'ALL';
|
|
2128
2135
|
type ApiRoute = {
|
|
2129
2136
|
path: string;
|
|
2130
2137
|
method: Methods;
|
|
2131
2138
|
handler: Handler;
|
|
2132
2139
|
middleware?: MiddlewareHandler | MiddlewareHandler[];
|
|
2133
2140
|
openapi?: DescribeRouteOptions;
|
|
2141
|
+
} | {
|
|
2142
|
+
path: string;
|
|
2143
|
+
method: Methods;
|
|
2144
|
+
createHandler: ({ mastra }: {
|
|
2145
|
+
mastra: Mastra;
|
|
2146
|
+
}) => Promise<Handler>;
|
|
2147
|
+
middleware?: MiddlewareHandler | MiddlewareHandler[];
|
|
2148
|
+
openapi?: DescribeRouteOptions;
|
|
2134
2149
|
};
|
|
2135
2150
|
type Middleware = MiddlewareHandler | {
|
|
2136
2151
|
path: string;
|
|
@@ -2184,6 +2199,11 @@ type ServerConfig = {
|
|
|
2184
2199
|
*/
|
|
2185
2200
|
openAPIDocs?: boolean;
|
|
2186
2201
|
};
|
|
2202
|
+
/**
|
|
2203
|
+
* Body size limit for the server
|
|
2204
|
+
* @default 4.5mb
|
|
2205
|
+
*/
|
|
2206
|
+
bodySizeLimit?: number;
|
|
2187
2207
|
};
|
|
2188
2208
|
|
|
2189
2209
|
interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow> = Record<string, Workflow>, TNewWorkflows extends Record<string, NewWorkflow> = Record<string, NewWorkflow>, TVectors extends Record<string, MastraVector> = Record<string, MastraVector>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends Logger = Logger, TNetworks extends Record<string, AgentNetwork> = Record<string, AgentNetwork>> {
|
|
@@ -2676,4 +2696,4 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
2676
2696
|
}): Promise<WorkflowRun | null>;
|
|
2677
2697
|
}
|
|
2678
2698
|
|
|
2679
|
-
export { type CoreToolMessage as $, type ApiRoute as A, type WatchEvent as B, type ToolAction as C, type DynamicMapping as D, type EvalRow as E, Agent as F, type AgentConfig as G, MastraMemory as H, type ToolExecutionContext as I, Tool as J, Step as K, Workflow as L, type Methods as M, type NewStep as N, type WorkflowOptions as O, type PathsToStringProps as P, type LanguageModel as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreSystemMessage as X, type CoreAssistantMessage as Y, type ZodPathType as Z, type CoreUserMessage as _, Mastra as a, type WorkflowRunState as a$, type EmbedResult as a0, type EmbedManyResult as a1, type BaseStructuredOutputType as a2, type StructuredOutputType as a3, type StructuredOutputArrayItem as a4, type StructuredOutput as a5, type GenerateReturn as a6, type StreamReturn as a7, type OutputType as a8, type DefaultLLMTextOptions as a9, type BaseCondition as aA, type ActionContext as aB, WhenConditionReturnValue as aC, type StepDef as aD, type StepCondition as aE, type StepConfig as aF, type StepResult$1 as aG, type StepsRecord$1 as aH, type WorkflowRunResult as aI, type WorkflowContext as aJ, type WorkflowLogMessage as aK, type WorkflowEvent as aL, type ResolverFunctionInput as aM, type ResolverFunctionOutput as aN, type SubscriberFunctionOutput as aO, type DependencyCheckOutput as aP, type StepResolverOutput as aQ, type WorkflowActors as aR, type WorkflowActionParams as aS, type WorkflowActions as aT, type WorkflowState as aU, type StepId as aV, type ExtractSchemaFromStep$1 as aW, type ExtractStepResult as aX, type StepInputType as aY, type ExtractSchemaType$1 as aZ, type PathsToStringProps$1 as a_, type DefaultLLMTextObjectOptions as aa, type DefaultLLMStreamOptions as ab, type DefaultLLMStreamObjectOptions as ac, type LLMTextOptions as ad, type LLMTextObjectOptions as ae, type LLMStreamOptions as af, type LLMInnerStreamOptions as ag, type LLMStreamObjectOptions as ah, createMockModel as ai, type Config as aj, type MessageResponse as ak, type MemoryConfig as al, type SharedMemoryConfig as am, type MemoryProcessorOpts as an, MemoryProcessor as ao, memoryDefaultOptions as ap, createTool as aq, type VercelTool as ar, type CoreTool as as, type StepExecutionContext as at, type StepAction as au, type StepVariableType as av, type StepNode as aw, type StepGraph as ax, type RetryConfig as ay, type VariableReference$1 as az, MastraStorage as b, type WorkflowResumeResult as b0, type
|
|
2699
|
+
export { type CoreToolMessage as $, type ApiRoute as A, type WatchEvent as B, type ToolAction as C, type DynamicMapping as D, type EvalRow as E, Agent as F, type AgentConfig as G, MastraMemory as H, type ToolExecutionContext as I, Tool as J, Step as K, Workflow as L, type Methods as M, type NewStep as N, type WorkflowOptions as O, type PathsToStringProps as P, type LanguageModel as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreSystemMessage as X, type CoreAssistantMessage as Y, type ZodPathType as Z, type CoreUserMessage as _, Mastra as a, type WorkflowRunState as a$, type EmbedResult as a0, type EmbedManyResult as a1, type BaseStructuredOutputType as a2, type StructuredOutputType as a3, type StructuredOutputArrayItem as a4, type StructuredOutput as a5, type GenerateReturn as a6, type StreamReturn as a7, type OutputType as a8, type DefaultLLMTextOptions as a9, type BaseCondition as aA, type ActionContext as aB, WhenConditionReturnValue as aC, type StepDef as aD, type StepCondition as aE, type StepConfig as aF, type StepResult$1 as aG, type StepsRecord$1 as aH, type WorkflowRunResult as aI, type WorkflowContext as aJ, type WorkflowLogMessage as aK, type WorkflowEvent as aL, type ResolverFunctionInput as aM, type ResolverFunctionOutput as aN, type SubscriberFunctionOutput as aO, type DependencyCheckOutput as aP, type StepResolverOutput as aQ, type WorkflowActors as aR, type WorkflowActionParams as aS, type WorkflowActions as aT, type WorkflowState as aU, type StepId as aV, type ExtractSchemaFromStep$1 as aW, type ExtractStepResult as aX, type StepInputType as aY, type ExtractSchemaType$1 as aZ, type PathsToStringProps$1 as a_, type DefaultLLMTextObjectOptions as aa, type DefaultLLMStreamOptions as ab, type DefaultLLMStreamObjectOptions as ac, type LLMTextOptions as ad, type LLMTextObjectOptions as ae, type LLMStreamOptions as af, type LLMInnerStreamOptions as ag, type LLMStreamObjectOptions as ah, createMockModel as ai, type Config as aj, type MessageResponse as ak, type MemoryConfig as al, type SharedMemoryConfig as am, type MemoryProcessorOpts as an, MemoryProcessor as ao, memoryDefaultOptions as ap, createTool as aq, type VercelTool as ar, type CoreTool as as, type StepExecutionContext as at, type StepAction as au, type StepVariableType as av, type StepNode as aw, type StepGraph as ax, type RetryConfig as ay, type VariableReference$1 as az, MastraStorage as b, type WorkflowResumeResult as b0, type MastraLanguageModel as b1, type MastraPrimitives as b2, type ToolsInput as b3, AgentNetwork as b4, type AgentNetworkConfig as b5, type VoiceEventType as b6, type VoiceEventMap as b7, type VoiceConfig as b8, MastraVoice as b9, CompositeVoice as ba, DefaultVoice as bb, type ToolsetsInput as bc, type DynamicArgument as bd, type AgentGenerateOptions as be, type AgentStreamOptions as bf, TABLE_WORKFLOW_SNAPSHOT as bg, TABLE_EVALS as bh, TABLE_MESSAGES as bi, TABLE_THREADS as bj, TABLE_TRACES as bk, TABLE_SCHEMAS as bl, type StorageThreadType as c, type MessageType as d, type StorageGetMessagesArg as e, type WorkflowRun as f, ExecutionEngine as g, type StepResult as h, type ExecutionGraph as i, type StepFlowEntry as j, type ExecuteFunction as k, type SerializedStep as l, type SerializedStepFlowEntry as m, createStep as n, cloneStep as o, createWorkflow as p, cloneWorkflow as q, type WorkflowResult as r, type NewWorkflowConfig as s, NewWorkflow as t, type StepSuccess as u, type StepFailure as v, type StepSuspended as w, type StepsRecord as x, type ExtractSchemaType as y, type ExtractSchemaFromStep as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
|
-
import { Tracer, Span, Context } from '@opentelemetry/api';
|
|
2
|
+
import { Tracer, Span, BaggageEntry, Context } from '@opentelemetry/api';
|
|
3
3
|
import { R as RegisteredLogger, L as Logger } from './index-CquI0inB.js';
|
|
4
4
|
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
|
|
@@ -96,7 +96,7 @@ declare class Telemetry {
|
|
|
96
96
|
/** Skip tracing if telemetry is not active */
|
|
97
97
|
skipIfNoTelemetry?: boolean;
|
|
98
98
|
}): T;
|
|
99
|
-
static setBaggage(baggage: Record<string,
|
|
99
|
+
static setBaggage(baggage: Record<string, BaggageEntry>, ctx?: Context): Context;
|
|
100
100
|
static withContext(ctx: Context, fn: () => void): void;
|
|
101
101
|
/**
|
|
102
102
|
* method to trace individual methods with proper context
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
|
-
import { Tracer, Span, Context } from '@opentelemetry/api';
|
|
2
|
+
import { Tracer, Span, BaggageEntry, Context } from '@opentelemetry/api';
|
|
3
3
|
import { R as RegisteredLogger, L as Logger } from './index-CquI0inB.cjs';
|
|
4
4
|
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
|
|
@@ -96,7 +96,7 @@ declare class Telemetry {
|
|
|
96
96
|
/** Skip tracing if telemetry is not active */
|
|
97
97
|
skipIfNoTelemetry?: boolean;
|
|
98
98
|
}): T;
|
|
99
|
-
static setBaggage(baggage: Record<string,
|
|
99
|
+
static setBaggage(baggage: Record<string, BaggageEntry>, ctx?: Context): Context;
|
|
100
100
|
static withContext(ctx: Context, fn: () => void): void;
|
|
101
101
|
/**
|
|
102
102
|
* method to trace individual methods with proper context
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { Tool as Tool$1, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
|
|
3
|
-
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-
|
|
2
|
+
import { Tool as Tool$1, Schema, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
|
|
3
|
+
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-D9APQt4V.cjs';
|
|
4
4
|
import { a as Metric, M as MetricResult, T as TestInfo } from './types-BtMyV38I.cjs';
|
|
5
5
|
import { Query } from 'sift';
|
|
6
6
|
import { z, ZodSchema } from 'zod';
|
|
7
|
-
import { JSONSchema7 } from 'json-schema';
|
|
7
|
+
import { JSONSchema7Type, JSONSchema7 } from 'json-schema';
|
|
8
8
|
import { B as BaseLogMessage, R as RegisteredLogger, L as Logger, d as Run$1 } from './index-CquI0inB.cjs';
|
|
9
9
|
import { RuntimeContext } from './runtime-context/index.cjs';
|
|
10
10
|
import { Span } from '@opentelemetry/api';
|
|
@@ -24,7 +24,7 @@ type VercelTool = Tool$1;
|
|
|
24
24
|
type CoreTool = {
|
|
25
25
|
id?: string;
|
|
26
26
|
description?: string;
|
|
27
|
-
parameters: ZodSchema;
|
|
27
|
+
parameters: ZodSchema | JSONSchema7Type | Schema;
|
|
28
28
|
execute?: (params: any, options: ToolExecutionOptions) => Promise<any>;
|
|
29
29
|
} & ({
|
|
30
30
|
type?: 'function' | undefined;
|
|
@@ -1137,7 +1137,9 @@ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema> = (
|
|
|
1137
1137
|
steps: string[];
|
|
1138
1138
|
resumePayload: any;
|
|
1139
1139
|
};
|
|
1140
|
-
emitter:
|
|
1140
|
+
emitter: {
|
|
1141
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
1142
|
+
};
|
|
1141
1143
|
}) => Promise<TStepOutput>;
|
|
1142
1144
|
interface NewStep<TStepId extends string = string, TSchemaIn extends z.ZodType<any> = z.ZodType<any>, TSchemaOut extends z.ZodType<any> = z.ZodType<any>, TResumeSchema extends z.ZodType<any> = z.ZodType<any>, TSuspendSchema extends z.ZodType<any> = z.ZodType<any>> {
|
|
1143
1145
|
id: TStepId;
|
|
@@ -1156,7 +1158,7 @@ type StepSuccess<T> = {
|
|
|
1156
1158
|
};
|
|
1157
1159
|
type StepFailure = {
|
|
1158
1160
|
status: 'failed';
|
|
1159
|
-
error: string;
|
|
1161
|
+
error: string | Error;
|
|
1160
1162
|
};
|
|
1161
1163
|
type StepSuspended<T> = {
|
|
1162
1164
|
status: 'suspended';
|
|
@@ -1242,7 +1244,9 @@ declare abstract class ExecutionEngine extends MastraBase {
|
|
|
1242
1244
|
resumePayload: any;
|
|
1243
1245
|
resumePath: number[];
|
|
1244
1246
|
};
|
|
1245
|
-
emitter:
|
|
1247
|
+
emitter: {
|
|
1248
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
1249
|
+
};
|
|
1246
1250
|
runtimeContext: RuntimeContext;
|
|
1247
1251
|
retryConfig?: {
|
|
1248
1252
|
attempts?: number;
|
|
@@ -1283,7 +1287,7 @@ type StepFlowEntry = {
|
|
|
1283
1287
|
};
|
|
1284
1288
|
type SerializedStep = Pick<NewStep, 'id' | 'description'> & {
|
|
1285
1289
|
component?: string;
|
|
1286
|
-
|
|
1290
|
+
serializedStepFlow?: SerializedStepFlowEntry[];
|
|
1287
1291
|
};
|
|
1288
1292
|
type SerializedStepFlowEntry = {
|
|
1289
1293
|
type: 'step';
|
|
@@ -1398,6 +1402,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1398
1402
|
delay?: number;
|
|
1399
1403
|
};
|
|
1400
1404
|
constructor({ mastra, id, inputSchema, outputSchema, description, executionEngine, retryConfig, steps, }: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>);
|
|
1405
|
+
get runs(): Map<string, Run<TSteps, TInput, TOutput>>;
|
|
1401
1406
|
get mastra(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, Workflow<Step<string, any, any, StepExecutionContext<any, WorkflowContext<any, Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, NewWorkflow<NewStep<string, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector>, Record<string, MastraTTS>, Logger, Record<string, AgentNetwork>> | undefined;
|
|
1402
1407
|
__registerMastra(mastra: Mastra): void;
|
|
1403
1408
|
__registerPrimitives(p: MastraPrimitives): void;
|
|
@@ -1464,7 +1469,9 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1464
1469
|
resumePayload: any;
|
|
1465
1470
|
runId?: string;
|
|
1466
1471
|
};
|
|
1467
|
-
emitter:
|
|
1472
|
+
emitter: {
|
|
1473
|
+
emit: (event: string, data: any) => void;
|
|
1474
|
+
};
|
|
1468
1475
|
mastra: Mastra;
|
|
1469
1476
|
}): Promise<z.infer<TOutput>>;
|
|
1470
1477
|
getWorkflowRuns(args?: {
|
|
@@ -2124,13 +2131,21 @@ type AgentStreamOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefine
|
|
|
2124
2131
|
threadId: string;
|
|
2125
2132
|
}) & (Z extends undefined ? DefaultLLMStreamOptions : DefaultLLMStreamObjectOptions);
|
|
2126
2133
|
|
|
2127
|
-
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
2134
|
+
type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'ALL';
|
|
2128
2135
|
type ApiRoute = {
|
|
2129
2136
|
path: string;
|
|
2130
2137
|
method: Methods;
|
|
2131
2138
|
handler: Handler;
|
|
2132
2139
|
middleware?: MiddlewareHandler | MiddlewareHandler[];
|
|
2133
2140
|
openapi?: DescribeRouteOptions;
|
|
2141
|
+
} | {
|
|
2142
|
+
path: string;
|
|
2143
|
+
method: Methods;
|
|
2144
|
+
createHandler: ({ mastra }: {
|
|
2145
|
+
mastra: Mastra;
|
|
2146
|
+
}) => Promise<Handler>;
|
|
2147
|
+
middleware?: MiddlewareHandler | MiddlewareHandler[];
|
|
2148
|
+
openapi?: DescribeRouteOptions;
|
|
2134
2149
|
};
|
|
2135
2150
|
type Middleware = MiddlewareHandler | {
|
|
2136
2151
|
path: string;
|
|
@@ -2184,6 +2199,11 @@ type ServerConfig = {
|
|
|
2184
2199
|
*/
|
|
2185
2200
|
openAPIDocs?: boolean;
|
|
2186
2201
|
};
|
|
2202
|
+
/**
|
|
2203
|
+
* Body size limit for the server
|
|
2204
|
+
* @default 4.5mb
|
|
2205
|
+
*/
|
|
2206
|
+
bodySizeLimit?: number;
|
|
2187
2207
|
};
|
|
2188
2208
|
|
|
2189
2209
|
interface Config<TAgents extends Record<string, Agent<any>> = Record<string, Agent<any>>, TWorkflows extends Record<string, Workflow> = Record<string, Workflow>, TNewWorkflows extends Record<string, NewWorkflow> = Record<string, NewWorkflow>, TVectors extends Record<string, MastraVector> = Record<string, MastraVector>, TTTS extends Record<string, MastraTTS> = Record<string, MastraTTS>, TLogger extends Logger = Logger, TNetworks extends Record<string, AgentNetwork> = Record<string, AgentNetwork>> {
|
|
@@ -2676,4 +2696,4 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
2676
2696
|
}): Promise<WorkflowRun | null>;
|
|
2677
2697
|
}
|
|
2678
2698
|
|
|
2679
|
-
export { type CoreToolMessage as $, type ApiRoute as A, type WatchEvent as B, type ToolAction as C, type DynamicMapping as D, type EvalRow as E, Agent as F, type AgentConfig as G, MastraMemory as H, type ToolExecutionContext as I, Tool as J, Step as K, Workflow as L, type Methods as M, type NewStep as N, type WorkflowOptions as O, type PathsToStringProps as P, type LanguageModel as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreSystemMessage as X, type CoreAssistantMessage as Y, type ZodPathType as Z, type CoreUserMessage as _, Mastra as a, type WorkflowRunState as a$, type EmbedResult as a0, type EmbedManyResult as a1, type BaseStructuredOutputType as a2, type StructuredOutputType as a3, type StructuredOutputArrayItem as a4, type StructuredOutput as a5, type GenerateReturn as a6, type StreamReturn as a7, type OutputType as a8, type DefaultLLMTextOptions as a9, type BaseCondition as aA, type ActionContext as aB, WhenConditionReturnValue as aC, type StepDef as aD, type StepCondition as aE, type StepConfig as aF, type StepResult$1 as aG, type StepsRecord$1 as aH, type WorkflowRunResult as aI, type WorkflowContext as aJ, type WorkflowLogMessage as aK, type WorkflowEvent as aL, type ResolverFunctionInput as aM, type ResolverFunctionOutput as aN, type SubscriberFunctionOutput as aO, type DependencyCheckOutput as aP, type StepResolverOutput as aQ, type WorkflowActors as aR, type WorkflowActionParams as aS, type WorkflowActions as aT, type WorkflowState as aU, type StepId as aV, type ExtractSchemaFromStep$1 as aW, type ExtractStepResult as aX, type StepInputType as aY, type ExtractSchemaType$1 as aZ, type PathsToStringProps$1 as a_, type DefaultLLMTextObjectOptions as aa, type DefaultLLMStreamOptions as ab, type DefaultLLMStreamObjectOptions as ac, type LLMTextOptions as ad, type LLMTextObjectOptions as ae, type LLMStreamOptions as af, type LLMInnerStreamOptions as ag, type LLMStreamObjectOptions as ah, createMockModel as ai, type Config as aj, type MessageResponse as ak, type MemoryConfig as al, type SharedMemoryConfig as am, type MemoryProcessorOpts as an, MemoryProcessor as ao, memoryDefaultOptions as ap, createTool as aq, type VercelTool as ar, type CoreTool as as, type StepExecutionContext as at, type StepAction as au, type StepVariableType as av, type StepNode as aw, type StepGraph as ax, type RetryConfig as ay, type VariableReference$1 as az, MastraStorage as b, type WorkflowResumeResult as b0, type
|
|
2699
|
+
export { type CoreToolMessage as $, type ApiRoute as A, type WatchEvent as B, type ToolAction as C, type DynamicMapping as D, type EvalRow as E, Agent as F, type AgentConfig as G, MastraMemory as H, type ToolExecutionContext as I, Tool as J, Step as K, Workflow as L, type Methods as M, type NewStep as N, type WorkflowOptions as O, type PathsToStringProps as P, type LanguageModel as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreSystemMessage as X, type CoreAssistantMessage as Y, type ZodPathType as Z, type CoreUserMessage as _, Mastra as a, type WorkflowRunState as a$, type EmbedResult as a0, type EmbedManyResult as a1, type BaseStructuredOutputType as a2, type StructuredOutputType as a3, type StructuredOutputArrayItem as a4, type StructuredOutput as a5, type GenerateReturn as a6, type StreamReturn as a7, type OutputType as a8, type DefaultLLMTextOptions as a9, type BaseCondition as aA, type ActionContext as aB, WhenConditionReturnValue as aC, type StepDef as aD, type StepCondition as aE, type StepConfig as aF, type StepResult$1 as aG, type StepsRecord$1 as aH, type WorkflowRunResult as aI, type WorkflowContext as aJ, type WorkflowLogMessage as aK, type WorkflowEvent as aL, type ResolverFunctionInput as aM, type ResolverFunctionOutput as aN, type SubscriberFunctionOutput as aO, type DependencyCheckOutput as aP, type StepResolverOutput as aQ, type WorkflowActors as aR, type WorkflowActionParams as aS, type WorkflowActions as aT, type WorkflowState as aU, type StepId as aV, type ExtractSchemaFromStep$1 as aW, type ExtractStepResult as aX, type StepInputType as aY, type ExtractSchemaType$1 as aZ, type PathsToStringProps$1 as a_, type DefaultLLMTextObjectOptions as aa, type DefaultLLMStreamOptions as ab, type DefaultLLMStreamObjectOptions as ac, type LLMTextOptions as ad, type LLMTextObjectOptions as ae, type LLMStreamOptions as af, type LLMInnerStreamOptions as ag, type LLMStreamObjectOptions as ah, createMockModel as ai, type Config as aj, type MessageResponse as ak, type MemoryConfig as al, type SharedMemoryConfig as am, type MemoryProcessorOpts as an, MemoryProcessor as ao, memoryDefaultOptions as ap, createTool as aq, type VercelTool as ar, type CoreTool as as, type StepExecutionContext as at, type StepAction as au, type StepVariableType as av, type StepNode as aw, type StepGraph as ax, type RetryConfig as ay, type VariableReference$1 as az, MastraStorage as b, type WorkflowResumeResult as b0, type MastraLanguageModel as b1, type MastraPrimitives as b2, type ToolsInput as b3, AgentNetwork as b4, type AgentNetworkConfig as b5, type VoiceEventType as b6, type VoiceEventMap as b7, type VoiceConfig as b8, MastraVoice as b9, CompositeVoice as ba, DefaultVoice as bb, type ToolsetsInput as bc, type DynamicArgument as bd, type AgentGenerateOptions as be, type AgentStreamOptions as bf, TABLE_WORKFLOW_SNAPSHOT as bg, TABLE_EVALS as bh, TABLE_MESSAGES as bi, TABLE_THREADS as bj, TABLE_TRACES as bk, TABLE_SCHEMAS as bl, type StorageThreadType as c, type MessageType as d, type StorageGetMessagesArg as e, type WorkflowRun as f, ExecutionEngine as g, type StepResult as h, type ExecutionGraph as i, type StepFlowEntry as j, type ExecuteFunction as k, type SerializedStep as l, type SerializedStepFlowEntry as m, createStep as n, cloneStep as o, createWorkflow as p, cloneWorkflow as q, type WorkflowResult as r, type NewWorkflowConfig as s, NewWorkflow as t, type StepSuccess as u, type StepFailure as v, type StepSuspended as w, type StepsRecord as x, type ExtractSchemaType as y, type ExtractSchemaFromStep as z };
|
package/dist/base.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRO52JMKQ_cjs = require('./chunk-RO52JMKQ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "MastraBase", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkRO52JMKQ_cjs.MastraBase; }
|
|
10
10
|
});
|
package/dist/base.d.cts
CHANGED
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraBase } from './chunk-
|
|
1
|
+
export { MastraBase } from './chunk-NDAW47QQ.js';
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCRHH7KRS_cjs = require('../chunk-CRHH7KRS.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "MastraBundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkCRHH7KRS_cjs.MastraBundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.d.cts
CHANGED
package/dist/bundler/index.d.ts
CHANGED
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraBundler } from '../chunk-
|
|
1
|
+
export { MastraBundler } from '../chunk-TCL7XDJL.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkITFMXU6H_cjs = require('./chunk-ITFMXU6H.cjs');
|
|
4
|
+
var chunkRE5MNHDE_cjs = require('./chunk-RE5MNHDE.cjs');
|
|
5
|
+
var chunkFXAV2WYX_cjs = require('./chunk-FXAV2WYX.cjs');
|
|
6
|
+
var chunkRO52JMKQ_cjs = require('./chunk-RO52JMKQ.cjs');
|
|
7
7
|
var fs = require('fs');
|
|
8
8
|
var path = require('path');
|
|
9
9
|
var fsp = require('fs/promises');
|
|
@@ -113,7 +113,7 @@ var fastEmbedProvider = ai.experimental_customProvider({
|
|
|
113
113
|
var defaultEmbedder = fastEmbedProvider.textEmbeddingModel;
|
|
114
114
|
|
|
115
115
|
// src/memory/memory.ts
|
|
116
|
-
var MemoryProcessor = class extends
|
|
116
|
+
var MemoryProcessor = class extends chunkRO52JMKQ_cjs.MastraBase {
|
|
117
117
|
/**
|
|
118
118
|
* Process a list of messages and return a filtered or transformed list.
|
|
119
119
|
* @param messages The messages to process
|
|
@@ -163,7 +163,7 @@ var newMemoryDefaultOptions = {
|
|
|
163
163
|
// new
|
|
164
164
|
use: "tool-call"}
|
|
165
165
|
};
|
|
166
|
-
var MastraMemory = class extends
|
|
166
|
+
var MastraMemory = class extends chunkRO52JMKQ_cjs.MastraBase {
|
|
167
167
|
MAX_CONTEXT_TOKENS;
|
|
168
168
|
storage;
|
|
169
169
|
vector;
|
|
@@ -182,7 +182,7 @@ var MastraMemory = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
182
182
|
if (config.storage) {
|
|
183
183
|
this.storage = config.storage;
|
|
184
184
|
} else {
|
|
185
|
-
this.storage = new
|
|
185
|
+
this.storage = new chunkRE5MNHDE_cjs.DefaultProxyStorage({
|
|
186
186
|
config: {
|
|
187
187
|
url: "file:memory.db"
|
|
188
188
|
}
|
|
@@ -236,7 +236,7 @@ export const yourAgent = new Agent({
|
|
|
236
236
|
})
|
|
237
237
|
`);
|
|
238
238
|
}
|
|
239
|
-
this.storage =
|
|
239
|
+
this.storage = chunkRE5MNHDE_cjs.augmentWithInit(this.storage);
|
|
240
240
|
const semanticRecallIsEnabled = this.threadConfig.semanticRecall !== false;
|
|
241
241
|
if (config.vector && semanticRecallIsEnabled) {
|
|
242
242
|
this.vector = config.vector;
|
|
@@ -279,7 +279,7 @@ export const agent = new Agent({
|
|
|
279
279
|
})
|
|
280
280
|
})
|
|
281
281
|
`);
|
|
282
|
-
this.vector = new
|
|
282
|
+
this.vector = new chunkITFMXU6H_cjs.LibSQLVector({
|
|
283
283
|
// TODO: MAY 20th BREAKING CHANGE: remove this default and throw an error if semantic recall is enabled but there's no vector db
|
|
284
284
|
connectionUrl: hasOldDb ? `file:${oldDb}` : `file:${newDb}`
|
|
285
285
|
});
|
|
@@ -422,7 +422,7 @@ ${messages.length ? messages.map((ft) => ft.message).join(`
|
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
setStorage(storage) {
|
|
425
|
-
if (storage instanceof
|
|
425
|
+
if (storage instanceof chunkRE5MNHDE_cjs.DefaultProxyStorage) {
|
|
426
426
|
this.deprecationWarnings.push(`Importing "DefaultStorage" from '@mastra/core/storage/libsql' is deprecated.
|
|
427
427
|
|
|
428
428
|
Instead of:
|
|
@@ -460,7 +460,8 @@ Do:
|
|
|
460
460
|
const defaultDimensions = 1536;
|
|
461
461
|
const isDefault = dimensions === defaultDimensions;
|
|
462
462
|
const usedDimensions = dimensions ?? defaultDimensions;
|
|
463
|
-
const
|
|
463
|
+
const separator = this.vector?.indexSeparator ?? "_";
|
|
464
|
+
const indexName = isDefault ? `memory${separator}messages` : `memory${separator}messages${separator}${usedDimensions}`;
|
|
464
465
|
if (typeof this.vector === `undefined`) {
|
|
465
466
|
throw new Error(`Tried to create embedding index but no vector db is attached to this Memory instance.`);
|
|
466
467
|
}
|
|
@@ -471,7 +472,7 @@ Do:
|
|
|
471
472
|
return { indexName };
|
|
472
473
|
}
|
|
473
474
|
getMergedThreadConfig(config) {
|
|
474
|
-
return
|
|
475
|
+
return chunkFXAV2WYX_cjs.deepMerge(this.threadConfig, config || {});
|
|
475
476
|
}
|
|
476
477
|
/**
|
|
477
478
|
* Apply all configured message processors to a list of messages.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkRE5MNHDE_cjs = require('./chunk-RE5MNHDE.cjs');
|
|
4
|
+
var chunkUVRGQEMD_cjs = require('./chunk-UVRGQEMD.cjs');
|
|
5
5
|
var chunkO7IW545H_cjs = require('./chunk-O7IW545H.cjs');
|
|
6
6
|
var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
|
|
7
7
|
|
|
8
8
|
// src/mastra/index.ts
|
|
9
9
|
var _Mastra_decorators, _init;
|
|
10
|
-
_Mastra_decorators = [
|
|
10
|
+
_Mastra_decorators = [chunkUVRGQEMD_cjs.InstrumentClass({
|
|
11
11
|
prefix: "mastra",
|
|
12
12
|
excludeMethods: ["getLogger", "getTelemetry"]
|
|
13
13
|
})];
|
|
@@ -67,14 +67,14 @@ exports.Mastra = class Mastra {
|
|
|
67
67
|
this.#logger = logger;
|
|
68
68
|
let storage = config?.storage;
|
|
69
69
|
if (!storage) {
|
|
70
|
-
storage = new
|
|
70
|
+
storage = new chunkRE5MNHDE_cjs.DefaultProxyStorage({
|
|
71
71
|
config: {
|
|
72
72
|
url: process.env.MASTRA_DEFAULT_STORAGE_URL || `:memory:`
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
storage =
|
|
77
|
-
this.#telemetry =
|
|
76
|
+
storage = chunkRE5MNHDE_cjs.augmentWithInit(storage);
|
|
77
|
+
this.#telemetry = chunkUVRGQEMD_cjs.Telemetry.init(config?.telemetry);
|
|
78
78
|
if (this.#telemetry) {
|
|
79
79
|
this.#storage = this.#telemetry.traceClass(storage, {
|
|
80
80
|
excludeMethods: ["__setTelemetry", "__getTelemetry", "batchTraceInsert"]
|
|
@@ -285,7 +285,7 @@ This is a warning for now, but will throw an error in the future
|
|
|
285
285
|
return this.#vnext_workflows;
|
|
286
286
|
}
|
|
287
287
|
setStorage(storage) {
|
|
288
|
-
if (storage instanceof
|
|
288
|
+
if (storage instanceof chunkRE5MNHDE_cjs.DefaultProxyStorage) {
|
|
289
289
|
this.#logger.warn(`Importing "DefaultStorage" from '@mastra/core/storage/libsql' is deprecated.
|
|
290
290
|
|
|
291
291
|
Instead of:
|
|
@@ -295,7 +295,7 @@ Do:
|
|
|
295
295
|
import { LibSQLStore } from '@mastra/libsql';
|
|
296
296
|
`);
|
|
297
297
|
}
|
|
298
|
-
this.#storage =
|
|
298
|
+
this.#storage = chunkRE5MNHDE_cjs.augmentWithInit(storage);
|
|
299
299
|
}
|
|
300
300
|
setLogger({
|
|
301
301
|
logger
|
|
@@ -327,7 +327,7 @@ Do:
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
setTelemetry(telemetry) {
|
|
330
|
-
this.#telemetry =
|
|
330
|
+
this.#telemetry = chunkUVRGQEMD_cjs.Telemetry.init(telemetry);
|
|
331
331
|
if (this.#agents) {
|
|
332
332
|
Object.keys(this.#agents).forEach(key => {
|
|
333
333
|
if (this.#telemetry) {
|