@mastra/core 0.9.4-alpha.2 → 0.9.4-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.d.cts +2 -2
  3. package/dist/agent/index.d.ts +2 -2
  4. package/dist/agent/index.js +1 -1
  5. package/dist/{base-Ds8Er4RI.d.ts → base-BCfssGt6.d.ts} +52 -14
  6. package/dist/{base-BH9nLjiE.d.cts → base-CAEcd6q2.d.cts} +52 -14
  7. package/dist/{chunk-MT4MRB64.cjs → chunk-24TNYZQE.cjs} +4 -4
  8. package/dist/{chunk-2TW4KTAP.cjs → chunk-3CTNBAF2.cjs} +23 -7
  9. package/dist/{chunk-4OTKXCGD.js → chunk-4WABQORE.js} +48 -6
  10. package/dist/{chunk-7BYKMXS2.js → chunk-6DIL4BTD.js} +1 -1
  11. package/dist/{chunk-NW6LO3QH.js → chunk-D5PCSVU5.js} +23 -7
  12. package/dist/{chunk-7FV65Q6G.cjs → chunk-HAENAPIH.cjs} +2 -2
  13. package/dist/{chunk-MUCBDM7Y.cjs → chunk-JA7Y3KJH.cjs} +5 -5
  14. package/dist/{chunk-OH4OCBZW.cjs → chunk-KZGB62K2.cjs} +38 -29
  15. package/dist/{chunk-U6I2YTXP.js → chunk-M4EDS6EW.js} +1 -1
  16. package/dist/{chunk-CLQS5YQO.js → chunk-MX6P7USA.js} +27 -18
  17. package/dist/{chunk-2OC4YT6C.js → chunk-NZV4OA6P.js} +1 -7
  18. package/dist/{chunk-ZPFKNO6J.cjs → chunk-QDAMIZY3.cjs} +49 -7
  19. package/dist/{chunk-IIK2DDET.cjs → chunk-V4SPAVHV.cjs} +2 -2
  20. package/dist/{chunk-6YUKY7NG.js → chunk-WKFKO3Q2.js} +2 -2
  21. package/dist/{chunk-2GXSTMD7.cjs → chunk-WQKOM7XM.cjs} +1 -7
  22. package/dist/{chunk-EK3WKXRL.js → chunk-XR75VNNH.js} +1 -1
  23. package/dist/eval/index.d.cts +2 -2
  24. package/dist/eval/index.d.ts +2 -2
  25. package/dist/index.cjs +50 -50
  26. package/dist/index.d.cts +3 -3
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +9 -9
  29. package/dist/integration/index.cjs +3 -3
  30. package/dist/integration/index.d.cts +2 -2
  31. package/dist/integration/index.d.ts +2 -2
  32. package/dist/integration/index.js +1 -1
  33. package/dist/llm/index.d.cts +2 -2
  34. package/dist/llm/index.d.ts +2 -2
  35. package/dist/mastra/index.d.cts +2 -2
  36. package/dist/mastra/index.d.ts +2 -2
  37. package/dist/mcp/index.d.cts +3 -3
  38. package/dist/mcp/index.d.ts +3 -3
  39. package/dist/memory/index.cjs +4 -4
  40. package/dist/memory/index.d.cts +2 -2
  41. package/dist/memory/index.d.ts +2 -2
  42. package/dist/memory/index.js +1 -1
  43. package/dist/network/index.cjs +4 -4
  44. package/dist/network/index.d.cts +2 -2
  45. package/dist/network/index.d.ts +2 -2
  46. package/dist/network/index.js +2 -2
  47. package/dist/relevance/index.cjs +4 -4
  48. package/dist/relevance/index.d.cts +2 -2
  49. package/dist/relevance/index.d.ts +2 -2
  50. package/dist/relevance/index.js +1 -1
  51. package/dist/server/index.d.cts +1 -1
  52. package/dist/server/index.d.ts +1 -1
  53. package/dist/storage/index.d.cts +2 -2
  54. package/dist/storage/index.d.ts +2 -2
  55. package/dist/storage/libsql/index.d.cts +2 -2
  56. package/dist/storage/libsql/index.d.ts +2 -2
  57. package/dist/telemetry/index.d.cts +2 -2
  58. package/dist/telemetry/index.d.ts +2 -2
  59. package/dist/tools/index.cjs +4 -4
  60. package/dist/tools/index.d.cts +2 -2
  61. package/dist/tools/index.d.ts +2 -2
  62. package/dist/tools/index.js +1 -1
  63. package/dist/utils.cjs +12 -12
  64. package/dist/utils.d.cts +2 -2
  65. package/dist/utils.d.ts +2 -2
  66. package/dist/utils.js +1 -1
  67. package/dist/vector/index.cjs +2 -2
  68. package/dist/vector/index.d.cts +2 -2
  69. package/dist/vector/index.d.ts +2 -2
  70. package/dist/vector/index.js +1 -1
  71. package/dist/vector/libsql/index.cjs +3 -3
  72. package/dist/vector/libsql/index.d.cts +36 -3
  73. package/dist/vector/libsql/index.d.ts +36 -3
  74. package/dist/vector/libsql/index.js +1 -1
  75. package/dist/voice/index.d.cts +2 -2
  76. package/dist/voice/index.d.ts +2 -2
  77. package/dist/workflows/index.cjs +22 -22
  78. package/dist/workflows/index.d.cts +3 -3
  79. package/dist/workflows/index.d.ts +3 -3
  80. package/dist/workflows/index.js +1 -1
  81. package/dist/workflows/vNext/index.cjs +4 -4
  82. package/dist/workflows/vNext/index.d.cts +3 -3
  83. package/dist/workflows/vNext/index.d.ts +3 -3
  84. package/dist/workflows/vNext/index.js +2 -2
  85. package/package.json +2 -1
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkOH4OCBZW_cjs = require('../chunk-OH4OCBZW.cjs');
3
+ var chunkKZGB62K2_cjs = require('../chunk-KZGB62K2.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Agent", {
8
8
  enumerable: true,
9
- get: function () { return chunkOH4OCBZW_cjs.Agent; }
9
+ get: function () { return chunkKZGB62K2_cjs.Agent; }
10
10
  });
