@mastra/core 0.9.1-alpha.3 → 0.9.1-alpha.5
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 +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/{base-CuXWXbrh.d.ts → base-BS0LLAna.d.ts} +69 -46
- package/dist/{base-mr-hn8v_.d.cts → base-QJ_GwQxQ.d.cts} +69 -46
- package/dist/{chunk-V7IE36YV.cjs → chunk-33XQ5DGU.cjs} +9 -9
- package/dist/{chunk-KWV5ZLOF.js → chunk-52SRR7WR.js} +1 -1
- package/dist/{chunk-TNILINST.cjs → chunk-6KB5CPBV.cjs} +1 -0
- package/dist/{chunk-ZRMY72JX.js → chunk-7IAP7VPO.js} +1 -1
- package/dist/{chunk-YTTBFAQJ.cjs → chunk-7JRVDC7F.cjs} +4 -1
- package/dist/{chunk-422BXQRT.cjs → chunk-7PRLYMXV.cjs} +242 -101
- package/dist/{chunk-SGTFVHOZ.js → chunk-7ZR64JAJ.js} +1 -1
- package/dist/{chunk-7AGAXO6B.cjs → chunk-CFWUR4PX.cjs} +16 -61
- package/dist/{chunk-PS2ZF6MA.js → chunk-FA7FWCKH.js} +1 -1
- package/dist/{chunk-4K4DHXRF.js → chunk-H2UWWO4L.js} +234 -93
- package/dist/{chunk-6AHC67YY.js → chunk-J7WRPNIY.js} +2 -2
- package/dist/{chunk-34622N67.js → chunk-JSUPD5IG.js} +4 -1
- package/dist/{chunk-YZFNMXY4.cjs → chunk-KF5VBC5P.cjs} +6 -6
- package/dist/{chunk-HFOT2NFM.js → chunk-KWYJUFY3.js} +1 -1
- package/dist/{chunk-BU45BMXY.js → chunk-KYULILA6.js} +2 -2
- package/dist/{chunk-U5DGGGS2.cjs → chunk-MAWT75XY.cjs} +2 -2
- package/dist/{chunk-RIBNDTA6.cjs → chunk-MYHX5XVW.cjs} +2 -2
- package/dist/{chunk-FKUPMQZP.cjs → chunk-POEYDVX7.cjs} +2 -2
- package/dist/{chunk-MWLZJBPF.js → chunk-Q6Z2YS6I.js} +1 -1
- package/dist/{chunk-ANYT6KP7.js → chunk-SEOWDGC2.js} +1 -0
- package/dist/{chunk-BFF2O6RO.js → chunk-SHDPMWGJ.js} +1 -1
- package/dist/{chunk-FPM2XCMS.cjs → chunk-XNBNJEES.cjs} +19 -19
- package/dist/{chunk-VMVXIPGW.js → chunk-YEA2KXXJ.js} +12 -57
- package/dist/{chunk-27PAET7X.cjs → chunk-ZKRQS3N5.cjs} +2 -2
- package/dist/{chunk-CEXM6WP5.cjs → chunk-ZWALP7T2.cjs} +2 -2
- package/dist/{chunk-P6KJ7FZZ.cjs → chunk-ZZRFVSYZ.cjs} +2 -2
- package/dist/eval/index.d.cts +1 -1
- package/dist/eval/index.d.ts +1 -1
- package/dist/index.cjs +62 -62
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/integration/index.cjs +3 -3
- package/dist/integration/index.d.cts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.d.cts +1 -1
- package/dist/llm/index.d.ts +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.ts +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +4 -4
- package/dist/network/index.d.cts +1 -1
- package/dist/network/index.d.ts +1 -1
- package/dist/network/index.js +2 -2
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +1 -1
- package/dist/relevance/index.d.ts +1 -1
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/storage/index.cjs +9 -9
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +2 -2
- package/dist/storage/libsql/index.cjs +19 -16
- package/dist/storage/libsql/index.d.cts +12 -17
- package/dist/storage/libsql/index.d.ts +12 -17
- package/dist/storage/libsql/index.js +5 -2
- package/dist/telemetry/index.cjs +6 -6
- package/dist/telemetry/index.d.cts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.cts +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +14 -14
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/voice/index.cjs +4 -4
- package/dist/voice/index.d.cts +7 -19
- package/dist/voice/index.d.ts +7 -19
- package/dist/voice/index.js +1 -1
- package/dist/workflows/index.cjs +22 -22
- package/dist/workflows/index.d.cts +2 -2
- package/dist/workflows/index.d.ts +2 -2
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/vNext/index.cjs +4 -4
- package/dist/workflows/vNext/index.d.cts +2 -2
- package/dist/workflows/vNext/index.d.ts +2 -2
- package/dist/workflows/vNext/index.js +2 -2
- package/package.json +4 -4
package/dist/agent/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7PRLYMXV_cjs = require('../chunk-7PRLYMXV.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 chunk7PRLYMXV_cjs.Agent; }
|
|
10
10
|
});
|
package/dist/agent/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export {
|
|
4
|
+
export { B as Agent, C as AgentConfig, bb as AgentGenerateOptions, bc as AgentStreamOptions, ba as DynamicArgument, a_ as MastraLanguageModel, a$ as ToolsInput, b9 as ToolsetsInput } from '../base-QJ_GwQxQ.cjs';
|
|
5
5
|
import '../base-BihKcqDY.cjs';
|
|
6
6
|
import '../types-BtMyV38I.cjs';
|
|
7
7
|
import '../runtime-context/index.cjs';
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Message as AiMessageType } from 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export {
|
|
4
|
+
export { B as Agent, C as AgentConfig, bb as AgentGenerateOptions, bc as AgentStreamOptions, ba as DynamicArgument, a_ as MastraLanguageModel, a$ as ToolsInput, b9 as ToolsetsInput } from '../base-BS0LLAna.js';
|
|
5
5
|
import '../base-DT2poiVK.js';
|
|
6
6
|
import '../types-BtMyV38I.js';
|
|
7
7
|
import '../runtime-context/index.js';
|
package/dist/agent/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Agent } from '../chunk-
|
|
1
|
+
export { Agent } from '../chunk-H2UWWO4L.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
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
3
|
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-DT2poiVK.js';
|
|
4
4
|
import { a as Metric, M as MetricResult, T as TestInfo } from './types-BtMyV38I.js';
|
|
5
5
|
import { Query } from 'sift';
|
|
@@ -1484,13 +1484,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1484
1484
|
mastra: Mastra;
|
|
1485
1485
|
}): Promise<z.infer<TOutput>>;
|
|
1486
1486
|
getWorkflowRuns(): Promise<WorkflowRuns>;
|
|
1487
|
-
getWorkflowRun(runId: string): Promise<
|
|
1488
|
-
workflowName: string;
|
|
1489
|
-
runId: string;
|
|
1490
|
-
snapshot: WorkflowRunState | string;
|
|
1491
|
-
createdAt: Date;
|
|
1492
|
-
updatedAt: Date;
|
|
1493
|
-
} | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1487
|
+
getWorkflowRun(runId: string): Promise<WorkflowRun | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1494
1488
|
}
|
|
1495
1489
|
/**
|
|
1496
1490
|
* Represents a workflow run that can be executed
|
|
@@ -1802,8 +1796,7 @@ type DefaultLLMTextObjectOptions = Omit<GenerateObjectOptions, MastraCustomLLMOp
|
|
|
1802
1796
|
type DefaultLLMStreamOptions = Omit<StreamTextOptions, MastraCustomLLMOptionsKeys>;
|
|
1803
1797
|
type DefaultLLMStreamObjectOptions = Omit<StreamObjectOptions, MastraCustomLLMOptionsKeys>;
|
|
1804
1798
|
type MastraCustomLLMOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefined> = {
|
|
1805
|
-
tools?:
|
|
1806
|
-
convertedTools?: Record<string, CoreTool>;
|
|
1799
|
+
tools?: Record<string, CoreTool>;
|
|
1807
1800
|
onStepFinish?: (step: unknown) => void;
|
|
1808
1801
|
experimental_output?: Z;
|
|
1809
1802
|
telemetry?: TelemetrySettings;
|
|
@@ -2022,22 +2015,34 @@ declare class CompositeVoice extends MastraVoice<unknown, unknown, unknown, Tool
|
|
|
2022
2015
|
off<E extends VoiceEventType>(event: E, callback: (data: E extends keyof VoiceEventMap ? VoiceEventMap[E] : unknown) => void): void;
|
|
2023
2016
|
}
|
|
2024
2017
|
|
|
2018
|
+
declare class DefaultVoice extends MastraVoice {
|
|
2019
|
+
constructor();
|
|
2020
|
+
speak(_input: string | NodeJS.ReadableStream): Promise<NodeJS.ReadableStream>;
|
|
2021
|
+
listen(_input: string | NodeJS.ReadableStream): Promise<string>;
|
|
2022
|
+
getSpeakers(): Promise<{
|
|
2023
|
+
voiceId: string;
|
|
2024
|
+
}[]>;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2025
2027
|
type ToolsInput = Record<string, ToolAction<any, any, any> | VercelTool>;
|
|
2026
2028
|
type ToolsetsInput = Record<string, ToolsInput>;
|
|
2027
2029
|
type MastraLanguageModel = LanguageModelV1;
|
|
2030
|
+
type DynamicArgument<T> = T | (({ runtimeContext }: {
|
|
2031
|
+
runtimeContext: RuntimeContext;
|
|
2032
|
+
}) => Promise<T> | T);
|
|
2028
2033
|
interface AgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>> {
|
|
2029
2034
|
name: TAgentId;
|
|
2030
|
-
instructions: string
|
|
2031
|
-
model: MastraLanguageModel
|
|
2035
|
+
instructions: DynamicArgument<string>;
|
|
2036
|
+
model: DynamicArgument<MastraLanguageModel>;
|
|
2037
|
+
tools?: DynamicArgument<TTools>;
|
|
2032
2038
|
defaultGenerateOptions?: AgentGenerateOptions;
|
|
2033
2039
|
defaultStreamOptions?: AgentStreamOptions;
|
|
2034
|
-
tools?: TTools;
|
|
2035
2040
|
mastra?: Mastra;
|
|
2036
|
-
/** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
|
|
2037
|
-
metrics?: TMetrics;
|
|
2038
2041
|
evals?: TMetrics;
|
|
2039
2042
|
memory?: MastraMemory;
|
|
2040
2043
|
voice?: CompositeVoice;
|
|
2044
|
+
/** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
|
|
2045
|
+
metrics?: TMetrics;
|
|
2041
2046
|
}
|
|
2042
2047
|
/**
|
|
2043
2048
|
* Options for generating responses with an agent
|
|
@@ -2300,17 +2305,42 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2300
2305
|
#private;
|
|
2301
2306
|
id: TAgentId;
|
|
2302
2307
|
name: TAgentId;
|
|
2303
|
-
readonly
|
|
2304
|
-
instructions: string;
|
|
2305
|
-
readonly model?: MastraLanguageModel;
|
|
2306
|
-
tools: TTools;
|
|
2308
|
+
readonly model?: DynamicArgument<MastraLanguageModel>;
|
|
2307
2309
|
/** @deprecated This property is deprecated. Use evals instead. */
|
|
2308
2310
|
metrics: TMetrics;
|
|
2309
2311
|
evals: TMetrics;
|
|
2310
|
-
voice: CompositeVoice;
|
|
2311
2312
|
constructor(config: AgentConfig<TAgentId, TTools, TMetrics>);
|
|
2312
2313
|
hasOwnMemory(): boolean;
|
|
2313
2314
|
getMemory(): MastraMemory | undefined;
|
|
2315
|
+
get voice(): CompositeVoice;
|
|
2316
|
+
getVoice({ runtimeContext }?: {
|
|
2317
|
+
runtimeContext?: RuntimeContext;
|
|
2318
|
+
}): Promise<CompositeVoice | DefaultVoice>;
|
|
2319
|
+
get instructions(): string;
|
|
2320
|
+
getInstructions({ runtimeContext }?: {
|
|
2321
|
+
runtimeContext?: RuntimeContext;
|
|
2322
|
+
}): string | Promise<string>;
|
|
2323
|
+
get tools(): TTools;
|
|
2324
|
+
getTools({ runtimeContext }?: {
|
|
2325
|
+
runtimeContext?: RuntimeContext;
|
|
2326
|
+
}): TTools | Promise<TTools>;
|
|
2327
|
+
get llm(): MastraLLMBase | Promise<MastraLLMBase>;
|
|
2328
|
+
/**
|
|
2329
|
+
* Gets or creates an LLM instance based on the current model
|
|
2330
|
+
* @param options Options for getting the LLM
|
|
2331
|
+
* @returns A promise that resolves to the LLM instance
|
|
2332
|
+
*/
|
|
2333
|
+
getLLM({ runtimeContext }?: {
|
|
2334
|
+
runtimeContext?: RuntimeContext;
|
|
2335
|
+
}): MastraLLMBase | Promise<MastraLLMBase>;
|
|
2336
|
+
/**
|
|
2337
|
+
* Gets the model, resolving it if it's a function
|
|
2338
|
+
* @param options Options for getting the model
|
|
2339
|
+
* @returns A promise that resolves to the model
|
|
2340
|
+
*/
|
|
2341
|
+
getModel({ runtimeContext }?: {
|
|
2342
|
+
runtimeContext?: RuntimeContext;
|
|
2343
|
+
}): MastraLanguageModel | Promise<MastraLanguageModel>;
|
|
2314
2344
|
__updateInstructions(newInstructions: string): void;
|
|
2315
2345
|
__registerPrimitives(p: MastraPrimitives): void;
|
|
2316
2346
|
__registerMastra(mastra: Mastra): void;
|
|
@@ -2319,8 +2349,9 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2319
2349
|
* @param tools
|
|
2320
2350
|
*/
|
|
2321
2351
|
__setTools(tools: TTools): void;
|
|
2322
|
-
generateTitleFromUserMessage({ message }: {
|
|
2352
|
+
generateTitleFromUserMessage({ message, runtimeContext, }: {
|
|
2323
2353
|
message: CoreUserMessage$1;
|
|
2354
|
+
runtimeContext?: RuntimeContext;
|
|
2324
2355
|
}): Promise<string>;
|
|
2325
2356
|
getMostRecentUserMessage(messages: Array<CoreMessage$1>): CoreUserMessage$1 | undefined;
|
|
2326
2357
|
genTitle(userMessage: CoreUserMessage$1 | undefined): Promise<string>;
|
|
@@ -2340,14 +2371,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2340
2371
|
}>;
|
|
2341
2372
|
private getResponseMessages;
|
|
2342
2373
|
sanitizeResponseMessages(messages: Array<CoreMessage$1>): Array<CoreMessage$1>;
|
|
2343
|
-
convertTools
|
|
2344
|
-
toolsets?: ToolsetsInput;
|
|
2345
|
-
clientTools?: ToolsInput;
|
|
2346
|
-
threadId?: string;
|
|
2347
|
-
resourceId?: string;
|
|
2348
|
-
runId?: string;
|
|
2349
|
-
runtimeContext: RuntimeContext;
|
|
2350
|
-
}): Record<string, CoreTool>;
|
|
2374
|
+
private convertTools;
|
|
2351
2375
|
preExecute({ resourceId, runId, threadId, thread, memoryConfig, messages, systemMessage, }: {
|
|
2352
2376
|
runId?: string;
|
|
2353
2377
|
threadId: string;
|
|
@@ -2374,7 +2398,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2374
2398
|
}): {
|
|
2375
2399
|
before: () => Promise<{
|
|
2376
2400
|
messageObjects: CoreMessage$1[];
|
|
2377
|
-
convertedTools: Record<string, CoreTool
|
|
2401
|
+
convertedTools: Record<string, CoreTool>;
|
|
2378
2402
|
threadId: string;
|
|
2379
2403
|
thread: StorageThreadType | null | undefined;
|
|
2380
2404
|
}>;
|
|
@@ -2461,23 +2485,18 @@ interface StorageColumn {
|
|
|
2461
2485
|
column: string;
|
|
2462
2486
|
};
|
|
2463
2487
|
}
|
|
2464
|
-
interface WorkflowRow {
|
|
2465
|
-
workflow_name: string;
|
|
2466
|
-
run_id: string;
|
|
2467
|
-
snapshot: WorkflowRunState;
|
|
2468
|
-
created_at: Date;
|
|
2469
|
-
updated_at: Date;
|
|
2470
|
-
}
|
|
2471
2488
|
interface WorkflowRuns {
|
|
2472
|
-
runs:
|
|
2473
|
-
workflowName: string;
|
|
2474
|
-
runId: string;
|
|
2475
|
-
snapshot: WorkflowRunState | string;
|
|
2476
|
-
createdAt: Date;
|
|
2477
|
-
updatedAt: Date;
|
|
2478
|
-
}>;
|
|
2489
|
+
runs: WorkflowRun[];
|
|
2479
2490
|
total: number;
|
|
2480
2491
|
}
|
|
2492
|
+
interface WorkflowRun {
|
|
2493
|
+
workflowName: string;
|
|
2494
|
+
runId: string;
|
|
2495
|
+
snapshot: WorkflowRunState | string;
|
|
2496
|
+
createdAt: Date;
|
|
2497
|
+
updatedAt: Date;
|
|
2498
|
+
resourceId?: string;
|
|
2499
|
+
}
|
|
2481
2500
|
type StorageGetMessagesArg = {
|
|
2482
2501
|
threadId: string;
|
|
2483
2502
|
resourceId?: string;
|
|
@@ -2642,13 +2661,17 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
2642
2661
|
}): Promise<WorkflowRunState | null>;
|
|
2643
2662
|
abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
2644
2663
|
abstract getWorkflowRuns(args?: {
|
|
2645
|
-
namespace?: string;
|
|
2646
2664
|
workflowName?: string;
|
|
2647
2665
|
fromDate?: Date;
|
|
2648
2666
|
toDate?: Date;
|
|
2649
2667
|
limit?: number;
|
|
2650
2668
|
offset?: number;
|
|
2669
|
+
resourceId?: string;
|
|
2651
2670
|
}): Promise<WorkflowRuns>;
|
|
2671
|
+
abstract getWorkflowRunById(args: {
|
|
2672
|
+
runId: string;
|
|
2673
|
+
workflowName?: string;
|
|
2674
|
+
}): Promise<WorkflowRun | null>;
|
|
2652
2675
|
}
|
|
2653
2676
|
|
|
2654
|
-
export { type
|
|
2677
|
+
export { type BaseStructuredOutputType as $, type ApiRoute as A, Agent as B, type AgentConfig as C, MastraMemory as D, type EvalRow as E, type ToolExecutionContext as F, Tool as G, Step as H, Workflow as I, type WorkflowOptions as J, type CoreMessage as K, type LanguageModel as L, type Methods as M, type NewStep as N, type CoreSystemMessage as O, type PathsToStringProps as P, type CoreAssistantMessage as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreUserMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreToolMessage as X, type EmbedResult as Y, type ZodPathType as Z, type EmbedManyResult as _, Mastra as a, type ToolsInput as a$, type StructuredOutputType as a0, type StructuredOutputArrayItem as a1, type StructuredOutput as a2, type GenerateReturn as a3, type StreamReturn as a4, type OutputType as a5, type DefaultLLMTextOptions as a6, type DefaultLLMTextObjectOptions as a7, type DefaultLLMStreamOptions as a8, type DefaultLLMStreamObjectOptions as a9, type StepDef as aA, type StepCondition as aB, type StepConfig as aC, type StepResult$1 as aD, type StepsRecord$1 as aE, type WorkflowRunResult as aF, type WorkflowContext as aG, type WorkflowLogMessage as aH, type WorkflowEvent as aI, type ResolverFunctionInput as aJ, type ResolverFunctionOutput as aK, type SubscriberFunctionOutput as aL, type DependencyCheckOutput as aM, type StepResolverOutput as aN, type WorkflowActors as aO, type WorkflowActionParams as aP, type WorkflowActions as aQ, type WorkflowState as aR, type StepId as aS, type ExtractSchemaFromStep$1 as aT, type ExtractStepResult as aU, type StepInputType as aV, type ExtractSchemaType$1 as aW, type PathsToStringProps$1 as aX, type WorkflowRunState as aY, type WorkflowResumeResult as aZ, type MastraLanguageModel as a_, type LLMTextOptions as aa, type LLMTextObjectOptions as ab, type LLMStreamOptions as ac, type LLMInnerStreamOptions as ad, type LLMStreamObjectOptions as ae, createMockModel as af, type Config as ag, type MessageResponse as ah, type MemoryConfig as ai, type SharedMemoryConfig as aj, type MemoryProcessorOpts as ak, MemoryProcessor as al, memoryDefaultOptions as am, createTool as an, type VercelTool as ao, type CoreTool as ap, type StepExecutionContext as aq, type StepAction as ar, type StepVariableType as as, type StepNode as at, type StepGraph as au, type RetryConfig as av, type VariableReference$1 as aw, type BaseCondition as ax, type ActionContext as ay, WhenConditionReturnValue as az, MastraStorage as b, type MastraPrimitives as b0, AgentNetwork as b1, type AgentNetworkConfig as b2, type VoiceEventType as b3, type VoiceEventMap as b4, type VoiceConfig as b5, MastraVoice as b6, CompositeVoice as b7, DefaultVoice as b8, type ToolsetsInput as b9, type DynamicArgument as ba, type AgentGenerateOptions as bb, type AgentStreamOptions as bc, TABLE_WORKFLOW_SNAPSHOT as bd, TABLE_EVALS as be, TABLE_MESSAGES as bf, TABLE_THREADS as bg, TABLE_TRACES as bh, TABLE_SCHEMAS as bi, type StorageThreadType as c, type MessageType as d, type StorageGetMessagesArg as e, type WorkflowRun as f, ExecutionEngine as g, type ExecutionGraph as h, type StepResult as i, type StepFlowEntry as j, type ExecuteFunction as k, createStep as l, cloneStep as m, createWorkflow as n, cloneWorkflow as o, type WorkflowResult as p, type NewWorkflowConfig as q, NewWorkflow as r, type StepSuccess as s, type StepFailure as t, type StepSuspended as u, type StepsRecord as v, type ExtractSchemaType as w, type ExtractSchemaFromStep as x, type WatchEvent as y, type ToolAction as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
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
3
|
import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-BihKcqDY.cjs';
|
|
4
4
|
import { a as Metric, M as MetricResult, T as TestInfo } from './types-BtMyV38I.cjs';
|
|
5
5
|
import { Query } from 'sift';
|
|
@@ -1484,13 +1484,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
|
|
|
1484
1484
|
mastra: Mastra;
|
|
1485
1485
|
}): Promise<z.infer<TOutput>>;
|
|
1486
1486
|
getWorkflowRuns(): Promise<WorkflowRuns>;
|
|
1487
|
-
getWorkflowRun(runId: string): Promise<
|
|
1488
|
-
workflowName: string;
|
|
1489
|
-
runId: string;
|
|
1490
|
-
snapshot: WorkflowRunState | string;
|
|
1491
|
-
createdAt: Date;
|
|
1492
|
-
updatedAt: Date;
|
|
1493
|
-
} | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1487
|
+
getWorkflowRun(runId: string): Promise<WorkflowRun | Run<TSteps, TInput, TOutput> | undefined>;
|
|
1494
1488
|
}
|
|
1495
1489
|
/**
|
|
1496
1490
|
* Represents a workflow run that can be executed
|
|
@@ -1802,8 +1796,7 @@ type DefaultLLMTextObjectOptions = Omit<GenerateObjectOptions, MastraCustomLLMOp
|
|
|
1802
1796
|
type DefaultLLMStreamOptions = Omit<StreamTextOptions, MastraCustomLLMOptionsKeys>;
|
|
1803
1797
|
type DefaultLLMStreamObjectOptions = Omit<StreamObjectOptions, MastraCustomLLMOptionsKeys>;
|
|
1804
1798
|
type MastraCustomLLMOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefined> = {
|
|
1805
|
-
tools?:
|
|
1806
|
-
convertedTools?: Record<string, CoreTool>;
|
|
1799
|
+
tools?: Record<string, CoreTool>;
|
|
1807
1800
|
onStepFinish?: (step: unknown) => void;
|
|
1808
1801
|
experimental_output?: Z;
|
|
1809
1802
|
telemetry?: TelemetrySettings;
|
|
@@ -2022,22 +2015,34 @@ declare class CompositeVoice extends MastraVoice<unknown, unknown, unknown, Tool
|
|
|
2022
2015
|
off<E extends VoiceEventType>(event: E, callback: (data: E extends keyof VoiceEventMap ? VoiceEventMap[E] : unknown) => void): void;
|
|
2023
2016
|
}
|
|
2024
2017
|
|
|
2018
|
+
declare class DefaultVoice extends MastraVoice {
|
|
2019
|
+
constructor();
|
|
2020
|
+
speak(_input: string | NodeJS.ReadableStream): Promise<NodeJS.ReadableStream>;
|
|
2021
|
+
listen(_input: string | NodeJS.ReadableStream): Promise<string>;
|
|
2022
|
+
getSpeakers(): Promise<{
|
|
2023
|
+
voiceId: string;
|
|
2024
|
+
}[]>;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2025
2027
|
type ToolsInput = Record<string, ToolAction<any, any, any> | VercelTool>;
|
|
2026
2028
|
type ToolsetsInput = Record<string, ToolsInput>;
|
|
2027
2029
|
type MastraLanguageModel = LanguageModelV1;
|
|
2030
|
+
type DynamicArgument<T> = T | (({ runtimeContext }: {
|
|
2031
|
+
runtimeContext: RuntimeContext;
|
|
2032
|
+
}) => Promise<T> | T);
|
|
2028
2033
|
interface AgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>> {
|
|
2029
2034
|
name: TAgentId;
|
|
2030
|
-
instructions: string
|
|
2031
|
-
model: MastraLanguageModel
|
|
2035
|
+
instructions: DynamicArgument<string>;
|
|
2036
|
+
model: DynamicArgument<MastraLanguageModel>;
|
|
2037
|
+
tools?: DynamicArgument<TTools>;
|
|
2032
2038
|
defaultGenerateOptions?: AgentGenerateOptions;
|
|
2033
2039
|
defaultStreamOptions?: AgentStreamOptions;
|
|
2034
|
-
tools?: TTools;
|
|
2035
2040
|
mastra?: Mastra;
|
|
2036
|
-
/** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
|
|
2037
|
-
metrics?: TMetrics;
|
|
2038
2041
|
evals?: TMetrics;
|
|
2039
2042
|
memory?: MastraMemory;
|
|
2040
2043
|
voice?: CompositeVoice;
|
|
2044
|
+
/** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
|
|
2045
|
+
metrics?: TMetrics;
|
|
2041
2046
|
}
|
|
2042
2047
|
/**
|
|
2043
2048
|
* Options for generating responses with an agent
|
|
@@ -2300,17 +2305,42 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2300
2305
|
#private;
|
|
2301
2306
|
id: TAgentId;
|
|
2302
2307
|
name: TAgentId;
|
|
2303
|
-
readonly
|
|
2304
|
-
instructions: string;
|
|
2305
|
-
readonly model?: MastraLanguageModel;
|
|
2306
|
-
tools: TTools;
|
|
2308
|
+
readonly model?: DynamicArgument<MastraLanguageModel>;
|
|
2307
2309
|
/** @deprecated This property is deprecated. Use evals instead. */
|
|
2308
2310
|
metrics: TMetrics;
|
|
2309
2311
|
evals: TMetrics;
|
|
2310
|
-
voice: CompositeVoice;
|
|
2311
2312
|
constructor(config: AgentConfig<TAgentId, TTools, TMetrics>);
|
|
2312
2313
|
hasOwnMemory(): boolean;
|
|
2313
2314
|
getMemory(): MastraMemory | undefined;
|
|
2315
|
+
get voice(): CompositeVoice;
|
|
2316
|
+
getVoice({ runtimeContext }?: {
|
|
2317
|
+
runtimeContext?: RuntimeContext;
|
|
2318
|
+
}): Promise<CompositeVoice | DefaultVoice>;
|
|
2319
|
+
get instructions(): string;
|
|
2320
|
+
getInstructions({ runtimeContext }?: {
|
|
2321
|
+
runtimeContext?: RuntimeContext;
|
|
2322
|
+
}): string | Promise<string>;
|
|
2323
|
+
get tools(): TTools;
|
|
2324
|
+
getTools({ runtimeContext }?: {
|
|
2325
|
+
runtimeContext?: RuntimeContext;
|
|
2326
|
+
}): TTools | Promise<TTools>;
|
|
2327
|
+
get llm(): MastraLLMBase | Promise<MastraLLMBase>;
|
|
2328
|
+
/**
|
|
2329
|
+
* Gets or creates an LLM instance based on the current model
|
|
2330
|
+
* @param options Options for getting the LLM
|
|
2331
|
+
* @returns A promise that resolves to the LLM instance
|
|
2332
|
+
*/
|
|
2333
|
+
getLLM({ runtimeContext }?: {
|
|
2334
|
+
runtimeContext?: RuntimeContext;
|
|
2335
|
+
}): MastraLLMBase | Promise<MastraLLMBase>;
|
|
2336
|
+
/**
|
|
2337
|
+
* Gets the model, resolving it if it's a function
|
|
2338
|
+
* @param options Options for getting the model
|
|
2339
|
+
* @returns A promise that resolves to the model
|
|
2340
|
+
*/
|
|
2341
|
+
getModel({ runtimeContext }?: {
|
|
2342
|
+
runtimeContext?: RuntimeContext;
|
|
2343
|
+
}): MastraLanguageModel | Promise<MastraLanguageModel>;
|
|
2314
2344
|
__updateInstructions(newInstructions: string): void;
|
|
2315
2345
|
__registerPrimitives(p: MastraPrimitives): void;
|
|
2316
2346
|
__registerMastra(mastra: Mastra): void;
|
|
@@ -2319,8 +2349,9 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2319
2349
|
* @param tools
|
|
2320
2350
|
*/
|
|
2321
2351
|
__setTools(tools: TTools): void;
|
|
2322
|
-
generateTitleFromUserMessage({ message }: {
|
|
2352
|
+
generateTitleFromUserMessage({ message, runtimeContext, }: {
|
|
2323
2353
|
message: CoreUserMessage$1;
|
|
2354
|
+
runtimeContext?: RuntimeContext;
|
|
2324
2355
|
}): Promise<string>;
|
|
2325
2356
|
getMostRecentUserMessage(messages: Array<CoreMessage$1>): CoreUserMessage$1 | undefined;
|
|
2326
2357
|
genTitle(userMessage: CoreUserMessage$1 | undefined): Promise<string>;
|
|
@@ -2340,14 +2371,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2340
2371
|
}>;
|
|
2341
2372
|
private getResponseMessages;
|
|
2342
2373
|
sanitizeResponseMessages(messages: Array<CoreMessage$1>): Array<CoreMessage$1>;
|
|
2343
|
-
convertTools
|
|
2344
|
-
toolsets?: ToolsetsInput;
|
|
2345
|
-
clientTools?: ToolsInput;
|
|
2346
|
-
threadId?: string;
|
|
2347
|
-
resourceId?: string;
|
|
2348
|
-
runId?: string;
|
|
2349
|
-
runtimeContext: RuntimeContext;
|
|
2350
|
-
}): Record<string, CoreTool>;
|
|
2374
|
+
private convertTools;
|
|
2351
2375
|
preExecute({ resourceId, runId, threadId, thread, memoryConfig, messages, systemMessage, }: {
|
|
2352
2376
|
runId?: string;
|
|
2353
2377
|
threadId: string;
|
|
@@ -2374,7 +2398,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
|
|
|
2374
2398
|
}): {
|
|
2375
2399
|
before: () => Promise<{
|
|
2376
2400
|
messageObjects: CoreMessage$1[];
|
|
2377
|
-
convertedTools: Record<string, CoreTool
|
|
2401
|
+
convertedTools: Record<string, CoreTool>;
|
|
2378
2402
|
threadId: string;
|
|
2379
2403
|
thread: StorageThreadType | null | undefined;
|
|
2380
2404
|
}>;
|
|
@@ -2461,23 +2485,18 @@ interface StorageColumn {
|
|
|
2461
2485
|
column: string;
|
|
2462
2486
|
};
|
|
2463
2487
|
}
|
|
2464
|
-
interface WorkflowRow {
|
|
2465
|
-
workflow_name: string;
|
|
2466
|
-
run_id: string;
|
|
2467
|
-
snapshot: WorkflowRunState;
|
|
2468
|
-
created_at: Date;
|
|
2469
|
-
updated_at: Date;
|
|
2470
|
-
}
|
|
2471
2488
|
interface WorkflowRuns {
|
|
2472
|
-
runs:
|
|
2473
|
-
workflowName: string;
|
|
2474
|
-
runId: string;
|
|
2475
|
-
snapshot: WorkflowRunState | string;
|
|
2476
|
-
createdAt: Date;
|
|
2477
|
-
updatedAt: Date;
|
|
2478
|
-
}>;
|
|
2489
|
+
runs: WorkflowRun[];
|
|
2479
2490
|
total: number;
|
|
2480
2491
|
}
|
|
2492
|
+
interface WorkflowRun {
|
|
2493
|
+
workflowName: string;
|
|
2494
|
+
runId: string;
|
|
2495
|
+
snapshot: WorkflowRunState | string;
|
|
2496
|
+
createdAt: Date;
|
|
2497
|
+
updatedAt: Date;
|
|
2498
|
+
resourceId?: string;
|
|
2499
|
+
}
|
|
2481
2500
|
type StorageGetMessagesArg = {
|
|
2482
2501
|
threadId: string;
|
|
2483
2502
|
resourceId?: string;
|
|
@@ -2642,13 +2661,17 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
2642
2661
|
}): Promise<WorkflowRunState | null>;
|
|
2643
2662
|
abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
2644
2663
|
abstract getWorkflowRuns(args?: {
|
|
2645
|
-
namespace?: string;
|
|
2646
2664
|
workflowName?: string;
|
|
2647
2665
|
fromDate?: Date;
|
|
2648
2666
|
toDate?: Date;
|
|
2649
2667
|
limit?: number;
|
|
2650
2668
|
offset?: number;
|
|
2669
|
+
resourceId?: string;
|
|
2651
2670
|
}): Promise<WorkflowRuns>;
|
|
2671
|
+
abstract getWorkflowRunById(args: {
|
|
2672
|
+
runId: string;
|
|
2673
|
+
workflowName?: string;
|
|
2674
|
+
}): Promise<WorkflowRun | null>;
|
|
2652
2675
|
}
|
|
2653
2676
|
|
|
2654
|
-
export { type
|
|
2677
|
+
export { type BaseStructuredOutputType as $, type ApiRoute as A, Agent as B, type AgentConfig as C, MastraMemory as D, type EvalRow as E, type ToolExecutionContext as F, Tool as G, Step as H, Workflow as I, type WorkflowOptions as J, type CoreMessage as K, type LanguageModel as L, type Methods as M, type NewStep as N, type CoreSystemMessage as O, type PathsToStringProps as P, type CoreAssistantMessage as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreUserMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreToolMessage as X, type EmbedResult as Y, type ZodPathType as Z, type EmbedManyResult as _, Mastra as a, type ToolsInput as a$, type StructuredOutputType as a0, type StructuredOutputArrayItem as a1, type StructuredOutput as a2, type GenerateReturn as a3, type StreamReturn as a4, type OutputType as a5, type DefaultLLMTextOptions as a6, type DefaultLLMTextObjectOptions as a7, type DefaultLLMStreamOptions as a8, type DefaultLLMStreamObjectOptions as a9, type StepDef as aA, type StepCondition as aB, type StepConfig as aC, type StepResult$1 as aD, type StepsRecord$1 as aE, type WorkflowRunResult as aF, type WorkflowContext as aG, type WorkflowLogMessage as aH, type WorkflowEvent as aI, type ResolverFunctionInput as aJ, type ResolverFunctionOutput as aK, type SubscriberFunctionOutput as aL, type DependencyCheckOutput as aM, type StepResolverOutput as aN, type WorkflowActors as aO, type WorkflowActionParams as aP, type WorkflowActions as aQ, type WorkflowState as aR, type StepId as aS, type ExtractSchemaFromStep$1 as aT, type ExtractStepResult as aU, type StepInputType as aV, type ExtractSchemaType$1 as aW, type PathsToStringProps$1 as aX, type WorkflowRunState as aY, type WorkflowResumeResult as aZ, type MastraLanguageModel as a_, type LLMTextOptions as aa, type LLMTextObjectOptions as ab, type LLMStreamOptions as ac, type LLMInnerStreamOptions as ad, type LLMStreamObjectOptions as ae, createMockModel as af, type Config as ag, type MessageResponse as ah, type MemoryConfig as ai, type SharedMemoryConfig as aj, type MemoryProcessorOpts as ak, MemoryProcessor as al, memoryDefaultOptions as am, createTool as an, type VercelTool as ao, type CoreTool as ap, type StepExecutionContext as aq, type StepAction as ar, type StepVariableType as as, type StepNode as at, type StepGraph as au, type RetryConfig as av, type VariableReference$1 as aw, type BaseCondition as ax, type ActionContext as ay, WhenConditionReturnValue as az, MastraStorage as b, type MastraPrimitives as b0, AgentNetwork as b1, type AgentNetworkConfig as b2, type VoiceEventType as b3, type VoiceEventMap as b4, type VoiceConfig as b5, MastraVoice as b6, CompositeVoice as b7, DefaultVoice as b8, type ToolsetsInput as b9, type DynamicArgument as ba, type AgentGenerateOptions as bb, type AgentStreamOptions as bc, TABLE_WORKFLOW_SNAPSHOT as bd, TABLE_EVALS as be, TABLE_MESSAGES as bf, TABLE_THREADS as bg, TABLE_TRACES as bh, TABLE_SCHEMAS as bi, type StorageThreadType as c, type MessageType as d, type StorageGetMessagesArg as e, type WorkflowRun as f, ExecutionEngine as g, type ExecutionGraph as h, type StepResult as i, type StepFlowEntry as j, type ExecuteFunction as k, createStep as l, cloneStep as m, createWorkflow as n, cloneWorkflow as o, type WorkflowResult as p, type NewWorkflowConfig as q, NewWorkflow as r, type StepSuccess as s, type StepFailure as t, type StepSuspended as u, type StepsRecord as v, type ExtractSchemaType as w, type ExtractSchemaFromStep as x, type WatchEvent as y, type ToolAction as z };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkZKRQS3N5_cjs = require('./chunk-ZKRQS3N5.cjs');
|
|
4
|
+
var chunkMYHX5XVW_cjs = require('./chunk-MYHX5XVW.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 = [chunkMYHX5XVW_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 chunkZKRQS3N5_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 = chunkZKRQS3N5_cjs.augmentWithInit(storage);
|
|
77
|
+
this.#telemetry = chunkMYHX5XVW_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 chunkZKRQS3N5_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 = chunkZKRQS3N5_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 = chunkMYHX5XVW_cjs.Telemetry.init(telemetry);
|
|
331
331
|
if (this.#agents) {
|
|
332
332
|
Object.keys(this.#agents).forEach(key => {
|
|
333
333
|
if (this.#telemetry) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-
|
|
1
|
+
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-SEOWDGC2.js';
|
|
2
2
|
import { MastraBase } from './chunk-CLJQYXNM.js';
|
|
3
3
|
|
|
4
4
|
// src/storage/base.ts
|
|
@@ -32,7 +32,7 @@ function createTool(opts) {
|
|
|
32
32
|
}
|
|
33
33
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
34
34
|
function jsonSchemaPropertiesToTSTypes(value) {
|
|
35
|
-
if (!value
|
|
35
|
+
if (!value?.type) {
|
|
36
36
|
return zod.z.object({});
|
|
37
37
|
}
|
|
38
38
|
if (Array.isArray(value.type)) {
|
|
@@ -61,6 +61,9 @@ Examples: ${value.examples.join(", ")}` : ""));
|
|
|
61
61
|
Examples: ${value.examples.join(", ")}` : ""));
|
|
62
62
|
break;
|
|
63
63
|
case "array":
|
|
64
|
+
if (!value.items || !value.items?.type) {
|
|
65
|
+
value.items = value.items ? { ...value.items, type: "string" } : { type: "string" };
|
|
66
|
+
}
|
|
64
67
|
zodType = zod.z.array(jsonSchemaPropertiesToTSTypes(value.items)).describe((value.description || "") + (value.examples ? `
|
|
65
68
|
Examples: ${value.examples.join(", ")}` : ""));
|
|
66
69
|
break;
|