fortrip 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15638,7 +15638,7 @@ var FRAGMENTS = {
|
|
|
15638
15638
|
"meals": '{{#if claude-skill cli}}\n## Presenting an offer\n\nGive the user, for each offer:\n\n- the room (`room.name`, beds, size) and the total, as above;\n- the meals: `meals.included` (breakfast, lunch, dinner) or `allInclusive`, with `guestsCoveredPerRoom`. Fewer than the guests per room means not everyone gets the meals (breakfast for 1 with 2 adults in the room): say who is covered. `unspecifiedMainMeals` counts main meals the hotel didn\'t name. With `known: false`, the meals are unknown: say so, and don\'t call it room only;\n- cancellation: `status` (`free`, `partial_penalty`, `non_refundable` or `unknown`), `freeCancellationEndsAt` (null with `free`: free until check-in) and the `penalties`. Times are in UTC: also give them in the hotel\'s `timeZone`;\n- confirmation: `mode` `instant` or `on_request` (within `withinMinutes`);\n- fees payable at the property (`payAtProperty.items`), in the property\'s currency. `disclosure: "incomplete"` means there can be fees not listed: say so.\n\nAn offer expires at `expiresAt`, about 30 minutes after it was made; after that, get offers again.\n\n"Not listed" is not "no": `listed: false` (amenities, policies, rooms), `null` and `unknown` mean the source didn\'t say. Tell the user it\'s unknown instead of turning it into "no".\n{{/if}}\n{{#if mcp}}\n- "Not listed" or "unknown" is not "no".\n{{/if}}\n',
|
|
15639
15639
|
"occupancy": "{{#if claude-skill cli}}\n## Rooms and guests\n\n- {{#if mcp claude-skill}}`stay.rooms` lists each room's party as `{ adults, childrenAges }`: two rooms of 2 adults, one with a child of 6, is `[{ adults: 2, childrenAges: [6] }, { adults: 2, childrenAges: [] }]`{{/if}}{{#if cli}}`--room <adults[:age,\u2026]>`, once per room, gives each room's party: two rooms of 2 adults, one with a child of 6, is `--room 2:6 --room 2`{{/if}}.\n- Ask each child's age; offers need it.\n- If the party doesn't split evenly across the rooms (3 adults in 2 rooms), ask the user how it splits.\n- Offers and orders take one party per call, every room the same: for different parties, order once per party. `{{tool:hotels offers}}` answers `stay_unsupported` (`mixed_occupancy`) for mixed rooms; `{{tool:hotels search}}` accepts them but prices only from the dates, with the note `party_split_required`.\n- Limits: 1\u2013{{limit:rooms}} rooms, 1\u2013{{limit:adultsPerRoom}} adults and 0\u2013{{limit:childrenPerRoom}} children (aged 0\u2013{{limit:childAgeMax}}) per room, 1\u2013{{limit:nightsSupplier}} nights, up to {{limit:offersHotels}} hotels per `{{tool:hotels offers}}` call. A longer stay answers `stay_unsupported` (`max_nights`): ask the user whether to split it into consecutive stays, each its own order.\n{{/if}}\n",
|
|
15640
15640
|
"order": '{{#if claude-skill cli}}\n## Workflow\n\n1. **Search** with `{{tool:hotels search}}` for candidate hotels: a destination, `{{arg:text}}` or both, and the stay\'s dates and rooms for indicative prices.\n{{#if cli}}\n\n ```bash\n {{tool:hotels search}} --place-name Bangkok --country TH --check-in 2026-11-10 \\\n --check-out 2026-11-12 --room 2 --stars-min 4 --sort price_asc --limit 10\n ```\n\n{{/if}}\n2. **Details** (optional) with `{{tool:hotels get}}`, when the user asks about a hotel or a stated preference needs evidence (a pool, a policy, room size). For a details-only question, call it directly when you know the hotel\'s `hotelId`; otherwise find the hotel with `{{tool:hotels search}}`.\n{{#if cli}}\n\n ```bash\n {{tool:hotels get}} <hotelId> [--rooms]\n ```\n\n{{/if}}\n3. **Offers** with `{{tool:hotels offers}}` for a few shortlisted hotels, with the dates and rooms the user will order. It takes about 15 seconds. A hotel is available only once this returns an offer for it.\n{{#if cli}}\n\n ```bash\n {{tool:hotels offers}} --hotel <hotelId> --hotel <hotelId> --check-in 2026-11-10 \\\n --check-out 2026-11-12 --room 2 --room 2 [--require-free-cancellation]\n ```\n\n{{/if}}\n4. **Order** with `{{tool:hotels book}}`, once the user has picked one offer and given the guests and the contact (see Ordering).\n{{#if cli}}\n\n ```bash\n {{tool:hotels book}} --offer <offerId> --guest 1:John:Smith --guest 2:Mary:Smith \\\n --first-name John --last-name Smith --email john@example.com \\\n --phone "+8613800000000"\n ```\n\n{{/if}}\n5. **Confirm, then give the payment link**, as in "Before giving the payment link" below.\n6. **After payment**, check the order with `{{tool:orders get}}` (see After payment).\n\n## Search\n\n### Where\n\n- **A place by name:** {{#if mcp claude-skill}}`{ kind: "place_name", name, countryCode }`{{/if}}{{#if cli}}`--place-name <name> --country <CC>`{{/if}}, in any language (Kyoto or \u4EAC\u90FD). The country is required: ask the user when it isn\'t clear. Names match exactly, ignoring only case and spacing: accents, hyphens, apostrophes and periods count ("K\xF6ln" or "Cologne", not "Koln"; "St. Moritz", not "St Moritz").\n- If several places bear the name, the answer is `destination_ambiguous` with up to {{limit:candidatesShown}} candidates and their hotel counts: ask the user which one they mean, then search it by its `placeId`; never pick one yourself.\n- `destination_not_found` with `no_match` means no place of that name in that country: check the spelling and accents, or try another name for the place. Its `nameAsText` counts the hotels that a `{{arg:text}}` search for the name would find.\n- **A place from an earlier answer:** {{#if mcp claude-skill}}`{ kind: "place", placeId }`{{/if}}{{#if cli}}`--place <placeId>`{{/if}}.\n- **Near a point:** {{#if mcp claude-skill}}`{ kind: "point", location: { lat, lng } }`{{/if}}{{#if cli}}`--point <lat,lng>`{{/if}}, for "near X" when you know where X is.\n- **A whole country:** {{#if mcp claude-skill}}`{ kind: "country", countryCode }`{{/if}}{{#if cli}}`--country-only <CC>`{{/if}}, as for the Maldives.\n- Countries, regions (states, provinces), prefecture-level cities in China and main islands cover their whole area. Towns, neighbourhoods, districts, small islands and points cover a circle of {{limit:radiusMetersDefault}} meters; `{{arg:destination.radiusMeters}}` sets another, up to {{limit:radiusMetersMax}} meters, and narrows an area to a circle around its center.\n- **Localities:** an area search lists its `localities`, the towns its hotels belong to, each with a `placeId`, its hotel `count` and the places it `includes` (Patong is part of Phuket). To search one, pass it as {{#if mcp claude-skill}}`{ kind: "locality", placeId }`{{/if}}{{#if cli}}`--locality <placeId>`{{/if}}. A town that isn\'t a locality answers `destination_not_found` with `not_a_locality` and, in `hub`, the locality it belongs to: search that locality, or the town itself with {{#if mcp claude-skill}}`kind: "place"`{{/if}}{{#if cli}}`--place`{{/if}} for a circle around it.\n- A price sort or price filter over more than {{limit:poolLimit}} hotels (in an area, or for text alone) answers `search_too_broad` with `matched` and the top `localities`: show them and ask the user which they prefer, unless the request already names one of them; search that one by its `placeId` as a locality, never by its name.\n\n### Text\n\n`{{arg:text}}` matches exact words in hotel names and addresses, in Chinese or English:\n\n- Every word must match as written (a typo such as "Shangahi" finds nothing): plurals, accents, spacing and abbreviations count ("hostel" and "hostels", "St Regis" and "Saint Regis" find different hotels). Hyphens and apostrophes don\'t (Ritz-Carlton finds Ritz Carlton).\n- In Chinese, matching follows word segmentation, so part of a name can match unrelated hotels (\u5E0C\u5C14 is not \u5E0C\u5C14\u987F).\n- Use only distinctive words: a hotel or brand name, a district or a landmark. Not "hotel", "near", "cheap" or "best".\n- Place names belong in the destination: "Maldives" as text finds a hotel named Maldives in China.\n\n### Filters\n\n- Stars run from 1 to 5 in half steps{{#if mcp claude-skill}} (`filters.stars`){{/if}}. "4 stars" as {{#if mcp claude-skill}}`{ min: 4, max: 4 }`{{/if}}{{#if cli}}`--stars-min 4 --stars-max 4`{{/if}} leaves out 4.5: unless the user means exactly 4, use {{#if mcp claude-skill}}`{ min: 4 }`{{/if}}{{#if cli}}`--stars-min 4`{{/if}} or ask. Unrated hotels are left out whenever stars are filtered.\n- `{{arg:filters.amenities}}` takes only the amenities that can filter (such as pool, parking, wifi); others, such as gym or spa, show in `{{tool:hotels get}}` but can\'t filter. A hotel matches only when it lists the amenity, and about half the hotels list no amenities at all (`coverage.excludedNoFacilityData` counts those left out): "not listed" is not "absent".\n- `{{arg:filters.price.maxPerRoomNight}}` bounds the indicative price per room per night, in the search\'s currency; hotels without one are left out and counted.\n\n### Results\n\n- `notes` explain the answer (a limited pool, a circle around an island, more hotels just outside it): pass on what matters to the user.\n- `coverage` has the counts: `matched` hotels, how many were priced and how many have a price.\n- A next page is {{#if mcp claude-skill}}`cursor` set to `nextCursor` and, optionally, `limit`{{/if}}{{#if cli}}`--cursor <nextCursor>` and, optionally, `--limit`{{/if}}; nothing else.\n{{/if}}\n{{#if mcp}}\n- A place name needs its `countryCode` (ask the user if unclear) and matches exactly (accents and periods count). On `destination_ambiguous`, ask the user which they mean, then search its `placeId`; never pick one yourself.\n- On `search_too_broad`, show its `localities` and ask the user which, unless they already named one; search it as `{ kind: "locality", placeId }`, never by name.\n- `text` matches whole words of hotel names and addresses: use a distinctive name, brand or landmark.\n{{/if}}\n',
|
|
15641
|
-
"payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:hotels book}}` answers with an unpaid order: `status` `awaiting_payment`, its `reference` (the support number), `price.total`, the stay and its terms, and `payment.url`, a Fortrip page that recaps the order and continues to the payment provider. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates,
|
|
15641
|
+
"payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:hotels book}}` answers with an unpaid order: `status` `awaiting_payment`, its `reference` (the support number), `price.total`, the stay and its terms, and `payment.url`, a Fortrip page that recaps the order and continues to the payment provider. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term: meals, cancellation (status, deadline, penalties) and fees payable at the property, unknowns included. Show the names and contact as the order holds them, so the user can catch a wrong one before paying; to correct one, order a new offer (see below).\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then pay one way only: give `payment.url` exactly as returned (don't shorten, rebuild or re-encode it), or use one of the ways below.\n\n{{/if}}\n{{#if mcp}}\n- Pay one way only: give `payment.url` or call `{{tool:orders pay}}`. First show the order's total and currency, the stay with each room's guests, the contact, any special requests and every term, end that reply by asking the user to confirm, and wait for a clear yes. Then give `payment.url` exactly as returned, to this user only: anyone holding it can pay.\n{{/if}}\n{{#if claude-skill cli}}\n- `payment.url` works like a payment credential: anyone holding it can pay. Give it to this user only, never in shared channels, documents, logs or tickets. With `requiresSignIn: true` (an order started on the Fortrip website), the user signs in to pay.\n- The link expires at `payment.expiresAt`; the order is then `expired`. To order the stay again, get offers again, and confirm the new order with the user before giving its link.\n- Another order of the stay (another party, or a corrected guest name or contact) needs a new offer: get offers again. When it replaces an unpaid order, tell the user to pay only the new link; the earlier one expires unpaid, or can be closed now with `{{tool:orders cancel}}`{{#if cli}} and `--close`{{/if}} once the user says they no longer want it.\n- An order `awaiting_payment` with `payment.status` `unpaid` whose `payment.url` is null has a payment being processed: read it again shortly with `{{tool:orders get}}`, and don't give an earlier link.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only on `payment.url` or by a way in the order's `payment.methods`.{{#if claude-skill cli}} A card number in a guest name, the contact or the special requests is rejected{{#if cli}} with exit 2{{/if}}.{{/if}}\n{{#if claude-skill cli}}\n\n## Paying without the link\n\nAn order whose `payment.methods` has the `stripe_shared_payment_token` entry (in {{#if claude-skill}}a result's text{{/if}}{{#if cli}}the text output{{/if}}, the line \"Pay without the link\") can also be paid through `{{tool:orders pay}}` with a Stripe shared payment token that the user's Link wallet grants for it. Use it only if you have a tool that can request such a token from the user's Link wallet: Link is for US and Canadian accounts, and caps a spend request at ${{limit:tokenPaymentMaxUsd}}, so only a USD order up to that has such an entry. Otherwise give `payment.url`, and never ask the user to create, type or paste a token.\n\n1. Confirm the order with the user as before giving the payment link: its total and currency, the stay with each room's guests, the contact, any special requests and every term, and a clear yes. The token comes from the user's wallet, never from card details.\n2. Request the token from the user's Link wallet with that entry's `handler.config.business_profile` and its `limits`: `maxAmount` (in cents), `currency` and `expiresAt`.\n3. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` with the token and the order's `price.total`{{#if cli}} (`--token`, `--total`){{/if}}{{#if claude-skill}}, the token as `sharedPaymentToken` or in UCP's `payment.instruments`{{/if}}. The order is then `confirming`, its payment `authorized`: check it as after payment.\n\nThe charge is in USD: a card in another currency may add a foreign transaction fee. Once `{{tool:orders pay}}` succeeds, `payment.url` stops working; a payment that fails leaves the link open. `payment_total_changed` means the total sent isn't the order's (`details.total`); the order's total hasn't changed: confirm it with the user, then {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders pay}}` again with it and the same token. `payment_declined`: the user picks another payment method in their wallet, or pays by link. `payment_action_required`: the card needs a verification this can't give: pay by link. `payment_credential_invalid`: request a new token with that entry's `limits`. `service_unavailable`: call `{{tool:orders pay}}` again with the same token, never a new one. A token pays one order only.\n\n## Paying with Alipay or WeChat Pay\n\nAn order whose result text has the line \"Pay with Alipay or WeChat Pay\" can be paid in the user's Alipay or WeChat wallet, with no token. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` {{#if claude-skill}}with `method` `stripe_alipay_wechat_pay`{{/if}}{{#if cli}}the way that line shows{{/if}} and the order's `price.total`, only after the user has confirmed.\n\n1. Confirm the order with the user as before giving the payment link: its total and currency, the stay with each room's guests, the contact, any special requests and every term, and a clear yes.\n2. Then show the `stripe_alipay_wechat_pay` entry of `payment.methods`: the WeChat Pay code as an image if you can, and both links (WeChat Pay and Alipay). The user pays once, by either. Alipay and WeChat Pay charge at once; if the hotel can't confirm, the payment is refunded in full. The total is in the order's currency, and the wallets show it in yuan at their rate.\n3. Check the order with `{{tool:orders get}}` until it isn't `awaiting_payment`.\n\nA WeChat Pay code expires {{limit:wechatCodeMinutes}} minutes after it is made, and goes dead earlier if the user opens the Alipay link instead. Then that entry's `wechatPay.qrData` is null: tell the user to open the WeChat link again, or {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders pay}}` again for a new code.\n\nWeChat can't scan a code shown on the same phone's screen. Offer both ways, since you can't tell which device the user is on: save the image and scan it from the album (WeChat, then Scan, then Album), or open the WeChat link on another screen; on a phone, the Alipay link opens the Alipay app.\n\n## After payment\n\nCheck the order with `{{tool:orders get}}`:\n\n- `confirming` while the hotel confirms, then `confirmed` with the hotel's `confirmationNumber`.\n- `failed`: no stay was booked; `payment.status` says whether the payment was released or refunded.\n- `needs_attention`: Fortrip is looking into it; the user can email {{support}} with the `reference`.\n- `manageUrl` is the user's own page for the order.\n{{/if}}\n",
|
|
15642
15642
|
"planning": "# Planning a hotel stay\n\nRead this when the request is more than one hotel for fixed dates: flexible dates, a budget, split stays, several destinations, or \"find me the best\". The rules in {{#if mcp}}the server instructions{{/if}}{{#if claude-skill cli}}SKILL.md{{/if}} still apply{{#if mcp}} (call order, destinations, confirming the order `{{tool:hotels book}}` returns before giving the payment link){{/if}}; this covers what to ask, how to compare and how to present.{{#if cli}} As there, `fortrip` is short for `npx -y fortrip@latest`.{{/if}}\n\n## What to collect\n\nKeep track of: dates (or the flexible window), nights, destination(s) with their country, rooms and the guests in each room, room constraints (beds, connecting rooms, accessibility), budget, and what the user said matters most (cheapest, most flexible, closest to X).\n\n{{#if mcp}}\nOffers and orders take one party per call, every room the same, so if the party doesn't split evenly across the rooms, ask how it splits. Rooms for different parties are priced and ordered separately, each order with its own payment link.\n\n{{/if}}\nAsk only for what changes which hotels qualify or how they rank. \"4 stars\" as {{#if mcp claude-skill}}`{ min: 4, max: 4 }`{{/if}}{{#if cli}}`--stars-min 4 --stars-max 4`{{/if}} leaves out 4.5: unless the user means exactly 4, use {{#if mcp claude-skill}}`{ min: 4 }`{{/if}}{{#if cli}}`--stars-min 4`{{/if}} or ask.{{#if mcp}} If children come along, ask each child's age; `{{tool:hotels offers}}` needs it. When a place name is ambiguous, ask which place the user means.{{/if}} Don't ask for trip type or style: infer it from the conversation or leave it general.\n\n## Evidence\n\n- {{#if mcp}}A `{{tool:hotels search}}` price is an indicative estimate per room per night, not a quote. Never call a search result available or bookable, and once{{/if}}{{#if claude-skill cli}}Once{{/if}} you have offers, compare offers only. A hotel without a search price can still have offers.\n- Use `{{tool:hotels get}}` only when a stated preference needs evidence (a pool, a policy, room size). An amenity or policy it doesn't list is unknown, not absent.\n{{#if mcp}}\n- A hotel is available only once `{{tool:hotels offers}}` returned an offer for it.\n{{/if}}\n- Anything {{#if mcp claude-skill}}the tools{{/if}}{{#if cli}}the CLI{{/if}} didn't return, such as reviews, style, price trends or exchange rates, is unknown. Say so instead of filling it in.\n\n## Ranking\n\n1. Drop options that break a hard constraint (dates, guests, budget cap, required facility). Compare a budget in the unit the user gave it: per night, per room or for the whole stay. An offer's `price.total` covers the whole stay and every room, in the offer's currency.\n2. Keep only options with a live offer.\n3. Order by the user's stated main goal. Goals they didn't state don't count.\n4. Use other preferences only to break ties.\n\nUse the cheapest comparable offer as the baseline unless the user fixed the room type. Two or three plans usually suffice, each with its price difference from the baseline and what it trades off (meals, cancellation, location, confirmation). Keep hotel names as returned and dates in the user's notation.\n\nFor a split stay or several destinations, price each leg with its own `{{tool:hotels offers}}` call and add up the legs. Each leg is a separate `{{tool:hotels book}}` call, with its own confirmation and its own payment link.\n\n## Stop and say so\n\n- `{{tool:hotels offers}}` covers up to {{limit:offersHotels}} hotels per call and takes about 15 seconds, and its offers expire after about 30 minutes. If the request needs more hotels or date combinations than a few calls can cover, narrow it with the user, or present the result as a comparison of the hotels you priced, not the best overall.\n- When a search is too broad to price, show its localities and ask the user which they prefer, unless the request already names one of them; never pick one yourself.\n- Urgency is not consent. Call `{{tool:hotels book}}` only for the offer the user picked, and give its payment link only after the user confirms the total, currency, stay and terms of the order `{{tool:hotels book}}` returned.\n",
|
|
15643
15643
|
"presentation": "{{#if claude-skill}}\n## Presenting hotels\n\nIf your interface can show rich elements, show each hotel as a card with only what Fortrip's tools returned for it in this conversation: photo, name, stars, region and price, and once you have offers every term that changes the choice (meals and who they cover, cancellation, fees payable at the property, confirmation), an unknown one as unknown. Label a search's `price.fromPerRoomNight` as an estimate per room-night and an offer's `price.total` as the whole stay for all rooms, in its currency, and draw a map only from returned `location` coordinates. Offer the choices you need to ask anyway (dates, a locality, which offer) as options to pick. Otherwise use a short list. Keep hotel names as returned, and never invent photos, ratings, reviews, prices, terms or coordinates.\n{{/if}}\n",
|
|
15644
15644
|
"prices": "{{#if claude-skill cli}}\n## Prices and currency\n\n- A search price (`price.fromPerRoomNight`) is indicative and not bookable: the lowest price of one unit (a room or, at a hostel, possibly a bed) per night, for any party and often any date, and it can be well above or below the offers. Call it an estimate, quote `{{tool:hotels offers}}` prices, and never call a search result available or bookable. `price: null` means there is no indicative price, not that the hotel is full; about half the hotels have none for given dates.\n{{/if}}\n- {{#if claude-skill cli}}In an offer or order, `price.total` is the whole stay for all rooms and is what is charged, in the request's `{{arg:currency}}` (`USD` by default); an{{/if}}{{#if mcp}}An{{/if}} order is in the currency of the offer it was made from.{{#if claude-skill cli}} `perNightAllRooms` is the total per night; to compare with a per-room budget, also divide by the rooms.{{/if}} On a USD order, Stripe's page may let the user pay in their card's local currency at Stripe's rate{{#if claude-skill cli}} (Adaptive Pricing): say so plainly, and that the total in that currency is the price{{/if}}.\n{{#if claude-skill cli}}\n- Every price of a response is in that one currency; don't convert it. `{{arg:currency}}`{{#if cli}} (or `FORTRIP_CURRENCY`){{/if}} is `USD` (the default) or `CNY`.\n- Each currency is paid through its own channel, with its own payment methods; the order's payment page shows them. CNY is paid through payment channels in mainland China and suits a user who pays that way.\n- A search not in CNY may carry `currencyHint` (CNY) when the request or the user's latest sign-in comes from mainland China: offer CNY prices if the user may pay that way, and then use CNY for both the search and the offers.\n- Fees payable at the property (`payAtProperty`) are separate, in the property's own currency, not converted.\n- After payment, `payment.localCharge` is what the card paid in its own currency. Orders made on the Fortrip website can be charged in another currency: `payment.chargeCurrency` says which.\n{{/if}}\n",
|
|
@@ -16282,6 +16282,11 @@ var paymentMethod = openUnion("id", [
|
|
|
16282
16282
|
)
|
|
16283
16283
|
]);
|
|
16284
16284
|
var orderReference = external_exports.string().regex(/^FT-[2-9A-HJ-NP-Z]{6}$/);
|
|
16285
|
+
var orderRoom = stayEcho.shape.rooms.element.extend({
|
|
16286
|
+
guests: external_exports.array(openObject({ firstName: external_exports.string(), lastName: external_exports.string() })).nullable().describe(
|
|
16287
|
+
"The guests the order names for this room, as given when ordering. null when none are on record yet: an order started on the Fortrip website names them at checkout."
|
|
16288
|
+
)
|
|
16289
|
+
});
|
|
16285
16290
|
var hotelItem = openObject({
|
|
16286
16291
|
type: external_exports.literal("hotel"),
|
|
16287
16292
|
hotel: openObject({
|
|
@@ -16291,7 +16296,8 @@ var hotelItem = openObject({
|
|
|
16291
16296
|
checkIn: localDate,
|
|
16292
16297
|
checkOut: localDate,
|
|
16293
16298
|
timeZone: external_exports.string().nullable(),
|
|
16294
|
-
rooms:
|
|
16299
|
+
rooms: external_exports.array(orderRoom).min(1),
|
|
16300
|
+
specialRequests: external_exports.string().nullable().describe("The requests for the hotel, as given when ordering; null when none were given. Not guaranteed."),
|
|
16295
16301
|
room: openObject({
|
|
16296
16302
|
name: localizedText.nullable(),
|
|
16297
16303
|
beds: localizedText.nullable()
|
|
@@ -16312,6 +16318,13 @@ var order = openObject({
|
|
|
16312
16318
|
),
|
|
16313
16319
|
createdAt: instant,
|
|
16314
16320
|
updatedAt: instant,
|
|
16321
|
+
contact: openObject({
|
|
16322
|
+
name: external_exports.string().describe("The contact's full name, as given when ordering."),
|
|
16323
|
+
email: external_exports.string().nullable().describe("Where the confirmation is sent; null when none is on record."),
|
|
16324
|
+
phone: external_exports.string().nullable().describe("The contact's phone number; null when none is on record.")
|
|
16325
|
+
}).nullable().describe(
|
|
16326
|
+
"Who the hotel and the confirmation reach, as given when ordering. null when none is on record yet: an order started on the Fortrip website gives it at checkout."
|
|
16327
|
+
),
|
|
16315
16328
|
items: external_exports.array(openUnion("type", [hotelItem])).min(1),
|
|
16316
16329
|
price: openObject({
|
|
16317
16330
|
total: money.describe(
|
|
@@ -16439,7 +16452,7 @@ function routePath(route2, input) {
|
|
|
16439
16452
|
}
|
|
16440
16453
|
|
|
16441
16454
|
// ../contract/src/tools.ts
|
|
16442
|
-
var ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates,
|
|
16455
|
+
var ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
|
|
16443
16456
|
var CALLS = {
|
|
16444
16457
|
mcp: {
|
|
16445
16458
|
cancel: "call cancel_order",
|
|
@@ -16471,12 +16484,12 @@ function cancelNextStep(surface) {
|
|
|
16471
16484
|
var CANCEL_NEXT_STEP = cancelNextStep("mcp");
|
|
16472
16485
|
function payNextStep(surface) {
|
|
16473
16486
|
const c = CALLS[surface];
|
|
16474
|
-
return `To pay without the link: only if you have a tool that can request a Stripe shared payment token from the user's Link wallet (US and Canadian Link accounts), and the order's payment.methods has the stripe_shared_payment_token entry. Otherwise give payment.url, and never ask the user to create, type or paste a token. Before you ${c.pay}, show the user the order's total and currency, the stay (hotel, room, dates,
|
|
16487
|
+
return `To pay without the link: only if you have a tool that can request a Stripe shared payment token from the user's Link wallet (US and Canadian Link accounts), and the order's payment.methods has the stripe_shared_payment_token entry. Otherwise give payment.url, and never ask the user to create, type or paste a token. Before you ${c.pay}, show the user the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Then request the token for this order from the user's Link wallet with that entry's handler config.business_profile and its limits (maxAmount in cents, currency, expiresAt), and ${c.payWith}. The charge is in USD: a card in another currency may add a foreign transaction fee. Pay one way only: either give payment.url or ${c.pay}. Once ${c.paid} succeeds, payment.url stops working; a failed payment leaves it open.`;
|
|
16475
16488
|
}
|
|
16476
16489
|
var PAY_NEXT_STEP = payNextStep("mcp");
|
|
16477
16490
|
function walletNextStep(surface) {
|
|
16478
16491
|
const c = CALLS[surface];
|
|
16479
|
-
return `Before you ${c.pay}${c.payWallet}, show the user the order's total and currency, the stay (hotel, room, dates,
|
|
16492
|
+
return `Before you ${c.pay}${c.payWallet}, show the user the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then ask them to confirm, and wait for a clear yes. Then show the stripe_alipay_wechat_pay entry of payment.methods: the WeChat code as an image if you can, and both links. The user pays once, by one of them. Alipay and WeChat Pay charge at once; if the hotel can't confirm, the payment is refunded in full. Then ${c.poll}.`;
|
|
16480
16493
|
}
|
|
16481
16494
|
var WALLET_NEXT_STEP = walletNextStep("mcp");
|
|
16482
16495
|
var nextStep = external_exports.string().optional().describe(
|
|
@@ -16524,7 +16537,7 @@ var TOOLS = [
|
|
|
16524
16537
|
{
|
|
16525
16538
|
name: "book_hotel",
|
|
16526
16539
|
title: "Create order",
|
|
16527
|
-
description: `Order one offer from get_hotel_offers. The answer is an unpaid order with a payment link: status awaiting_payment, the total, the stay and its terms, and payment.url, a Fortrip page to pay on. Nothing is charged until the order is paid, on that page or with pay_order; anyone holding the link can pay. Send the contact and, for each room of the offer, at least one guest. If the price or terms changed since the offer, the answer is offer_changed with every change and a new offer: show the changes and ask the user again before ordering it. Sending the same details again returns the same order. An offer is ordered once: for another order of the stay (another party, or a corrected guest name), get offers again and order the new offer; when it replaces an unpaid order, tell the user to pay only the new link, as the earlier one expires unpaid. To cancel an order, use cancel_order; for changes, or a cancellation cancel_order can't make, the user emails ${SUPPORT_EMAIL} with the order's reference.`,
|
|
16540
|
+
description: `Order one offer from get_hotel_offers. The answer is an unpaid order with a payment link: status awaiting_payment, the total, the stay and its terms, and payment.url, a Fortrip page to pay on. Nothing is charged until the order is paid, on that page or with pay_order; anyone holding the link can pay. Send the contact and, for each room of the offer, at least one guest. If the price or terms changed since the offer, the answer is offer_changed with every change and a new offer: show the changes and ask the user again before ordering it. Sending the same details again returns the same order. An offer is ordered once: for another order of the stay (another party, or a corrected guest name or contact), get offers again and order the new offer; when it replaces an unpaid order, tell the user to pay only the new link, as the earlier one expires unpaid. To cancel an order, use cancel_order; for changes, or a cancellation cancel_order can't make, the user emails ${SUPPORT_EMAIL} with the order's reference.`,
|
|
16528
16541
|
annotations: {
|
|
16529
16542
|
readOnlyHint: false,
|
|
16530
16543
|
idempotentHint: false,
|
|
@@ -16566,7 +16579,7 @@ var TOOLS = [
|
|
|
16566
16579
|
{
|
|
16567
16580
|
name: "pay_order",
|
|
16568
16581
|
title: "Pay order",
|
|
16569
|
-
description: `Pay a USD order without its link, by one of its payment.methods: a Stripe shared payment token, only if you can request one from the user's Link wallet (US and Canadian accounts; never ask the user for one), or Alipay/WeChat Pay (method stripe_alipay_wechat_pay). Call it only after the user confirmed the order's total and currency, the stay and every term with a clear yes. Token: request it with the entry's handler config.business_profile and limits, and pass it with price.total; a token pays one order. Wallet: pass method and price.total, then show the entry it returns: the WeChat code as an image if you can, and both links; the user pays once, by either. A code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: success closes payment.url, a failure leaves it open, and each error says how to recover. Then poll get_order.`,
|
|
16582
|
+
description: `Pay a USD order without its link, by one of its payment.methods: a Stripe shared payment token, only if you can request one from the user's Link wallet (US and Canadian accounts; never ask the user for one), or Alipay/WeChat Pay (method stripe_alipay_wechat_pay). Call it only after the user confirmed the order's total and currency, the stay with each room's guests, the contact, any special requests and every term with a clear yes. Token: request it with the entry's handler config.business_profile and limits, and pass it with price.total; a token pays one order. Wallet: pass method and price.total, then show the entry it returns: the WeChat code as an image if you can, and both links; the user pays once, by either. A code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: success closes payment.url, a failure leaves it open, and each error says how to recover. Then poll get_order.`,
|
|
16570
16583
|
annotations: {
|
|
16571
16584
|
readOnlyHint: false,
|
|
16572
16585
|
idempotentHint: true,
|
|
@@ -16994,10 +17007,22 @@ function itemLines(item) {
|
|
|
16994
17007
|
`time zone ${h.timeZone ?? "not listed"}`
|
|
16995
17008
|
].join(" \xB7 "),
|
|
16996
17009
|
`Room: ${h.room.name ? h.room.name.text : "room name not listed"} \xB7 ${h.room.beds ? `beds: ${h.room.beds.text}` : "beds not listed"}`,
|
|
17010
|
+
guestsLine(h.rooms),
|
|
17011
|
+
`Special requests: ${h.specialRequests === null ? "none" : h.specialRequests.replace(/\s+/g, " ").trim()}`,
|
|
16997
17012
|
`Terms: ${mealsWithLabel(h.meals)} \xB7 ${cancellationText(h.cancellation)} \xB7 ${feesText(h.payAtProperty)}`,
|
|
16998
17013
|
`Hotel confirmation number: ${h.confirmationNumber ?? "none yet"}`
|
|
16999
17014
|
];
|
|
17000
17015
|
}
|
|
17016
|
+
function guestsLine(rooms) {
|
|
17017
|
+
const names2 = rooms.map((r) => (r.guests ?? []).map((g) => `${g.firstName} ${g.lastName}`).join(", "));
|
|
17018
|
+
if (names2.every((n) => n === "")) return "Guests: none named yet";
|
|
17019
|
+
if (names2.length === 1) return `Guests: ${names2[0]}`;
|
|
17020
|
+
return `Guests: ${names2.map((n, i) => `room ${i + 1} ${n || "none named yet"}`).join("; ")}`;
|
|
17021
|
+
}
|
|
17022
|
+
function contactLine(c) {
|
|
17023
|
+
if (c === null) return "Contact: none on record yet";
|
|
17024
|
+
return `Contact: ${c.name} \xB7 ${c.email ?? "no email on record"} \xB7 ${c.phone ?? "no phone on record"}`;
|
|
17025
|
+
}
|
|
17001
17026
|
function paymentLines(o, surface) {
|
|
17002
17027
|
const p = o.payment;
|
|
17003
17028
|
const lines = [
|
|
@@ -17070,6 +17095,7 @@ function orderLines(o, surface = "mcp") {
|
|
|
17070
17095
|
return [
|
|
17071
17096
|
`Order ${o.orderId} \xB7 reference ${o.reference} \xB7 ${label(ORDER_STATUS_WORDS, o.status)} \xB7 created ${when(o.createdAt, null)} \xB7 updated ${when(o.updatedAt, null)}`,
|
|
17072
17097
|
...o.items.flatMap(itemLines),
|
|
17098
|
+
contactLine(o.contact),
|
|
17073
17099
|
...paymentLines(o, surface)
|
|
17074
17100
|
];
|
|
17075
17101
|
}
|
|
@@ -17639,7 +17665,7 @@ function withConsent(tool, surface, text2, orders) {
|
|
|
17639
17665
|
// ../contract/package.json
|
|
17640
17666
|
var package_default = {
|
|
17641
17667
|
name: "@fortrip/agent-contract",
|
|
17642
|
-
version: "5.
|
|
17668
|
+
version: "5.3.0",
|
|
17643
17669
|
license: "Apache-2.0",
|
|
17644
17670
|
description: "The contract of Fortrip's agent API (https://api.fortrip.ai/v1) and its MCP server: limits, paths, request and response schemas, error codes and field rules.",
|
|
17645
17671
|
type: "module",
|
package/dist/cli.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
unwrap,
|
|
29
29
|
usageError,
|
|
30
30
|
whoami
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TEXEQ57H.js";
|
|
32
32
|
|
|
33
33
|
// src/commands.ts
|
|
34
34
|
import { readFileSync } from "fs";
|
|
@@ -1207,7 +1207,7 @@ async function run(argv) {
|
|
|
1207
1207
|
case "mcp": {
|
|
1208
1208
|
parseOptions(spec, rest);
|
|
1209
1209
|
const mcpUrl = resolveMcpUrl(apiUrl);
|
|
1210
|
-
const { runMcpBridge } = await import("./mcp-bridge-
|
|
1210
|
+
const { runMcpBridge } = await import("./mcp-bridge-M763WDKU.js");
|
|
1211
1211
|
await runMcpBridge(mcpUrl, apiUrl);
|
|
1212
1212
|
return void 0;
|
|
1213
1213
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fortrip",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Search, price and book Fortrip hotels from the terminal or an AI agent.",
|
|
6
6
|
"mcpName": "io.github.FortripEngineering/fortrip",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"typescript": "^5.9.0",
|
|
34
34
|
"uqr": "0.1.3",
|
|
35
35
|
"zod": "4.4.3",
|
|
36
|
-
"@fortrip/agent-contract": "5.
|
|
36
|
+
"@fortrip/agent-contract": "5.3.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup",
|