@@ -1,7 +1,7 @@
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, bj as AgentGenerateOptions, bk as AgentStreamOptions, bi as DynamicArgument, b2 as MastraLanguageModel, b4 as ToolsInput, bh as ToolsetsInput } from '../base-BH9nLjiE.cjs';
4
+ export { F as Agent, G as AgentConfig, bl as AgentGenerateOptions, bm as AgentStreamOptions, bk as DynamicArgument, b2 as MastraLanguageModel, b4 as ToolsInput, bj as ToolsetsInput } from '../base-CAEcd6q2.cjs';
5
5
  import '../base-H7siSAfu.cjs';
6
6
  import '../types-BtMyV38I.cjs';
7
7
  import '../runtime-context/index.cjs';
@@ -17,10 +17,10 @@ import '../vector/filter/index.cjs';
17
17
  import '@opentelemetry/sdk-trace-base';
18
18
  import '../tts/index.cjs';
19
19
  import 'node:http';
20
+ import 'hono';
20
21
  import 'events';
21
22
  import '../deployer/index.cjs';
22
23
  import '../bundler/index.cjs';
23
- import 'hono';
24
24
  import 'hono/cors';
25
25
  import 'hono-openapi';
26
26
  import 'ai/test';
@@ -1,7 +1,7 @@
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, bj as AgentGenerateOptions, bk as AgentStreamOptions, bi as DynamicArgument, b2 as MastraLanguageModel, b4 as ToolsInput, bh as ToolsetsInput } from '../base-Ds8Er4RI.js';
4
+ export { F as Agent, G as AgentConfig, bl as AgentGenerateOptions, bm as AgentStreamOptions, bk as DynamicArgument, b2 as MastraLanguageModel, b4 as ToolsInput, bj as ToolsetsInput } from '../base-BCfssGt6.js';
5
5
  import '../base-4Z34GQL8.js';
6
6
  import '../types-BtMyV38I.js';
7
7
  import '../runtime-context/index.js';
@@ -17,10 +17,10 @@ import '../vector/filter/index.js';
17
17
  import '@opentelemetry/sdk-trace-base';
18
18
  import '../tts/index.js';
19
19
  import 'node:http';
20
+ import 'hono';
20
21
  import 'events';
21
22
  import '../deployer/index.js';
22
23
  import '../bundler/index.js';
23
- import 'hono';
24
24
  import 'hono/cors';
25
25
  import 'hono-openapi';
26
26
  import 'ai/test';
@@ -1 +1 @@
1
- export { Agent } from '../chunk-CLQS5YQO.js';
1
+ export { Agent } from '../chunk-MX6P7USA.js';
@@ -14,9 +14,9 @@ import EventEmitter from 'node:events';
14
14
  import { MastraVector } from './vector/index.js';
15
15
  import { MastraTTS } from './tts/index.js';
16
16
  import * as http from 'node:http';
17
+ import { Context, Handler, MiddlewareHandler } from 'hono';
17
18
  import EventEmitter$1 from 'events';
18
19
  import { MastraDeployer } from './deployer/index.js';
19
- import { Handler, MiddlewareHandler } from 'hono';
20
20
  import { cors } from 'hono/cors';
21
21
  import { DescribeRouteOptions } from 'hono-openapi';
22
22
  import { MockLanguageModelV1 } from 'ai/test';
@@ -98,10 +98,7 @@ type ConvertedTool = {
98
98
  parameters: InternalCoreTool['parameters'];
99
99
  execute: InternalCoreTool['execute'];
100
100
  };
