fortrip 5.3.0 → 6.0.0-rc.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.
- package/README.md +34 -20
- package/THIRD-PARTY-NOTICES +0 -26
- package/dist/{chunk-TEXEQ57H.js → chunk-OUCQQEEU.js} +1591 -966
- package/dist/cli.js +125 -756
- package/dist/{mcp-bridge-M763WDKU.js → mcp-bridge-ANLTZ4MB.js} +24 -19
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ are both `fortrip`; they talk to Fortrip API v1, `https://api.fortrip.ai/v1`.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx -y fortrip login
|
|
9
|
-
npx -y fortrip hotels search --place-name Bangkok --country TH --check-in
|
|
9
|
+
npx -y fortrip hotels search --place-name Bangkok --country TH --check-in YYYY-MM-DD --check-out YYYY-MM-DD --room 2
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Install and run
|
|
@@ -50,8 +50,10 @@ link is approved.
|
|
|
50
50
|
You stay signed in. Access tokens are short-lived and the CLI renews them
|
|
51
51
|
itself, before they run out; refresh tokens don't expire, so the sign-in lasts
|
|
52
52
|
until you run `fortrip logout`, which revokes this machine's sign-in and
|
|
53
|
-
deletes it (other machines stay signed in).
|
|
54
|
-
|
|
53
|
+
deletes it (other machines stay signed in). When Fortrip can't be reached, or
|
|
54
|
+
no longer takes this version of the CLI, `logout` deletes the sign-in all the
|
|
55
|
+
same and warns that it was not revoked. `fortrip whoami` prints the signed-in
|
|
56
|
+
account.
|
|
55
57
|
|
|
56
58
|
The sign-in is saved in `~/.config/fortrip/credentials.json` (`$XDG_CONFIG_HOME`
|
|
57
59
|
is honoured), mode `0600`, per API URL, so a token is only sent to the server
|
|
@@ -77,24 +79,24 @@ other command that needs to save a sign-in exits 1 too. The error says to set
|
|
|
77
79
|
| Command | What it does |
|
|
78
80
|
|---|---|
|
|
79
81
|
| `hotels search` | Find hotels in a place, near a point or by name, with indicative prices |
|
|
80
|
-
| `hotels get <hotelId>` | Hotel details: description, policies, amenities and
|
|
82
|
+
| `hotels get <hotelId>` | Hotel details: description, policies, amenities and room types |
|
|
81
83
|
| `hotels offers` | Live bookable offers for up to 15 hotels |
|
|
82
|
-
| `
|
|
84
|
+
| `orders create` | Create an unpaid order for an offer, with a payment link |
|
|
83
85
|
| `orders get <orderId>` | Show an order and its status |
|
|
84
86
|
| `orders list` | List your orders, newest first |
|
|
85
87
|
| `orders cancel <orderId>` | Cancel a paid order under its terms (--max-penalty), or close an unpaid one (--close) |
|
|
86
|
-
| `orders pay <orderId>` | Pay an order with a Link token (US and Canada)
|
|
88
|
+
| `orders pay <orderId>` | Pay an order with a Link token (US and Canada), instead of its payment link |
|
|
87
89
|
| `login` | Sign in through the browser |
|
|
88
90
|
| `logout` | Revoke and forget the saved token |
|
|
89
91
|
| `whoami` | Show the signed-in account |
|
|
90
92
|
| `mcp` | Run an MCP server over stdio for local clients, bridged to Fortrip's hosted server |
|
|
91
93
|
|
|
92
94
|
```bash
|
|
93
|
-
fortrip hotels search --place-name Tokyo --country JP --check-in
|
|
94
|
-
fortrip hotels offers --hotel <hotelId> --check-in
|
|
95
|
+
fortrip hotels search --place-name Tokyo --country JP --check-in YYYY-MM-DD --check-out YYYY-MM-DD --room 2
|
|
96
|
+
fortrip hotels offers --hotel <hotelId> --check-in YYYY-MM-DD --check-out YYYY-MM-DD --room 2 --room 2
|
|
95
97
|
```
|
|
96
98
|
|
|
97
|
-
`hotels search`, `hotels offers` and `
|
|
99
|
+
`hotels search`, `hotels offers` and `orders create` also accept `--body '<json>'`
|
|
98
100
|
or `--body @file.json` with the raw request body; flags override its fields.
|
|
99
101
|
|
|
100
102
|
`--room` gives one room's party, as `adults` or `adults:age,age` with each
|
|
@@ -103,11 +105,9 @@ child of 6, is `--room 2 --room 2:6`. `hotels search` accepts rooms that
|
|
|
103
105
|
differ; `hotels offers` takes one party per call, so every room must be the
|
|
104
106
|
same.
|
|
105
107
|
|
|
106
|
-
`
|
|
108
|
+
`orders create` creates an unpaid order and prints a payment link for it.
|
|
107
109
|
Nothing is charged until the person pays on the page the link opens, or
|
|
108
|
-
approves a shared payment token for `orders pay` in their wallet
|
|
109
|
-
scans the WeChat Pay code or opens the Alipay link that
|
|
110
|
-
`orders pay --method stripe_alipay_wechat_pay` prints. Orders
|
|
110
|
+
approves a shared payment token for `orders pay` in their wallet. Orders
|
|
111
111
|
are paid in the currency of the offers they come from (`--currency`).
|
|
112
112
|
|
|
113
113
|
`orders get` and `orders list` say of each order whether it can be cancelled
|
|
@@ -117,9 +117,11 @@ the person agreed to exactly as shown; if the penalty has gone up since,
|
|
|
117
117
|
nothing changes and the command exits 1 with `cancellation_changed`. An
|
|
118
118
|
unpaid order is closed instead, once the person says they no longer want it:
|
|
119
119
|
`orders cancel <orderId> --close` closes it, nothing is charged, and it
|
|
120
|
-
becomes `
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
becomes `closed`. Without `--max-penalty` or `--close` the command is
|
|
121
|
+
refused with exit 2 and nothing is sent: `orders get` shows the order's Cancel
|
|
122
|
+
line, with the command to run. A flag that doesn't fit the order (`--close`
|
|
123
|
+
on a paid one, `--max-penalty` on an unpaid one) is not sent either: the
|
|
124
|
+
command answers `order_not_cancellable` and exits 1.
|
|
123
125
|
|
|
124
126
|
## For AI agents
|
|
125
127
|
|
|
@@ -135,7 +137,7 @@ npx skills add FortripEngineering/fortrip --skill fortrip-cli
|
|
|
135
137
|
|
|
136
138
|
Fortrip's hosted MCP server is `https://mcp.fortrip.ai/`. It has eight tools:
|
|
137
139
|
`search_hotels`, `get_hotel`, `get_hotel_offers`,
|
|
138
|
-
`
|
|
140
|
+
`create_order`, `get_order`, `list_orders`, `cancel_order` and `pay_order`.
|
|
139
141
|
|
|
140
142
|
Clients that support remote MCP servers with OAuth don't need the CLI: add
|
|
141
143
|
`https://mcp.fortrip.ai/` as a remote server and sign in to Fortrip in the
|
|
@@ -146,15 +148,26 @@ Clients that start local servers can run the CLI as a bridge. `fortrip mcp`
|
|
|
146
148
|
runs an MCP server on stdio that forwards to the hosted server with your saved
|
|
147
149
|
sign-in.
|
|
148
150
|
|
|
151
|
+
A tool's result is one block of text, the same from the bridge as from the
|
|
152
|
+
hosted server; an error is a tool error (`isError: true`) whose one block of
|
|
153
|
+
text says what happened and what to do next, with Fortrip's error envelope in
|
|
154
|
+
`_meta["ai.fortrip/error"]`. For the JSON of a result, use a command with
|
|
155
|
+
`--json`.
|
|
156
|
+
|
|
149
157
|
You can add the bridge to a client before you sign in: signed out, it still
|
|
150
158
|
starts and lists its tools. A tool call is then answered with a tool error
|
|
151
|
-
(`isError: true`, code `unauthenticated`) whose
|
|
159
|
+
(`isError: true`, code `unauthenticated`) whose text says to run
|
|
152
160
|
`npx -y fortrip login` in a terminal, or to open the sign-in link it names and
|
|
153
161
|
approve it. Once you have, the next tool call works, with no restart. If a
|
|
154
162
|
sign-in stops working later, only the request that hit it fails, the same way
|
|
155
163
|
for a tool call; any other request that hits a sign-in problem gets the
|
|
156
164
|
JSON-RPC error `-32001` instead. The server keeps running.
|
|
157
165
|
|
|
166
|
+
When this version of the CLI is too old for Fortrip, a tool call is answered
|
|
167
|
+
with the tool error `client_outdated`, whose text says so and gives the
|
|
168
|
+
command that updates the CLI. Update it, then restart the server in your
|
|
169
|
+
client.
|
|
170
|
+
|
|
158
171
|
Claude Desktop (Settings, Developer, Edit Config; on macOS
|
|
159
172
|
`~/Library/Application Support/Claude/claude_desktop_config.json`, on Windows
|
|
160
173
|
`%APPDATA%\Claude\claude_desktop_config.json`) and Cursor (`~/.cursor/mcp.json`,
|
|
@@ -212,9 +225,10 @@ that starts with `local_`.
|
|
|
212
225
|
|---|---|
|
|
213
226
|
| 0 | Success |
|
|
214
227
|
| 1 | Any other error, including the answers of the API that aren't mistakes in the request, such as `destination_ambiguous` or `offer_changed` (`retryable` says whether it is worth one retry) |
|
|
215
|
-
| 2 | Invalid arguments (local, or the API's `invalid_request`) |
|
|
228
|
+
| 2 | Invalid arguments (local, or the API's `invalid_request`). Found locally, nothing is sent, and each issue names its flag (`--total is required`), or its JSON Pointer when the value came from `--body` |
|
|
216
229
|
| 3 | Not signed in, or the sign-in wasn't accepted; `loginUrl` on stderr |
|
|
217
|
-
| 4 | Rate limited (`retryAfterSeconds`
|
|
230
|
+
| 4 | Rate limited: stderr says when to retry (`Retryable: retry after 7 s.`; `retryAfterSeconds` with `--json`) |
|
|
231
|
+
| 5 | This version of the CLI is too old for Fortrip (`client_outdated`): stderr is Fortrip's message, with the command that updates the CLI. Update it, then run the command again |
|
|
218
232
|
|
|
219
233
|
## Support
|
|
220
234
|
|
package/THIRD-PARTY-NOTICES
CHANGED
|
@@ -28,29 +28,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
28
28
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
29
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
30
|
SOFTWARE.
|
|
31
|
-
|
|
32
|
-
================================================================================
|
|
33
|
-
uqr 0.1.3 (MIT)
|
|
34
|
-
--------------------------------------------------------------------------------
|
|
35
|
-
MIT License
|
|
36
|
-
|
|
37
|
-
Copyright (c) Project Nayuki
|
|
38
|
-
Copyright (c) 2023 Anthony Fu <https://github.com/antfu>
|
|
39
|
-
|
|
40
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
41
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
42
|
-
in the Software without restriction, including without limitation the rights
|
|
43
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
44
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
45
|
-
furnished to do so, subject to the following conditions:
|
|
46
|
-
|
|
47
|
-
The above copyright notice and this permission notice shall be included in all
|
|
48
|
-
copies or substantial portions of the Software.
|
|
49
|
-
|
|
50
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
51
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
52
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
53
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
54
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
55
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
56
|
-
SOFTWARE.
|