fortrip 6.0.1 → 6.2.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.
@@ -14840,7 +14840,9 @@ var destination = external_exports.discriminatedUnion(
14840
14840
  radiusMeters
14841
14841
  }),
14842
14842
  strictInput({
14843
- kind: external_exports.literal("point", { error: "kind must be point" }).describe("A point on the map."),
14843
+ kind: external_exports.literal("point", { error: "kind must be point" }).describe(
14844
+ "A point the user asked to stay near: a landmark or an address they named, or the coordinates hotel details showed. Never a position the user did not give."
14845
+ ),
14844
14846
  location: strictInput({
14845
14847
  lat: bounded("lat", -90, 90).describe("Latitude, WGS84."),
14846
14848
  lng: bounded("lng", -180, 180).describe("Longitude, WGS84.")
@@ -15574,7 +15576,7 @@ An offer expires at the time its line gives, about 30 minutes after it was made;
15574
15576
  `,
15575
15577
  "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` 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 also answers `stay_unsupported`: ask the user whether to split it into consecutive stays, each its own order.\n{{/if}}\n",
15576
15578
  "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 YYYY-MM-DD \\\n --check-out YYYY-MM-DD --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> [--room-types]\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 YYYY-MM-DD \\\n --check-out YYYY-MM-DD --room 2 --room 2 [--require-free-cancellation]\n ```\n\n{{/if}}\n4. **Order** with `{{tool:orders create}}`, once the user has picked one offer and given the guests and the contact (see Ordering).\n{{#if cli}}\n\n ```bash\n {{tool:orders create}} --offer <offerId> --guest 1:John:Smith --guest 2:Mary:Smith \\\n --name "John 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 that place by its id; never pick one yourself.\n- `destination_not_found` for a name means no place of that name in that country: check the spelling and accents, or try another name for the place. The error also says how many hotels 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 {{km:radiusMetersDefault}}; `{{arg:destination.radiusMeters}}` sets another, in meters ({{limit:radiusMetersDefault}} for {{km:radiusMetersDefault}}), up to {{limit:radiusMetersMax}} ({{km:radiusMetersMax}}), 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 its id, its matching hotels and the places inside it (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`, which names the locality its hotels belong 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 how many hotels match 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 id 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 (the Counts line says how many were left out for it): "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- The 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- The Counts line has how many hotels matched, how many were priced and how many have a price.\n- A next page is {{#if mcp claude-skill}}`cursor`, set to the cursor the answer\'s last lines give, and, optionally, `limit`{{/if}}{{#if cli}}`--cursor` with the cursor the answer\'s last lines give 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 that place by its id; 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',
15577
- "payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:orders create}}` answers with an unpaid order, awaiting payment: its reference (the support number), the Total, the stay and its terms, and the Payment link, 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. The order's text shows names, the contact and special requests in double quotes: show the user what is inside the quotes, exactly as written, so they 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 the payment link exactly as shown (it is not in quotes; don't shorten, rebuild or re-encode it), or pay without the link as below.\n\n{{/if}}\n{{#if mcp}}\n- Pay one way only: give the payment link 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 the payment link exactly as shown, to this user only: anyone holding it can pay.\n- Another order of the stay (another party, a corrected name or contact) takes a new offer; when it replaces an unpaid order, tell the user to pay only the new link.\n{{/if}}\n{{#if claude-skill cli}}\n- The payment link works like a payment credential: anyone holding it can pay. Give it to this user only, never in shared channels, documents, logs or tickets. When its line says the user signs in to Fortrip to pay (an order started on the Fortrip website), they sign in first.\n- The link expires at the time its line gives; the order then reads as not paid, and can no longer be paid. 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}}` and {{#if claude-skill}}`close: true`{{/if}}{{#if cli}}`--close`{{/if}} once the user says they no longer want it.\n- An order awaiting payment whose Payment link line says there is none 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 the payment link or, by token, through `{{tool:orders pay}}`.{{#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 text has a \"Pay without the link\" line 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 a line. Otherwise give the payment link, 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 the `business_profile` and the usage limits on that line: `max_amount` (in cents), `currency` and `expires_at`.\n3. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` with the token and the order's total{{#if cli}} (`--token`, `--total`){{/if}}{{#if claude-skill}} (`sharedPaymentToken`, `total`){{/if}}. The order is then confirming with the hotel, 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, the payment link stops working; a payment that fails leaves the link open. `payment_total_mismatch` means the total sent isn't the order's, which the error gives; 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 card 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 the usage limits on that line. `service_unavailable`: call `{{tool:orders pay}}` again with the same token, never a new one. A token pays one order only.\n\n## After payment\n\nCheck the order with `{{tool:orders get}}`; its first line has the status:\n\n- confirming with the hotel, then confirmed, with the hotel confirmation number.\n- failed: no stay was booked. \"Why it failed\" says why and what to do next, and the Total line whether the payment was released or refunded.\n- needs attention from Fortrip: Fortrip is looking into it; the user can email {{support}} with the order's reference.\n- The Manage link is the user's own page for the order.\n{{/if}}\n",
15579
+ "payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:orders create}}` answers with an unpaid order, awaiting payment: its reference (the support number), the Total, the stay and its terms, and the Payment link, 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. The order's text shows names, the contact and special requests in double quotes: show the user what is inside the quotes, exactly as written, so they 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 the payment link exactly as shown (it is not in quotes; don't shorten, rebuild or re-encode it), or pay without the link as below.\n\n{{/if}}\n{{#if mcp}}\n- {{#if token-pay}}Pay one way only: give the payment link or call `{{tool:orders pay}}`. {{/if}}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 the payment link exactly as shown, to this user only: anyone holding it can pay.\n- Another order of the stay (another party, a corrected name or contact) takes a new offer; when it replaces an unpaid order, tell the user to pay only the new link.\n{{/if}}\n{{#if claude-skill cli}}\n- The payment link works like a payment credential: anyone holding it can pay. Give it to this user only, never in shared channels, documents, logs or tickets. When its line says the user signs in to Fortrip to pay (an order started on the Fortrip website), they sign in first.\n- The link expires at the time its line gives; the order then reads as not paid, and can no longer be paid. 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}}` and {{#if claude-skill}}`close: true`{{/if}}{{#if cli}}`--close`{{/if}} once the user says they no longer want it.\n- An order awaiting payment whose Payment link line says there is none 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 the payment link{{#if token-pay}} or, by token, through `{{tool:orders pay}}`{{/if}}.{{#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 text has a \"Pay without the link\" line 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 a line. Otherwise give the payment link, 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 the `business_profile` and the usage limits on that line: `max_amount` (in cents), `currency` and `expires_at`.\n3. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` with the token and the order's total{{#if cli}} (`--token`, `--total`){{/if}}{{#if claude-skill}} (`sharedPaymentToken`, `total`){{/if}}. The order is then confirming with the hotel, 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, the payment link stops working; a payment that fails leaves the link open. `payment_total_mismatch` means the total sent isn't the order's, which the error gives; 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 card 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 the usage limits on that line. `service_unavailable`: call `{{tool:orders pay}}` again with the same token, never a new one. A token pays one order only.\n\n## After payment\n\nCheck the order with `{{tool:orders get}}`; its first line has the status:\n\n- confirming with the hotel, then confirmed, with the hotel confirmation number.\n- failed: no stay was booked. \"Why it failed\" says why and what to do next, and the Total line whether the payment was released or refunded.\n- needs attention from Fortrip: Fortrip is looking into it; the user can email {{support}} with the order's reference.\n- The Manage link is the user's own page for the order.\n{{/if}}\n",
15578
15580
  "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:orders create}}` 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 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). Give a hotel's name without the double quotes the text shows it in, exactly as written inside them, 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:orders create}}` 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:orders create}}` 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:orders create}}` returned.\n",
15579
15581
  "presentation": `{{#if claude-skill}}
15580
15582
  ## Presenting hotels
@@ -15583,12 +15585,13 @@ If your interface can show rich elements, show each hotel as a card with only wh
15583
15585
  {{/if}}
15584
15586
  `,
15585
15587
  "prices": '{{#if claude-skill cli}}\n## Prices and currency\n\n- A search price (shown as "estimate from \u2026 /room-night") is indicative and not bookable: the lowest price of one unit (a room or, at a hostel, possibly a bed) per night on the searched dates, for any party and possibly read days ago, 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. A hotel with "no indicative price" isn\'t full; about half the hotels have none for given dates.\n{{/if}}\n- {{#if claude-skill cli}}In an offer or order, the 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}} An offer\'s "average per room-night" is its total divided by the rooms and the nights, for comparison only.{{/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 an answer 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 end with a "Currency:" line 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 ("fees not in the total") are separate, in the property\'s own currency, not converted.\n- After payment, "card charged" on the order\'s Total line is what the card paid in its own currency. An order made on the Fortrip website can be in another currency: its Total says which.\n{{/if}}\n',
15586
- "scope": "{{#if claude-skill cli}}\n# Fortrip hotel stays\n\n{{/if}}\nFortrip: hotel search, live offers and orders with a payment link.{{#if claude-skill cli}} Not for flights, activities, or changing an existing order.{{/if}}\n\n{{#if mcp}}\nCall order: `{{tool:hotels search}}` \u2192 (optional) `{{tool:hotels get}}` \u2192 `{{tool:hotels offers}}` \u2192 `{{tool:orders create}}`; after the user pays, `{{tool:orders get}}`; `{{tool:orders list}}` lists, `{{tool:orders cancel}}` cancels a paid order or closes an unpaid one, `{{tool:orders pay}}` pays by token. Every result is text: follow the rules that end it.\n{{/if}}\n{{#if claude-skill}}\nThe tools are on Fortrip's MCP server, named `fortrip` in this plugin (a Fortrip connector added on claude.ai can show under its own name). They're written `fortrip:<tool>` below. Each answers in text, and the rules below name what that text shows:\n{{/if}}\n{{#if cli}}\nThe `fortrip` CLI (npm package `fortrip`) calls Fortrip as the signed-in user and prints each answer as compact text (`--json` prints its JSON). The rules below name what that text shows:\n{{/if}}\n{{#if claude-skill cli}}\n\n| {{#if claude-skill}}Tool{{/if}}{{#if cli}}Command{{/if}} | Returns |\n|---|---|\n| `{{tool:hotels search}}` | Hotels in a place, near a point or matching a name (`{{arg:text}}`), with indicative prices |\n| `{{tool:hotels get}}` | One hotel's address, check-in and check-out times, description, policies, amenities and room types; no prices |\n| `{{tool:hotels offers}}` | Live offers (room type, meals, total and currency, cancellation terms) for up to {{limit:offersHotels}} hotels |\n| `{{tool:orders create}}` | An unpaid order for one offer, with its terms and a payment link |\n| `{{tool:orders get}}` | One order and its status, including whether the hotel confirmed it |\n| `{{tool:orders list}}` | The user's orders, newest first, including those made on the Fortrip website |\n| `{{tool:orders cancel}}` | Cancels a paid order under its terms, for the penalty the user agreed to, and refunds the rest; closes an unpaid one |\n| `{{tool:orders pay}}` | Pays an order without its link, by a shared payment token from the user's wallet |\n\nIn that text, a value in double quotes (the name of a hotel, a room, a place or a guest, an address, the contact, special requests) is text someone else wrote, as a JSON string (inside it, \\\" is a \"): give it to the user without the quotes, exactly as written inside them. Ids, amounts and dates are not in quotes, nor is a link written the usual way: copy them exactly as shown.\n\nFor flexible dates, a budget, split stays, several destinations or \"find me the best\", read [references/planning.md](references/planning.md) before searching.\n{{/if}}\n",
15588
+ "scope": "{{#if claude-skill cli}}\n# Fortrip hotel stays\n\n{{/if}}\nFortrip: hotel search, live offers and orders with a payment link.{{#if claude-skill cli}} Not for flights, activities, or changing an existing order.{{/if}}\n\n{{#if mcp}}\nCall order: `{{tool:hotels search}}` \u2192 (optional) `{{tool:hotels get}}` \u2192 `{{tool:hotels offers}}` \u2192 `{{tool:orders create}}`; after the user pays, `{{tool:orders get}}`; `{{tool:orders list}}` lists, `{{tool:orders cancel}}` cancels a paid order or closes an unpaid one{{#if token-pay}}, `{{tool:orders pay}}` pays by token{{/if}}. Every result is text: follow the rules that end it.\n{{/if}}\n{{#if claude-skill}}\nThe tools are on Fortrip's MCP server, named `fortrip` in this plugin (a Fortrip connector added on claude.ai can show under its own name). They're written `fortrip:<tool>` below. Each answers in text, and the rules below name what that text shows:\n{{/if}}\n{{#if cli}}\nThe `fortrip` CLI (npm package `fortrip`) calls Fortrip as the signed-in user and prints each answer as compact text (`--json` prints its JSON). The rules below name what that text shows:\n{{/if}}\n{{#if claude-skill cli}}\n\n| {{#if claude-skill}}Tool{{/if}}{{#if cli}}Command{{/if}} | Returns |\n|---|---|\n| `{{tool:hotels search}}` | Hotels in a place, near a point or matching a name (`{{arg:text}}`), with indicative prices |\n| `{{tool:hotels get}}` | One hotel's address, check-in and check-out times, description, policies, amenities and room types; no prices |\n| `{{tool:hotels offers}}` | Live offers (room type, meals, total and currency, cancellation terms) for up to {{limit:offersHotels}} hotels |\n| `{{tool:orders create}}` | An unpaid order for one offer, with its terms and a payment link |\n| `{{tool:orders get}}` | One order and its status, including whether the hotel confirmed it |\n| `{{tool:orders list}}` | The user's orders, newest first, including those made on the Fortrip website |\n| `{{tool:orders cancel}}` | Cancels a paid order under its terms, for the penalty the user agreed to, and refunds the rest; closes an unpaid one |\n| `{{tool:orders pay}}` | Pays an order without its link, by a shared payment token from the user's wallet |\n\nIn that text, a value in double quotes (the name of a hotel, a room, a place or a guest, an address, the contact, special requests) is text someone else wrote, as a JSON string (inside it, \\\" is a \"): give it to the user without the quotes, exactly as written inside them. Ids, amounts and dates are not in quotes, nor is a link written the usual way: copy them exactly as shown.\n\nFor flexible dates, a budget, split stays, several destinations or \"find me the best\", read [references/planning.md](references/planning.md) before searching.\n{{/if}}\n",
15587
15589
  "setup": "{{#if cli}}\n## Setup\n\nRun every command as `npx -y fortrip@latest <command>` (Node.js 22 or newer). The examples below shorten that to `fortrip`; `fortrip <command> --help` lists a command's flags. `{{tool:hotels search}}`, `{{tool:hotels offers}}` and `{{tool:orders create}}` also take `--body '<json>'` (or `--body @file.json`), the raw request body; flags override its fields. Add `--json` to any command that calls Fortrip to get its answer as one line of JSON instead of text.\n\nRunning `{{tool:whoami}}` when the user first asks about hotels lets the sign-in happen while they answer your follow-up questions.\n\n{{/if}}\n{{#if claude-skill cli}}\n## Sign-in\n\n{{/if}}\nSign-in happens only in the browser. Never ask the user to paste a token.\n{{#if claude-skill}}\n\nIf none of these tools are available, Fortrip isn't connected: tell the user to add the Fortrip connector or plugin and sign in.\n{{/if}}\n{{#if mcp claude-skill}}\nIf a tool says the user isn't signed in, ask them to reconnect.\n{{/if}}\n{{#if cli}}\n\nIf a command exits with code **3** and stderr has `loginUrl`, show it to the user as a link together with `userCode`, e.g. \"Sign in to Fortrip: <loginUrl> (code <userCode>), then tell me when you're done.\" When they confirm, rerun the same command; it finishes the sign-in itself. Don't run `{{tool:login}}`: it waits for up to 10 minutes. Commands that exit 3 together share one `loginUrl`; show it once. If the rerun gives a different `loginUrl`, show that one.\n\nWhen Fortrip no longer accepts the saved sign-in (it was revoked, or it expired and couldn't be renewed), the command also exits 3 with a `loginUrl`; handle it the same way. The saved sign-in is kept until the user approves the new link.\n\nIn a remote agent environment or a CI run without a browser, the user can set `FORTRIP_TOKEN` instead. Exit 3 with `tokenSource: \"FORTRIP_TOKEN\"` means Fortrip didn't accept that token: tell the user to replace or unset it.\n\n## Exit codes\n\n| Code | Meaning | What to do |\n|---|---|---|\n| 0 | Success; the answer on stdout | Continue |\n| 1 | Any other error: an error from Fortrip (see Errors), a network error or a timeout | Read the error on stderr. If it says it is retryable, wait as long as it says (or a few seconds) and retry once |\n| 2 | Invalid arguments, or `invalid_request` from Fortrip | Fix the flags; the error lists each bad field with a message |\n| 3 | Not signed in | Show `loginUrl` to the user, then rerun (above) |\n| 4 | Rate limited | Wait as long as the error says, then retry once |\n| 5 | This version of the CLI is too old for Fortrip (`client_outdated`) | Run the update command the error gives, then rerun the same command |\n\nOutput on stdout or stderr can carry `warning` (with `recoveryFile` when a sign-in couldn't be saved): pass it on to the user.\n{{/if}}\n",
15588
15590
  "support": "{{#if claude-skill cli}}\n## Cancelling an order\n\n`{{tool:orders get}}` and `{{tool:orders list}}` say on each order's Cancel line what can be done to it now. A paid order that can be cancelled has the penalty under its terms and the refund, what was paid less the penalty, both in the order's currency; an unpaid one can be closed instead. Otherwise the line says what blocks both.\n\n1. Show the user the stay (hotel, dates) and the penalty and the refund on the Cancel line (amount and currency). A refund of 0 means nothing is paid back: say so plainly.\n2. End that reply by asking the user to confirm the cancellation, and wait for a clear yes.\n3. Then {{#if claude-skill}}make the call{{/if}}{{#if cli}}run the command{{/if}} the Cancel line gives, exactly as shown: `{{tool:orders cancel}}` with `{{arg:maximumPenalty}}` set to the penalty on that line{{#if cli}}, its amount (the CLI takes the currency from the order){{/if}}. Never state a refund the order's text doesn't show, and never choose or work out an amount yourself.\n\nThe order is then cancelling, and cancelled once the hotel has cancelled and the refund is issued: check it with `{{tool:orders get}}`, which then says what the cancellation kept and returned. If the hotel refuses, the order is confirmed again and its Cancel line says so. `cancellation_changed` means the penalty is now higher than the one the user agreed to: read the order again and ask the user again. `order_not_cancellable` says which of cancelling and closing applies to the order now, or what blocks both; nothing is ever cancelled or closed by the other one.\n\nClose an unpaid order only once the user says they no longer want it: {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders cancel}}` with {{#if claude-skill}}`close: true`{{/if}}{{#if cli}}`--close`{{/if}}. It then reads as not paid, and nothing is charged. `payment_in_progress` means a payment of it is under way: read it again shortly.{{#if cli}} Without `--max-penalty` or `--close`, `{{tool:orders cancel}}` is refused with exit 2 and nothing is sent: `{{tool:orders get}}` shows the order's Cancel line, with the command to run.{{/if}}\n\n## Changes and support\n\n{{/if}}\n{{#if mcp}}Cancel a paid order only after the user confirmed the penalty and the refund on its Cancel line; close an unpaid one only once they say they no longer want it. An order can't be changed, only{{/if}}{{#if claude-skill}}These tools can't change an order: it can only be{{/if}}{{#if cli}}The CLI can't change an order: it can only be{{/if}} cancelled under its terms and ordered again. For a cancellation that `{{tool:orders cancel}}` can't make, or other problems, the user emails {{support}} with the order's reference (never its payment link).\n"
15589
15591
  };
15590
15592
 
15591
15593
  // ../contract/src/guide.ts
15594
+ var TOKEN_PAY = "token-pay";
15592
15595
  var SURFACES = ["mcp", "claude-skill", "cli"];
15593
15596
  var TOPICS = {
15594
15597
  main: [
@@ -15606,7 +15609,7 @@ var TOPICS = {
15606
15609
  ],
15607
15610
  planning: ["planning"]
15608
15611
  };
15609
- function renderGuide(surface, topic) {
15612
+ function renderGuide(surface, topic, options = {}) {
15610
15613
  if (!Object.hasOwn(TOPICS, topic)) {
15611
15614
  throw new Error(`Unknown guide topic "${topic}"`);
15612
15615
  }
@@ -15615,7 +15618,7 @@ function renderGuide(surface, topic) {
15615
15618
  if (fragment === void 0) {
15616
15619
  throw new Error(`Missing guide fragment "${name}"`);
15617
15620
  }
15618
- return renderText(fragment, surface).trim();
15621
+ return renderText(fragment, surface, options).trim();
15619
15622
  });
15620
15623
  const text2 = parts.filter(Boolean).join("\n\n");
15621
15624
  return `${text2.replace(/\n{3,}/g, "\n\n")}
@@ -15624,14 +15627,17 @@ function renderGuide(surface, topic) {
15624
15627
  var TOKEN = /{{([^{}]*)}}/g;
15625
15628
  var CONDITION = /{{#if ([^{}]*)}}|{{\/if}}/g;
15626
15629
  var LONE_CONDITION = /^[ \t]*({{#if [^{}\n]*}}|{{\/if}})[ \t]*\n/gm;
15627
- function renderText(text2, surface) {
15630
+ function renderText(text2, surface, options = {}) {
15628
15631
  if (!SURFACES.includes(surface)) {
15629
15632
  throw new Error(`Unknown guide surface "${surface}"`);
15630
15633
  }
15631
15634
  for (const [token2, body] of text2.matchAll(TOKEN)) {
15632
15635
  if (!/^(#if |\/if$)/.test(body ?? "")) resolve(token2, surface, false);
15633
15636
  }
15634
- const shown = select(text2, surface).replace(
15637
+ if (options.tokenPay === false && surface !== "mcp") {
15638
+ throw new Error(`The guide without payment by token is the MCP server's only, not the ${surface} surface's`);
15639
+ }
15640
+ const shown = select(text2, surface, options.tokenPay !== false).replace(
15635
15641
  TOKEN,
15636
15642
  (token2) => resolve(token2, surface, true)
15637
15643
  );
@@ -15640,7 +15646,7 @@ function renderText(text2, surface) {
15640
15646
  }
15641
15647
  return shown;
15642
15648
  }
15643
- function select(text2, surface) {
15649
+ function select(text2, surface, tokenPay) {
15644
15650
  const tagged = text2.replace(LONE_CONDITION, "$1");
15645
15651
  const open = [];
15646
15652
  let out = "";
@@ -15655,6 +15661,10 @@ function select(text2, surface) {
15655
15661
  continue;
15656
15662
  }
15657
15663
  const names2 = tag[1].trim().split(/\s+/);
15664
+ if (names2.length === 1 && names2[0] === TOKEN_PAY) {
15665
+ open.push(tokenPay);
15666
+ continue;
15667
+ }
15658
15668
  for (const name of names2) {
15659
15669
  if (!SURFACES.includes(name)) {
15660
15670
  throw new Error(`Unknown guide surface "${name}" in ${tag[0]}`);
@@ -16497,11 +16507,12 @@ var READ = {
16497
16507
  destructiveHint: false
16498
16508
  };
16499
16509
  var READ_OWN = { ...READ, openWorldHint: false };
16510
+ var PAID_WHERE = ", on that page or with pay_order";
16500
16511
  var TOOLS = [
16501
16512
  {
16502
16513
  name: "search_hotels",
16503
16514
  title: "Search hotels",
16504
- description: "Find hotels by destination and/or text, with an indicative per-room-night price when a stay is given. destination is a place_name with its countryCode, a place or locality by placeId from an earlier answer, a point, or a country. text matches hotel names, brands and areas word for word. Indicative prices are estimates and not bookable: get_hotel_offers returns what the user pays. A name several places bear answers destination_ambiguous, and a search too broad to price answers search_too_broad with its localities; each error says what to do next. The answer states what was searched, the counts and notes; a next page is the cursor and, optionally, limit.",
16515
+ description: "Use this when the user wants hotels in a place they name, or a hotel by its name or brand. It finds hotels by destination and/or text, with an indicative per-room-night price when a stay is given. destination is the place the user asked for, never a location they did not give: a place_name with its countryCode, a place or locality by placeId from an earlier answer, a point (a landmark or an address the user named, or the coordinates hotel details showed), or a country. text matches hotel names, brands and areas word for word. Indicative prices are estimates and not bookable: get_hotel_offers returns what the user pays. A name several places bear answers destination_ambiguous, and a search too broad to price answers search_too_broad with its localities; each error says what to do next. The answer states what was searched, the counts and notes; a next page is the cursor and, optionally, limit.",
16505
16516
  annotations: READ,
16506
16517
  input: searchHotelsInput,
16507
16518
  output: searchResult
@@ -16509,7 +16520,7 @@ var TOOLS = [
16509
16520
  {
16510
16521
  name: "get_hotel",
16511
16522
  title: "Hotel details",
16512
- description: `One hotel's catalogue facts: names, address, coordinates, time zone, check-in and check-out times, the full description, every policy and the amenities, and its room types with include: "roomTypes". "Not listed" is not "no". No prices or availability: get_hotel_offers has those.`,
16523
+ description: `Use this when the user asks about one hotel itself: where it is, its check-in and check-out times, its policies, amenities or room types. It returns the hotel's catalogue facts: names, address, coordinates, time zone, check-in and check-out times, the full description, every policy and the amenities, and its room types with include: "roomTypes". "Not listed" is not "no". No prices or availability: get_hotel_offers has those.`,
16513
16524
  annotations: READ,
16514
16525
  input: getHotelInput,
16515
16526
  output: hotel
@@ -16517,7 +16528,7 @@ var TOOLS = [
16517
16528
  {
16518
16529
  name: "get_hotel_offers",
16519
16530
  title: "Live offers",
16520
- description: `Live, bookable offers for up to ${LIMITS.offersHotels} hotels and one stay. Every room in stay.rooms must have the same party: for different parties, call once per party. Each offer has the room type, the meals included, the total, in the request's currency, for the whole stay and every room (what is charged), with its average per room-night for comparison, fees payable at the property, the cancellation terms with times in UTC and the hotel's time zone, the confirmation mode, and an offerId for create_order with the time it expires. Hotels with nothing to offer are listed as unavailable with the reason. Up to limitPerHotel offers per hotel (default ${LIMITS.offersPerHotelDefault}, fewer when the call's hotels share its ${LIMITS.offersPerCallDefault} offers), picked to span price, free cancellation, breakfast and rooms, listed cheapest first; the answer says, per hotel, how many more a call for that hotel alone would show.`,
16531
+ description: `Use this when the user wants what a stay really costs or whether it can be booked, at hotels already found, and before create_order. It returns live, bookable offers for up to ${LIMITS.offersHotels} hotels and one stay. Every room in stay.rooms must have the same party: for different parties, call once per party. Each offer has the room type, the meals included, the total, in the request's currency, for the whole stay and every room (what is charged), with its average per room-night for comparison, fees payable at the property, the cancellation terms with times in UTC and the hotel's time zone, the confirmation mode, and an offerId for create_order with the time it expires. Hotels with nothing to offer are listed as unavailable with the reason. Up to limitPerHotel offers per hotel (default ${LIMITS.offersPerHotelDefault}, fewer when the call's hotels share its ${LIMITS.offersPerCallDefault} offers), picked to span price, free cancellation, breakfast and rooms, listed cheapest first; the answer says, per hotel, how many more a call for that hotel alone would show.`,
16521
16532
  annotations: READ,
16522
16533
  input: hotelOffersInput,
16523
16534
  output: hotelOffersResult
@@ -16525,7 +16536,7 @@ var TOOLS = [
16525
16536
  {
16526
16537
  name: "create_order",
16527
16538
  title: "Create order",
16528
- description: `Create an unpaid order for one offer from get_hotel_offers. It takes items, one item with the offer's offerId inside it (nowhere else in the arguments) and hotel.rooms, and contact. The answer is the order, awaiting payment: its reference, the total, the stay and its terms, and a payment link, 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: another order of the stay (another party, or a corrected guest name or contact) takes a new offer. cancel_order cancels or closes an order; for changes, or a cancellation it can't make, the user emails ${SUPPORT_EMAIL} with the order's reference.`,
16539
+ description: `Create an unpaid order when the user asks to book one offer from get_hotel_offers. It takes items, one item with the offer's offerId inside it (nowhere else in the arguments) and hotel.rooms, and contact. The answer is the order, awaiting payment: its reference, the total, the stay and its terms, and a payment link, a Fortrip page to pay on. Nothing is charged until the order is paid${PAID_WHERE}; 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: another order of the stay (another party, or a corrected guest name or contact) takes a new offer. cancel_order cancels or closes an order; for changes, or a cancellation it can't make, the user emails ${SUPPORT_EMAIL} with the order's reference.`,
16529
16540
  // Destructive: Claude's connector review asks `destructiveHint: true`
16530
16541
  // "for tools that modify or delete data", and a per-call confirmation
16531
16542
  // before an order is created is the behaviour wanted. Idempotent: the
@@ -16542,7 +16553,7 @@ var TOOLS = [
16542
16553
  {
16543
16554
  name: "get_order",
16544
16555
  title: "Get order",
16545
- description: "One of the user's orders by orderId: its status, the payment status and, while it awaits payment, its payment link; the stay, its guests and its terms; whether it can be cancelled now, for which penalty and refund, or closed; why a failed order booked nothing and what a cancellation kept; and the hotel's confirmation number once there is one. It shows whether a payment went through.",
16556
+ description: "Use this when the user asks about one order of theirs: whether it is paid or confirmed, its terms, or what cancelling it would cost. It returns the order by orderId: its status, the payment status and, while it awaits payment, its payment link; the stay, its guests and its terms; whether it can be cancelled now, for which penalty and refund, or closed; why a failed order booked nothing and what a cancellation kept; and the hotel's confirmation number once there is one. It shows whether a payment went through.",
16546
16557
  annotations: READ_OWN,
16547
16558
  input: getOrderInput,
16548
16559
  output: order
@@ -16550,7 +16561,7 @@ var TOOLS = [
16550
16561
  {
16551
16562
  name: "list_orders",
16552
16563
  title: "List orders",
16553
- description: "The user's hotel orders, newest first, including those made on the Fortrip website, each as get_order shows it. A next page is the cursor the answer gives.",
16564
+ description: "Use this when the user asks what they have booked, or about an order whose orderId you do not have. It returns the user's hotel orders, newest first, including those made on the Fortrip website, each as get_order shows it. A next page is the cursor the answer gives.",
16554
16565
  annotations: READ_OWN,
16555
16566
  input: listOrdersInput,
16556
16567
  output: orderList
@@ -16558,7 +16569,7 @@ var TOOLS = [
16558
16569
  {
16559
16570
  name: "cancel_order",
16560
16571
  title: "Cancel order",
16561
- description: "Cancel a paid order under its terms, or close an unpaid one. It takes the orderId and exactly one of maximumPenalty (a paid order) and close: true (an unpaid one). Paid (the order's Cancel line says it can be cancelled): pass maximumPenalty, the penalty on that line exactly as shown. The order becomes cancelling, then cancelled with the refund on its way, or confirmed again if the hotel refuses. If the penalty rose above maximumPenalty, the answer is cancellation_changed and nothing changed. Unpaid (the Cancel line says it can be closed): close: true closes it: nothing is charged, and it can no longer be paid. A mode that does not fit the order (close on an order paid meanwhile) answers order_not_cancellable, which says which mode applies now or what blocks both: nothing is cancelled or closed by the other mode. While a payment is under way the answer is payment_in_progress. The same call again answers the order as it is.",
16572
+ description: "Use this when the user asks to cancel a paid order or to close an unpaid one. It cancels a paid order under its terms, or closes an unpaid one. It takes the orderId and exactly one of maximumPenalty (a paid order) and close: true (an unpaid one). Paid (the order's Cancel line says it can be cancelled): pass maximumPenalty, the penalty on that line exactly as shown. The order becomes cancelling, then cancelled with the refund on its way, or confirmed again if the hotel refuses. If the penalty rose above maximumPenalty, the answer is cancellation_changed and nothing changed. Unpaid (the Cancel line says it can be closed): close: true closes it: nothing is charged, and it can no longer be paid. A mode that does not fit the order (close on an order paid meanwhile) answers order_not_cancellable, which says which mode applies now or what blocks both: nothing is cancelled or closed by the other mode. While a payment is under way the answer is payment_in_progress. The same call again answers the order as it is.",
16562
16573
  annotations: {
16563
16574
  readOnlyHint: false,
16564
16575
  idempotentHint: true,
@@ -17788,7 +17799,7 @@ function notCancellable(d, surface) {
17788
17799
  ours`This order can be neither cancelled nor closed now: ${blockerText(c)}.`
17789
17800
  ];
17790
17801
  }
17791
- function detailLines(e, surface) {
17802
+ function detailLines(e, surface, tokenPay) {
17792
17803
  const getOrder = (id) => surface === "cli" ? ours`\`fortrip orders get ${id}\`` : ours`get_order`;
17793
17804
  switch (e.code) {
17794
17805
  case "invalid_request": {
@@ -17893,7 +17904,7 @@ function detailLines(e, surface) {
17893
17904
  ];
17894
17905
  case "service_unavailable":
17895
17906
  return [
17896
- ours`Retry once with the same details (a payment with the same token, never a new one); if it fails again, tell the user.`
17907
+ tokenPay ? ours`Retry once with the same details (a payment with the same token, never a new one); if it fails again, tell the user.` : ours`Retry once with the same details; if it fails again, tell the user.`
17897
17908
  ];
17898
17909
  case "supplier_unavailable":
17899
17910
  return [
@@ -17914,7 +17925,7 @@ function retryLine(retryable, after) {
17914
17925
  }
17915
17926
  return retryable === false ? ours`Not retryable.` : ours`Retryable: unknown.`;
17916
17927
  }
17917
- function renderError(envelope, status, surface = "mcp") {
17928
+ function renderError(envelope, status, surface = "mcp", options = {}) {
17918
17929
  let known = null;
17919
17930
  let body = null;
17920
17931
  try {
@@ -17939,9 +17950,11 @@ function renderError(envelope, status, surface = "mcp") {
17939
17950
  retryLine(body.retryable, body.retryAfterSeconds)
17940
17951
  ];
17941
17952
  if (typeof body.pointer === "string") lines.push(ours`Field: ${token("pointer", body.pointer)}`);
17942
- if (known) lines.push(...detailLines(known, surface));
17953
+ if (known) lines.push(...detailLines(known, surface, options.tokenPay !== false));
17943
17954
  else if (body.details !== void 0) lines.push(ours`Details: ${raw(body.details)}`);
17944
- if (typeof body.requestId === "string") lines.push(ours`Request id: ${token("id", body.requestId)}`);
17955
+ if (typeof body.requestId === "string" && (surface === "cli" || body.code === "internal")) {
17956
+ lines.push(ours`Request id: ${token("id", body.requestId)}`);
17957
+ }
17945
17958
  return lines.join("\n");
17946
17959
  }
17947
17960
 
@@ -18082,12 +18095,21 @@ function renderHotel(h) {
18082
18095
 
18083
18096
  // ../contract/src/render/index.ts
18084
18097
  var HOTEL_TOOLS = /* @__PURE__ */ new Set(["search_hotels", "get_hotel", "get_hotel_offers"]);
18085
- function renderToolResult(tool, data, surface = "mcp") {
18086
- const text2 = resultText(tool, data, surface);
18098
+ function renderToolResult(tool, data, surface = "mcp", options = {}) {
18099
+ const text2 = resultText(tool, options.tokenPay === false ? withoutTokenRequest(data) : data, surface);
18087
18100
  return surface === "mcp" && HOTEL_TOOLS.has(tool) ? `${text2}
18088
18101
 
18089
18102
  ${PRESENTATION_HINT}` : text2;
18090
18103
  }
18104
+ function withoutTokenRequest(value) {
18105
+ if (Array.isArray(value)) return value.map(withoutTokenRequest);
18106
+ if (typeof value !== "object" || value === null) return value;
18107
+ const out = {};
18108
+ for (const [key, inner] of Object.entries(value)) {
18109
+ out[key] = key === "payment" && typeof inner === "object" && inner !== null && "tokenRequest" in inner ? { ...inner, tokenRequest: null } : withoutTokenRequest(inner);
18110
+ }
18111
+ return out;
18112
+ }
18091
18113
  var orderPage = openObject({ data: external_exports.array(external_exports.unknown()), nextCursor: external_exports.string().nullable() });
18092
18114
  function resultText(tool, data, surface) {
18093
18115
  const schema = tool === "list_orders" ? orderPage : TOOLS.find((t) => t.name === tool)?.output;
@@ -18185,7 +18207,7 @@ function withRules(text2, surface, applies) {
18185
18207
  // ../contract/package.json
18186
18208
  var package_default = {
18187
18209
  name: "@fortrip/agent-contract",
18188
- version: "6.0.1",
18210
+ version: "6.2.0",
18189
18211
  license: "Apache-2.0",
18190
18212
  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.",
18191
18213
  type: "module",
package/dist/cli.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  unwrap,
32
32
  usageError,
33
33
  whoami
34
- } from "./chunk-4SKE4K7Q.js";
34
+ } from "./chunk-22QPWLDP.js";
35
35
 
36
36
  // src/commands.ts
37
37
  import { readFileSync } from "fs";
@@ -587,7 +587,7 @@ async function run(argv) {
587
587
  case "mcp": {
588
588
  parseOptions(spec, rest);
589
589
  const mcpUrl = resolveMcpUrl(apiUrl);
590
- const { runMcpBridge } = await import("./mcp-bridge-THMWRFFF.js");
590
+ const { runMcpBridge } = await import("./mcp-bridge-BBYKYAWY.js");
591
591
  await runMcpBridge(mcpUrl, apiUrl);
592
592
  return void 0;
593
593
  }
@@ -14,7 +14,7 @@ import {
14
14
  renderError,
15
15
  renderGuide,
16
16
  requireToken
17
- } from "./chunk-4SKE4K7Q.js";
17
+ } from "./chunk-22QPWLDP.js";
18
18
 
19
19
  // src/mcp-bridge.ts
20
20
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fortrip",
3
- "version": "6.0.1",
3
+ "version": "6.2.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",
@@ -32,7 +32,7 @@
32
32
  "tsx": "^4.20.0",
33
33
  "typescript": "^5.9.0",
34
34
  "zod": "4.4.3",
35
- "@fortrip/agent-contract": "6.0.1"
35
+ "@fortrip/agent-contract": "6.2.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsup",