import { z } from "zod"; export const promptMerchantSchema = z .string() .optional() .describe( "Опційний merchant alias з wfp_list_profiles. Якщо не передати, використовується WFP_DEFAULT_MERCHANT.", ); export function getDateRange(days: number): { startDate: string; endDate: string } { const endDate = new Date().toISOString().split("T")[0]!; const startDate = new Date(Date.now() - days * 86_400_000).toISOString().split("T")[0]!; return { startDate, endDate }; } export function merchantInstruction(merchant?: string): string { if (merchant) { return `У кожному tool call передавай merchant="${merchant}".`; } return 'Якщо в MCP налаштовано кілька merchant-профілів, спочатку виклич wfp_list_profiles і далі явно передавай merchant="" у кожному tool call. Якщо профіль один, використовуй default merchant.'; } export function merchantArg(merchant?: string): string { return merchant ? `, merchant="${merchant}"` : ""; }