Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/chrome/src/agent/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -16198,6 +16198,20 @@ const ADAPTERS = [
- Date picker is a custom calendar; type-then-tab usually doesn't commit. Click into the field, pick from the calendar grid (arrow keys + Enter work).
- "Book a trip" vs "Save for later" — the latter is a wishlist action, not a hold.
- Trip dashboard at /trips after a booking shows itinerary, change/cancel options. Cancellation rules vary per supplier.`,
},
{
name: 'ctrip',
category: 'general',
matches: (url) => /^https?:\/\/(?:(?:www|hotels|flights|trains|vacations|huodong|piao|passport|my|secure)\.)?ctrip\.com\//.test(url),
notes: `
- Choose "酒店", "机票", "火车票", "旅游", or "景点门票" before filling fields. Attraction tickets may hand off to piao.ctrip.com or huodong.ctrip.com; re-read after the host changes.
- Treat "广告" cards as sponsored. Compare the exact product, supplier, dates, inclusions, restrictions, and final total; ignore homepage rank, crossed-out/member prices, and "起" prices.
- Hotels: set city/property, "入住" / "离店", rooms, and guests; verify "房型", bed, breakfast, occupancy, payment timing, and "退订". Rows for one hotel are not interchangeable.
- Flights: verify airports, local dates/times, carrier, stops/transfers, cabin, "行李", change/refund terms, and separate tickets. Do not compare headline fares alone.
- Trains: verify train, stations, date, seat, passenger, chargeable extras, and total. After a 12306 handoff, re-read the destination page; do not assume Ctrip completed the ticket.
- Treat QR "扫码", password, SMS "短信", payment/real-name verification, a blank flights page, and HTTP 432 as blocking challenges. Do not retry or enter unprovided identity details; ask the user. For HTTP 432, pause and return through www.ctrip.com's "机票" entry.
- On the review page, remove only unrequested chargeable extras; preserve beneficial coupons and check their restrictions. Re-read travelers, contact, itinerary, terms, currency, and total; get explicit confirmation before "提交订单".
- Report success only with "订单号" plus "预订成功" or the applicable "出票成功" status. Pending confirmation, a payment redirect, or an itinerary held for payment is incomplete.`,
},
{
name: 'google-maps',
Expand Down
14 changes: 14 additions & 0 deletions src/firefox/src/agent/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -16196,6 +16196,20 @@ const ADAPTERS = [
- Date picker is a custom calendar; type-then-tab usually doesn't commit. Click into the field, pick from the calendar grid (arrow keys + Enter work).
- "Book a trip" vs "Save for later" — the latter is a wishlist action, not a hold.
- Trip dashboard at /trips after a booking shows itinerary, change/cancel options. Cancellation rules vary per supplier.`,
},
{
name: 'ctrip',
category: 'general',
matches: (url) => /^https?:\/\/(?:(?:www|hotels|flights|trains|vacations|huodong|piao|passport|my|secure)\.)?ctrip\.com\//.test(url),
notes: `
- Choose "酒店", "机票", "火车票", "旅游", or "景点门票" before filling fields. Attraction tickets may hand off to piao.ctrip.com or huodong.ctrip.com; re-read after the host changes.
- Treat "广告" cards as sponsored. Compare the exact product, supplier, dates, inclusions, restrictions, and final total; ignore homepage rank, crossed-out/member prices, and "起" prices.
- Hotels: set city/property, "入住" / "离店", rooms, and guests; verify "房型", bed, breakfast, occupancy, payment timing, and "退订". Rows for one hotel are not interchangeable.
- Flights: verify airports, local dates/times, carrier, stops/transfers, cabin, "行李", change/refund terms, and separate tickets. Do not compare headline fares alone.
- Trains: verify train, stations, date, seat, passenger, chargeable extras, and total. After a 12306 handoff, re-read the destination page; do not assume Ctrip completed the ticket.
- Treat QR "扫码", password, SMS "短信", payment/real-name verification, a blank flights page, and HTTP 432 as blocking challenges. Do not retry or enter unprovided identity details; ask the user. For HTTP 432, pause and return through www.ctrip.com's "机票" entry.
- On the review page, remove only unrequested chargeable extras; preserve beneficial coupons and check their restrictions. Re-read travelers, contact, itinerary, terms, currency, and total; get explicit confirmation before "提交订单".
- Report success only with "订单号" plus "预订成功" or the applicable "出票成功" status. Pending confirmation, a payment redirect, or an itinerary held for payment is incomplete.`,
},
{
name: 'google-maps',
Expand Down
49 changes: 49 additions & 0 deletions test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,55 @@ test('matches Mercado Libre LATAM storefronts and includes marketplace guidance'
assert.equal(firefoxAdapter?.notes, adapter?.notes);
});

test('matches Ctrip travel surfaces and includes Chinese booking guidance', () => {
const trustedUrls = [
'https://www.ctrip.com/',
'https://hotels.ctrip.com/hotels/437892.html',
'https://flights.ctrip.com/international/search/oneway-sha-sin',
'https://trains.ctrip.com/TrainBooking/SearchTrain.aspx',
'https://vacations.ctrip.com/',
'https://huodong.ctrip.com/things-to-do/list',
'https://piao.ctrip.com/',
'https://passport.ctrip.com/user/login',
'https://my.ctrip.com/myinfo/orders',
'https://secure.ctrip.com/booking',
];
for (const url of trustedUrls) {
assert.equal(getActiveAdapter(url)?.name, 'ctrip');
assert.equal(getActiveAdapterFx(url)?.name, 'ctrip');
}

const rejectedUrls = [
'https://pages.ctrip.com/corporate/',
'https://tickets.ctrip.com/',
'https://ctrip.com.phishing.example/hotels',
'https://example.com/?next=https://hotels.ctrip.com/',
];
for (const url of rejectedUrls) {
assert.notEqual(getActiveAdapter(url)?.name, 'ctrip');
assert.notEqual(getActiveAdapterFx(url)?.name, 'ctrip');
}

const adapter = getActiveAdapter('https://hotels.ctrip.com/hotels/437892.html');
const firefoxAdapter = getActiveAdapterFx('https://flights.ctrip.com/');
assert.match(adapter?.notes || '', /酒店.*机票.*火车票/s);
assert.match(adapter?.notes || '', /广告/);
assert.match(adapter?.notes || '', /入住.*离店.*房型/s);
assert.match(adapter?.notes || '', /退订|取消/);
assert.match(adapter?.notes || '', /行李/);
assert.match(adapter?.notes || '', /12306/);
assert.doesNotMatch(adapter?.notes || '', /12306 adapter/);
assert.match(adapter?.notes || '', /扫码|短信/);
assert.match(adapter?.notes || '', /HTTP 432/);
assert.match(adapter?.notes || '', /提交订单/);
assert.match(adapter?.notes || '', /explicit confirmation/);
assert.match(adapter?.notes || '', /preserve beneficial coupons/i);
const noteBullets = (adapter?.notes || '').trim().split('\n').filter((line) => line.startsWith('- '));
assert.equal(noteBullets.length, 8);
assert.match(adapter?.notes || '', /订单号|出票成功|预订成功/);
assert.equal(firefoxAdapter?.notes, adapter?.notes);
});

test('matches Coupang shopping surfaces and includes Korean marketplace guidance', () => {
const trustedUrls = [
'https://coupang.com/',
Expand Down
Loading