fortrip 4.3.0 → 4.3.1
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.
package/README.md
CHANGED
|
@@ -67,8 +67,8 @@ commands use it, and the next successful save merges it back. `login` doesn't
|
|
|
67
67
|
carry on in that case: it exits 1, with `recoveryFile` in the error, and the
|
|
68
68
|
sign-in is kept in that file all the same.
|
|
69
69
|
|
|
70
|
-
If the directory itself can't be written (a read-only home, as in some
|
|
71
|
-
|
|
70
|
+
If the directory itself can't be written (a read-only home, as in some remote
|
|
71
|
+
agent environments), `login` exits 1 before it asks you to approve anything, and any
|
|
72
72
|
other command that needs to save a sign-in exits 1 too. The error says to set
|
|
73
73
|
`XDG_CONFIG_HOME` to a directory that can be written, or to set `FORTRIP_TOKEN`.
|
|
74
74
|
|
|
@@ -82,8 +82,8 @@ other command that needs to save a sign-in exits 1 too. The error says to set
|
|
|
82
82
|
| `hotels book` | Order an offer: an unpaid order with a payment link |
|
|
83
83
|
| `orders get <orderId>` | Show an order and its status |
|
|
84
84
|
| `orders list` | List your orders, newest first |
|
|
85
|
-
| `orders cancel <orderId>` |
|
|
86
|
-
| `orders pay <orderId>` | Pay an order with a Link
|
|
85
|
+
| `orders cancel <orderId>` | Without --max-penalty it shows the penalty and refund and cancels nothing; with the penalty the user agreed to, it cancels the order under its terms |
|
|
86
|
+
| `orders pay <orderId>` | Pay an order with a Link token (US and Canada) or with Alipay or WeChat Pay, instead of its payment link |
|
|
87
87
|
| `login` | Sign in through the browser |
|
|
88
88
|
| `logout` | Revoke and forget the saved token |
|
|
89
89
|
| `whoami` | Show the signed-in account |
|
|
@@ -197,7 +197,7 @@ args = ["-y", "fortrip", "mcp"]
|
|
|
197
197
|
|
|
198
198
|
| Variable | Meaning |
|
|
199
199
|
|---|---|
|
|
200
|
-
| `FORTRIP_TOKEN` | An access token, used instead of the saved sign-in. It is short-lived, so it suits
|
|
200
|
+
| `FORTRIP_TOKEN` | An access token, used instead of the saved sign-in. It is short-lived, so it suits a remote agent environment or a CI run; for longer, sign in. It isn't tied to a server: it is sent to whatever `FORTRIP_API_URL` points at. If Fortrip doesn't accept it, or it contains a line break or another character that can't be sent in a header, commands exit 3 with `tokenSource: "FORTRIP_TOKEN"` and no `loginUrl`; the error never repeats the token. |
|
|
201
201
|
| `FORTRIP_API_URL` | The API's base URL (default `https://api.fortrip.ai`). It must be `https`, except for `localhost`, `127.0.0.1` and `[::1]`, which may use plain `http`. It may end in a path prefix (`http://localhost:3000/api/public`), which every request path follows; a query or fragment is dropped. |
|
|
202
202
|
| `FORTRIP_MCP_URL` | The MCP server `fortrip mcp` bridges to (default `https://mcp.fortrip.ai/`), under the same URL rule. Your sign-in is sent to it, so it must be the MCP server of the API you use: on the origin of `FORTRIP_API_URL`, except that the default API goes with the default MCP server, `api.fortrip.ai` and `mcp.fortrip.ai`. When you set `FORTRIP_API_URL` to a local or preview API, set `FORTRIP_MCP_URL` too; `fortrip mcp` exits 2 and says so when you don't. |
|
|
203
203
|
| `FORTRIP_DISPLAY_CURRENCY` | The default `--display-currency` for `hotels search` and `hotels offers` (`USD` or `CNY`). It only changes the currency prices are shown in: orders are paid in USD. |
|
|
@@ -14838,7 +14838,7 @@ var destination = external_exports.discriminatedUnion(
|
|
|
14838
14838
|
countryCode: countryCode.describe("ISO 3166-1 alpha-2 country, e.g. JP.")
|
|
14839
14839
|
}),
|
|
14840
14840
|
strictInput({
|
|
14841
|
-
kind: external_exports.literal("locality", { error: "kind must be locality" }).describe("A locality
|
|
14841
|
+
kind: external_exports.literal("locality", { error: "kind must be locality" }).describe("A locality listed in an earlier search response."),
|
|
14842
14842
|
placeId: placeId.describe("placeId of the locality."),
|
|
14843
14843
|
radiusMeters
|
|
14844
14844
|
})
|
|
@@ -15085,7 +15085,7 @@ var maximumPenaltyError = "maximumPenalty must be a number of 0 or more: the ord
|
|
|
15085
15085
|
var cancelOrderInput = strictInput({
|
|
15086
15086
|
orderId: orderId.describe("The orderId of the order to cancel."),
|
|
15087
15087
|
maximumPenalty: external_exports.number({ error: maximumPenaltyError }).min(0, { error: maximumPenaltyError }).describe(
|
|
15088
|
-
`The penalty the user agreed to
|
|
15088
|
+
`The penalty the user agreed to: a JSON number equal to the order's cancel.penalty.amount, e.g. 120.5 for "120.50".`
|
|
15089
15089
|
)
|
|
15090
15090
|
});
|
|
15091
15091
|
var sharedPaymentTokenRe = /^spt_[A-Za-z0-9]{1,250}$/;
|
|
@@ -15453,6 +15453,7 @@ var cancelFlags = flagsOf(cancelOrderInput, [
|
|
|
15453
15453
|
flag: "max-penalty",
|
|
15454
15454
|
field: "maximumPenalty",
|
|
15455
15455
|
type: "number",
|
|
15456
|
+
optional: true,
|
|
15456
15457
|
placeholder: "<amount>",
|
|
15457
15458
|
description: "The penalty the user agreed to, exactly as `orders get` shows it, in the order's currency, e.g. `12.50`. Without it, the command cancels nothing: it shows the penalty and the refund."
|
|
15458
15459
|
}
|
|
@@ -15463,7 +15464,7 @@ var payFlags = flagsOf(payOrderInput, [
|
|
|
15463
15464
|
field: "sharedPaymentToken",
|
|
15464
15465
|
type: "string",
|
|
15465
15466
|
placeholder: "<spt_\u2026>",
|
|
15466
|
-
description: "Required unless --wallet. The spt_\u2026 token the user's Link wallet issued for this order."
|
|
15467
|
+
description: "Required unless --wallet. The spt_\u2026 token the user's Link wallet issued for this order. For agents that can request a token from the user's Link wallet; people pay by the order's link or --wallet."
|
|
15467
15468
|
},
|
|
15468
15469
|
{
|
|
15469
15470
|
flag: "wallet",
|
|
@@ -15542,7 +15543,7 @@ var COMMANDS = [
|
|
|
15542
15543
|
{
|
|
15543
15544
|
group: "orders",
|
|
15544
15545
|
name: "cancel",
|
|
15545
|
-
summary: "
|
|
15546
|
+
summary: "Without --max-penalty it shows the penalty and refund and cancels nothing; with the penalty the user agreed to, it cancels the order under its terms",
|
|
15546
15547
|
tool: "cancel_order",
|
|
15547
15548
|
flags: cancelFlags,
|
|
15548
15549
|
positionals: [positional(cancelOrderInput, "orderId")]
|
|
@@ -15550,7 +15551,7 @@ var COMMANDS = [
|
|
|
15550
15551
|
{
|
|
15551
15552
|
group: "orders",
|
|
15552
15553
|
name: "pay",
|
|
15553
|
-
summary: "Pay an order with a Link
|
|
15554
|
+
summary: "Pay an order with a Link token (US and Canada) or with Alipay or WeChat Pay, instead of its payment link",
|
|
15554
15555
|
tool: "pay_order",
|
|
15555
15556
|
flags: payFlags,
|
|
15556
15557
|
positionals: [positional(payOrderInput, "orderId")]
|
|
@@ -15632,16 +15633,16 @@ var GLOBAL_FLAGS = [
|
|
|
15632
15633
|
// ../contract/src/guide-data.generated.ts
|
|
15633
15634
|
var FRAGMENTS = {
|
|
15634
15635
|
"booking": "{{#if claude-skill cli}}\n## Ordering\n\n{{/if}}\n- Call `{{tool:hotels book}}` only for the offer the user picked, with at least one guest per room{{#if claude-skill cli}}, named as the user gave them{{/if}}; never invent guests.{{#if claude-skill cli}} Room 1 is the offer's first room, and a room takes no more guests than it sleeps.{{/if}}\n- Guest names: Latin letters as on the passport (M\xFCller \u2192 Mueller), first and last name 1\u2013{{limit:guestName}} characters each{{#if cli}}, as `--guest 1:John:Smith` (room 1, first name, last name){{/if}}.\n{{#if claude-skill cli}}\n- The contact's first and last name (up to {{limit:contactFirstName}} characters each), email and phone (with its country code) are all required. Special requests must be in English and aren't guaranteed.\n{{/if}}\n- `{{tool:hotels book}}` can take about two minutes{{#if cli}}: allow the command at least 3 minutes{{/if}}. If it times out, {{#if cli}}run it again with identical flags{{/if}}{{#if mcp claude-skill}}call it again with the same details{{/if}}: it returns the same order.\n{{#if mcp}}\n- On `offer_changed`, show the user every change and ask again before ordering the new offer.\n{{/if}}\n{{#if cli}}\n- `{{tool:hotels book}}` takes only these fields: a `--body` with any other field (such as `nationality`) is rejected with exit 2.\n{{/if}}\n",
|
|
15635
|
-
"errors": "{{#if claude-skill cli}}\n## Errors\n\n{{#if claude-skill}}A tool error{{/if}}{{#if cli}}An error on stderr{{/if}} carries `code`, `message` and `retryable`, and `retryAfterSeconds` when waiting helps; many carry `details`. Search errors are under Search. Ordering errors:\n\n| `code` | Do this |\n|---|---|\n| `offer_changed` (409) | The price or terms changed since the offer: `changes` lists every change (`worse` says which are worse for the user) and `offer` is the new offer. Show the user every change and ask again; if they still want it, order the new offer, and confirm the new order before giving its link |\n| `offer_expired` (409) | Get offers again and let the user choose again |\n| `offer_unavailable` (422) | The offer is sold out or was refused: get offers again and let the user choose again |\n| `order_in_progress` (409) | The same order is still being created: wait `retryAfterSeconds`, then {{#if claude-skill}}call again with the same details{{/if}}{{#if cli}}run the command again with identical flags{{/if}} |\n| `offer_already_ordered` (409) | This offer was already ordered with other details: show that order (`orderId`) instead. An offer is ordered once |\n| `order_exists` (409) | This stay already has an open order for one of these guests (`orderId`, `status`): show it instead of ordering again. A party with none of its guests can order the stay from a new offer (get offers again), and so can the user once the stay's order is confirmed, cancelled or refused by the hotel. It also answers when the stay's earlier order failed at the hotel with its outcome unknown, or the stay has had {{limit:ordersPerStay}} orders; for those, the user emails {{support}} |\n| `order_attempts_exhausted` (409) | This order can't be tried again: the user emails {{support}} with its `reference` |\n| `order_removed` (410) | The order was never completed and no payment is held: get offers again and order the new offer (the order keeps its `orderId`) |\n| `stay_unsupported` (422) | `mixed_occupancy`: order once per party; `max_nights`: at most `max` nights per order |\n| `stay_in_past` (422) | Check-in has passed in the hotel's time zone: ask for new dates |\n| `ordering_paused` (503) | Ordering is paused on Fortrip's side: tell the user, and try again only after `retryAfterSeconds`
|
|
15636
|
+
"errors": "{{#if claude-skill cli}}\n## Errors\n\n{{#if claude-skill}}A tool error{{/if}}{{#if cli}}An error on stderr{{/if}} carries `code`, `message` and `retryable`, and `retryAfterSeconds` when waiting helps; many carry `details`. Search errors are under Search. Ordering errors:\n\n| `code` | Do this |\n|---|---|\n| `offer_changed` (409) | The price or terms changed since the offer: `changes` lists every change (`worse` says which are worse for the user) and `offer` is the new offer. Show the user every change and ask again; if they still want it, order the new offer, and confirm the new order before giving its link |\n| `offer_expired` (409) | Get offers again and let the user choose again |\n| `offer_unavailable` (422) | The offer is sold out or was refused: get offers again and let the user choose again |\n| `order_in_progress` (409) | The same order is still being created: wait `retryAfterSeconds`, then {{#if claude-skill}}call again with the same details{{/if}}{{#if cli}}run the command again with identical flags{{/if}} |\n| `offer_already_ordered` (409) | This offer was already ordered with other details: show that order (`orderId`) instead. An offer is ordered once |\n| `order_exists` (409) | This stay already has an open order for one of these guests (`orderId`, `status`): show it instead of ordering again. A party with none of its guests can order the stay from a new offer (get offers again), and so can the user once the stay's order is confirmed, cancelled or refused by the hotel. It also answers when the stay's earlier order failed at the hotel with its outcome unknown, or the stay has had {{limit:ordersPerStay}} orders; for those, the user emails {{support}} |\n| `order_attempts_exhausted` (409) | This order can't be tried again: the user emails {{support}} with its `reference` |\n| `order_removed` (410) | The order was never completed and no payment is held: get offers again and order the new offer (the order keeps its `orderId`) |\n| `stay_unsupported` (422) | `mixed_occupancy`: order once per party; `max_nights`: at most `max` nights per order |\n| `stay_in_past` (422) | Check-in has passed in the hotel's time zone: ask for new dates |\n| `ordering_paused` (503) | Ordering is paused on Fortrip's side: tell the user, and try again only after `retryAfterSeconds` |\n\nAny code:\n\n- `invalid_request` (400): `details.issues` lists each bad field; fix them. For amenities, `details.filterable` lists those that can filter.\n- `cursor_invalid` (400): the page is gone; search again from the first page.\n- `not_found` (404): no such hotel, or no such order for this user.\n- `rate_limited` (429): wait `retryAfterSeconds`, then retry once.\n- `service_unavailable` (503) and `supplier_unavailable` (503 or 504): wait `retryAfterSeconds`, then retry once with the same details; if it fails again, tell the user.\n- Any other code: read `message`. If `retryable` is true, wait `retryAfterSeconds` and retry once; otherwise tell the user instead of guessing.\n{{/if}}\n",
|
|
15636
15637
|
"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',
|
|
15637
15638
|
"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{{/if}}\n- Offers and orders take one party per call, every room the same: for different parties, order once per party.{{#if claude-skill cli}} `{{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`.{{/if}}\n{{#if claude-skill cli}}\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",
|
|
15638
|
-
"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
|
|
15639
|
+
"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: 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- Typos return nothing: "Shangahi" finds no hotel.\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 USD; 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',
|
|
15639
15640
|
"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 payment on Stripe. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term: meals, cancellation (status, deadline, penalties) and fees payable at the property, unknowns included.\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then give `payment.url` exactly as returned: don't shorten, rebuild or re-encode it.\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 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) 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.\n- An order `awaiting_payment` whose `payment.url` is null had its link unreadable this time: read it again with `{{tool:orders get}}`.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only through Stripe.{{#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.handlers` isn't empty (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 `payment.handlers` is empty for a larger order. Otherwise give `payment.url`, and never ask the user to create, type or paste a token.\n\n1. Show the user the order's total and currency, the stay (hotel, room, dates, rooms and guests per room) and every term: meals, cancellation and fees payable at the property. End that reply by asking the user to confirm, and wait for 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 handler's `config.business_profile` and `payment.credentialLimits`: `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. Pay one way only: either give `payment.url` or {{#if claude-skill}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders pay}}`. 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 the order's `payment.credentialLimits`. `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: it is for users who have a mainland-China wallet. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` {{#if claude-skill}}with `method` `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. Show the user the order's total in USD, the stay (hotel, room, dates, rooms and guests per room) and every term: meals, cancellation and fees payable at the property. End that reply by asking the user to confirm, and wait for a clear yes. Pay one way only: `payment.url` or this.\n2. Then show `payment.wallets`: 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 US dollars, 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 `payment.wallets.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",
|
|
15640
15641
|
"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}}SKILL.md{{/if}}{{#if cli}}`{{tool:guide}}`{{/if}} still apply (call order, destinations, one party per offer and order, confirming the order `{{tool:hotels book}}` returns before giving the payment link); 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\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\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 children come along, ask each child's age; `{{tool:hotels offers}}` needs it. Don't ask for trip type or style: infer it from the conversation or leave it general. When a place name is ambiguous, ask which place the user means.\n\n## Evidence\n\n- 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 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- A hotel is available only once `{{tool:hotels offers}}` returned an offer for it.\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 other than `approx`, 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 USD.\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. Show at most three plans, 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",
|
|
15641
15642
|
"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 USD, 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",
|
|
15642
15643
|
"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 mcp}}\n- Search prices are indicative, not bookable: quote `{{tool:hotels offers}}` prices.\n{{/if}}\n- {{#if claude-skill cli}}In an offer or order, {{/if}}`price.total` is the whole stay for all rooms and is what is charged, in USD for offers and the orders made from them.{{#if claude-skill cli}} `perNightAllRooms` is the total per night; to compare with a per-room budget, also divide by the rooms.{{/if}} 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 USD total is the price{{/if}}. `approx`{{#if claude-skill cli}}, in `{{arg:displayCurrency}}`, with its `rateDate`,{{/if}} is an estimate, never the charge.\n{{#if claude-skill cli}}\n- `{{arg:displayCurrency}}`{{#if cli}} (or `FORTRIP_DISPLAY_CURRENCY`){{/if}} is `USD` or `CNY`: `CNY` adds `approx` in yuan to suit a user who thinks in it. It never changes the charge.\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",
|
|
15643
15644
|
"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:hotels book}}`; after the user pays, `{{tool:orders get}}`; `{{tool:orders list}}` lists, `{{tool:orders cancel}}` cancels, `{{tool:orders pay}}` pays by token or Alipay/WeChat Pay. `{{tool:guide}}` returns Fortrip's guidance for flexible dates, budgets or several destinations.\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:\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):\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 rooms; no prices |\n| `{{tool:hotels offers}}` | Live offers (room, meals, total in USD, cancellation terms) for up to {{limit:offersHotels}} hotels |\n| `{{tool:hotels book}}` | 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 an order under its terms, for the penalty the user agreed to, and refunds the rest |\n| `{{tool:orders pay}}` | Pays an order without its link, by a shared payment token from the user's wallet, or with Alipay or WeChat Pay |\n\nFor flexible dates, a budget, split stays, several destinations or \"find me the best\", {{#if claude-skill}}read [references/planning.md](references/planning.md){{/if}}{{#if cli}}also run `{{tool:guide}} planning`{{/if}} before searching.\n{{/if}}\n",
|
|
15644
|
-
"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:hotels book}}` 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\nWhen the user first asks about hotels, run `{{tool:whoami}}` before asking follow-up questions, so the sign-in can happen while they answer.\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
|
|
15645
|
+
"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:hotels book}}` 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\nWhen the user first asks about hotels, run `{{tool:whoami}}` before asking follow-up questions, so the sign-in can happen while they answer.\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 `retryable` is true, wait `retryAfterSeconds` (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 `retryAfterSeconds`, then retry once |\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",
|
|
15645
15646
|
"support": "{{#if claude-skill cli}}\n## Cancelling an order\n\n`{{tool:orders get}}` and `{{tool:orders list}}` say of each order whether the user can cancel it now (`cancel.available`), and then the penalty under its terms (`cancel.penalty`) and the refund, what was paid less the penalty (`cancel.refund`), both in the charge currency; otherwise `cancel.reason` says why not.\n\n1. Show the user the stay (hotel, dates), `cancel.penalty` and `cancel.refund` (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}}call{{/if}}{{#if cli}}run{{/if}} `{{tool:orders cancel}}` with `{{arg:maximumPenalty}}` set to `cancel.penalty.amount` as shown. Never state a refund the order didn't return, 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}}`. If the hotel refuses, the order is `confirmed` again with `cancel.reason` `refused`. `cancellation_changed` (409) 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` (409) says why in `reason`.{{#if cli}} Without `--max-penalty`, `{{tool:orders cancel}}` cancels nothing: it prints the penalty and the refund and exits 2.{{/if}}\n\n## Changes and support\n\n{{/if}}\n{{#if mcp}}For changes{{/if}}{{#if claude-skill}}These tools can't change an order: for changes{{/if}}{{#if cli}}The CLI can't change an order: for changes{{/if}}, a cancellation that `{{tool:orders cancel}}` can't make, or other problems, the user emails {{support}} with the order's `reference` (never `payment.url`).\n"
|
|
15646
15647
|
};
|
|
15647
15648
|
|
|
@@ -15954,6 +15955,7 @@ var destination2 = openUnion("kind", [
|
|
|
15954
15955
|
})
|
|
15955
15956
|
]);
|
|
15956
15957
|
var count = external_exports.number().int();
|
|
15958
|
+
var hotels = (what) => count.nullable().describe(what);
|
|
15957
15959
|
var searchResult = openObject({
|
|
15958
15960
|
destination: destination2.nullable(),
|
|
15959
15961
|
text: openObject({
|
|
@@ -15974,17 +15976,31 @@ var searchResult = openObject({
|
|
|
15974
15976
|
"price_desc"
|
|
15975
15977
|
]),
|
|
15976
15978
|
coverage: openObject({
|
|
15977
|
-
matched: count
|
|
15978
|
-
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15979
|
+
matched: count.describe(
|
|
15980
|
+
"Hotels that match the destination, the text and every filter but the price filter."
|
|
15981
|
+
),
|
|
15982
|
+
priced: hotels(
|
|
15983
|
+
"Hotels priced: those on this page, or with a price sort or price filter the whole priced set (pricing.scope); null without prices."
|
|
15984
|
+
),
|
|
15985
|
+
withPrice: hotels("Of those priced, how many have an indicative price; null when prices weren't asked for or are unavailable."),
|
|
15986
|
+
poolRadiusMeters: external_exports.number().nullable().describe(
|
|
15987
|
+
`When a price sort or price filter priced only the nearest ${LIMITS.poolLimit.toLocaleString("en-US")}: how far the farthest of them is from the center, in meters; otherwise null.`
|
|
15988
|
+
),
|
|
15989
|
+
excludedNoPrice: hotels("With a price filter: priced hotels left out for having no indicative price; otherwise null."),
|
|
15990
|
+
excludedNoFacilityData: hotels(
|
|
15991
|
+
"With an amenity filter: hotels left out for listing no facilities at all, though they may have the amenity; otherwise null."
|
|
15992
|
+
),
|
|
15993
|
+
withinMaxRadius: hotels(
|
|
15994
|
+
`For a radius under ${LIMITS.radiusMetersMax.toLocaleString("en-US")} m: how many would match within ${LIMITS.radiusMetersMax.toLocaleString("en-US")} m of the center; otherwise null.`
|
|
15995
|
+
),
|
|
15996
|
+
textAnywhere: hotels(
|
|
15997
|
+
"With text and a place: the hotels that match the text anywhere in the place's country; otherwise null."
|
|
15998
|
+
),
|
|
15999
|
+
localities: localities.nullable().describe("For an area: its top localities, the towns its matching hotels belong to; otherwise null."),
|
|
16000
|
+
nameAsText: hotels(
|
|
16001
|
+
"When a place_name search matched few hotels: how many in its country match the name as text; otherwise null."
|
|
16002
|
+
)
|
|
16003
|
+
}).describe("What the search covered: counts of hotels, each null when it doesn't apply."),
|
|
15988
16004
|
data: external_exports.array(hotelSummary),
|
|
15989
16005
|
nextCursor: external_exports.string().nullable().describe("Pass it back as cursor for the next page; null on the last page."),
|
|
15990
16006
|
notes: external_exports.array(
|
|
@@ -16070,11 +16086,17 @@ var hotel = openObject({
|
|
|
16070
16086
|
var meals = openObject({
|
|
16071
16087
|
known: external_exports.boolean(),
|
|
16072
16088
|
included: external_exports.array(openEnum(["breakfast", "lunch", "dinner"])).nullable(),
|
|
16073
|
-
unspecifiedMainMeals: external_exports.number().int().nullable()
|
|
16089
|
+
unspecifiedMainMeals: external_exports.number().int().nullable().describe(
|
|
16090
|
+
"Main meals a day beyond included that the rate doesn't name (e.g. 1 when a half-board rate doesn't say lunch or dinner); null when known is false."
|
|
16091
|
+
),
|
|
16074
16092
|
allInclusive: external_exports.boolean().nullable(),
|
|
16075
|
-
guestsCoveredPerRoom: external_exports.number().int().nullable()
|
|
16093
|
+
guestsCoveredPerRoom: external_exports.number().int().nullable().describe(
|
|
16094
|
+
"How many guests in each room the meals are for; fewer than the guests in the room means not everyone gets them. null when not stated."
|
|
16095
|
+
),
|
|
16076
16096
|
label: localizedText.nullable()
|
|
16077
|
-
})
|
|
16097
|
+
}).describe(
|
|
16098
|
+
"What the rate includes to eat. known false: the meals are unknown, not none, and included, unspecifiedMainMeals and allInclusive are null."
|
|
16099
|
+
);
|
|
16078
16100
|
var payAtProperty = openObject({
|
|
16079
16101
|
disclosure: openEnum(["complete", "incomplete"]),
|
|
16080
16102
|
items: external_exports.array(
|
|
@@ -16092,20 +16114,24 @@ var payAtProperty = openObject({
|
|
|
16092
16114
|
collectedAt: openEnum(["property", "unknown"])
|
|
16093
16115
|
})
|
|
16094
16116
|
)
|
|
16095
|
-
})
|
|
16117
|
+
}).describe(
|
|
16118
|
+
"Fees paid at the property, on top of price.total, in the property's currency, not converted. disclosure incomplete: there may be fees not listed."
|
|
16119
|
+
);
|
|
16096
16120
|
var cancellation = openObject({
|
|
16097
16121
|
status: openEnum(["free", "partial_penalty", "non_refundable", "unknown"]),
|
|
16098
|
-
asOf: instant,
|
|
16122
|
+
asOf: instant.describe("When these terms were read: status and penalties are as of this time."),
|
|
16099
16123
|
freeCancellationEndsAt: instant.nullable(),
|
|
16100
16124
|
penalties: external_exports.array(
|
|
16101
16125
|
openObject({ startsAt: instant.nullable(), amount: money })
|
|
16102
16126
|
),
|
|
16103
16127
|
timeZone: external_exports.string().nullable()
|
|
16104
|
-
});
|
|
16128
|
+
}).describe("The cancellation terms, read at asOf.");
|
|
16105
16129
|
var confirmation = openObject({
|
|
16106
|
-
mode: openEnum(["instant", "on_request", "unknown"])
|
|
16107
|
-
|
|
16108
|
-
|
|
16130
|
+
mode: openEnum(["instant", "on_request", "unknown"]).describe(
|
|
16131
|
+
"instant: the hotel confirms the booking as soon as it is made. on_request: the hotel confirms or refuses it later, within withinMinutes when stated. unknown: not stated."
|
|
16132
|
+
),
|
|
16133
|
+
withinMinutes: external_exports.number().int().nullable().describe("For on_request, the minutes the hotel takes to confirm; null when instant or not stated.")
|
|
16134
|
+
}).describe("How the hotel confirms a booking of this offer.");
|
|
16109
16135
|
var offer = openObject({
|
|
16110
16136
|
offerId,
|
|
16111
16137
|
type: openEnum(["hotel"]),
|
|
@@ -16118,7 +16144,9 @@ var offer = openObject({
|
|
|
16118
16144
|
}),
|
|
16119
16145
|
price: openObject({
|
|
16120
16146
|
total: money,
|
|
16121
|
-
perNightAllRooms: money
|
|
16147
|
+
perNightAllRooms: money.describe(
|
|
16148
|
+
"price.total divided by the nights: all rooms, one night. A search's fromPerRoomNight is for one room; divide by roomCount to compare."
|
|
16149
|
+
),
|
|
16122
16150
|
approx: openObject({
|
|
16123
16151
|
total: money,
|
|
16124
16152
|
perNightAllRooms: money,
|
|
@@ -16129,13 +16157,18 @@ var offer = openObject({
|
|
|
16129
16157
|
cancellation,
|
|
16130
16158
|
confirmation
|
|
16131
16159
|
});
|
|
16160
|
+
var removed = (step) => external_exports.number().int().describe(`Offers left out ${step}.`);
|
|
16132
16161
|
var omitted = openObject({
|
|
16133
|
-
byNationality:
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16162
|
+
byNationality: removed(
|
|
16163
|
+
"because the hotel sells them only to guests of some nationalities; Fortrip can't book them"
|
|
16164
|
+
),
|
|
16165
|
+
byFilters: removed("by filters"),
|
|
16166
|
+
dominated: removed(
|
|
16167
|
+
"because another offer of the same room is as good on price and every term, or can't be told apart from one kept"
|
|
16168
|
+
),
|
|
16169
|
+
unreadable: removed("because their details came back incomplete or inconsistent"),
|
|
16170
|
+
byLimit: removed("by limitPerHotel")
|
|
16171
|
+
}).describe("How many offers each selection step left out.");
|
|
16139
16172
|
var UNAVAILABLE_REASONS = [
|
|
16140
16173
|
"sold_out",
|
|
16141
16174
|
"no_matching_offers",
|
|
@@ -16157,7 +16190,9 @@ var hotelOffersResult = openObject({
|
|
|
16157
16190
|
unavailable: external_exports.array(
|
|
16158
16191
|
openObject({
|
|
16159
16192
|
hotelId,
|
|
16160
|
-
reason: openEnum(UNAVAILABLE_REASONS)
|
|
16193
|
+
reason: openEnum(UNAVAILABLE_REASONS).describe(
|
|
16194
|
+
"Why the hotel has no offers: sold_out (nothing left for the stay), no_matching_offers (the filters left none), nationality_restricted (the hotel sells this stay only to guests of some nationalities; Fortrip can't book it), offers_unreadable (its offers came back incomplete or inconsistent), not_found (Fortrip has no bookable hotel with this hotelId), supplier_unavailable (offers couldn't be fetched this time; try again), stay_in_past (check-in has passed in the hotel's time zone)."
|
|
16195
|
+
),
|
|
16161
16196
|
omitted: omitted.nullable()
|
|
16162
16197
|
})
|
|
16163
16198
|
)
|
|
@@ -16232,7 +16267,9 @@ var hotelItem = openObject({
|
|
|
16232
16267
|
beds: localizedText.nullable()
|
|
16233
16268
|
}),
|
|
16234
16269
|
meals,
|
|
16235
|
-
cancellation
|
|
16270
|
+
cancellation: cancellation.describe(
|
|
16271
|
+
"The terms the order was made on, read at asOf; cancel says whether it can be cancelled now."
|
|
16272
|
+
),
|
|
16236
16273
|
payAtProperty,
|
|
16237
16274
|
confirmationNumber: external_exports.string().nullable()
|
|
16238
16275
|
})
|
|
@@ -16240,32 +16277,36 @@ var hotelItem = openObject({
|
|
|
16240
16277
|
var order = openObject({
|
|
16241
16278
|
orderId,
|
|
16242
16279
|
reference: orderReference,
|
|
16243
|
-
status: openEnum(ORDER_STATUSES)
|
|
16280
|
+
status: openEnum(ORDER_STATUSES).describe(
|
|
16281
|
+
"awaiting_payment: unpaid, nothing charged; payable until payment.expiresAt. expired: not paid in time, nothing charged. confirming: paid or held, the booking is with the hotel. confirmed: the hotel confirmed and the payment is charged. failed: no stay was booked; payment.status says what became of the money. cancelling, then cancelled: a cancellation under the terms. needs_attention: a person at Fortrip has to resolve it."
|
|
16282
|
+
),
|
|
16244
16283
|
createdAt: instant,
|
|
16245
16284
|
updatedAt: instant,
|
|
16246
16285
|
items: external_exports.array(openUnion("type", [hotelItem])).min(1),
|
|
16247
|
-
price: openObject({
|
|
16286
|
+
price: openObject({
|
|
16287
|
+
total: money.describe(
|
|
16288
|
+
"The whole stay for all rooms, in payment.chargeCurrency: what paying charges, or once paid what was charged. Fees payable at the property are not in it."
|
|
16289
|
+
)
|
|
16290
|
+
}),
|
|
16248
16291
|
payment: openObject({
|
|
16249
16292
|
status: openEnum(PAYMENT_STATUSES),
|
|
16250
16293
|
url: external_exports.string().nullable().describe(
|
|
16251
16294
|
"The payment page, on fortrip.ai. With requiresSignIn false it continues to Stripe Checkout, and anyone holding it can pay; with requiresSignIn true (an order started on the Fortrip website) it continues to the Fortrip booking page, where only the signed-in owner can pay. null when the order isn't awaiting payment, or, while it is, when the link couldn't be read this time: read the order again."
|
|
16252
16295
|
),
|
|
16253
16296
|
requiresSignIn: external_exports.boolean(),
|
|
16254
|
-
expiresAt: instant.nullable()
|
|
16255
|
-
|
|
16256
|
-
|
|
16257
|
-
|
|
16258
|
-
|
|
16259
|
-
|
|
16260
|
-
|
|
16297
|
+
expiresAt: instant.nullable().describe(
|
|
16298
|
+
"When the time to pay ends: an order unpaid by then expires, with nothing charged. null unless status is awaiting_payment."
|
|
16299
|
+
),
|
|
16300
|
+
chargeCurrency: external_exports.string().describe(
|
|
16301
|
+
"The currency the order is charged in: USD for an order made through the API; an order made on the Fortrip website may be in another."
|
|
16302
|
+
),
|
|
16303
|
+
localCurrencyAtCheckout: external_exports.boolean().describe(
|
|
16304
|
+
"Whether paying by url may charge the card in its own currency, converted by Stripe; false once paid by token, Alipay or WeChat Pay."
|
|
16305
|
+
),
|
|
16306
|
+
localCharge: money.nullable().describe("What the card was charged in its own currency, when Stripe converted the total; otherwise null."),
|
|
16261
16307
|
handlers: external_exports.array(paymentHandler).describe(
|
|
16262
|
-
|
|
16308
|
+
`The ways to pay other than url: a com.stripe.payments handler takes a Stripe shared payment token through pay_order. [] when a token can't pay the order: over $${LIMITS.tokenPaymentMaxUsd}, not charged in USD, an order started on the Fortrip website, a negotiated price, under ${LIMITS.payMinMinutesLeft} minutes left, ${LIMITS.tokensPerOrder} tokens tried, a token payment is under way, an Alipay or WeChat Pay payment is open, or token payment isn't offered for this order.`
|
|
16263
16309
|
),
|
|
16264
|
-
/** What a payment credential for `pay_order` must allow, with
|
|
16265
|
-
* `handlers`: at least `maxAmount`, in minor units (cents) of
|
|
16266
|
-
* `currency`, lowercase as Stripe takes it, and valid until at least
|
|
16267
|
-
* `expiresAt`, past which the order can't be paid. `null` when
|
|
16268
|
-
* `handlers` is empty. */
|
|
16269
16310
|
credentialLimits: openObject({
|
|
16270
16311
|
maxAmount: external_exports.number().int().describe("Request the token for at least this amount, in cents; a token that allows less can't pay."),
|
|
16271
16312
|
currency: external_exports.string().describe("The token's currency, lowercase as Stripe takes it: usd."),
|
|
@@ -16275,11 +16316,9 @@ var order = openObject({
|
|
|
16275
16316
|
}).nullable().describe(
|
|
16276
16317
|
"What the shared payment token for pay_order must allow. null exactly when handlers is []."
|
|
16277
16318
|
),
|
|
16278
|
-
/** Paying with Alipay or WeChat Pay through `pay_order`'s `method`.
|
|
16279
|
-
* `null` when it is neither offered for the order nor open on it. */
|
|
16280
16319
|
wallets: openObject({
|
|
16281
|
-
open: external_exports.boolean().describe("Whether pay_order has opened
|
|
16282
|
-
current: openEnum(["wechat_pay", "alipay"]).nullable().describe("
|
|
16320
|
+
open: external_exports.boolean().describe("Whether pay_order has opened an Alipay or WeChat Pay payment on this order."),
|
|
16321
|
+
current: openEnum(["wechat_pay", "alipay"]).nullable().describe("Which of the two the payment is on now; null until it is open."),
|
|
16283
16322
|
wechatPay: openObject({
|
|
16284
16323
|
qrData: external_exports.string().nullable().describe(
|
|
16285
16324
|
"The WeChat Pay code's content, to draw as a QR code; null when there is no live code (open wechatPay.url for one)."
|
|
@@ -16294,9 +16333,6 @@ var order = openObject({
|
|
|
16294
16333
|
"Paying with Alipay or WeChat Pay: pass method alipay_wechat_pay to pay_order to open it. null when the order can't be paid this way and none is open."
|
|
16295
16334
|
)
|
|
16296
16335
|
}),
|
|
16297
|
-
/** Whether the user can cancel the order now and, when they can, its
|
|
16298
|
-
* penalty under the accepted terms (read a minute ahead) and the refund,
|
|
16299
|
-
* what was paid less the penalty, both in the charge currency. */
|
|
16300
16336
|
cancel: openObject({
|
|
16301
16337
|
available: external_exports.boolean().describe("Whether the user can cancel the order now."),
|
|
16302
16338
|
reason: openEnum(CANCEL_REASONS).describe(
|
|
@@ -16390,7 +16426,7 @@ var READ_OWN = { ...READ, openWorldHint: false };
|
|
|
16390
16426
|
var TOOLS = [
|
|
16391
16427
|
{
|
|
16392
16428
|
name: "get_planning_guide",
|
|
16393
|
-
title: "
|
|
16429
|
+
title: "Planning guide",
|
|
16394
16430
|
description: `Returns Fortrip's planning guide for a request that is more than one hotel for fixed dates (flexible dates, a budget, split stays, several destinations, "find me the best"): what to ask the user, which results count as evidence, how to rank and how to present options.`,
|
|
16395
16431
|
annotations: READ_OWN,
|
|
16396
16432
|
input: null,
|
|
@@ -16406,7 +16442,7 @@ var TOOLS = [
|
|
|
16406
16442
|
},
|
|
16407
16443
|
{
|
|
16408
16444
|
name: "get_hotel",
|
|
16409
|
-
title: "
|
|
16445
|
+
title: "Hotel details",
|
|
16410
16446
|
description: `One hotel's catalogue facts: names, address, location, time zone, check-in and check-out times, the full description, every policy and the amenities, and its rooms with include: "rooms". "Not listed" is not "no". No prices or availability: get_hotel_offers has those.`,
|
|
16411
16447
|
annotations: READ,
|
|
16412
16448
|
input: getHotelInput,
|
|
@@ -16414,7 +16450,7 @@ var TOOLS = [
|
|
|
16414
16450
|
},
|
|
16415
16451
|
{
|
|
16416
16452
|
name: "get_hotel_offers",
|
|
16417
|
-
title: "
|
|
16453
|
+
title: "Live offers",
|
|
16418
16454
|
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, the meals included, price.total in USD for the whole stay and every room (what is charged), 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 book_hotel that expires at expiresAt. Hotels with nothing to offer are listed under unavailable with the reason. Up to limitPerHotel offers per hotel, default ${LIMITS.offersPerHotelDefault}, chosen for a spread of choices in this order while room remains: the cheapest offer, the cheapest that can be cancelled free, the cheapest with breakfast, the cheapest of each other room, then the rest by price; listed cheapest first.`,
|
|
16419
16455
|
annotations: READ,
|
|
16420
16456
|
input: hotelOffersInput,
|
|
@@ -16422,7 +16458,7 @@ var TOOLS = [
|
|
|
16422
16458
|
},
|
|
16423
16459
|
{
|
|
16424
16460
|
name: "book_hotel",
|
|
16425
|
-
title: "Create
|
|
16461
|
+
title: "Create order",
|
|
16426
16462
|
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 (or Alipay/WeChat Pay); 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.`,
|
|
16427
16463
|
annotations: {
|
|
16428
16464
|
readOnlyHint: false,
|
|
@@ -16464,7 +16500,7 @@ var TOOLS = [
|
|
|
16464
16500
|
},
|
|
16465
16501
|
{
|
|
16466
16502
|
name: "pay_order",
|
|
16467
|
-
title: "Pay order
|
|
16503
|
+
title: "Pay order",
|
|
16468
16504
|
description: `Pay an order without its link, by shared payment token or Alipay/WeChat Pay (method alipay_wechat_pay). Token: only if payment.handlers isn't empty and you can request one from the user's Link wallet (US and Canadian accounts); never ask the user for one. First show the user the USD total, the stay and every term (meals, cancellation, fees payable at the property), ask them to confirm and wait for a clear yes. Token: request it with config.business_profile and payment.credentialLimits; pass it with price.total. Wallet: pass method, price.total; show payment.wallets (WeChat code as an image if you can, both links); they pay once by either; a code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: payment.url or pay_order. On success payment.url stops working; on failure it stays open. Then poll get_order. payment_total_changed: confirm details.total, retry. payment_credential_invalid: new token. service_unavailable: retry. Else payment.url. A token pays one order only.`,
|
|
16469
16505
|
annotations: {
|
|
16470
16506
|
readOnlyHint: false,
|
|
@@ -17004,7 +17040,7 @@ var CENTER_BASES2 = {
|
|
|
17004
17040
|
seat: "the seat",
|
|
17005
17041
|
capital: "the capital",
|
|
17006
17042
|
busiest_settlement: "the settlement with the most hotels",
|
|
17007
|
-
hub: "the locality
|
|
17043
|
+
hub: "the locality",
|
|
17008
17044
|
point: "its location"
|
|
17009
17045
|
};
|
|
17010
17046
|
function radiusWords(meters, source) {
|
|
@@ -17071,7 +17107,7 @@ function countsLine(r) {
|
|
|
17071
17107
|
if (c.excludedNoFacilityData !== null) {
|
|
17072
17108
|
parts.push(`${num(c.excludedNoFacilityData)} left out for listing no facilities`);
|
|
17073
17109
|
}
|
|
17074
|
-
if (c.withinMaxRadius !== null) parts.push(`${num(c.withinMaxRadius)} within
|
|
17110
|
+
if (c.withinMaxRadius !== null) parts.push(`${num(c.withinMaxRadius)} within ${LIMITS.radiusMetersMax / 1e3} km`);
|
|
17075
17111
|
if (c.textAnywhere !== null) {
|
|
17076
17112
|
parts.push(`${num(c.textAnywhere)} match the text anywhere in ${country}`);
|
|
17077
17113
|
}
|
|
@@ -17225,13 +17261,13 @@ function ambiguous(d, surface) {
|
|
|
17225
17261
|
for (const c of d.candidates) {
|
|
17226
17262
|
const other = [c.names.en, c.names.zh].find((n) => n && n !== c.name);
|
|
17227
17263
|
const where = [c.region && `${c.region.name} ${c.region.placeId}`, c.countryCode].filter(Boolean).join(", ");
|
|
17228
|
-
const
|
|
17264
|
+
const hotels2 = c.hotels.scope === "area" ? `${plural(c.hotels.count, "hotel")} in the area` : c.hotels.radiusMeters === null ? plural(c.hotels.count, "hotel") : `${plural(c.hotels.count, "hotel")} within ${km(c.hotels.radiusMeters)}`;
|
|
17229
17265
|
lines.push(
|
|
17230
17266
|
[
|
|
17231
17267
|
`- ${c.name}${other ? ` (${other})` : ""} ${c.placeId}`,
|
|
17232
17268
|
`${c.kind} in ${where}`,
|
|
17233
17269
|
c.population === null ? "population not recorded" : `population ${num(c.population)}`,
|
|
17234
|
-
|
|
17270
|
+
hotels2
|
|
17235
17271
|
].join(" \xB7 ")
|
|
17236
17272
|
);
|
|
17237
17273
|
}
|
|
@@ -17548,7 +17584,7 @@ function withConsent(tool, surface, text2, orders) {
|
|
|
17548
17584
|
// ../contract/package.json
|
|
17549
17585
|
var package_default = {
|
|
17550
17586
|
name: "@fortrip/agent-contract",
|
|
17551
|
-
version: "4.3.
|
|
17587
|
+
version: "4.3.1",
|
|
17552
17588
|
license: "Apache-2.0",
|
|
17553
17589
|
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.",
|
|
17554
17590
|
type: "module",
|
|
@@ -17571,7 +17607,10 @@ var package_default = {
|
|
|
17571
17607
|
import: "./dist/regions.js"
|
|
17572
17608
|
}
|
|
17573
17609
|
},
|
|
17574
|
-
files: [
|
|
17610
|
+
files: [
|
|
17611
|
+
"dist",
|
|
17612
|
+
"NOTICE"
|
|
17613
|
+
],
|
|
17575
17614
|
sideEffects: false,
|
|
17576
17615
|
engines: {
|
|
17577
17616
|
node: ">=22"
|
|
@@ -18703,7 +18742,9 @@ export {
|
|
|
18703
18742
|
GLOBAL_FLAGS,
|
|
18704
18743
|
renderGuide,
|
|
18705
18744
|
order,
|
|
18745
|
+
PUBLIC_ORIGINS,
|
|
18706
18746
|
API,
|
|
18747
|
+
MCP_SERVER_URL,
|
|
18707
18748
|
HTTP_ROUTES,
|
|
18708
18749
|
routePath,
|
|
18709
18750
|
TOOLS,
|
|
@@ -18720,8 +18761,6 @@ export {
|
|
|
18720
18761
|
VERSION,
|
|
18721
18762
|
isEnvelope,
|
|
18722
18763
|
unwrap,
|
|
18723
|
-
DEFAULT_API_URL,
|
|
18724
|
-
DEFAULT_MCP_URL,
|
|
18725
18764
|
resolveApiUrl,
|
|
18726
18765
|
resolveMcpUrl,
|
|
18727
18766
|
loadSession,
|
package/dist/cli.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
COMMANDS,
|
|
5
5
|
COMMAND_GROUPS,
|
|
6
6
|
CliError,
|
|
7
|
-
DEFAULT_API_URL,
|
|
8
|
-
DEFAULT_MCP_URL,
|
|
9
7
|
EXIT,
|
|
10
8
|
GLOBAL_FLAGS,
|
|
11
9
|
HTTP_ROUTES,
|
|
12
10
|
LIMITS,
|
|
11
|
+
MCP_SERVER_URL,
|
|
12
|
+
PUBLIC_ORIGINS,
|
|
13
13
|
TOOLS,
|
|
14
14
|
VERSION,
|
|
15
15
|
authorizedRequest,
|
|
@@ -28,12 +28,35 @@ import {
|
|
|
28
28
|
unwrap,
|
|
29
29
|
usageError,
|
|
30
30
|
whoami
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-63KHFEME.js";
|
|
32
32
|
|
|
33
33
|
// src/commands.ts
|
|
34
34
|
import { readFileSync } from "fs";
|
|
35
35
|
import { parseArgs } from "util";
|
|
36
36
|
|
|
37
|
+
// src/environment.ts
|
|
38
|
+
var CURRENCY_COMMANDS = COMMANDS.filter(
|
|
39
|
+
(spec) => spec.flags.some((flag) => flag.field === "displayCurrency")
|
|
40
|
+
).map((spec) => commandInvocation(spec).slice("fortrip ".length)).join(" and ");
|
|
41
|
+
var ENVIRONMENT = [
|
|
42
|
+
{
|
|
43
|
+
name: "FORTRIP_TOKEN",
|
|
44
|
+
help: "Use this token instead of the saved login (a remote agent environment or a CI run)",
|
|
45
|
+
internal: false
|
|
46
|
+
},
|
|
47
|
+
{ name: "FORTRIP_API_URL", help: `API base URL (default ${PUBLIC_ORIGINS.api})`, internal: true },
|
|
48
|
+
{
|
|
49
|
+
name: "FORTRIP_MCP_URL",
|
|
50
|
+
help: `MCP server URL for fortrip mcp (default ${MCP_SERVER_URL})`,
|
|
51
|
+
internal: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "FORTRIP_DISPLAY_CURRENCY",
|
|
55
|
+
help: `Default --display-currency for ${CURRENCY_COMMANDS}`,
|
|
56
|
+
internal: false
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
|
|
37
60
|
// src/help.ts
|
|
38
61
|
var WIDTH = 78;
|
|
39
62
|
function wrap(text, indent) {
|
|
@@ -107,9 +130,9 @@ Options:
|
|
|
107
130
|
${optionList(HELP_FLAG)}
|
|
108
131
|
`;
|
|
109
132
|
}
|
|
110
|
-
var
|
|
111
|
-
(
|
|
112
|
-
).
|
|
133
|
+
var ENVIRONMENT_LINES = ENVIRONMENT.map(
|
|
134
|
+
(variable) => ` ${variable.name.padEnd(Math.max(...ENVIRONMENT.map((v) => v.name.length)) + 2)}${variable.help}`
|
|
135
|
+
).join("\n");
|
|
113
136
|
function overallHelp() {
|
|
114
137
|
const rows = [
|
|
115
138
|
...COMMAND_GROUPS.map((group) => [`${group.name} <command>`, group.summary]),
|
|
@@ -135,10 +158,7 @@ Exit codes: 0 ok, 1 error (retry once when the error says it is retryable),
|
|
|
135
158
|
cancelled), 3 not signed in or sign-in not accepted, 4 rate limited.
|
|
136
159
|
|
|
137
160
|
Environment:
|
|
138
|
-
|
|
139
|
-
FORTRIP_API_URL API base URL (default ${DEFAULT_API_URL})
|
|
140
|
-
FORTRIP_MCP_URL MCP server URL for fortrip mcp (default ${DEFAULT_MCP_URL})
|
|
141
|
-
FORTRIP_DISPLAY_CURRENCY Default --display-currency for ${CURRENCY_COMMANDS}
|
|
161
|
+
${ENVIRONMENT_LINES}
|
|
142
162
|
`;
|
|
143
163
|
}
|
|
144
164
|
|
|
@@ -1182,7 +1202,7 @@ async function run(argv) {
|
|
|
1182
1202
|
case "mcp": {
|
|
1183
1203
|
parseOptions(spec, rest);
|
|
1184
1204
|
const mcpUrl = resolveMcpUrl(apiUrl);
|
|
1185
|
-
const { runMcpBridge } = await import("./mcp-bridge-
|
|
1205
|
+
const { runMcpBridge } = await import("./mcp-bridge-2GXFE2SC.js");
|
|
1186
1206
|
await runMcpBridge(mcpUrl, apiUrl);
|
|
1187
1207
|
return void 0;
|
|
1188
1208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fortrip",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
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": "4.3.
|
|
36
|
+
"@fortrip/agent-contract": "4.3.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup",
|