import { V as VercelTool, T as ToolAction, a as ToolsInput, M as Mastra, b as MastraPrimitives, c as MastraMemory, C as CoreTool, A as Agent, W as Workflow, S as Step, d as StepExecutionContext, e as WorkflowContext, f as AgentNetwork } from './base-hRgvGkC2.js'; import { CoreMessage, Message } from 'ai'; import { MastraTTS } from './tts/index.js'; import { MastraVector } from './vector/index.js'; import { z, ZodObject } from 'zod'; import { L as Logger } from './index-BXwGr3N7.js'; import { M as Metric } from './types-CwTG2XyQ.js'; import './base-Dq_cxikD.js'; import '@opentelemetry/api'; import '@opentelemetry/sdk-trace-base'; import 'sift'; import 'json-schema'; import 'xstate'; import 'events'; import './vector/filter/index.js'; import 'stream'; declare const delay: (ms: number) => Promise; declare function jsonSchemaPropertiesToTSTypes(value: any): z.ZodTypeAny; declare function jsonSchemaToModel(jsonSchema: Record): ZodObject; /** * Deep merges two objects, recursively merging nested objects and arrays */ declare function deepMerge(target: T, source: Partial): T; interface TagMaskOptions { /** Called when masking begins */ onStart?: () => void; /** Called when masking ends */ onEnd?: () => void; /** Called for each chunk that is masked */ onMask?: (chunk: string) => void; } /** * Transforms a stream by masking content between XML tags. * @param stream Input stream to transform * @param tag Tag name to mask between (e.g. for ..., use 'foo') * @param options Optional configuration for masking behavior */ declare function maskStreamTags(stream: AsyncIterable, tag: string, options?: TagMaskOptions): AsyncIterable; /** * Resolve serialized zod output - This function takes the string output ot the `jsonSchemaToZod` function * and instantiates the zod object correctly. * * @param schema - serialized zod object * @returns resolved zod object */ declare function resolveSerializedZodOutput(schema: string): z.ZodType; /** * Checks if a tool is a Vercel Tool * @param tool - The tool to check * @returns True if the tool is a Vercel Tool, false otherwise */ declare function isVercelTool(tool?: ToolToConvert): tool is VercelTool; interface ToolOptions { name: string; runId?: string; threadId?: string; resourceId?: string; logger: Logger; description?: string; mastra?: (Mastra & MastraPrimitives) | MastraPrimitives; memory?: MastraMemory; agentName?: string; } type ToolToConvert = VercelTool | ToolAction; /** * Ensures a tool has an ID and inputSchema by generating one if not present * @param tool - The tool to ensure has an ID and inputSchema * @returns The tool with an ID and inputSchema */ declare function ensureToolProperties(tools: ToolsInput): ToolsInput; /** * Converts a Vercel Tool or Mastra Tool into a CoreTool format * @param tool - The tool to convert (either VercelTool or ToolAction) * @param options - Tool options including Mastra-specific settings * @param logType - Type of tool to log (tool or toolset) * @returns A CoreTool that can be used by the system */ declare function makeCoreTool(tool: ToolToConvert, options: ToolOptions, logType?: 'tool' | 'toolset'): CoreTool; /** * Creates a proxy for a Mastra instance to handle deprecated properties * @param mastra - The Mastra instance to proxy * @param logger - The logger to use for warnings * @returns A proxy for the Mastra instance */ declare function createMastraProxy({ mastra, logger }: { mastra: Mastra; logger: Logger; }): Mastra>>, Record[], Record>>>[], string, any, any>>, Record, Record, Logger, Record>; declare function checkEvalStorageFields(traceObject: any, logger?: Logger): boolean; declare function ensureAllMessagesAreCoreMessages(messages: (CoreMessage | Message)[]): CoreMessage[]; export { type TagMaskOptions, checkEvalStorageFields, createMastraProxy, deepMerge, delay, ensureAllMessagesAreCoreMessages, ensureToolProperties, isVercelTool, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, makeCoreTool, maskStreamTags, resolveSerializedZodOutput };