Checkout integration kit

Two tools your agent calls around checkout: before_checkout right before it tries, after_checkout right after. Plain fetch, no API key.

What each call returns and how to act on it: the spec.

Core

integrations/core/arc.ts has beforeCheckout() and afterCheckout() with no dependencies. Every adapter wraps it. before_checkout returns only route, endpoint, checked_at, stale, confidence, reaches_checkout, blockers and a one-line next_step. after_checkout posts furthest_step, blocker and the store's own error message, if any. User agents are arc-integration/<name>.

import { beforeCheckout, afterCheckout } from "./integrations/core/arc";

const arc = await beforeCheckout({ url: "https://allbirds.com/products/mens-wool-runners" });
// ... try checkout, using arc.endpoint when a machine route works ...
await afterCheckout({ store: "allbirds.com", furthest_step: "cart", blocker: "captcha",
  agent_family: "browser", agent_name: "my-agent" });

Vercel AI SDK

tool() definitions arcBeforeCheckout and arcAfterCheckout, with zod input schemas.

npm i ai zod
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
import { generateText, stepCountIs } from "ai";
import { arcCheckoutTools } from "./integrations/ai-sdk/tools";

const tools = arcCheckoutTools({ agentName: "my-shopping-agent", agentFamily: "browser" });
await generateText({ model, tools, stopWhen: stepCountIs(5),
  prompt: "Before checkout on https://allbirds.com/products/mens-wool-runners, ask ARC for the best route." });

LangChain (JS and Python)

A tool() pair for LangChain JS, and the same pair in Python with langchain_core.tools.

npm i @langchain/core @langchain/langgraph zod
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/langchain/definitions.ts https://www.arcreport.ai/integrations/langchain/definitions.ts
curl -s --create-dirs -o integrations/langchain/tools.ts https://www.arcreport.ai/integrations/langchain/tools.ts
curl -s --create-dirs -o integrations/langchain/arc_checkout_tools.py https://www.arcreport.ai/integrations/langchain/arc_checkout_tools.py
// JS
import { arcCheckoutTools } from "./integrations/langchain/tools";
const { arcBeforeCheckout, arcAfterCheckout } = arcCheckoutTools({ agentName: "my-agent" });
const agent = createReactAgent({ llm, tools: [arcBeforeCheckout, arcAfterCheckout] });

# Python (pip install langchain-core)
from arc_checkout_tools import arc_before_checkout, arc_after_checkout
agent = create_react_agent(llm, [arc_before_checkout, arc_after_checkout])

Stagehand and browser agents

withArcCheckout() calls before_checkout, runs your browser steps with the best route in hand, then reports with after_checkout.

curl -s --create-dirs -o integrations/core/arc.ts https://www.arcreport.ai/integrations/core/arc.ts
curl -s --create-dirs -o integrations/stagehand/checkout-guard.ts https://www.arcreport.ai/integrations/stagehand/checkout-guard.ts
import { withArcCheckout } from "./integrations/stagehand/checkout-guard";

await withArcCheckout(productUrl, async (arc, mark) => {
  if (arc.reaches_checkout && arc.endpoint) console.log("Machine route:", arc.route, arc.endpoint);
  await page.act("add this product to the cart"); mark("cart");
  await page.act("go to checkout");               mark("checkout");
  return { furthest_step: "checkout", blocker: "none" };
}, { agentName: "my-stagehand-agent" });

Notes