@mastra/core 0.10.2-alpha.7 → 0.10.3
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 +4 -4
- package/dist/agent/index.d.cts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/{base-BVo_KTj_.d.ts → base-Bdo-CPMn.d.ts} +3 -2
- package/dist/{base-CCeahyG8.d.cts → base-Dmg7H-Iz.d.cts} +3 -2
- package/dist/chunk-32C7JDIZ.js +1 -0
- package/dist/{chunk-6NJLWXMZ.js → chunk-4TEWSQS5.js} +1 -1
- package/dist/{chunk-GNJ7CAHY.js → chunk-4UWPFBC6.js} +1 -1
- package/dist/chunk-4Z3OU5RY.cjs +31 -0
- package/dist/{chunk-LKO4XMRH.js → chunk-5EB62G6T.js} +2 -2
- package/dist/{chunk-MWU2UKZI.js → chunk-677GIYFF.js} +4 -1
- package/dist/{chunk-2AFAKGJ4.js → chunk-B4TMM6NT.js} +6 -5
- package/dist/{chunk-YZB2YQ63.cjs → chunk-B7SQOKEC.cjs} +2 -2
- package/dist/chunk-C4LMN2IR.js +27 -0
- package/dist/{chunk-II7UBNGM.cjs → chunk-ERUGEZPR.cjs} +2 -2
- package/dist/{chunk-DXK4HYTL.js → chunk-FGBS7VRU.js} +1 -1
- package/dist/{chunk-PBHXIWAK.cjs → chunk-FHLDRRKJ.cjs} +6 -3
- package/dist/{chunk-P5XIIDTT.cjs → chunk-IBIGJYTD.cjs} +4 -4
- package/dist/{chunk-24D3CMWO.js → chunk-K7BZ4VXX.js} +2 -2
- package/dist/{chunk-SMPHOXU3.cjs → chunk-LMTSGD2E.cjs} +4 -4
- package/dist/{chunk-IJWOVA22.cjs → chunk-MVXVUMLA.cjs} +18 -17
- package/dist/chunk-QFTBW7ZZ.cjs +2 -0
- package/dist/{chunk-PNPMKRS2.cjs → chunk-VBSKHNCY.cjs} +5 -5
- package/dist/{chunk-TN3TNMXO.cjs → chunk-WWLMZIHW.cjs} +6 -31
- package/dist/{chunk-26WUL725.js → chunk-Y5BGCPNZ.js} +2 -24
- package/dist/error/index.cjs +75 -0
- package/dist/error/index.d.cts +80 -0
- package/dist/error/index.d.ts +80 -0
- package/dist/error/index.js +70 -0
- package/dist/eval/index.d.cts +1 -1
- package/dist/eval/index.d.ts +1 -1
- package/dist/index.cjs +46 -49
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -9
- 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.d.cts +1 -1
- package/dist/mastra/index.d.ts +1 -1
- package/dist/mcp/index.d.cts +1 -1
- package/dist/mcp/index.d.ts +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 +2 -2
- package/dist/server/index.d.ts +2 -2
- 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/telemetry/index.d.cts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.cts +18 -7
- package/dist/tools/index.d.ts +18 -7
- package/dist/tools/index.js +1 -1
- package/dist/utils.cjs +14 -18
- package/dist/utils.d.cts +4 -10
- package/dist/utils.d.ts +4 -10
- package/dist/utils.js +1 -1
- package/dist/voice/index.d.cts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/workflows/index.cjs +9 -9
- 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/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.d.cts +2 -2
- package/dist/workflows/legacy/index.d.ts +2 -2
- package/dist/workflows/legacy/index.js +1 -1
- package/error.d.ts +1 -0
- package/package.json +2 -2
package/dist/agent/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkMVXVUMLA_cjs = require('../chunk-MVXVUMLA.cjs');
|
|
4
|
+
var chunkFHLDRRKJ_cjs = require('../chunk-FHLDRRKJ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Agent", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkMVXVUMLA_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "MessageList", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkFHLDRRKJ_cjs.MessageList; }
|
|
15
15
|
});
|
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 { A as Agent, ap as AgentConfig, bQ as AgentGenerateOptions, bR as AgentStreamOptions, bP as DynamicArgument, bn as MastraLanguageModel, bS as MastraMessageContentV2, s as MastraMessageV2, bN as MessageList, T as ToolsInput, bO as ToolsetsInput } from '../base-Dmg7H-Iz.cjs';
|
|
5
5
|
import '../base-BY9WFI65.cjs';
|
|
6
6
|
import '../types-Bo1uigWx.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 { A as Agent, ap as AgentConfig, bQ as AgentGenerateOptions, bR as AgentStreamOptions, bP as DynamicArgument, bn as MastraLanguageModel, bS as MastraMessageContentV2, s as MastraMessageV2, bN as MessageList, T as ToolsInput, bO as ToolsetsInput } from '../base-Bdo-CPMn.js';
|
|
5
5
|
import '../base-C0yUw8BC.js';
|
|
6
6
|
import '../types-Bo1uigWx.js';
|
|
7
7
|
import '../runtime-context/index.js';
|
package/dist/agent/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Agent } from '../chunk-
|
|
2
|
-
export { MessageList } from '../chunk-
|
|
1
|
+
export { Agent } from '../chunk-B4TMM6NT.js';
|
|
2
|
+
export { MessageList } from '../chunk-677GIYFF.js';
|
|
@@ -1680,7 +1680,7 @@ type MastraMessageV2 = {
|
|
|
1680
1680
|
type?: string;
|
|
1681
1681
|
};
|
|
1682
1682
|
type MessageInput = UIMessage | Message | MastraMessageV1 | CoreMessage$1 | MastraMessageV2;
|
|
1683
|
-
type MessageSource = 'memory' | 'response' | 'user' | 'system';
|
|
1683
|
+
type MessageSource = 'memory' | 'response' | 'user' | 'system' | 'context';
|
|
1684
1684
|
declare class MessageList {
|
|
1685
1685
|
private messages;
|
|
1686
1686
|
private systemMessages;
|
|
@@ -1689,6 +1689,7 @@ declare class MessageList {
|
|
|
1689
1689
|
private memoryMessages;
|
|
1690
1690
|
private newUserMessages;
|
|
1691
1691
|
private newResponseMessages;
|
|
1692
|
+
private userContextMessages;
|
|
1692
1693
|
private generateMessageId?;
|
|
1693
1694
|
constructor({ threadId, resourceId, generateMessageId, }?: {
|
|
1694
1695
|
threadId?: string;
|
|
@@ -3434,4 +3435,4 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
3434
3435
|
}): Promise<WorkflowRun | null>;
|
|
3435
3436
|
}
|
|
3436
3437
|
|
|
3437
|
-
export { type
|
|
3438
|
+
export { type StepCondition as $, Agent as A, TABLE_EVALS as B, type CoreTool as C, TABLE_MESSAGES as D, type EvalRow as E, TABLE_THREADS as F, TABLE_TRACES as G, TABLE_SCHEMAS as H, type VariableReference$1 as I, type StepResult$1 as J, type StepAction as K, LegacyWorkflow as L, Mastra as M, type LegacyWorkflowRunResult as N, type WorkflowOptions as O, type StepVariableType as P, type StepNode as Q, type StepGraph as R, type StepExecutionContext as S, type ToolsInput as T, type RetryConfig as U, type VercelTool as V, type WorkflowContext as W, type BaseCondition as X, type ActionContext as Y, WhenConditionReturnValue as Z, type StepDef as _, type MastraPrimitives as a, createStep as a$, type StepConfig as a0, type StepsRecord$1 as a1, type WorkflowLogMessage as a2, type WorkflowEvent as a3, type ResolverFunctionInput as a4, type ResolverFunctionOutput as a5, type SubscriberFunctionOutput as a6, type DependencyCheckOutput as a7, type StepResolverOutput as a8, type WorkflowActors as a9, type StructuredOutputType as aA, type StructuredOutputArrayItem as aB, type StructuredOutput as aC, type GenerateReturn as aD, type StreamReturn as aE, type OutputType as aF, type DefaultLLMTextOptions as aG, type DefaultLLMTextObjectOptions as aH, type DefaultLLMStreamOptions as aI, type DefaultLLMStreamObjectOptions as aJ, type LLMTextOptions as aK, type LLMTextObjectOptions as aL, type LLMStreamOptions as aM, type LLMInnerStreamOptions as aN, type LLMStreamObjectOptions as aO, createMockModel as aP, type Config as aQ, type MessageType as aR, type MessageResponse as aS, type MemoryConfig as aT, type SharedMemoryConfig as aU, type MemoryProcessorOpts as aV, MemoryProcessor as aW, memoryDefaultOptions as aX, type StepFlowEntry as aY, type SerializedStep as aZ, type SerializedStepFlowEntry as a_, type WorkflowActionParams as aa, type WorkflowActions as ab, type LegacyWorkflowState as ac, type StepId as ad, type ExtractSchemaFromStep$1 as ae, type ExtractStepResult as af, type StepInputType as ag, type ExtractSchemaType$1 as ah, type PathsToStringProps$1 as ai, type LegacyWorkflowRunState as aj, type WorkflowResumeResult as ak, Tool as al, createTool as am, type InternalCoreTool as an, type ToolExecutionContext as ao, type AgentConfig as ap, type WorkflowConfig as aq, type LanguageModel as ar, type CoreMessage as as, type CoreSystemMessage as at, type CoreAssistantMessage as au, type CoreUserMessage as av, type CoreToolMessage as aw, type EmbedResult as ax, type EmbedManyResult as ay, type BaseStructuredOutputType as az, MastraMemory as b, cloneStep as b0, createWorkflow as b1, cloneWorkflow as b2, type WorkflowResult as b3, Run as b4, type ExecutionGraph as b5, ExecutionEngine as b6, type ExecuteFunction as b7, type StepSuccess as b8, type StepFailure as b9, type VersionDetail as bA, type ArgumentInfo as bB, type PositionalArgumentInfo as bC, type NamedArgumentInfo as bD, type SubcommandInfo as bE, type CommandInfo as bF, type EnvironmentVariableInfo as bG, type PackageInfo as bH, type RemoteInfo as bI, type MCPServerConfig as bJ, type ServerInfo as bK, type ServerDetailInfo as bL, type MCPToolType as bM, MessageList as bN, type ToolsetsInput as bO, type DynamicArgument as bP, type AgentGenerateOptions as bQ, type AgentStreamOptions as bR, type MastraMessageContentV2 as bS, type StepSuspended as ba, type StepRunning as bb, type StepResult as bc, type StepsRecord as bd, type DynamicMapping as be, type PathsToStringProps as bf, type ExtractSchemaType as bg, type ExtractSchemaFromStep as bh, type VariableReference as bi, type StreamEvent as bj, type WatchEvent as bk, type ZodPathType as bl, type WorkflowRunState as bm, type MastraLanguageModel as bn, type VoiceEventType as bo, type VoiceEventMap as bp, type VoiceConfig as bq, MastraVoice as br, CompositeVoice as bs, DefaultVoice as bt, type AgentNetworkConfig as bu, type ConvertedTool as bv, type MCPServerSSEOptions as bw, type MCPServerHonoSSEOptions as bx, type MCPServerHTTPOptions as by, type Repository as bz, type ToolAction as c, LegacyStep as d, Workflow as e, type Step as f, AgentNetwork as g, MCPServerBase as h, type Methods as i, type ApiRoute as j, type MastraAuthConfig as k, type ContextWithMastra as l, MastraAuthProvider as m, type MastraAuthProviderOptions as n, MastraStorage as o, type TABLE_NAMES as p, type StorageColumn as q, type StorageThreadType as r, type MastraMessageV2 as s, type StorageGetMessagesArg as t, type MastraMessageV1 as u, type WorkflowRuns as v, type WorkflowRun as w, type LegacyWorkflowRuns as x, type LegacyWorkflowRun as y, TABLE_WORKFLOW_SNAPSHOT as z };
|
|
@@ -1680,7 +1680,7 @@ type MastraMessageV2 = {
|
|
|
1680
1680
|
type?: string;
|
|
1681
1681
|
};
|
|
1682
1682
|
type MessageInput = UIMessage | Message | MastraMessageV1 | CoreMessage$1 | MastraMessageV2;
|
|
1683
|
-
type MessageSource = 'memory' | 'response' | 'user' | 'system';
|
|
1683
|
+
type MessageSource = 'memory' | 'response' | 'user' | 'system' | 'context';
|
|
1684
1684
|
declare class MessageList {
|
|
1685
1685
|
private messages;
|
|
1686
1686
|
private systemMessages;
|
|
@@ -1689,6 +1689,7 @@ declare class MessageList {
|
|
|
1689
1689
|
private memoryMessages;
|
|
1690
1690
|
private newUserMessages;
|
|
1691
1691
|
private newResponseMessages;
|
|
1692
|
+
private userContextMessages;
|
|
1692
1693
|
private generateMessageId?;
|
|
1693
1694
|
constructor({ threadId, resourceId, generateMessageId, }?: {
|
|
1694
1695
|
threadId?: string;
|
|
@@ -3434,4 +3435,4 @@ declare abstract class MastraStorage extends MastraBase {
|
|
|
3434
3435
|
}): Promise<WorkflowRun | null>;
|
|
3435
3436
|
}
|
|
3436
3437
|
|
|
3437
|
-
export { type
|
|
3438
|
+
export { type StepCondition as $, Agent as A, TABLE_EVALS as B, type CoreTool as C, TABLE_MESSAGES as D, type EvalRow as E, TABLE_THREADS as F, TABLE_TRACES as G, TABLE_SCHEMAS as H, type VariableReference$1 as I, type StepResult$1 as J, type StepAction as K, LegacyWorkflow as L, Mastra as M, type LegacyWorkflowRunResult as N, type WorkflowOptions as O, type StepVariableType as P, type StepNode as Q, type StepGraph as R, type StepExecutionContext as S, type ToolsInput as T, type RetryConfig as U, type VercelTool as V, type WorkflowContext as W, type BaseCondition as X, type ActionContext as Y, WhenConditionReturnValue as Z, type StepDef as _, type MastraPrimitives as a, createStep as a$, type StepConfig as a0, type StepsRecord$1 as a1, type WorkflowLogMessage as a2, type WorkflowEvent as a3, type ResolverFunctionInput as a4, type ResolverFunctionOutput as a5, type SubscriberFunctionOutput as a6, type DependencyCheckOutput as a7, type StepResolverOutput as a8, type WorkflowActors as a9, type StructuredOutputType as aA, type StructuredOutputArrayItem as aB, type StructuredOutput as aC, type GenerateReturn as aD, type StreamReturn as aE, type OutputType as aF, type DefaultLLMTextOptions as aG, type DefaultLLMTextObjectOptions as aH, type DefaultLLMStreamOptions as aI, type DefaultLLMStreamObjectOptions as aJ, type LLMTextOptions as aK, type LLMTextObjectOptions as aL, type LLMStreamOptions as aM, type LLMInnerStreamOptions as aN, type LLMStreamObjectOptions as aO, createMockModel as aP, type Config as aQ, type MessageType as aR, type MessageResponse as aS, type MemoryConfig as aT, type SharedMemoryConfig as aU, type MemoryProcessorOpts as aV, MemoryProcessor as aW, memoryDefaultOptions as aX, type StepFlowEntry as aY, type SerializedStep as aZ, type SerializedStepFlowEntry as a_, type WorkflowActionParams as aa, type WorkflowActions as ab, type LegacyWorkflowState as ac, type StepId as ad, type ExtractSchemaFromStep$1 as ae, type ExtractStepResult as af, type StepInputType as ag, type ExtractSchemaType$1 as ah, type PathsToStringProps$1 as ai, type LegacyWorkflowRunState as aj, type WorkflowResumeResult as ak, Tool as al, createTool as am, type InternalCoreTool as an, type ToolExecutionContext as ao, type AgentConfig as ap, type WorkflowConfig as aq, type LanguageModel as ar, type CoreMessage as as, type CoreSystemMessage as at, type CoreAssistantMessage as au, type CoreUserMessage as av, type CoreToolMessage as aw, type EmbedResult as ax, type EmbedManyResult as ay, type BaseStructuredOutputType as az, MastraMemory as b, cloneStep as b0, createWorkflow as b1, cloneWorkflow as b2, type WorkflowResult as b3, Run as b4, type ExecutionGraph as b5, ExecutionEngine as b6, type ExecuteFunction as b7, type StepSuccess as b8, type StepFailure as b9, type VersionDetail as bA, type ArgumentInfo as bB, type PositionalArgumentInfo as bC, type NamedArgumentInfo as bD, type SubcommandInfo as bE, type CommandInfo as bF, type EnvironmentVariableInfo as bG, type PackageInfo as bH, type RemoteInfo as bI, type MCPServerConfig as bJ, type ServerInfo as bK, type ServerDetailInfo as bL, type MCPToolType as bM, MessageList as bN, type ToolsetsInput as bO, type DynamicArgument as bP, type AgentGenerateOptions as bQ, type AgentStreamOptions as bR, type MastraMessageContentV2 as bS, type StepSuspended as ba, type StepRunning as bb, type StepResult as bc, type StepsRecord as bd, type DynamicMapping as be, type PathsToStringProps as bf, type ExtractSchemaType as bg, type ExtractSchemaFromStep as bh, type VariableReference as bi, type StreamEvent as bj, type WatchEvent as bk, type ZodPathType as bl, type WorkflowRunState as bm, type MastraLanguageModel as bn, type VoiceEventType as bo, type VoiceEventMap as bp, type VoiceConfig as bq, MastraVoice as br, CompositeVoice as bs, DefaultVoice as bt, type AgentNetworkConfig as bu, type ConvertedTool as bv, type MCPServerSSEOptions as bw, type MCPServerHonoSSEOptions as bx, type MCPServerHTTPOptions as by, type Repository as bz, type ToolAction as c, LegacyStep as d, Workflow as e, type Step as f, AgentNetwork as g, MCPServerBase as h, type Methods as i, type ApiRoute as j, type MastraAuthConfig as k, type ContextWithMastra as l, MastraAuthProvider as m, type MastraAuthProviderOptions as n, MastraStorage as o, type TABLE_NAMES as p, type StorageColumn as q, type StorageThreadType as r, type MastraMessageV2 as s, type StorageGetMessagesArg as t, type MastraMessageV1 as u, type WorkflowRuns as v, type WorkflowRun as w, type LegacyWorkflowRuns as x, type LegacyWorkflowRun as y, TABLE_WORKFLOW_SNAPSHOT as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/tools/tool.ts
|
|
4
|
+
var Tool = class {
|
|
5
|
+
id;
|
|
6
|
+
description;
|
|
7
|
+
inputSchema;
|
|
8
|
+
outputSchema;
|
|
9
|
+
execute;
|
|
10
|
+
mastra;
|
|
11
|
+
constructor(opts) {
|
|
12
|
+
this.id = opts.id;
|
|
13
|
+
this.description = opts.description;
|
|
14
|
+
this.inputSchema = opts.inputSchema;
|
|
15
|
+
this.outputSchema = opts.outputSchema;
|
|
16
|
+
this.execute = opts.execute;
|
|
17
|
+
this.mastra = opts.mastra;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function createTool(opts) {
|
|
21
|
+
return new Tool(opts);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/tools/toolchecks.ts
|
|
25
|
+
function isVercelTool(tool) {
|
|
26
|
+
return !!(tool && !(tool instanceof Tool) && "parameters" in tool);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exports.Tool = Tool;
|
|
30
|
+
exports.createTool = createTool;
|
|
31
|
+
exports.isVercelTool = isVercelTool;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { augmentWithInit } from './chunk-YOQP5T77.js';
|
|
2
|
-
import { MessageList } from './chunk-
|
|
3
|
-
import { deepMerge } from './chunk-
|
|
2
|
+
import { MessageList } from './chunk-677GIYFF.js';
|
|
3
|
+
import { deepMerge } from './chunk-Y5BGCPNZ.js';
|
|
4
4
|
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
5
5
|
|
|
6
6
|
// src/memory/memory.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isUiMessage, isCoreMessage } from './chunk-
|
|
1
|
+
import { isUiMessage, isCoreMessage } from './chunk-Y5BGCPNZ.js';
|
|
2
2
|
import { randomUUID } from 'crypto';
|
|
3
3
|
import { convertToCoreMessages } from 'ai';
|
|
4
4
|
import { convertUint8ArrayToBase64, convertBase64ToUint8Array } from '@ai-sdk/provider-utils';
|
|
@@ -354,6 +354,7 @@ var MessageList = class _MessageList {
|
|
|
354
354
|
memoryMessages = /* @__PURE__ */ new Set();
|
|
355
355
|
newUserMessages = /* @__PURE__ */ new Set();
|
|
356
356
|
newResponseMessages = /* @__PURE__ */ new Set();
|
|
357
|
+
userContextMessages = /* @__PURE__ */ new Set();
|
|
357
358
|
generateMessageId;
|
|
358
359
|
constructor({
|
|
359
360
|
threadId,
|
|
@@ -643,6 +644,8 @@ ${JSON.stringify(message, null, 2)}`
|
|
|
643
644
|
this.newResponseMessages.add(messageV2);
|
|
644
645
|
} else if (messageSource === `user`) {
|
|
645
646
|
this.newUserMessages.add(messageV2);
|
|
647
|
+
} else if (messageSource === `context`) {
|
|
648
|
+
this.userContextMessages.add(messageV2);
|
|
646
649
|
} else {
|
|
647
650
|
throw new Error(`Missing message source for message ${messageV2}`);
|
|
648
651
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DefaultVoice } from './chunk-FLPSXJWQ.js';
|
|
2
2
|
import { executeHook } from './chunk-BB4KXGBU.js';
|
|
3
|
-
import { MastraLLM } from './chunk-
|
|
3
|
+
import { MastraLLM } from './chunk-FGBS7VRU.js';
|
|
4
|
+
import { MessageList } from './chunk-677GIYFF.js';
|
|
4
5
|
import { InstrumentClass } from './chunk-EWDGXKOQ.js';
|
|
5
|
-
import {
|
|
6
|
-
import { ensureToolProperties, makeCoreTool, createMastraProxy } from './chunk-26WUL725.js';
|
|
6
|
+
import { ensureToolProperties, makeCoreTool, createMastraProxy } from './chunk-Y5BGCPNZ.js';
|
|
7
7
|
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
8
8
|
import { RegisteredLogger } from './chunk-XXVGT7SJ.js';
|
|
9
9
|
import { RuntimeContext } from './chunk-SGGPJWRQ.js';
|
|
@@ -763,7 +763,7 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
763
763
|
}).addSystem({
|
|
764
764
|
role: "system",
|
|
765
765
|
content: instructions || `${this.instructions}.`
|
|
766
|
-
}).add(context || [], "
|
|
766
|
+
}).add(context || [], "context");
|
|
767
767
|
if (!memory || !threadId && !resourceId) {
|
|
768
768
|
messageList.add(messages, "user");
|
|
769
769
|
return {
|
|
@@ -821,7 +821,7 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
821
821
|
const processedList = new MessageList({
|
|
822
822
|
threadId,
|
|
823
823
|
resourceId
|
|
824
|
-
}).addSystem(instructions || `${this.instructions}.`).addSystem(memorySystemMessage).add(context || [], "
|
|
824
|
+
}).addSystem(instructions || `${this.instructions}.`).addSystem(memorySystemMessage).add(context || [], "context").add(processedMemoryMessages, "memory").add(messageList.get.input.v2(), "user").get.all.prompt();
|
|
825
825
|
return {
|
|
826
826
|
convertedTools,
|
|
827
827
|
threadId,
|
|
@@ -1155,6 +1155,7 @@ var Agent = class extends (_a = MastraBase) {
|
|
|
1155
1155
|
runId,
|
|
1156
1156
|
toolChoice,
|
|
1157
1157
|
experimental_output,
|
|
1158
|
+
telemetry,
|
|
1158
1159
|
memory: this.getMemory(),
|
|
1159
1160
|
runtimeContext,
|
|
1160
1161
|
...args
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4Z3OU5RY_cjs = require('./chunk-4Z3OU5RY.cjs');
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
|
|
6
6
|
// src/integration/integration.ts
|
|
@@ -68,7 +68,7 @@ var OpenAPIToolset = class {
|
|
|
68
68
|
const tools = Object.keys(clientMethods).reduce((acc, key) => {
|
|
69
69
|
const comment = documentations[key]?.comment;
|
|
70
70
|
const fallbackComment = `Execute ${key}`;
|
|
71
|
-
const tool =
|
|
71
|
+
const tool = chunk4Z3OU5RY_cjs.createTool({
|
|
72
72
|
id: key,
|
|
73
73
|
inputSchema: schemas[key] || zod.z.object({}),
|
|
74
74
|
description: comment || fallbackComment,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/tools/tool.ts
|
|
2
|
+
var Tool = class {
|
|
3
|
+
id;
|
|
4
|
+
description;
|
|
5
|
+
inputSchema;
|
|
6
|
+
outputSchema;
|
|
7
|
+
execute;
|
|
8
|
+
mastra;
|
|
9
|
+
constructor(opts) {
|
|
10
|
+
this.id = opts.id;
|
|
11
|
+
this.description = opts.description;
|
|
12
|
+
this.inputSchema = opts.inputSchema;
|
|
13
|
+
this.outputSchema = opts.outputSchema;
|
|
14
|
+
this.execute = opts.execute;
|
|
15
|
+
this.mastra = opts.mastra;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function createTool(opts) {
|
|
19
|
+
return new Tool(opts);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/tools/toolchecks.ts
|
|
23
|
+
function isVercelTool(tool) {
|
|
24
|
+
return !!(tool && !(tool instanceof Tool) && "parameters" in tool);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Tool, createTool, isVercelTool };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMVXVUMLA_cjs = require('./chunk-MVXVUMLA.cjs');
|
|
4
4
|
var cohereAi = require('cohere-ai');
|
|
5
5
|
|
|
6
6
|
var CohereRelevanceScorer = class {
|
|
@@ -38,7 +38,7 @@ Relevance score (0-1):`;
|
|
|
38
38
|
var MastraAgentRelevanceScorer = class {
|
|
39
39
|
agent;
|
|
40
40
|
constructor(name, model) {
|
|
41
|
-
this.agent = new
|
|
41
|
+
this.agent = new chunkMVXVUMLA_cjs.Agent({
|
|
42
42
|
name: `Relevance Scorer ${name}`,
|
|
43
43
|
instructions: `You are a specialized agent for evaluating the relevance of text to queries.
|
|
44
44
|
Your task is to rate how well a text passage answers a given query.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { delay } from './chunk-
|
|
1
|
+
import { delay } from './chunk-Y5BGCPNZ.js';
|
|
2
2
|
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
3
3
|
import { RegisteredLogger } from './chunk-XXVGT7SJ.js';
|
|
4
4
|
import { jsonSchema, generateText, Output, generateObject, streamText, streamObject } from 'ai';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWWLMZIHW_cjs = require('./chunk-WWLMZIHW.cjs');
|
|
4
4
|
var crypto = require('crypto');
|
|
5
5
|
var ai = require('ai');
|
|
6
6
|
var providerUtils = require('@ai-sdk/provider-utils');
|
|
@@ -356,6 +356,7 @@ var MessageList = class _MessageList {
|
|
|
356
356
|
memoryMessages = /* @__PURE__ */ new Set();
|
|
357
357
|
newUserMessages = /* @__PURE__ */ new Set();
|
|
358
358
|
newResponseMessages = /* @__PURE__ */ new Set();
|
|
359
|
+
userContextMessages = /* @__PURE__ */ new Set();
|
|
359
360
|
generateMessageId;
|
|
360
361
|
constructor({
|
|
361
362
|
threadId,
|
|
@@ -645,6 +646,8 @@ ${JSON.stringify(message, null, 2)}`
|
|
|
645
646
|
this.newResponseMessages.add(messageV2);
|
|
646
647
|
} else if (messageSource === `user`) {
|
|
647
648
|
this.newUserMessages.add(messageV2);
|
|
649
|
+
} else if (messageSource === `context`) {
|
|
650
|
+
this.userContextMessages.add(messageV2);
|
|
648
651
|
} else {
|
|
649
652
|
throw new Error(`Missing message source for message ${messageV2}`);
|
|
650
653
|
}
|
|
@@ -854,10 +857,10 @@ ${JSON.stringify(message, null, 2)}`
|
|
|
854
857
|
};
|
|
855
858
|
}
|
|
856
859
|
static isVercelUIMessage(msg) {
|
|
857
|
-
return !_MessageList.isMastraMessage(msg) &&
|
|
860
|
+
return !_MessageList.isMastraMessage(msg) && chunkWWLMZIHW_cjs.isUiMessage(msg);
|
|
858
861
|
}
|
|
859
862
|
static isVercelCoreMessage(msg) {
|
|
860
|
-
return !_MessageList.isMastraMessage(msg) &&
|
|
863
|
+
return !_MessageList.isMastraMessage(msg) && chunkWWLMZIHW_cjs.isCoreMessage(msg);
|
|
861
864
|
}
|
|
862
865
|
static isMastraMessage(msg) {
|
|
863
866
|
return _MessageList.isMastraMessageV2(msg) || _MessageList.isMastraMessageV1(msg);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBB6DPGIV_cjs = require('./chunk-BB6DPGIV.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkMVXVUMLA_cjs = require('./chunk-MVXVUMLA.cjs');
|
|
5
|
+
var chunk4Z3OU5RY_cjs = require('./chunk-4Z3OU5RY.cjs');
|
|
6
6
|
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
7
7
|
var chunkRFAN7FAT_cjs = require('./chunk-RFAN7FAT.cjs');
|
|
8
8
|
var chunkLABUWBKX_cjs = require('./chunk-LABUWBKX.cjs');
|
|
@@ -720,7 +720,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
720
720
|
|
|
721
721
|
// src/workflows/workflow.ts
|
|
722
722
|
function createStep(params) {
|
|
723
|
-
if (params instanceof
|
|
723
|
+
if (params instanceof chunkMVXVUMLA_cjs.Agent) {
|
|
724
724
|
return {
|
|
725
725
|
id: params.name,
|
|
726
726
|
// @ts-ignore
|
|
@@ -785,7 +785,7 @@ function createStep(params) {
|
|
|
785
785
|
}
|
|
786
786
|
};
|
|
787
787
|
}
|
|
788
|
-
if (params instanceof
|
|
788
|
+
if (params instanceof chunk4Z3OU5RY_cjs.Tool) {
|
|
789
789
|
if (!params.inputSchema || !params.outputSchema) {
|
|
790
790
|
throw new Error("Tool must have input and output schemas defined");
|
|
791
791
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EMITTER_SYMBOL } from './chunk-Y7D2JLKS.js';
|
|
2
|
-
import { Agent } from './chunk-
|
|
3
|
-
import { Tool } from './chunk-
|
|
2
|
+
import { Agent } from './chunk-B4TMM6NT.js';
|
|
3
|
+
import { Tool } from './chunk-C4LMN2IR.js';
|
|
4
4
|
import { MastraBase } from './chunk-JOCKZ2US.js';
|
|
5
5
|
import { RegisteredLogger } from './chunk-XXVGT7SJ.js';
|
|
6
6
|
import { RuntimeContext } from './chunk-SGGPJWRQ.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkLXFZUKP3_cjs = require('./chunk-LXFZUKP3.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkFHLDRRKJ_cjs = require('./chunk-FHLDRRKJ.cjs');
|
|
5
|
+
var chunkWWLMZIHW_cjs = require('./chunk-WWLMZIHW.cjs');
|
|
6
6
|
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
7
7
|
|
|
8
8
|
// src/memory/memory.ts
|
|
@@ -130,7 +130,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
130
130
|
if (config?.workingMemory && "use" in config.workingMemory) {
|
|
131
131
|
throw new Error("The workingMemory.use option has been removed. Working memory always uses tool-call mode.");
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return chunkWWLMZIHW_cjs.deepMerge(this.threadConfig, config || {});
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* Apply all configured message processors to a list of messages.
|
|
@@ -221,7 +221,7 @@ https://mastra.ai/en/docs/memory/overview`
|
|
|
221
221
|
toolCallIds
|
|
222
222
|
};
|
|
223
223
|
const savedMessages = await this.saveMessages({ messages: [message], memoryConfig: config });
|
|
224
|
-
const list = new
|
|
224
|
+
const list = new chunkFHLDRRKJ_cjs.MessageList({ threadId, resourceId }).add(savedMessages[0], "memory");
|
|
225
225
|
return list.get.all.v1()[0];
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk3JGO7S6X_cjs = require('./chunk-3JGO7S6X.cjs');
|
|
4
4
|
var chunkST5RMVLG_cjs = require('./chunk-ST5RMVLG.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkVBSKHNCY_cjs = require('./chunk-VBSKHNCY.cjs');
|
|
6
|
+
var chunkFHLDRRKJ_cjs = require('./chunk-FHLDRRKJ.cjs');
|
|
6
7
|
var chunkTICDQWVJ_cjs = require('./chunk-TICDQWVJ.cjs');
|
|
7
|
-
var
|
|
8
|
-
var chunkTN3TNMXO_cjs = require('./chunk-TN3TNMXO.cjs');
|
|
8
|
+
var chunkWWLMZIHW_cjs = require('./chunk-WWLMZIHW.cjs');
|
|
9
9
|
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
10
10
|
var chunkRFAN7FAT_cjs = require('./chunk-RFAN7FAT.cjs');
|
|
11
11
|
var chunkLABUWBKX_cjs = require('./chunk-LABUWBKX.cjs');
|
|
@@ -228,13 +228,13 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
228
228
|
if (typeof this.#tools === "function") {
|
|
229
229
|
throw new Error("Tools are not compatible when tools are a function. Please use getTools() instead.");
|
|
230
230
|
}
|
|
231
|
-
return
|
|
231
|
+
return chunkWWLMZIHW_cjs.ensureToolProperties(this.#tools);
|
|
232
232
|
}
|
|
233
233
|
getTools({
|
|
234
234
|
runtimeContext = new chunkLABUWBKX_cjs.RuntimeContext()
|
|
235
235
|
} = {}) {
|
|
236
236
|
if (typeof this.#tools !== "function") {
|
|
237
|
-
return
|
|
237
|
+
return chunkWWLMZIHW_cjs.ensureToolProperties(this.#tools);
|
|
238
238
|
}
|
|
239
239
|
const result = this.#tools({
|
|
240
240
|
runtimeContext
|
|
@@ -244,7 +244,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
244
244
|
this.logger.error(`[Agent:${this.name}] - Function-based tools returned empty value`);
|
|
245
245
|
throw new Error("Tools are required when using a function to provide them. The function returned an empty value.");
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return chunkWWLMZIHW_cjs.ensureToolProperties(tools);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
get llm() {
|
|
@@ -266,7 +266,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
266
266
|
runtimeContext
|
|
267
267
|
});
|
|
268
268
|
return resolveMaybePromise(model, model2 => {
|
|
269
|
-
const llm = new
|
|
269
|
+
const llm = new chunkVBSKHNCY_cjs.MastraLLM({
|
|
270
270
|
model: model2,
|
|
271
271
|
mastra: this.#mastra
|
|
272
272
|
});
|
|
@@ -393,7 +393,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
393
393
|
memoryConfig,
|
|
394
394
|
resourceId,
|
|
395
395
|
runId,
|
|
396
|
-
messageList = new
|
|
396
|
+
messageList = new chunkFHLDRRKJ_cjs.MessageList({
|
|
397
397
|
threadId,
|
|
398
398
|
resourceId
|
|
399
399
|
})
|
|
@@ -525,7 +525,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
525
525
|
runtimeContext
|
|
526
526
|
}) : this.model
|
|
527
527
|
};
|
|
528
|
-
return [k,
|
|
528
|
+
return [k, chunkWWLMZIHW_cjs.makeCoreTool(tool, options)];
|
|
529
529
|
}));
|
|
530
530
|
const assignedToolEntriesConverted = Object.fromEntries(assignedCoreToolEntries.filter(entry => Boolean(entry)));
|
|
531
531
|
toolsForRequest = {
|
|
@@ -565,7 +565,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
565
565
|
runtimeContext
|
|
566
566
|
}) : this.model
|
|
567
567
|
};
|
|
568
|
-
const convertedToCoreTool =
|
|
568
|
+
const convertedToCoreTool = chunkWWLMZIHW_cjs.makeCoreTool(toolObj, options, "toolset");
|
|
569
569
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
@@ -606,7 +606,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
606
606
|
runtimeContext
|
|
607
607
|
}) : this.model
|
|
608
608
|
};
|
|
609
|
-
const convertedToCoreTool =
|
|
609
|
+
const convertedToCoreTool = chunkWWLMZIHW_cjs.makeCoreTool(rest, options, "client-tool");
|
|
610
610
|
toolsForRequest[toolName] = convertedToCoreTool;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
@@ -673,7 +673,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
673
673
|
let mastraProxy = void 0;
|
|
674
674
|
const logger = this.logger;
|
|
675
675
|
if (this.#mastra) {
|
|
676
|
-
mastraProxy =
|
|
676
|
+
mastraProxy = chunkWWLMZIHW_cjs.createMastraProxy({
|
|
677
677
|
mastra: this.#mastra,
|
|
678
678
|
logger
|
|
679
679
|
});
|
|
@@ -763,14 +763,14 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
763
763
|
runId,
|
|
764
764
|
runtimeContext
|
|
765
765
|
});
|
|
766
|
-
const messageList = new
|
|
766
|
+
const messageList = new chunkFHLDRRKJ_cjs.MessageList({
|
|
767
767
|
threadId,
|
|
768
768
|
resourceId,
|
|
769
769
|
generateMessageId
|
|
770
770
|
}).addSystem({
|
|
771
771
|
role: "system",
|
|
772
772
|
content: instructions || `${this.instructions}.`
|
|
773
|
-
}).add(context || [], "
|
|
773
|
+
}).add(context || [], "context");
|
|
774
774
|
if (!memory || !threadId && !resourceId) {
|
|
775
775
|
messageList.add(messages, "user");
|
|
776
776
|
return {
|
|
@@ -825,10 +825,10 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
825
825
|
systemMessage,
|
|
826
826
|
memorySystemMessage: memorySystemMessage || void 0
|
|
827
827
|
});
|
|
828
|
-
const processedList = new
|
|
828
|
+
const processedList = new chunkFHLDRRKJ_cjs.MessageList({
|
|
829
829
|
threadId,
|
|
830
830
|
resourceId
|
|
831
|
-
}).addSystem(instructions || `${this.instructions}.`).addSystem(memorySystemMessage).add(context || [], "
|
|
831
|
+
}).addSystem(instructions || `${this.instructions}.`).addSystem(memorySystemMessage).add(context || [], "context").add(processedMemoryMessages, "memory").add(messageList.get.input.v2(), "user").get.all.prompt();
|
|
832
832
|
return {
|
|
833
833
|
convertedTools,
|
|
834
834
|
threadId,
|
|
@@ -1162,6 +1162,7 @@ exports.Agent = class Agent extends (_a = chunkVHZPWE5L_cjs.MastraBase) {
|
|
|
1162
1162
|
runId,
|
|
1163
1163
|
toolChoice,
|
|
1164
1164
|
experimental_output,
|
|
1165
|
+
telemetry,
|
|
1165
1166
|
memory: this.getMemory(),
|
|
1166
1167
|
runtimeContext,
|
|
1167
1168
|
...args
|
|
@@ -1911,7 +1912,7 @@ var Machine = class extends EventEmitter__default.default {
|
|
|
1911
1912
|
const logger = this.logger;
|
|
1912
1913
|
let mastraProxy = void 0;
|
|
1913
1914
|
if (this.#mastra) {
|
|
1914
|
-
mastraProxy =
|
|
1915
|
+
mastraProxy = chunkWWLMZIHW_cjs.createMastraProxy({
|
|
1915
1916
|
mastra: this.#mastra,
|
|
1916
1917
|
logger
|
|
1917
1918
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWWLMZIHW_cjs = require('./chunk-WWLMZIHW.cjs');
|
|
4
4
|
var chunkVHZPWE5L_cjs = require('./chunk-VHZPWE5L.cjs');
|
|
5
5
|
var chunkRFAN7FAT_cjs = require('./chunk-RFAN7FAT.cjs');
|
|
6
6
|
var ai = require('ai');
|
|
@@ -162,7 +162,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
162
162
|
});
|
|
163
163
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
164
164
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
165
|
-
await
|
|
165
|
+
await chunkWWLMZIHW_cjs.delay(10 * 1e3);
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
...rest
|
|
@@ -231,7 +231,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
231
231
|
});
|
|
232
232
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
233
233
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
234
|
-
await
|
|
234
|
+
await chunkWWLMZIHW_cjs.delay(10 * 1e3);
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
...rest
|
|
@@ -304,7 +304,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
304
304
|
});
|
|
305
305
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
306
306
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
307
|
-
await
|
|
307
|
+
await chunkWWLMZIHW_cjs.delay(10 * 1e3);
|
|
308
308
|
}
|
|
309
309
|
},
|
|
310
310
|
onFinish: async (props) => {
|
|
@@ -395,7 +395,7 @@ var MastraLLM = class extends MastraLLMBase {
|
|
|
395
395
|
});
|
|
396
396
|
if (props?.response?.headers?.["x-ratelimit-remaining-tokens"] && parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"], 10) < 2e3) {
|
|
397
397
|
this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
|
|
398
|
-
await
|
|
398
|
+
await chunkWWLMZIHW_cjs.delay(10 * 1e3);
|
|
399
399
|
}
|
|
400
400
|
},
|
|
401
401
|
onFinish: async (props) => {
|