# ARC checkout tools for the Vercel AI SDK Two tools: `arcBeforeCheckout` (call right before checkout) and `arcAfterCheckout` (report how it went). No API key. Plain fetch. User agent `arc-integration/ai-sdk`. ## Get the files ```sh curl -s --create-dirs -o integrations/core/arc.ts https://www.arcreport.ai/integrations/core/arc.ts curl -s --create-dirs -o integrations/core/schemas.ts https://www.arcreport.ai/integrations/core/schemas.ts curl -s --create-dirs -o integrations/ai-sdk/definitions.ts https://www.arcreport.ai/integrations/ai-sdk/definitions.ts curl -s --create-dirs -o integrations/ai-sdk/tools.ts https://www.arcreport.ai/integrations/ai-sdk/tools.ts ``` Every file is listed at https://www.arcreport.ai/integrations. ## Quickstart ```ts // npm i ai zod import { generateText, stepCountIs } from "ai"; import { arcCheckoutTools } from "./integrations/ai-sdk/tools"; const tools = arcCheckoutTools({ agentName: "my-shopping-agent", agentFamily: "browser" }); const { text } = await generateText({ model, tools, stopWhen: stepCountIs(5), prompt: "Before checkout on https://allbirds.com/products/mens-wool-runners, ask ARC for the best route.", }); ``` `arcBeforeCheckout` returns only `host`, `known`, `route`, `endpoint`, `checked_at`, `stale`, `confidence`, `reaches_checkout`, `blockers` and a one-line `next_step`. `arcAfterCheckout` sends `furthest_step`, `blocker` and the store's own error message (if any) to `POST /api/outcomes`, and reuses the contributor key ARC issues. Reporting the route tried is a planned field; it is not sent yet. ## Files - `definitions.ts`: description, zod `inputSchema` and `execute` for each tool. No import from `ai`. Tested in `integrations/core/kit.test.ts`. - `tools.ts`: wraps each definition in `tool()` from `ai`. ARC's own app does not install `ai`, so the repo's `tsconfig.json` leaves this one file out of type checking. Spec: https://www.arcreport.ai/for-agents#before-checkout ยท Kit: https://www.arcreport.ai/integrations