Skip to content

agent: add adapter for Mercado Libre - #2607

Merged
webbrain-one merged 3 commits into
webbrain-one:mainfrom
alectimison-maker:agent/add-mercado-libre-adapter
Jul 27, 2026
Merged

agent: add adapter for Mercado Libre#2607
webbrain-one merged 3 commits into
webbrain-one:mainfrom
alectimison-maker:agent/add-mercado-libre-adapter

Conversation

@alectimison-maker

Copy link
Copy Markdown
Contributor

Summary

  • add a focused Mercado Libre / Mercado Livre adapter for the Argentina, Mexico, and Brazil storefronts requested in CONTRIBUTING.md
  • mirror localized marketplace guidance across Chrome and Firefox
  • cover trusted storefront/product/search hosts, country scope, and lookalike-domain rejection in the Node test suite

Motivation

Regional site adapters are the project's highest-priority contribution area, and the contribution guide specifically calls out mercadolibre.com.ar, mercadolibre.com.mx, and mercadolivre.com.br.

These storefronts have a few behaviors that generic e-commerce guidance does not capture:

  • catalog pages can group competing seller offers under one product
  • required variations can change stock, price, seller, and delivery
  • shipping cost and arrival depend on the destination postal code / CEP
  • Spanish and Portuguese storefronts use different action labels
  • automated search navigation can land on an account-verification wall

The seller/offer guidance is based on Mercado Libre's own catalog documentation and current product pages:

Design

  • match only exact registered-domain suffixes for the three researched storefronts, including their official product and search subdomains
  • reject suffix/path lookalikes and intentionally leave other Mercado Libre country sites out until their localization is researched
  • tell the agent to compare the active seller offer, select variations, set delivery location, and verify the cart total before a consequential purchase action
  • stop on /gz/account-verification instead of retrying or attempting a bypass

A broad mercadolibre.* matcher was rejected because it would silently apply incomplete localization guidance to unresearched countries and make lookalike handling less explicit.

Testing

  • node test/run.js — new test passed; 1350 passed, 1 pre-existing failure (the repository's package.json is 26.0.1 while the newest CHANGELOG.md entry is 26.0.0)
  • red/green check — before the adapter, the suite reported 1349 passed and 2 failed; after the adapter, only the existing changelog failure remains
  • node test/security/injection-corpus.mjs — 60/60 passed
  • node --check src/chrome/src/agent/adapters.js — passed
  • node --check src/firefox/src/agent/adapters.js — passed
  • git diff --check — passed

Live HTTP checks confirmed all three storefront roots respond and the three search hosts can redirect automated requests to /gz/account-verification. No signed-in purchase flow was performed.

Compatibility and risks

This only adds adapter metadata and tests. It adds no dependency, API, permission, storage, or data-format changes. The main residual risk is future marketplace label/layout drift.

Scope

  • other Mercado Libre country storefronts remain intentionally deferred
  • no selectors, scraping logic, login automation, verification bypass, or checkout automation are introduced

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a localized Mercado Libre/Livre adapter for Argentina, Mexico, and Brazil.

Changes:

  • Adds storefront matching and marketplace guidance.
  • Mirrors behavior across Chrome and Firefox.
  • Tests trusted hosts, lookalikes, localization, and parity.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/chrome/src/agent/adapters.js Adds the Chrome adapter.
src/firefox/src/agent/adapters.js Mirrors the Firefox adapter.
test/run.js Adds matching and guidance tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chrome/src/agent/adapters.js Outdated
- Catalog product pages can group the same product from many sellers. The main buy box represents ONE seller/offer, while "Otras opciones de compra"/"Outras opções de compra" may have a different price, seller reputation, shipping cost, or arrival date. Compare the active offer before quoting or adding it.
- Variant trap: choose required color, size ("talle"/"talla"/"tamanho"), capacity, voltage, flavor, or other variation BEFORE adding. A variation can change stock, seller, price, and delivery; read back the selected variation from the product page or cart.
- LOCATION-FIRST shipping: set the destination postal code ("código postal" in AR/MX, "CEP" in BR) before promising availability, freight, free shipping, pickup, or an arrival date. Re-check these in the cart because they depend on both destination and seller.
- Displayed discounts and installment amounts ("cuotas"/"parcelas") may depend on the payment method, and the listing price can exclude shipping. Use "Agregar/Adicionar ao carrito" when choices still need review; verify seller, variations, quantity, shipping, and the final payable total before any consequential "Comprar ahora/agora" action.
Comment thread src/firefox/src/agent/adapters.js Outdated
- Catalog product pages can group the same product from many sellers. The main buy box represents ONE seller/offer, while "Otras opciones de compra"/"Outras opções de compra" may have a different price, seller reputation, shipping cost, or arrival date. Compare the active offer before quoting or adding it.
- Variant trap: choose required color, size ("talle"/"talla"/"tamanho"), capacity, voltage, flavor, or other variation BEFORE adding. A variation can change stock, seller, price, and delivery; read back the selected variation from the product page or cart.
- LOCATION-FIRST shipping: set the destination postal code ("código postal" in AR/MX, "CEP" in BR) before promising availability, freight, free shipping, pickup, or an arrival date. Re-check these in the cart because they depend on both destination and seller.
- Displayed discounts and installment amounts ("cuotas"/"parcelas") may depend on the payment method, and the listing price can exclude shipping. Use "Agregar/Adicionar ao carrito" when choices still need review; verify seller, variations, quantity, shipping, and the final payable total before any consequential "Comprar ahora/agora" action.
esokullu and others added 2 commits July 27, 2026 23:27
- replace blended ES/PT labels ("Agregar/Adicionar ao carrito",
  "Comprar ahora/agora") with per-locale label lists; those strings
  match no control on either storefront and contradicted the
  don't-mix-locales rule in the first bullet
- distinguish catalog pages (/p/MLA…, /p/MLM…, /p/MLB…), which carry the
  multi-seller offer list, from single-seller -_JM listings, which do not
- warn that checkout continues on a Mercado Pago host where the adapter
  no longer fires, so the final total must be confirmed there
- date the volatile UI labels per CONTRIBUTING.md
- lock both fixes with test assertions

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adapter notes ride along with every first-turn request on the site, so
they should carry only what the model cannot infer. Drops the variant-
selection and price-excludes-shipping/installments bullets, which are
generic marketplace advice, and folds the postal-code rule into one
line. Keeps the site-specific content: locale-exact buy labels, the
catalog vs single-seller URL split, the Mercado Pago hand-off, and the
account-verification stop.

Notes go 2041 -> 1217 chars (5 bullets), from 5th-largest adapter to
19th of 74.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@webbrain-one
webbrain-one merged commit 101449b into webbrain-one:main Jul 27, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants