Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Merge main and cover Noon Supermall
Barack Sokullu1d9b80ab14c3
diff --cc src/chrome/src/agent/adapters.jsindex 174bbdcee,9badb5469..64dcf5895--- a/src/chrome/src/agent/adapters.js+++ b/src/chrome/src/agent/adapters.js@@@ -17627,53 -17627,53 +17627,100 @@@ const ADAPTERS =- Stickers, GIFs, and bot commands (/) all live in popups above the message input.- DO NOT send a message unless the user named the recipient AND the exact message body in this conversation.- "Edit message" works for a window after sending (~48h); "Delete for everyone" within a shorter window — both have explicit confirms.`,+ },+ // ─── Regional — CIS + MENA (RU/TR/AE) ──────────────────────────────+ // High-priority CONTRIBUTING.md coverage: Wildberries, Avito, VK, noon.+ // Keep before the federated Mastodon matcher.+ {+ name: 'wildberries',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?wildberries\.ru\//.test(url),+ notes: `+- Wildberries is Russia's largest e-commerce MARKETPLACE (fashion-first, sells everything). As of 2026-09, Russian labels: "Добавить в корзину" = add to cart, "Корзина" = cart, "Войти" = log in, "Сортировка" = sort, "Фильтры" = filters.+- Variant trap: pick size ("Размер") and color BEFORE adding — apparel listings block the add until a size is chosen.+- Seller/price trap: the same item ships from different warehouses with different delivery ETAs ("Способ доставки"). Check the delivery estimate before quoting; the card price is not the arrival date.+- WB Wallet ("WB Кошелёк") vs card pricing may differ — quote the cart/payment total, not the card price.+- Sort with "Сортировка" (price low→high "Дешевле", rating, new) and filter in the left rail (brand, price, size, rating) rather than URL edits. Cart lives at /lk/basket; checkout needs login.`,+ },+ {+ name: 'avito',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.|m\.)?avito\.ru\//.test(url),+ notes: `+- Avito is Russia's largest CLASSIFIEDS site (like sahibinden: vehicles, real estate, goods, jobs, services). Most listings are "contact the seller", NOT checkout — do NOT hunt for a cart button on a typical listing.+- Anti-scam trap: contact via "Показать номер" (show number) or "Написать" (message) often needs login; phone numbers may be partially masked. Never promise a revealed number without clicking through.+- Filter in the left/top rail: price, "Город" (city), category facets, "С фото"/"С доставкой" toggles. Sort via "Сначала дешевле/дороже" rather than URL params.+- Avito Delivery ("Авито Доставка") is a SEPARATE escrow flow from local pickup — confirm which one the user wants before advising.+- Posting ("Разместить объявление") needs login and moderation; new ads show "На проверке" (under review), not live. Do not report as published until active.`,+ },+ {+ name: 'vk',+ category: 'general',+ matches: (url) => /^https?:\/\/(?:vk\.(?:com|ru)|(?:www|m)\.vk\.(?:com|ru)|id\.vk\.ru)\//.test(url),+ notes: `+- VK (vk.com) is Russia/CIS social + services (Feed, Messages, Communities, Video, Market, Mini-apps). Login is phone/QR; 2FA may appear — surface it to the user and stop, do not loop.+- Messages: dialog list on the LEFT, active chat on the RIGHT; input is a contenteditable box, Enter sends. DO NOT send unless the user named the recipient AND the exact body in this conversation.+- Communities/Groups vs personal pages look alike — check the header ("Сообщество"/subscribers vs "Друзья"/friends) before acting as/against the wrong entity.+- VK Video/Clips and Market are separate tabs with their own players/carts — do not mix Market checkout with social actions.+- Language trap: UI may be Russian ("Войти", "Сообщения", "Новости") or English depending on locale — read visible button text instead of assuming.`,+ },+ {+ name: 'noon',+ category: 'general',- matches: (url) => /^https?:\/\/(www\.)?noon\.com\//.test(url),++ matches: (url) => /^https?:\/\/(www\.|supermall\.)?noon\.com\//.test(url),+ notes: `+- noon.com is the MENA mega-marketplace (UAE/Saudi/Egypt storefronts share one domain with country switcher). Prices/availability are PER COUNTRY — set the country ("Ship to UAE/Saudi/Egypt") first or listings are meaningless.+- Variant trap: pick size/color ("Size", "Colour") BEFORE "Add To Cart" — required options block the add.+- Seller trap ("Sold by noon" vs marketplace sellers): check "Sold by" + ratings before quoting; fulfillment speed ("Get it by") varies by seller/warehouse.+- Price trap: coupons ("Apply code") and noon VIP/"noon One" discounts apply only at cart — quote the cart total, not the card price.+- Sort via "Sort by" (price low→high, popularity) and filter via the left rail (Brand, Price, Fulfilment) rather than URL edits. Cart at /cart; checkout needs login/OTP.`,+ },+ // ─── Regional — India daily-use (IN) ────────────────────────────────+ // High-priority CONTRIBUTING.md coverage: food, rail, payments, value+ // marketplace. Keep before the federated Mastodon matcher.+ {+ name: 'swiggy',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?swiggy\.com\//.test(url),+ notes: `+ - Swiggy is India's food-delivery + quick-commerce site (Food, Instamart grocery, Dineout). As of 2026-09, ordering needs a delivery LOCATION first — set it via the location pin/header ("Enter delivery address") before the restaurant list is meaningful; without it listings are generic.+ - Restaurant discovery: search by dish/restaurant, then open the restaurant page. Veg-only toggle ("Veg"), "Offers" filter, ratings ("4.0+"), cost-for-two, and delivery-time sort live above the list — set them instead of guessing URL params.+ - Dish trap: many dishes have REQUIRED customisations (size, spice, add-ons) in a modal. Pick them before "Add". "Add" becomes "ADD +" stepper; the cart is the header "Cart" drawer, not a page.+ - Instamart is a SEPARATE tab/flow from Food with its own cart — do not mix Food and Instamart items in one checkout.+ - Checkout requires login (phone OTP). Do NOT place the order without explicit user confirmation — payment/UPI is irreversible. Success = order-tracking page with ETA, not the cart drawer.`,+ },+ {+ name: 'irctc',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?irctc\.co\.in\//.test(url),+ notes: `+ - IRCTC (irctc.co.in) is Indian Railways ticketing. Login ("LOGIN") needs username/password + CAPTCHA; booking also needs passenger details (name, age, berth preference) and an explicit user confirm before "Book Now".+ - Search with station CODES (e.g. NDLS, BCT, HWH) in "From"/"To", journey date, and quota ("General", "Tatkal", "Ladies"). Sort/filter by class (SL/3A/2A/1A/CC) and train type; availability colours (Available/RAC/WL + number) are per class — read the exact class row before quoting.+ - Tatkal trap: booking opens at 10:00 IST for AC classes and 11:00 IST for non-AC classes on the calendar day before the train's departure date at its originating station. Online Tatkal/Premium Tatkal booking requires an Aadhaar-authenticated account and Aadhaar-based OTP during booking; surface authentication or OTP needs to the user instead of retrying. Do not calculate from a later boarding-station date; check live availability before promising a berth.+ - PNR/status trap: "PNR Status" is a separate flow from booking history ("Booked Ticket History"). Cancel via "Cancel Ticket" with confirmation; partial-cancel needs per-passenger selection.+ - Never submit payment or final booking without the user confirming train number, class, date, quota, and passenger list. Success = PNR on the booking-confirmation page.`,+ },+ {+ name: 'paytm',+ category: 'finance',+ matches: (url) => /^https?:\/\/(www\.)?paytm\.com\//.test(url),+ notes: `+ - Paytm is Indian recharge/bills/UPI/payments. Top flows: Mobile Recharge, DTH, Electricity, Gas, Broadband, Credit-card bill. Pick the operator/circle (e.g. "Airtel Prepaid", state electricity board) BEFORE entering the number — plans and bill-fetch depend on it.+ - Bill-fetch trap: postpaid/utility pages "Fetch Bill" from the account/consumer number first; the payable amount appears only after fetch. Do NOT pay a stale or typed amount without fetching.+ - Pay-via choice matters: UPI vs Wallet vs card/netbanking are separate radios at checkout. Wallet balance may be insufficient — check it before promising a wallet payment.+ - Login is phone-OTP; KYC-gated features (Wallet top-up limits) fail without it. Surface OTP/login to the user and stop — do not loop retries.+ - Do NOT complete any payment without explicit user confirmation of payee, amount, and method. Success = transaction/UPI reference ID page, not the "Pay" button state.`,+ },+ {+ name: 'snapdeal',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?snapdeal\.com\//.test(url),+ notes: `+ - Snapdeal is an Indian value-goods MARKETPLACE (unbranded/apparel/home). Prices are low but sizes/sellers vary — open the product page and read the exact variant before quoting.+ - Pincode-first trap: delivery/availability depends on the delivery "Pincode" set near the buy box. Set it first; "Check" reveals COD availability and delivery ETA.+ - Variant trap: pick Size/Color BEFORE "Add To Cart"/"Buy Now" — required options block the add until chosen.+ - COD vs prepaid: many listings offer Cash on Delivery; prepaid may show extra discount. Confirm the payment choice with the user — do not assume.+ - Sort via "Sort by" (popularity, price low→high) and filter via the left rail (Brand, Price, Size, Ratings) rather than URL edits. Cart lives at /cart; checkout needs login/OTP.`,},{// Mastodon is federated and self-hosted across many domains. Keep thisdiff --cc src/firefox/src/agent/adapters.jsindex eb63a46a9,de22bfbe9..7e3889c14--- a/src/firefox/src/agent/adapters.js+++ b/src/firefox/src/agent/adapters.js@@@ -17625,53 -17625,53 +17625,100 @@@ const ADAPTERS =- Stickers, GIFs, and bot commands (/) all live in popups above the message input.- DO NOT send a message unless the user named the recipient AND the exact message body in this conversation.- "Edit message" works for a window after sending (~48h); "Delete for everyone" within a shorter window — both have explicit confirms.`,+ },+ // ─── Regional — CIS + MENA (RU/TR/AE) ──────────────────────────────+ // High-priority CONTRIBUTING.md coverage: Wildberries, Avito, VK, noon.+ // Keep before the federated Mastodon matcher.+ {+ name: 'wildberries',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?wildberries\.ru\//.test(url),+ notes: `+- Wildberries is Russia's largest e-commerce MARKETPLACE (fashion-first, sells everything). As of 2026-09, Russian labels: "Добавить в корзину" = add to cart, "Корзина" = cart, "Войти" = log in, "Сортировка" = sort, "Фильтры" = filters.+- Variant trap: pick size ("Размер") and color BEFORE adding — apparel listings block the add until a size is chosen.+- Seller/price trap: the same item ships from different warehouses with different delivery ETAs ("Способ доставки"). Check the delivery estimate before quoting; the card price is not the arrival date.+- WB Wallet ("WB Кошелёк") vs card pricing may differ — quote the cart/payment total, not the card price.+- Sort with "Сортировка" (price low→high "Дешевле", rating, new) and filter in the left rail (brand, price, size, rating) rather than URL edits. Cart lives at /lk/basket; checkout needs login.`,+ },+ {+ name: 'avito',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.|m\.)?avito\.ru\//.test(url),+ notes: `+- Avito is Russia's largest CLASSIFIEDS site (like sahibinden: vehicles, real estate, goods, jobs, services). Most listings are "contact the seller", NOT checkout — do NOT hunt for a cart button on a typical listing.+- Anti-scam trap: contact via "Показать номер" (show number) or "Написать" (message) often needs login; phone numbers may be partially masked. Never promise a revealed number without clicking through.+- Filter in the left/top rail: price, "Город" (city), category facets, "С фото"/"С доставкой" toggles. Sort via "Сначала дешевле/дороже" rather than URL params.+- Avito Delivery ("Авито Доставка") is a SEPARATE escrow flow from local pickup — confirm which one the user wants before advising.+- Posting ("Разместить объявление") needs login and moderation; new ads show "На проверке" (under review), not live. Do not report as published until active.`,+ },+ {+ name: 'vk',+ category: 'general',+ matches: (url) => /^https?:\/\/(?:vk\.(?:com|ru)|(?:www|m)\.vk\.(?:com|ru)|id\.vk\.ru)\//.test(url),+ notes: `+- VK (vk.com) is Russia/CIS social + services (Feed, Messages, Communities, Video, Market, Mini-apps). Login is phone/QR; 2FA may appear — surface it to the user and stop, do not loop.+- Messages: dialog list on the LEFT, active chat on the RIGHT; input is a contenteditable box, Enter sends. DO NOT send unless the user named the recipient AND the exact body in this conversation.+- Communities/Groups vs personal pages look alike — check the header ("Сообщество"/subscribers vs "Друзья"/friends) before acting as/against the wrong entity.+- VK Video/Clips and Market are separate tabs with their own players/carts — do not mix Market checkout with social actions.+- Language trap: UI may be Russian ("Войти", "Сообщения", "Новости") or English depending on locale — read visible button text instead of assuming.`,+ },+ {+ name: 'noon',+ category: 'general',- matches: (url) => /^https?:\/\/(www\.)?noon\.com\//.test(url),++ matches: (url) => /^https?:\/\/(www\.|supermall\.)?noon\.com\//.test(url),+ notes: `+- noon.com is the MENA mega-marketplace (UAE/Saudi/Egypt storefronts share one domain with country switcher). Prices/availability are PER COUNTRY — set the country ("Ship to UAE/Saudi/Egypt") first or listings are meaningless.+- Variant trap: pick size/color ("Size", "Colour") BEFORE "Add To Cart" — required options block the add.+- Seller trap ("Sold by noon" vs marketplace sellers): check "Sold by" + ratings before quoting; fulfillment speed ("Get it by") varies by seller/warehouse.+- Price trap: coupons ("Apply code") and noon VIP/"noon One" discounts apply only at cart — quote the cart total, not the card price.+- Sort via "Sort by" (price low→high, popularity) and filter via the left rail (Brand, Price, Fulfilment) rather than URL edits. Cart at /cart; checkout needs login/OTP.`,+ },+ // ─── Regional — India daily-use (IN) ────────────────────────────────+ // High-priority CONTRIBUTING.md coverage: food, rail, payments, value+ // marketplace. Keep before the federated Mastodon matcher.+ {+ name: 'swiggy',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?swiggy\.com\//.test(url),+ notes: `+ - Swiggy is India's food-delivery + quick-commerce site (Food, Instamart grocery, Dineout). As of 2026-09, ordering needs a delivery LOCATION first — set it via the location pin/header ("Enter delivery address") before the restaurant list is meaningful; without it listings are generic.+ - Restaurant discovery: search by dish/restaurant, then open the restaurant page. Veg-only toggle ("Veg"), "Offers" filter, ratings ("4.0+"), cost-for-two, and delivery-time sort live above the list — set them instead of guessing URL params.+ - Dish trap: many dishes have REQUIRED customisations (size, spice, add-ons) in a modal. Pick them before "Add". "Add" becomes "ADD +" stepper; the cart is the header "Cart" drawer, not a page.+ - Instamart is a SEPARATE tab/flow from Food with its own cart — do not mix Food and Instamart items in one checkout.+ - Checkout requires login (phone OTP). Do NOT place the order without explicit user confirmation — payment/UPI is irreversible. Success = order-tracking page with ETA, not the cart drawer.`,+ },+ {+ name: 'irctc',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?irctc\.co\.in\//.test(url),+ notes: `+ - IRCTC (irctc.co.in) is Indian Railways ticketing. Login ("LOGIN") needs username/password + CAPTCHA; booking also needs passenger details (name, age, berth preference) and an explicit user confirm before "Book Now".+ - Search with station CODES (e.g. NDLS, BCT, HWH) in "From"/"To", journey date, and quota ("General", "Tatkal", "Ladies"). Sort/filter by class (SL/3A/2A/1A/CC) and train type; availability colours (Available/RAC/WL + number) are per class — read the exact class row before quoting.+ - Tatkal trap: booking opens at 10:00 IST for AC classes and 11:00 IST for non-AC classes on the calendar day before the train's departure date at its originating station. Online Tatkal/Premium Tatkal booking requires an Aadhaar-authenticated account and Aadhaar-based OTP during booking; surface authentication or OTP needs to the user instead of retrying. Do not calculate from a later boarding-station date; check live availability before promising a berth.+ - PNR/status trap: "PNR Status" is a separate flow from booking history ("Booked Ticket History"). Cancel via "Cancel Ticket" with confirmation; partial-cancel needs per-passenger selection.+ - Never submit payment or final booking without the user confirming train number, class, date, quota, and passenger list. Success = PNR on the booking-confirmation page.`,+ },+ {+ name: 'paytm',+ category: 'finance',+ matches: (url) => /^https?:\/\/(www\.)?paytm\.com\//.test(url),+ notes: `+ - Paytm is Indian recharge/bills/UPI/payments. Top flows: Mobile Recharge, DTH, Electricity, Gas, Broadband, Credit-card bill. Pick the operator/circle (e.g. "Airtel Prepaid", state electricity board) BEFORE entering the number — plans and bill-fetch depend on it.+ - Bill-fetch trap: postpaid/utility pages "Fetch Bill" from the account/consumer number first; the payable amount appears only after fetch. Do NOT pay a stale or typed amount without fetching.+ - Pay-via choice matters: UPI vs Wallet vs card/netbanking are separate radios at checkout. Wallet balance may be insufficient — check it before promising a wallet payment.+ - Login is phone-OTP; KYC-gated features (Wallet top-up limits) fail without it. Surface OTP/login to the user and stop — do not loop retries.+ - Do NOT complete any payment without explicit user confirmation of payee, amount, and method. Success = transaction/UPI reference ID page, not the "Pay" button state.`,+ },+ {+ name: 'snapdeal',+ category: 'general',+ matches: (url) => /^https?:\/\/(www\.)?snapdeal\.com\//.test(url),+ notes: `+ - Snapdeal is an Indian value-goods MARKETPLACE (unbranded/apparel/home). Prices are low but sizes/sellers vary — open the product page and read the exact variant before quoting.+ - Pincode-first trap: delivery/availability depends on the delivery "Pincode" set near the buy box. Set it first; "Check" reveals COD availability and delivery ETA.+ - Variant trap: pick Size/Color BEFORE "Add To Cart"/"Buy Now" — required options block the add until chosen.+ - COD vs prepaid: many listings offer Cash on Delivery; prepaid may show extra discount. Confirm the payment choice with the user — do not assume.+ - Sort via "Sort by" (popularity, price low→high) and filter via the left rail (Brand, Price, Size, Ratings) rather than URL edits. Cart lives at /cart; checkout needs login/OTP.`,},{// Mastodon is federated and self-hosted across many domains. Keep thisdiff --cc test/run.jsindex cfa334419,23b7f5b3d..dc5573c72--- a/test/run.js+++ b/test/run.js@@@ -10226,28 -10226,23 +10226,62 @@@ test('report-driven adapter notes remaiassert.equal(getActiveAdapter('https://naukrigulf.com.evil.example/job/1'), null);});+test('VK adapter covers canonical, mobile, and login hosts without trusting lookalikes', () => {+ const trustedUrls = [+ 'https://vk.com/feed',+ 'https://www.vk.com/im',+ 'https://m.vk.com/messages',+ 'https://vk.ru/feed',+ 'https://www.vk.ru/im',+ 'https://m.vk.ru/messages',+ 'https://id.vk.ru/auth',+ ];+ const lookalikeUrls = [+ 'https://id.vk.com.evil.example/auth',+ 'https://m.vk.ru.evil.example/messages',+ 'https://example.com/?next=https://id.vk.ru/auth',+ ];++ for (const getAdapter of [getActiveAdapter, getActiveAdapterFx]) {+ for (const url of trustedUrls) assert.equal(getAdapter(url)?.name, 'vk', url);+ for (const url of lookalikeUrls) assert.notEqual(getAdapter(url)?.name, 'vk', url);+ }+});+++test('Noon adapter covers its primary and Supermall storefronts without trusting lookalikes', () => {++ const trustedUrls = [++ 'https://noon.com/egypt-en/',++ 'https://www.noon.com/uae-en/',++ 'https://supermall.noon.com/saudi-en/cart/',++ ];++ const lookalikeUrls = [++ 'https://supermall.noon.com.evil.example/saudi-en/cart/',++ 'https://example.com/?next=https://supermall.noon.com/saudi-en/cart/',++ ];++++ for (const getAdapter of [getActiveAdapter, getActiveAdapterFx]) {++ for (const url of trustedUrls) assert.equal(getAdapter(url)?.name, 'noon', url);++ for (const url of lookalikeUrls) assert.notEqual(getAdapter(url)?.name, 'noon', url);++ }++});+++ test('India payment and Tatkal guidance keeps finance, timing, and authentication safety signals', () => {+ for (const getAdapter of [getActiveAdapter, getActiveAdapterFx]) {+ const paytm = getAdapter('https://paytm.com/recharge');+ assert.equal(paytm?.name, 'paytm');+ assert.equal(paytm?.category, 'finance');++ const irctc = getAdapter('https://www.irctc.co.in/nget/train-search');+ assert.equal(irctc?.name, 'irctc');+ assert.match(irctc?.notes || '', /10:00 IST for AC classes/);+ assert.match(irctc?.notes || '', /11:00 IST for non-AC classes/);+ assert.match(irctc?.notes || '', /departure date at its originating station/);+ assert.match(irctc?.notes || '', /requires an Aadhaar-authenticated account/);+ assert.match(irctc?.notes || '', /Aadhaar-based OTP during booking/);+ assert.doesNotMatch(irctc?.notes || '', /~24h before departure/);+ }+ });+test('adapter-match trace metadata is content-free, queued before tracing, and de-duplicated per run', () => {for (const [label, AgentClass] of [['chrome', AgentCh], ['firefox', AgentFx]]) {const agent = new AgentClass({});