101
- /**
102
- * Options for starting an MCP server with SSE transport
103
- */
104
- interface MCPServerSSEOptions {
101
+ interface MCPServerSSEOptionsBase {
105
102
  /**
106
103
  * Parsed URL of the incoming request
107
104
  */
@@ -114,6 +111,11 @@ interface MCPServerSSEOptions {
114
111
  * Path for POSTing client messages (e.g. '/message')
115
112
  */
116
113
  messagePath: string;
114
+ }
115
+ /**
116
+ * Options for starting an MCP server with SSE transport
117
+ */
118
+ interface MCPServerSSEOptions extends MCPServerSSEOptionsBase {
117
119
  /**
118
120
  * Incoming HTTP request
119
121
  */
@@ -123,6 +125,37 @@ interface MCPServerSSEOptions {
123
125
  */
124
126
  res: http.ServerResponse<http.IncomingMessage>;
125
127
  }
128
+ /**
129
+ * Options for starting an MCP server with Hono SSE transport
130
+ */
131
+ interface MCPServerHonoSSEOptions extends MCPServerSSEOptionsBase {
132
+ /**
133
+ * Incoming Hono context
134
+ */
135
+ context: Context;
136
+ }
137
+ interface MCPServerHTTPOptions {
138
+ /**
139
+ * Parsed URL of the incoming request
140
+ */
141
+ url: URL;
142
+ /**
143
+ * Path for establishing the HTTP connection (e.g. '/mcp')
144
+ */
145
+ httpPath: string;
146
+ /**
147
+ * Incoming HTTP request
148
+ */
149
+ req: http.IncomingMessage;
150
+ /**
151
+ * HTTP response (must support .write/.end)
152
+ */
153
+ res: http.ServerResponse<http.IncomingMessage>;
154
+ /**
155
+ * Optional options to pass to the transport (e.g. sessionIdGenerator)
156
+ */
157
+ options?: any;
158
+ }
126
159
 
127
160
  /**
128
161
  * Abstract base class for MCP server implementations
@@ -164,13 +197,17 @@ declare abstract class MCPServerBase extends MastraBase {
164
197
  * @param options Options for the SSE transport
165
198
  */
166
199
  abstract startSSE(options: MCPServerSSEOptions): Promise<void>;
167
- abstract startHTTP(options: {
168
- url: URL;
169
- httpPath: string;
170
- req: http.IncomingMessage;
171
- res: http.ServerResponse<http.IncomingMessage>;
172
- options?: any;
173
- }): Promise<void>;
200
+ /**
201
+ * Start the MCP server using Hono SSE transport
202
+ * Used for Hono servers
203
+ * @param options Options for the SSE transport
204
+ */
205
+ abstract startHonoSSE(options: MCPServerHonoSSEOptions): Promise<Response | undefined>;
206
+ /**
207
+ * Start the MCP server using HTTP transport
208
+ * @param options Options for the HTTP transport
209
+ */
210
+ abstract startHTTP(options: MCPServerHTTPOptions): Promise<void>;
174
211
  /**
175
212
  * Close the MCP server and all its connections
176
213
  */
@@ -2560,13 +2597,14 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2560
2597
  threadId: string;
2561
2598
  thread: StorageThreadType | null | undefined;
2562
2599
  }>;
2563
- after: ({ result, thread: threadAfter, threadId, memoryConfig, outputText, runId, }: {
2600
+ after: ({ result, thread: threadAfter, threadId, memoryConfig, outputText, runId, experimental_generateMessageId, }: {
2564
2601
  runId: string;
2565
2602
  result: Record<string, any>;
2566
2603
  thread: StorageThreadType | null | undefined;
2567
2604
  threadId: string;
2568
2605
  memoryConfig: MemoryConfig | undefined;
2569
2606
  outputText: string;
2607
+ experimental_generateMessageId: any;
2570
2608
  }) => Promise<void>;
2571
2609
  };
2572
2610
  generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[] | Message[], args?: AgentGenerateOptions<Z> & {
@@ -2839,4 +2877,4 @@ declare abstract class MastraStorage extends MastraBase {
2839
2877
  }): Promise<WorkflowRun | null>;
2840
2878
  }
2841
2879
 
2842
- 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 PathsToStringProps$1 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 VariableReference$1 as aA, type BaseCondition as aB, type ActionContext as aC, WhenConditionReturnValue as aD, type StepDef as aE, type StepCondition as aF, type StepConfig as aG, type StepResult$1 as aH, type StepsRecord$1 as aI, type WorkflowRunResult as aJ, type WorkflowContext as aK, type WorkflowLogMessage as aL, type WorkflowEvent as aM, type ResolverFunctionInput as aN, type ResolverFunctionOutput as aO, type SubscriberFunctionOutput as aP, type DependencyCheckOutput as aQ, type StepResolverOutput as aR, type WorkflowActors as aS, type WorkflowActionParams as aT, type WorkflowActions as aU, type WorkflowState as aV, type StepId as aW, type ExtractSchemaFromStep$1 as aX, type ExtractStepResult as aY, type StepInputType as aZ, type ExtractSchemaType$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 InternalCoreTool as at, type StepExecutionContext as au, type StepAction as av, type StepVariableType as aw, type StepNode as ax, type StepGraph as ay, type RetryConfig as az, MastraStorage as b, type WorkflowRunState as b0, type WorkflowResumeResult as b1, type MastraLanguageModel as b2, type MastraPrimitives as b3, type ToolsInput as b4, AgentNetwork as b5, MCPServerBase as b6, type MCPServerConfig as b7, type ConvertedTool as b8, type MCPServerSSEOptions as b9, type AgentNetworkConfig as ba, type VoiceEventType as bb, type VoiceEventMap as bc, type VoiceConfig as bd, MastraVoice as be, CompositeVoice as bf, DefaultVoice as bg, type ToolsetsInput as bh, type DynamicArgument as bi, type AgentGenerateOptions as bj, type AgentStreamOptions as bk, TABLE_WORKFLOW_SNAPSHOT as bl, TABLE_EVALS as bm, TABLE_MESSAGES as bn, TABLE_THREADS as bo, TABLE_TRACES as bp, TABLE_SCHEMAS as bq, 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 };
2880
+ 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 PathsToStringProps$1 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 VariableReference$1 as aA, type BaseCondition as aB, type ActionContext as aC, WhenConditionReturnValue as aD, type StepDef as aE, type StepCondition as aF, type StepConfig as aG, type StepResult$1 as aH, type StepsRecord$1 as aI, type WorkflowRunResult as aJ, type WorkflowContext as aK, type WorkflowLogMessage as aL, type WorkflowEvent as aM, type ResolverFunctionInput as aN, type ResolverFunctionOutput as aO, type SubscriberFunctionOutput as aP, type DependencyCheckOutput as aQ, type StepResolverOutput as aR, type WorkflowActors as aS, type WorkflowActionParams as aT, type WorkflowActions as aU, type WorkflowState as aV, type StepId as aW, type ExtractSchemaFromStep$1 as aX, type ExtractStepResult as aY, type StepInputType as aZ, type ExtractSchemaType$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 InternalCoreTool as at, type StepExecutionContext as au, type StepAction as av, type StepVariableType as aw, type StepNode as ax, type StepGraph as ay, type RetryConfig as az, MastraStorage as b, type WorkflowRunState as b0, type WorkflowResumeResult as b1, type MastraLanguageModel as b2, type MastraPrimitives as b3, type ToolsInput as b4, AgentNetwork as b5, MCPServerBase as b6, type MCPServerConfig as b7, type ConvertedTool as b8, type MCPServerSSEOptions as b9, type MCPServerHonoSSEOptions as ba, type MCPServerHTTPOptions as bb, type AgentNetworkConfig as bc, type VoiceEventType as bd, type VoiceEventMap as be, type VoiceConfig as bf, MastraVoice as bg, CompositeVoice as bh, DefaultVoice as bi, type ToolsetsInput as bj, type DynamicArgument as bk, type AgentGenerateOptions as bl, type AgentStreamOptions as bm, TABLE_WORKFLOW_SNAPSHOT as bn, TABLE_EVALS as bo, TABLE_MESSAGES as bp, TABLE_THREADS as bq, TABLE_TRACES as br, TABLE_SCHEMAS as bs, 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 };
@@ -14,9 +14,9 @@ import EventEmitter from 'node:events';
14
14
  import { MastraVector } from './vector/index.cjs';
