fortrip 4.3.1 → 5.0.0-rc.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 +16 -24
- package/dist/{chunk-63KHFEME.js → chunk-GZSRXWVN.js} +281 -287
- package/dist/cli.js +103 -48
- package/dist/{mcp-bridge-2GXFE2SC.js → mcp-bridge-IK2S4XXQ.js} +7 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -82,12 +82,11 @@ 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>` |
|
|
85
|
+
| `orders cancel <orderId>` | With the penalty the user agreed to (--max-penalty) it cancels a paid order under its terms, and --close closes an unpaid one; with neither it changes nothing and shows what the order allows |
|
|
86
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 |
|
|
90
|
-
| `guide [topic]` | Print the guide for AI agents (Markdown); `fortrip guide planning` prints the planning guide |
|
|
91
90
|
| `mcp` | Run an MCP server over stdio for local clients, bridged to Fortrip's hosted server |
|
|
92
91
|
|
|
93
92
|
```bash
|
|
@@ -107,32 +106,26 @@ same.
|
|
|
107
106
|
`hotels book` creates an unpaid order and prints a payment link for it.
|
|
108
107
|
Nothing is charged until the person pays on the page the link opens, or
|
|
109
108
|
approves a shared payment token for `orders pay` in their wallet, or
|
|
110
|
-
scans the WeChat Pay code or opens the Alipay link that
|
|
111
|
-
prints. Orders
|
|
112
|
-
are paid in
|
|
109
|
+
scans the WeChat Pay code or opens the Alipay link that
|
|
110
|
+
`orders pay --method stripe_alipay_wechat_pay` prints. Orders
|
|
111
|
+
are paid in the currency of the offers they come from (`--currency`).
|
|
113
112
|
|
|
114
113
|
`orders get` and `orders list` say of each order whether it can be cancelled
|
|
115
114
|
now and, if so, the penalty under its terms and the refund.
|
|
116
115
|
`orders cancel <orderId> --max-penalty <amount>` cancels it, with the penalty
|
|
117
116
|
the person agreed to exactly as shown; if the penalty has gone up since,
|
|
118
|
-
nothing changes and the command exits 1 with `cancellation_changed`.
|
|
119
|
-
|
|
120
|
-
and
|
|
117
|
+
nothing changes and the command exits 1 with `cancellation_changed`. An
|
|
118
|
+
unpaid order is closed instead, once the person says they no longer want it:
|
|
119
|
+
`orders cancel <orderId> --close` closes it, nothing is charged, and it
|
|
120
|
+
becomes `expired`. Without `--max-penalty` or `--close` it changes nothing:
|
|
121
|
+
it prints the order's penalty and refund, or that it can be closed, and
|
|
122
|
+
exits 2.
|
|
121
123
|
|
|
122
124
|
## For AI agents
|
|
123
125
|
|
|
124
|
-
|
|
125
|
-
npx -y fortrip guide # when to use the CLI, call order, sign-in, what to show before a payment link
|
|
126
|
-
npx -y fortrip guide planning # flexible dates, budgets, split stays, several destinations
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Both print Markdown, with `fortrip@latest` replaced by the running version, so
|
|
130
|
-
an agent keeps using the same CLI for the whole conversation. The guide is
|
|
131
|
-
written once in
|
|
126
|
+
The agent guide is written once in
|
|
132
127
|
[`@fortrip/agent-contract`](https://github.com/FortripEngineering/fortrip/tree/main/packages/contract/guide)
|
|
133
|
-
and
|
|
134
|
-
|
|
135
|
-
For agents that can run shell commands, the same guide is also a skill:
|
|
128
|
+
and ships as a skill, with the planning guide as `references/planning.md`:
|
|
136
129
|
|
|
137
130
|
```bash
|
|
138
131
|
npx skills add FortripEngineering/fortrip --skill fortrip-cli
|
|
@@ -140,8 +133,8 @@ npx skills add FortripEngineering/fortrip --skill fortrip-cli
|
|
|
140
133
|
|
|
141
134
|
## MCP server
|
|
142
135
|
|
|
143
|
-
Fortrip's hosted MCP server is `https://mcp.fortrip.ai/`. It has
|
|
144
|
-
`
|
|
136
|
+
Fortrip's hosted MCP server is `https://mcp.fortrip.ai/`. It has eight tools:
|
|
137
|
+
`search_hotels`, `get_hotel`, `get_hotel_offers`,
|
|
145
138
|
`book_hotel`, `get_order`, `list_orders`, `cancel_order` and `pay_order`.
|
|
146
139
|
|
|
147
140
|
Clients that support remote MCP servers with OAuth don't need the CLI: add
|
|
@@ -200,14 +193,13 @@ args = ["-y", "fortrip", "mcp"]
|
|
|
200
193
|
| `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
194
|
| `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
195
|
| `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
|
-
| `
|
|
196
|
+
| `FORTRIP_CURRENCY` | The default `--currency` for `hotels search` and `hotels offers` (`USD` or `CNY`, where available). Prices are in this currency, and an order made from the offers is paid in it. |
|
|
204
197
|
|
|
205
198
|
## Output and exit codes
|
|
206
199
|
|
|
207
200
|
A command prints its result as compact text on stdout, the same text the MCP
|
|
208
201
|
tools return. With `--json` (anywhere before `--`) it prints the API's JSON
|
|
209
|
-
instead, on one line. `
|
|
210
|
-
stdio.
|
|
202
|
+
instead, on one line. `fortrip mcp` speaks MCP over stdio.
|
|
211
203
|
|
|
212
204
|
Errors go to stderr, as text, or with `--json` as one line of JSON:
|
|
213
205
|
`{ "error": { "code", "message", "retryable", "requestId", … } }`, Fortrip's
|