import { z } from 'zod';
/**
* Base query schema with research context
*/
export const BaseQuerySchema = z.object({
researchGoal: z
.string()
.optional()
.describe('What you want to find or understand'),
reasoning: z
.string()
.optional()
.describe('Why this query helps achieve the goal'),
});
/**
* Creates bulk query schema (1-5 queries per call)
*/
export function createBulkQuerySchema<T extends z.ZodTypeAny>(
toolName: string,
singleQuerySchema: T
) {
return z.object({
queries: z
.array(singleQuerySchema)
.min(1)
.max(5)
.describe(
`Research queries for ${toolName} (1-5 queries per call for optimal resource management). Review schema before use for optimal results`
),
});
}
export type BaseQuery = z.infer<typeof BaseQuerySchema>;