Shop on Amazon and Amazon Fresh through your browser
Use browser automation for all Amazon actions. All browser operations are executed through the assistant browser CLI, invoked via host_bash. Use helper scripts with host_bash to normalize extraction results and decide the next step.
host_bash for assistant browser CLI commands and deterministic helper scripts under scripts/.assistant browser chrome relay.Run this early in each turn when intent is unclear:
bun {baseDir}/scripts/amazon-intent.ts --request "<latest user request>" --checkout-reviewed <true|false> --has-cart-items <true|false>
Use the returned step to route to one of: search, variant_select, cart_review, checkout_review, fresh_slot, place_order.
search)assistant browser --session amazon navigate --url "https://www.amazon.com/s?k=<urlencoded query>"
assistant browser --session amazon --json snapshot
assistant browser --session amazon --json extract --include-links
bun {baseDir}/scripts/amazon-parse-search.ts --query "<query>" --input-json '<json payload with extracted text/links>'
variant_select)bun {baseDir}/scripts/amazon-parse-product.ts --input-json '<json payload with extracted text/links>'
cart_review)assistant browser --session amazon navigate --url "https://www.amazon.com/gp/cart/view.html"
assistant browser --session amazon --json snapshot
assistant browser --session amazon --json extract --include-links
bun {baseDir}/scripts/amazon-parse-cart.ts --input-json '<json payload with extracted text>'
fresh_slot)For Amazon Fresh flows, explicitly verify slot selection in UI before checkout:
If slot cannot be verified after retries, stop and ask user to choose slot manually.
checkout_review)assistant browser --session amazon --json snapshot
assistant browser --session amazon --json extract
assistant browser --session amazon screenshot --full-page --output /tmp/amazon-checkout.jpg
bun {baseDir}/scripts/amazon-checkout-sanity.ts --cart-confirmed true --input-json '<json payload with extracted text>'
place_order)Immediately before clicking final submit button:
Place your order, Buy now, or equivalent).assistant browser --session amazon --json snapshot before the next click/type.{
"phase": "search",
"context": { "checkoutReviewed": false, "hasCartItems": false },
"extracted": {
"text": "...",
"links": ["https://www.amazon.com/dp/B08XGDN3TZ"]
},
"userIntent": "order aa batteries"
}