/** * zod input schemas shared by the AI SDK and LangChain JS adapters. * Works with zod 3.23+ and zod 4 (only object, string, enum, optional and describe are used). */ import { z } from "zod"; import { BLOCKERS, FURTHEST_STEPS } from "./arc.ts"; export const beforeCheckoutSchema = z.object({ url: z.string().min(1).describe("The store or product URL you are about to check out on, such as https://allbirds.com/products/wool-runner."), }); export const afterCheckoutSchema = z.object({ store: z.string().min(1).describe("The store URL or hostname you tried to check out on."), furthest_step: z.enum(FURTHEST_STEPS).describe("The furthest step you reached: product, cart, checkout, payment or placed."), blocker: z.enum(BLOCKERS).describe("What stopped you, or none if nothing did."), store_error_text: z.string().max(400).optional().describe("The store's own error message, word for word, if it showed one. Nothing else."), }); export type BeforeCheckoutArgs = z.infer; export type AfterCheckoutArgs = z.infer;