15
15
  import { MastraTTS } from './tts/index.cjs';
16
16
  import * as http from 'node:http';
17
+ import { Context, Handler, MiddlewareHandler } from 'hono';
17
18
  import EventEmitter$1 from 'events';
18
19
  import { MastraDeployer } from './deployer/index.cjs';
19
- import { Handler, MiddlewareHandler } from 'hono';
20
20
  import { cors } from 'hono/cors';
21
21
  import { DescribeRouteOptions } from 'hono-openapi';
22
22
  import { MockLanguageModelV1 } from 'ai/test';
@@ -98,10 +98,7 @@ type ConvertedTool = {
98
98
  parameters: InternalCoreTool['parameters'];
99
99
  execute: InternalCoreTool['execute'];
100
100
  };
101
- /**
102
- * Options for starting an MCP server with SSE transport
103
- */
104
- interface MCPServerSSEOptions {
101
+ interface MCPServerSSEOptionsBase {
105
102
  /**
106
103
  * Parsed URL of the incoming request
107
104
  */
@@ -114,6 +111,11 @@ interface MCPServerSSEOptions {
114
111
  * Path for POSTing client messages (e.g. '/message')
115
112
  */
116
113
  messagePath: string;
114
+ }
115
+ /**
116
+ * Options for starting an MCP server with SSE transport
117
+ */
118
+ interface MCPServerSSEOptions extends MCPServerSSEOptionsBase {
117
119
  /**
118
120
  * Incoming HTTP request
119
121
  */
@@ -123,6 +125,37 @@ interface MCPServerSSEOptions {
123
125
  */
124
126
  res: http.ServerResponse<http.IncomingMessage>;
125
127
  }
128
+ /**
129
+ * Options for starting an MCP server with Hono SSE transport
130
+ */
131
+ interface MCPServerHonoSSEOptions extends MCPServerSSEOptionsBase {
132
+ /**
133
+ * Incoming Hono context
134
+ */
135
+ context: Context;
136
+ }
137
+ interface MCPServerHTTPOptions {
138
+ /**
139
+ * Parsed URL of the incoming request
140
+ */
141
+ url: URL;
142
+ /**
143
+ * Path for establishing the HTTP connection (e.g. '/mcp')
144
+ */
145
+ httpPath: string;
146
+ /**
147
+ * Incoming HTTP request
148
+ */
149
+ req: http.IncomingMessage;
150
+ /**
151
+ * HTTP response (must support .write/.end)
152
+ */
153
+ res: http.ServerResponse<http.IncomingMessage>;
154
+ /**
155
+ * Optional options to pass to the transport (e.g. sessionIdGenerator)
156
+ */
157
+ options?: any;
158
+ }
126
159
 
127
160
  /**
128
161
  * Abstract base class for MCP server implementations
@@ -164,13 +197,17 @@ declare abstract class MCPServerBase extends MastraBase {
164
197
  * @param options Options for the SSE transport
165
198
  */
166
199
  abstract startSSE(options: MCPServerSSEOptions): Promise<void>;
167
- abstract startHTTP(options: {
168
- url: URL;
169
- httpPath: string;
170
- req: http.IncomingMessage;
171
- res: http.ServerResponse<http.IncomingMessage>;
172
- options?: any;
173
- }): Promise<void>;
200
+ /**
201
+ * Start the MCP server using Hono SSE transport
202
+ * Used for Hono servers
203
+ * @param options Options for the SSE transport
204
+ */
205
+ abstract startHonoSSE(options: MCPServerHonoSSEOptions): Promise<Response | undefined>;
206
+ /**
207
+ * Start the MCP server using HTTP transport
208
+ * @param options Options for the HTTP transport
209
+ */
210
+ abstract startHTTP(options: MCPServerHTTPOptions): Promise<void>;
174
211
  /**
175
212
  * Close the MCP server and all its connections
176
213
  */
@@ -2560,13 +2597,14 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2560
2597
  threadId: string;
2561
2598
  thread: StorageThreadType | null | undefined;
2562
2599
  }>;
2563
- after: ({ result, thread: threadAfter, threadId, memoryConfig, outputText, runId, }: {
2600
+ after: ({ result, thread: threadAfter, threadId, memoryConfig, outputText, runId, experimental_generateMessageId, }: {
2564
2601
  runId: string;
2565
2602
  result: Record<string, any>;
2566
2603
  thread: StorageThreadType | null | undefined;
2567
2604
  threadId: string;
2568
2605
  memoryConfig: MemoryConfig | undefined;
2569
2606
  outputText: string;
2607
+ experimental_generateMessageId: any;
2570
2608
  }) => Promise<void>;
2571
2609
  };
2572
2610
  generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[] | Message[], args?: AgentGenerateOptions<Z> & {
@@ -2839,4 +2877,4 @@ declare abstract class MastraStorage extends MastraBase {
2839
2877
  }): Promise<WorkflowRun | null>;
2840
2878
  }
2841
2879
 
2842
- 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 PathsToStringProps$1 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 VariableReference$1 as aA, type BaseCondition as aB, type ActionContext as aC, WhenConditionReturnValue as aD, type StepDef as aE, type StepCondition as aF, type StepConfig as aG, type StepResult$1 as aH, type StepsRecord$1 as aI, type WorkflowRunResult as aJ, type WorkflowContext as aK, type WorkflowLogMessage as aL, type WorkflowEvent as aM, type ResolverFunctionInput as aN, type ResolverFunctionOutput as aO, type SubscriberFunctionOutput as aP, type DependencyCheckOutput as aQ, type StepResolverOutput as aR, type WorkflowActors as aS, type WorkflowActionParams as aT, type WorkflowActions as aU, type WorkflowState as aV, type StepId as aW, type ExtractSchemaFromStep$1 as aX, type ExtractStepResult as aY, type StepInputType as aZ, type ExtractSchemaType$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 InternalCoreTool as at, type StepExecutionContext as au, type StepAction as av, type StepVariableType as aw, type StepNode as ax, type StepGraph as ay, type RetryConfig as az, MastraStorage as b, type WorkflowRunState as b0, type WorkflowResumeResult as b1, type MastraLanguageModel as b2, type MastraPrimitives as b3, type ToolsInput as b4, AgentNetwork as b5, MCPServerBase as b6, type MCPServerConfig as b7, type ConvertedTool as b8, type MCPServerSSEOptions as b9, type AgentNetworkConfig as ba, type VoiceEventType as bb, type VoiceEventMap as bc, type VoiceConfig as bd, MastraVoice as be, CompositeVoice as bf, DefaultVoice as bg, type ToolsetsInput as bh, type DynamicArgument as bi, type AgentGenerateOptions as bj, type AgentStreamOptions as bk, TABLE_WORKFLOW_SNAPSHOT as bl, TABLE_EVALS as bm, TABLE_MESSAGES as bn, TABLE_THREADS as bo, TABLE_TRACES as bp, TABLE_SCHEMAS as bq, 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 };
2880
+ 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 PathsToStringProps$1 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 VariableReference$1 as aA, type BaseCondition as aB, type ActionContext as aC, WhenConditionReturnValue as aD, type StepDef as aE, type StepCondition as aF, type StepConfig as aG, type StepResult$1 as aH, type StepsRecord$1 as aI, type WorkflowRunResult as aJ, type WorkflowContext as aK, type WorkflowLogMessage as aL, type WorkflowEvent as aM, type ResolverFunctionInput as aN, type ResolverFunctionOutput as aO, type SubscriberFunctionOutput as aP, type DependencyCheckOutput as aQ, type StepResolverOutput as aR, type WorkflowActors as aS, type WorkflowActionParams as aT, type WorkflowActions as aU, type WorkflowState as aV, type StepId as aW, type ExtractSchemaFromStep$1 as aX, type ExtractStepResult as aY, type StepInputType as aZ, type ExtractSchemaType$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 InternalCoreTool as at, type StepExecutionContext as au, type StepAction as av, type StepVariableType as aw, type StepNode as ax, type StepGraph as ay, type RetryConfig as az, MastraStorage as b, type WorkflowRunState as b0, type WorkflowResumeResult as b1, type MastraLanguageModel as b2, type MastraPrimitives as b3, type ToolsInput as b4, AgentNetwork as b5, MCPServerBase as b6, type MCPServerConfig as b7, type ConvertedTool as b8, type MCPServerSSEOptions as b9, type MCPServerHonoSSEOptions as ba, type MCPServerHTTPOptions as bb, type AgentNetworkConfig as bc, type VoiceEventType as bd, type VoiceEventMap as be, type VoiceConfig as bf, MastraVoice as bg, CompositeVoice as bh, DefaultVoice as bi, type ToolsetsInput as bj, type DynamicArgument as bk, type AgentGenerateOptions as bl, type AgentStreamOptions as bm, TABLE_WORKFLOW_SNAPSHOT as bn, TABLE_EVALS as bo, TABLE_MESSAGES as bp, TABLE_THREADS as bq, TABLE_TRACES as br, TABLE_SCHEMAS as bs, 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,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkZPFKNO6J_cjs = require('./chunk-ZPFKNO6J.cjs');
3
+ var chunkQDAMIZY3_cjs = require('./chunk-QDAMIZY3.cjs');
4
4
  var chunkRAQBTCIR_cjs = require('./chunk-RAQBTCIR.cjs');
5
- var chunk2TW4KTAP_cjs = require('./chunk-2TW4KTAP.cjs');
5
+ var chunk3CTNBAF2_cjs = require('./chunk-3CTNBAF2.cjs');
6
6
  var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
7
7
  var fs = require('fs');
8
8
  var path = require('path');
@@ -279,7 +279,7 @@ export const agent = new Agent({
279
279
  })
280
280
  })
