@@ -18,8 +18,8 @@ import type { FullOutput, MastraModelOutput } from '@mastra/core/stream';
1818import type { Tool } from '@mastra/core/tools' ;
1919import { standardSchemaToJSONSchema , toStandardSchema } from '@mastra/schema-compat/schema' ;
2020import type { JSONSchema7 } from 'json-schema' ;
21- import type { ZodType } from 'zod/v3' ;
2221import type {
22+ ZodSchema ,
2323 GenerateLegacyParams ,
2424 GetAgentResponse ,
2525 GetToolResponse ,
@@ -237,15 +237,15 @@ export class Agent extends BaseResource {
237237 params : GenerateLegacyParams < undefined > & { output ?: never ; experimental_output ?: never } ,
238238 ) : Promise < GenerateReturn < any , undefined , undefined > > ;
239239 // Use `any` in overload return types to avoid "Type instantiation is excessively deep" errors
240- async generateLegacy < Output extends JSONSchema7 | ZodType > (
240+ async generateLegacy < Output extends JSONSchema7 | ZodSchema > (
241241 params : GenerateLegacyParams < Output > & { output : Output ; experimental_output ?: never } ,
242242 ) : Promise < GenerateReturn < any , any , any > > ;
243- async generateLegacy < StructuredOutput extends JSONSchema7 | ZodType > (
243+ async generateLegacy < StructuredOutput extends JSONSchema7 | ZodSchema > (
244244 params : GenerateLegacyParams < StructuredOutput > & { output ?: never ; experimental_output : StructuredOutput } ,
245245 ) : Promise < GenerateReturn < any , any , any > > ;
246246 async generateLegacy <
247- Output extends JSONSchema7 | ZodType | undefined = undefined ,
248- _StructuredOutput extends JSONSchema7 | ZodType | undefined = undefined ,
247+ Output extends JSONSchema7 | ZodSchema | undefined = undefined ,
248+ _StructuredOutput extends JSONSchema7 | ZodSchema | undefined = undefined ,
249249 > ( params : GenerateLegacyParams < Output > ) : Promise < GenerateReturn < any , any , any > > {
250250 const processedParams = {
251251 ...params ,
@@ -726,7 +726,7 @@ export class Agent extends BaseResource {
726726 * @param params - Stream parameters including prompt
727727 * @returns Promise containing the enhanced Response object with processDataStream method
728728 */
729- async streamLegacy < T extends JSONSchema7 | ZodType | undefined = undefined > (
729+ async streamLegacy < T extends JSONSchema7 | ZodSchema | undefined = undefined > (
730730 params : StreamLegacyParams < T > ,
731731 ) : Promise <
732732 Response & {
0 commit comments