From 60e94a9bc21afd0e67d7978c92bf4396c6418f8f Mon Sep 17 00:00:00 2001 From: alectimison-maker Date: Wed, 29 Jul 2026 17:14:14 +0800 Subject: [PATCH] agent: add adapter for Coupang --- src/chrome/src/agent/adapters.js | 14 ++++++++++++ src/firefox/src/agent/adapters.js | 14 ++++++++++++ test/run.js | 38 +++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/src/chrome/src/agent/adapters.js b/src/chrome/src/agent/adapters.js index c271c50c4..a9f64a473 100644 --- a/src/chrome/src/agent/adapters.js +++ b/src/chrome/src/agent/adapters.js @@ -16294,6 +16294,20 @@ const ADAPTERS = [ - Search hosts (listado.mercadolibre.com.ar, listado.mercadolibre.com.mx, lista.mercadolivre.com.br) can redirect automation to /gz/account-verification. If that wall appears, STOP and ask the user to complete it manually — do not retry, bypass, or claim results were read.`, }, + // ─── Regional — Coupang (Korea) ────────────────────────────────────── + { + name: 'coupang', + category: 'general', + matches: (url) => /^https?:\/\/(?:(?:www|m|cart)\.)?coupang\.com\//.test(url), + notes: ` +- As of 2026-07, background requests can return an Akamai Access Denied page even when the shopping page works in the active tab. If fetch_url or research_url is blocked, switch immediately to read_page, the accessibility tree, and DOM tools; do not retry the same URL. +- Coupang is a Korean MARKETPLACE. Stable labels: "장바구니 담기" = add to cart, "바로구매" = buy now, "장바구니" = cart, and "판매자" = seller. "바로구매" skips the cart, so do not click it when the task is only to collect or compare items. +- Search defaults to "쿠팡 랭킹순", and sponsored products are marked "AD". For a price comparison choose "낮은가격순" and enable "배송비 포함"; do not present the default ranking or an ad position as the cheapest result. +- Product pages may group pack count, size, color, or other variants behind "모든 옵션 보기". Select the exact option first and compare the displayed unit price (for example, 100g당), not only the bundle total. +- The same product can be fulfilled by different sellers. Read "판매자", seller rating, delivery fee, and arrival date for the selected offer; product reviews may be pooled across different sellers and are not evidence about that seller. +- "로켓배송" describes Coupang-fulfilled delivery, while "와우" free shipping, free returns, or dawn delivery are membership-conditional. Confirm the selected offer and the cart total before promising delivery, savings, or a final price.`, + }, + // ─── Regional — Türkiye (TR) ────────────────────────────────────────── // Regional adapters are the project's #1 wanted contribution (CONTRIBUTING.md); // Türkiye is top of the priority list. Add more TR sites (trendyol, diff --git a/src/firefox/src/agent/adapters.js b/src/firefox/src/agent/adapters.js index 2f58e93a0..659f29572 100644 --- a/src/firefox/src/agent/adapters.js +++ b/src/firefox/src/agent/adapters.js @@ -16292,6 +16292,20 @@ const ADAPTERS = [ - Search hosts (listado.mercadolibre.com.ar, listado.mercadolibre.com.mx, lista.mercadolivre.com.br) can redirect automation to /gz/account-verification. If that wall appears, STOP and ask the user to complete it manually — do not retry, bypass, or claim results were read.`, }, + // ─── Regional — Coupang (Korea) ────────────────────────────────────── + { + name: 'coupang', + category: 'general', + matches: (url) => /^https?:\/\/(?:(?:www|m|cart)\.)?coupang\.com\//.test(url), + notes: ` +- As of 2026-07, background requests can return an Akamai Access Denied page even when the shopping page works in the active tab. If fetch_url or research_url is blocked, switch immediately to read_page, the accessibility tree, and DOM tools; do not retry the same URL. +- Coupang is a Korean MARKETPLACE. Stable labels: "장바구니 담기" = add to cart, "바로구매" = buy now, "장바구니" = cart, and "판매자" = seller. "바로구매" skips the cart, so do not click it when the task is only to collect or compare items. +- Search defaults to "쿠팡 랭킹순", and sponsored products are marked "AD". For a price comparison choose "낮은가격순" and enable "배송비 포함"; do not present the default ranking or an ad position as the cheapest result. +- Product pages may group pack count, size, color, or other variants behind "모든 옵션 보기". Select the exact option first and compare the displayed unit price (for example, 100g당), not only the bundle total. +- The same product can be fulfilled by different sellers. Read "판매자", seller rating, delivery fee, and arrival date for the selected offer; product reviews may be pooled across different sellers and are not evidence about that seller. +- "로켓배송" describes Coupang-fulfilled delivery, while "와우" free shipping, free returns, or dawn delivery are membership-conditional. Confirm the selected offer and the cart total before promising delivery, savings, or a final price.`, + }, + // ─── Regional — Türkiye (TR) ────────────────────────────────────────── // Regional adapters are the project's #1 wanted contribution (CONTRIBUTING.md); // Türkiye is top of the priority list. Add more TR sites (trendyol, diff --git a/test/run.js b/test/run.js index 6ebdaa2c2..022c3431a 100644 --- a/test/run.js +++ b/test/run.js @@ -2453,6 +2453,44 @@ test('matches Mercado Libre LATAM storefronts and includes marketplace guidance' assert.equal(firefoxAdapter?.notes, adapter?.notes); }); +test('matches Coupang shopping surfaces and includes Korean marketplace guidance', () => { + const trustedUrls = [ + 'https://coupang.com/', + 'https://www.coupang.com/np/search?q=bodywash', + 'https://m.coupang.com/vm/products/40994378', + 'https://cart.coupang.com/cartView.pang', + ]; + for (const url of trustedUrls) { + assert.equal(getActiveAdapter(url)?.name, 'coupang'); + assert.equal(getActiveAdapterFx(url)?.name, 'coupang'); + } + + const rejectedUrls = [ + 'https://wing.coupang.com/', + 'https://www.tw.coupang.com/', + 'https://coupang.com.phishing.example/vp/products/40994378', + 'https://example.com/coupang.com/vp/products/40994378', + ]; + for (const url of rejectedUrls) { + assert.notEqual(getActiveAdapter(url)?.name, 'coupang'); + assert.notEqual(getActiveAdapterFx(url)?.name, 'coupang'); + } + + const adapter = getActiveAdapter('https://www.coupang.com/vp/products/40994378'); + const firefoxAdapter = getActiveAdapterFx('https://cart.coupang.com/'); + assert.match(adapter?.notes || '', /2026-07/); + assert.match(adapter?.notes || '', /Akamai Access Denied/); + assert.match(adapter?.notes || '', /배송비 포함/); + assert.match(adapter?.notes || '', /낮은가격순/); + assert.match(adapter?.notes || '', /판매자/); + assert.match(adapter?.notes || '', /different sellers/i); + assert.match(adapter?.notes || '', /로켓배송/); + assert.match(adapter?.notes || '', /와우/); + assert.match(adapter?.notes || '', /장바구니 담기/); + assert.match(adapter?.notes || '', /바로구매/); + assert.equal(firefoxAdapter?.notes, adapter?.notes); +}); + test('matches sahibinden.com and includes anti-bot guidance', () => { assert.equal(getActiveAdapter('https://www.sahibinden.com/')?.name, 'sahibinden'); assert.equal(getActiveAdapter('https://sahibinden.com/kategori/vasita')?.name, 'sahibinden');