281
281
  `);
282
- this.vector = new chunkZPFKNO6J_cjs.LibSQLVector({
282
+ this.vector = new chunkQDAMIZY3_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
  });
@@ -472,7 +472,7 @@ Do:
472
472
  return { indexName };
473
473
  }
474
474
  getMergedThreadConfig(config) {
475
- return chunk2TW4KTAP_cjs.deepMerge(this.threadConfig, config || {});
475
+ return chunk3CTNBAF2_cjs.deepMerge(this.threadConfig, config || {});
476
476
  }
477
477
  /**
478
478
  * Apply all configured message processors to a list of messages.
@@ -6,6 +6,7 @@ var crypto = require('crypto');
6
6
  var ai = require('ai');
7
7
  var jsonSchemaToZod = require('json-schema-to-zod');
8
8
  var zod = require('zod');
9
+ var zodFromJsonSchema = require('zod-from-json-schema');
9
10
  var zodToJsonSchema = require('zod-to-json-schema');
10
11
 
11
12
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -552,18 +553,33 @@ function convertVercelToolParameters(tool) {
552
553
  if (isZodType(schema)) {
553
554
  return schema;
554
555
  } else {
555
- let schemaToUse;
556
- if ("jsonSchema" in schema) {
557
- schemaToUse = schema.jsonSchema;
558
- } else {
559
- schemaToUse = schema;
556
+ const jsonSchemaToConvert = "jsonSchema" in schema ? schema.jsonSchema : schema;
557
+ try {
558
+ const rawShape = zodFromJsonSchema.jsonSchemaObjectToZodRawShape(jsonSchemaToConvert);
559
+ return zod.z.object(rawShape);
560
+ } catch (e) {
561
+ const errorMessage = `[CoreToolBuilder] Failed to convert Vercel tool JSON schema parameters to Zod. Original schema: ${JSON.stringify(jsonSchemaToConvert)}`;
562
+ console.error(errorMessage, e);
563
+ throw new Error(errorMessage + (e instanceof Error ? `
564
+ ${e.stack}` : "\nUnknown error object"));
560
565
  }
561
- return resolveSerializedZodOutput(jsonSchemaToZod__default.default(schemaToUse));
562
566
  }
563
567
  }
564
568
  function convertInputSchema(tool) {
565
569
  const schema = tool.inputSchema ?? zod.z.object({});
566
- return isZodType(schema) ? schema : resolveSerializedZodOutput(jsonSchemaToZod__default.default(schema));
570
+ if (isZodType(schema)) {
571
+ return schema;
572
+ } else {
573
+ try {
574
+ const rawShape = zodFromJsonSchema.jsonSchemaObjectToZodRawShape(schema);
575
+ return zod.z.object(rawShape);
576
+ } catch (e) {
577
+ const errorMessage = `[CoreToolBuilder] Failed to convert tool input JSON schema to Zod. Original schema: ${JSON.stringify(schema)}`;
578
+ console.error(errorMessage, e);
579
+ throw new Error(errorMessage + (e instanceof Error ? `
580
+ ${e.stack}` : "\nUnknown error object"));
581
+ }
582
+ }
567
583
  }
568
584
  var CoreToolBuilder = class extends chunkEG74VBSP_cjs.MastraBase {
569
585
  originalTool;
@@ -1,4 +1,4 @@
1
- import { MastraVector } from './chunk-2OC4YT6C.js';
1
+ import { MastraVector } from './chunk-NZV4OA6P.js';
2
2
  import { BaseFilterTranslator } from './chunk-LGERQTJM.js';
3
3
  import { isAbsolute, join, resolve } from 'path';
4
4
  import { createClient } from '@libsql/client';
@@ -679,10 +679,11 @@ var LibSQLVector = class extends MastraVector {
679
679
  }
680
680
  }
681
681
  /**
682
- * Updates an index entry by its ID with the provided vector and/or metadata.
682
+ * @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
683
683
  *
684
- * @param indexName - The name of the index to update.
685
- * @param id - The ID of the index entry to update.
684
+ * Updates a vector by its ID with the provided vector and/or metadata.
685
+ * @param indexName - The name of the index containing the vector.
686
+ * @param id - The ID of the vector to update.
686
687
  * @param update - An object containing the vector and/or metadata to update.
687
688
  * @param update.vector - An optional array of numbers representing the new vector.
688
689
  * @param update.metadata - An optional record containing the new metadata.
@@ -690,6 +691,23 @@ var LibSQLVector = class extends MastraVector {
690
691
  * @throws Will throw an error if no updates are provided or if the update operation fails.
691
692
  */
692
693
  async updateIndexById(indexName, id, update) {
694
+ this.logger.warn(
695
+ `Deprecation Warning: updateIndexById() is deprecated. Please use updateVector() instead. updateIndexById() will be removed on May 20th, 2025.`
696
+ );
697
+ await this.updateVector(indexName, id, update);
698
+ }
699
+ /**
700
+ * Updates a vector by its ID with the provided vector and/or metadata.
701
+ *
702
+ * @param indexName - The name of the index containing the vector.
703
+ * @param id - The ID of the vector to update.
704
+ * @param update - An object containing the vector and/or metadata to update.
705
+ * @param update.vector - An optional array of numbers representing the new vector.
706
+ * @param update.metadata - An optional record containing the new metadata.
707
+ * @returns A promise that resolves when the update is complete.
708
+ * @throws Will throw an error if no updates are provided or if the update operation fails.
709
+ */
710
+ async updateVector(indexName, id, update) {
693
711
  try {
694
712
  const updates = [];
695
713
  const args = [];
@@ -715,17 +733,41 @@ var LibSQLVector = class extends MastraVector {
715
733
  args
716
734
  });
717
735
  } catch (error) {
718
- throw new Error(`Failed to update index by id: ${id} for index: ${indexName}: ${error.message}`);
736
+ throw new Error(`Failed to update vector by id: ${id} for index: ${indexName}: ${error.message}`);
719
737
  }
720
738
  }
739
+ /**
740
+ * @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
741
+ *
742
+ * Deletes a vector by its ID.
743
+ * @param indexName - The name of the index containing the vector.
744
+ * @param id - The ID of the vector to delete.
745
+ * @returns A promise that resolves when the deletion is complete.
746
+ * @throws Will throw an error if the deletion operation fails.
747
+ */
721
748
  async deleteIndexById(indexName, id) {
749
+ this.logger.warn(
750
+ `Deprecation Warning: deleteIndexById() is deprecated.
751
+ Please use deleteVector() instead.
752
+ deleteIndexById() will be removed on May 20th, 2025.`
753
+ );
754
+ await this.deleteVector(indexName, id);
755
+ }
756
+ /**
757
+ * Deletes a vector by its ID.
758
+ * @param indexName - The name of the index containing the vector.
759
+ * @param id - The ID of the vector to delete.
760
+ * @returns A promise that resolves when the deletion is complete.
761
+ * @throws Will throw an error if the deletion operation fails.
762
+ */
763
+ async deleteVector(indexName, id) {
722
764
  try {
723
765
  await this.turso.execute({
724
766
  sql: `DELETE FROM ${indexName} WHERE vector_id = ?`,
725
767
  args: [id]
726
768
  });
727
769
  } catch (error) {
728
- throw new Error(`Failed to delete index by id: ${id} for index: ${indexName}: ${error.message}`);
770
+ throw new Error(`Failed to delete vector by id: ${id} for index: ${indexName}: ${error.message}`);
729
771
  }
730
772
  }
731
773
  async truncateIndex(indexName) {
@@ -1,4 +1,4 @@
1
- import { delay } from './chunk-NW6LO3QH.js';
1
+ import { delay } from './chunk-D5PCSVU5.js';
2
2
  import { MastraBase } from './chunk-235X76GC.js';
3
3
  import { RegisteredLogger } from './chunk-CMPPXW4U.js';
4
4
  import { jsonSchema, generateText, Output, generateObject, streamText, streamObject } from 'ai';
@@ -4,6 +4,7 @@ import { createHash } from 'crypto';
4
4
  import { convertToCoreMessages, jsonSchema, zodSchema } from 'ai';
5
5
  import jsonSchemaToZod from 'json-schema-to-zod';
6
6
  import { z } from 'zod';
7
+ import { jsonSchemaObjectToZodRawShape } from 'zod-from-json-schema';
7
8
  import { zodToJsonSchema } from 'zod-to-json-schema';
8
9
 
9
10
  // src/tools/tool.ts
@@ -546,18 +547,33 @@ function convertVercelToolParameters(tool) {
546
547
  if (isZodType(schema)) {
547
548
  return schema;
548
549
  } else {
549
- let schemaToUse;
550
- if ("jsonSchema" in schema) {
551
- schemaToUse = schema.jsonSchema;
552
- } else {
553
- schemaToUse = schema;
550
+ const jsonSchemaToConvert = "jsonSchema" in schema ? schema.jsonSchema : schema;
551
+ try {
552
+ const rawShape = jsonSchemaObjectToZodRawShape(jsonSchemaToConvert);
553
+ return z.object(rawShape);
554
+ } catch (e) {
555
+ const errorMessage = `[CoreToolBuilder] Failed to convert Vercel tool JSON schema parameters to Zod. Original schema: ${JSON.stringify(jsonSchemaToConvert)}`;
556
+ console.error(errorMessage, e);
557
+ throw new Error(errorMessage + (e instanceof Error ? `
558
+ ${e.stack}` : "\nUnknown error object"));
554
559
  }
555
- return resolveSerializedZodOutput(jsonSchemaToZod(schemaToUse));
556
560
  }
557
561
  }
558
562
  function convertInputSchema(tool) {
559
563
  const schema = tool.inputSchema ?? z.object({});
560
- return isZodType(schema) ? schema : resolveSerializedZodOutput(jsonSchemaToZod(schema));
564
+ if (isZodType(schema)) {
565
+ return schema;
566
+ } else {
567
+ try {
568
+ const rawShape = jsonSchemaObjectToZodRawShape(schema);
569
+ return z.object(rawShape);
570
+ } catch (e) {
571
+ const errorMessage = `[CoreToolBuilder] Failed to convert tool input JSON schema to Zod. Original schema: ${JSON.stringify(schema)}`;
572
+ console.error(errorMessage, e);
573
+ throw new Error(errorMessage + (e instanceof Error ? `
574
+ ${e.stack}` : "\nUnknown error object"));
575
+ }
576
+ }
561
577
  }
562
578
  var CoreToolBuilder = class extends MastraBase {
563
579
  originalTool;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2TW4KTAP_cjs = require('./chunk-2TW4KTAP.cjs');
3
+ var chunk3CTNBAF2_cjs = require('./chunk-3CTNBAF2.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 = chunk2TW4KTAP_cjs.createTool({
71
+ const tool = chunk3CTNBAF2_cjs.createTool({
72
72
  id: key,
73
73
  inputSchema: schemas[key] || zod.z.object({}),
74
74
  description: comment || fallbackComment,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2TW4KTAP_cjs = require('./chunk-2TW4KTAP.cjs');
3
+ var chunk3CTNBAF2_cjs = require('./chunk-3CTNBAF2.cjs');
4
4
  var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
5
5
  var chunkO44MSFMZ_cjs = require('./chunk-O44MSFMZ.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 chunk2TW4KTAP_cjs.delay(10 * 1e3);
165
+ await chunk3CTNBAF2_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 chunk2TW4KTAP_cjs.delay(10 * 1e3);
234
+ await chunk3CTNBAF2_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 chunk2TW4KTAP_cjs.delay(10 * 1e3);
307
+ await chunk3CTNBAF2_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 chunk2TW4KTAP_cjs.delay(10 * 1e3);
398
+ await chunk3CTNBAF2_cjs.delay(10 * 1e3);
399
399
  }
400
400
  },
401
401
  onFinish: async (props) => {