@fortrip/agent-contract 1.0.0-rc.1 → 2.0.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/LICENSE +202 -21
- package/NOTICE +4 -0
- package/README.md +27 -6
- package/dist/index.d.ts +20 -8
- package/dist/index.js +55 -38
- package/package.json +11 -11
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@ paths, error reasons and field rules that the Fortrip CLI (`fortrip`), the
|
|
|
5
5
|
hosted MCP server and the store listings all share, so they cannot drift
|
|
6
6
|
apart.
|
|
7
7
|
|
|
8
|
-
It has one peer dependency, `zod` (4.4
|
|
9
|
-
ES2023 does.
|
|
10
|
-
`/api/agent/v1`.
|
|
8
|
+
It has one peer dependency, `zod` (`^4.4.0`), and runs anywhere
|
|
9
|
+
ES2023 does. Its major version changes when the contract breaks, not with
|
|
10
|
+
the API: `2.x` serves `/api/agent/v1`.
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
13
|
import { API, LIMITS, containsCardNumber } from "@fortrip/agent-contract";
|
|
@@ -16,10 +16,31 @@ API.search; // "/api/agent/v1/hotels/search"
|
|
|
16
16
|
LIMITS.rooms; // 8
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
It exports:
|
|
20
|
+
|
|
21
|
+
- `API`, `LIMITS`, `BOARD_CODES`, `CURRENCIES`, `SEARCH_SORTS` and
|
|
22
|
+
`ERROR_REASONS`: paths, limits and error reasons;
|
|
23
|
+
- `searchHotelsInput`, `getHotelInput`, `getRatesInput` and
|
|
24
|
+
`createBookingInput`, the zod schemas of the requests, and `bookingResult`,
|
|
25
|
+
`meResult` and `authConfig`, those of responses;
|
|
26
|
+
- `COMMANDS`, `COMMAND_GROUPS` and `GLOBAL_FLAGS`, the CLI's commands, the
|
|
27
|
+
groups they are typed after and its flags, `commandInvocation(spec)`, a
|
|
28
|
+
command as it is typed (`fortrip hotels search`), and `TOOLS`, the MCP
|
|
29
|
+
tools;
|
|
30
|
+
- `renderGuide(surface, topic)`, the agent guide as Markdown for `"mcp"`,
|
|
31
|
+
`"claude-skill"` or `"cli"`;
|
|
32
|
+
- field rules such as `containsCardNumber`, the guest-name rule and the date
|
|
33
|
+
helpers, and `CONTRACT_VERSION`.
|
|
34
|
+
|
|
19
35
|
Browser code that only needs the guest-name rule (`GUEST_NAME_PATTERN`,
|
|
20
36
|
`GUEST_NAME_TITLE`, `GUEST_NAME_MESSAGE`, `guestNameRe`, `normalizeGuestName`)
|
|
21
37
|
can import it from `@fortrip/agent-contract/guest-name`. That module imports
|
|
22
|
-
|
|
23
|
-
load. The root entry exports the same names.
|
|
38
|
+
no package, so it does not pull in `zod` or the schemas the root entry builds
|
|
39
|
+
at load. The root entry exports the same names.
|
|
24
40
|
|
|
25
|
-
|
|
41
|
+
Apache License 2.0 (versions before 2.0.0: MIT). Copyright 2026 FortripAI, Inc.
|
|
42
|
+
"Fortrip" is a trademark of FortripAI, Inc. The license does not grant
|
|
43
|
+
permission to use the trade names, trademarks, service marks or product names
|
|
44
|
+
of FortripAI, Inc., except as required for reasonable and customary use in
|
|
45
|
+
describing the origin of the software and reproducing the content of the NOTICE
|
|
46
|
+
file (section 6). Source: <https://github.com/FortripEngineering/fortrip/tree/main/packages/contract>.
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare const CARD_NUMBER_MESSAGE = "This looks like a payment card number. Paym
|
|
|
24
24
|
*/
|
|
25
25
|
declare function containsCardNumber(text: string, minDigits?: number): boolean;
|
|
26
26
|
|
|
27
|
-
type ToolName = "get_planning_guide" | "search_hotels" | "get_hotel" | "
|
|
27
|
+
type ToolName = "get_planning_guide" | "search_hotels" | "get_hotel" | "get_hotel_rates" | "book_hotel";
|
|
28
28
|
interface ToolSpec {
|
|
29
29
|
name: ToolName;
|
|
30
30
|
title: string;
|
|
@@ -69,10 +69,10 @@ declare const MCP_RATES_INPUT: z.ZodObject<{
|
|
|
69
69
|
freeCancellation: z.ZodOptional<z.ZodBoolean>;
|
|
70
70
|
maxRoomsPerHotel: z.ZodDefault<z.ZodNumber>;
|
|
71
71
|
}, z.core.$strict>;
|
|
72
|
-
/** Rides on every
|
|
72
|
+
/** Rides on every book_hotel answer: some clients never show the model
|
|
73
73
|
* the server instructions. */
|
|
74
74
|
declare const BOOKING_NEXT_STEP = "Show the user amount, currency, the stay (hotel, room, dates, rooms, guests per room) and every item in terms (meals, cancellation, confirmation, pay-at-hotel fees), then end your reply by asking them to confirm. Only after they say yes, give them paymentUrl exactly as returned.";
|
|
75
|
-
/**
|
|
75
|
+
/** book_hotel's answer over MCP: the booking result plus `nextStep`. */
|
|
76
76
|
declare const MCP_BOOKING_RESULT: z.ZodObject<{
|
|
77
77
|
agentOrderId: z.ZodString;
|
|
78
78
|
paymentUrl: z.ZodString;
|
|
@@ -151,8 +151,16 @@ interface OptionSpec {
|
|
|
151
151
|
placeholder?: string;
|
|
152
152
|
description: string;
|
|
153
153
|
}
|
|
154
|
+
/** A product category's commands, typed after its name: `fortrip hotels`. */
|
|
155
|
+
interface CommandGroupSpec {
|
|
156
|
+
name: "hotels";
|
|
157
|
+
summary: string;
|
|
158
|
+
}
|
|
154
159
|
interface CommandSpec {
|
|
155
|
-
|
|
160
|
+
/** The group it is typed after; `null` for a command typed on its own. */
|
|
161
|
+
group: CommandGroupSpec["name"] | null;
|
|
162
|
+
/** Unique within its group. */
|
|
163
|
+
name: "search" | "get" | "rates" | "book" | "login" | "logout" | "whoami" | "guide" | "mcp";
|
|
156
164
|
summary: string;
|
|
157
165
|
/** The MCP tool the command mirrors; `null` for one that is the CLI's own. */
|
|
158
166
|
tool: ToolName | null;
|
|
@@ -163,7 +171,11 @@ interface CommandSpec {
|
|
|
163
171
|
/** Options that are not input fields, such as `--body`. */
|
|
164
172
|
options?: readonly OptionSpec[];
|
|
165
173
|
}
|
|
174
|
+
declare const COMMAND_GROUPS: readonly CommandGroupSpec[];
|
|
166
175
|
declare const COMMANDS: readonly CommandSpec[];
|
|
176
|
+
/** `fortrip hotels search`, `fortrip login`: a command as it is typed,
|
|
177
|
+
* without its arguments. */
|
|
178
|
+
declare function commandInvocation(spec: Pick<CommandSpec, "group" | "name">): string;
|
|
167
179
|
/** Options of the CLI itself: `--help` after any command, `--version` on its own. */
|
|
168
180
|
declare const GLOBAL_FLAGS: readonly OptionSpec[];
|
|
169
181
|
|
|
@@ -229,7 +241,7 @@ declare const getHotelInput: z.ZodObject<{
|
|
|
229
241
|
hotelId: z.ZodCoercedNumber<unknown>;
|
|
230
242
|
includeRooms: z.ZodOptional<z.ZodBoolean>;
|
|
231
243
|
}, z.core.$strip>;
|
|
232
|
-
/** `POST /api/agent/v1/hotels/rates` and the MCP `
|
|
244
|
+
/** `POST /api/agent/v1/hotels/rates` and the MCP `get_hotel_rates` arguments. */
|
|
233
245
|
declare const getRatesInput: z.ZodObject<{
|
|
234
246
|
hotelIds: z.ZodArray<z.ZodNumber>;
|
|
235
247
|
checkIn: z.ZodString;
|
|
@@ -258,7 +270,7 @@ declare const getRatesInput: z.ZodObject<{
|
|
|
258
270
|
maxRoomsPerHotel: z.ZodDefault<z.ZodNumber>;
|
|
259
271
|
}, z.core.$strict>;
|
|
260
272
|
/**
|
|
261
|
-
* `POST /api/agent/v1/hotels/bookings` and the MCP `
|
|
273
|
+
* `POST /api/agent/v1/hotels/bookings` and the MCP `book_hotel`
|
|
262
274
|
* arguments. The booking action validates guest names (Latin letters) and
|
|
263
275
|
* the room assignment again. Occupancy is per room, every room the same.
|
|
264
276
|
* Unknown keys are refused, not dropped: a misspelled `children` would
|
|
@@ -323,7 +335,7 @@ declare const SEARCH_SORTS: readonly ["recommended", "price-asc", "price-desc",
|
|
|
323
335
|
declare const SUPPORT_EMAIL = "info@fortrip.ai";
|
|
324
336
|
|
|
325
337
|
/**
|
|
326
|
-
* What `
|
|
338
|
+
* What `book_hotel` / `POST /api/agent/v1/hotels/bookings` answers with.
|
|
327
339
|
* Its JSON Schema allows no other keys, so a caller that parses its answer
|
|
328
340
|
* through this schema drops a field the server adds until it is added here,
|
|
329
341
|
* rather than failing a strict client's validation. The MCP tool adds a
|
|
@@ -419,4 +431,4 @@ declare const ERROR_REASONS: {
|
|
|
419
431
|
/** The contract's version, from package.json, the one place a release bumps it. */
|
|
420
432
|
declare const CONTRACT_VERSION: string;
|
|
421
433
|
|
|
422
|
-
export { API, type AuthConfig, BOARD_CODES, BOOKING_NEXT_STEP, type BookingResult, CARD_NUMBER_MESSAGE, COMMANDS, CONTRACT_VERSION, CURRENCIES, type CommandSpec, type CreateBookingInput, type CreateBookingParsed, ERROR_REASONS, type ErrorReason, type FlagSpec, GLOBAL_FLAGS, type GetHotelInput, type GetHotelParsed, type GetRatesInput, type GetRatesParsed, type GuideSurface, type GuideTopic, LIMITS, MCP_BOOKING_RESULT, MCP_RATES_INPUT, type MeResult, type OptionSpec, SEARCH_SORTS, SUPPORT_EMAIL, type SearchHotelsInput, type SearchHotelsParsed, TOOLS, type ToolName, type ToolSpec, addIsoDateDays, authConfig, bookingResult, childrenAges, containsCardNumber, countIsoDateDays, createBookingInput, flag, getHotelInput, getRatesInput, isIsoDate, isoDate, meResult, nonEmpty, oneOf, positiveId, renderGuide, searchHotelsInput, strictInput, text, wholeNumber };
|
|
434
|
+
export { API, type AuthConfig, BOARD_CODES, BOOKING_NEXT_STEP, type BookingResult, CARD_NUMBER_MESSAGE, COMMANDS, COMMAND_GROUPS, CONTRACT_VERSION, CURRENCIES, type CommandGroupSpec, type CommandSpec, type CreateBookingInput, type CreateBookingParsed, ERROR_REASONS, type ErrorReason, type FlagSpec, GLOBAL_FLAGS, type GetHotelInput, type GetHotelParsed, type GetRatesInput, type GetRatesParsed, type GuideSurface, type GuideTopic, LIMITS, MCP_BOOKING_RESULT, MCP_RATES_INPUT, type MeResult, type OptionSpec, SEARCH_SORTS, SUPPORT_EMAIL, type SearchHotelsInput, type SearchHotelsParsed, TOOLS, type ToolName, type ToolSpec, addIsoDateDays, authConfig, bookingResult, childrenAges, commandInvocation, containsCardNumber, countIsoDateDays, createBookingInput, flag, getHotelInput, getRatesInput, isIsoDate, isoDate, meResult, nonEmpty, oneOf, positiveId, renderGuide, searchHotelsInput, strictInput, text, wholeNumber };
|
package/dist/index.js
CHANGED
|
@@ -339,20 +339,20 @@ var roomNoError = `roomNo must be a whole number from 1 to ${LIMITS.rooms}`;
|
|
|
339
339
|
var contactEmailError = "contactEmail must be an email address";
|
|
340
340
|
var createBookingInput = strictInput({
|
|
341
341
|
hotelId: positiveId("hotelId").describe("Hotel id."),
|
|
342
|
-
roomId: nonEmpty("roomId").describe("roomId from
|
|
342
|
+
roomId: nonEmpty("roomId").describe("roomId from get_hotel_rates"),
|
|
343
343
|
ratePlanCode: nonEmpty("ratePlanCode").describe(
|
|
344
|
-
"ratePlanCode from
|
|
344
|
+
"ratePlanCode from get_hotel_rates"
|
|
345
345
|
),
|
|
346
346
|
checkIn: isoDate("checkIn").describe(stayDescriptions.checkIn),
|
|
347
347
|
checkOut: isoDate("checkOut").describe(stayDescriptions.checkOut),
|
|
348
348
|
rooms: wholeNumber("rooms", 1, LIMITS.rooms).describe(
|
|
349
|
-
"Number of rooms, as in
|
|
349
|
+
"Number of rooms, as in get_hotel_rates; every room has the same occupancy"
|
|
350
350
|
),
|
|
351
351
|
adults: wholeNumber("adults (per room)", 1, LIMITS.adultsPerRoom).describe(
|
|
352
|
-
"Adults per room, not in total, as in
|
|
352
|
+
"Adults per room, not in total, as in get_hotel_rates (2 rooms for 4 adults = rooms 2, adults 2)"
|
|
353
353
|
),
|
|
354
354
|
childrenAges: childrenAges(LIMITS.childrenPerRoom).default([]).describe(
|
|
355
|
-
"Age of each child in one room (0-17), per room, as in
|
|
355
|
+
"Age of each child in one room (0-17), per room, as in get_hotel_rates"
|
|
356
356
|
),
|
|
357
357
|
guests: z2.array(
|
|
358
358
|
strictInput({
|
|
@@ -473,7 +473,7 @@ var ratesFlags = flagsOf(getRatesInput, [
|
|
|
473
473
|
type: "id",
|
|
474
474
|
multiple: true,
|
|
475
475
|
placeholder: ID,
|
|
476
|
-
description: `Hotels to price, by id from \`search\`: repeat the flag or comma-separate, up to ${LIMITS.ratesHotels}. Each call takes about 15 seconds.`
|
|
476
|
+
description: `Hotels to price, by id from \`hotels search\`: repeat the flag or comma-separate, up to ${LIMITS.ratesHotels}. Each call takes about 15 seconds.`
|
|
477
477
|
},
|
|
478
478
|
{ flag: "check-in", field: "checkIn", type: "string", placeholder: DATE },
|
|
479
479
|
{ flag: "check-out", field: "checkOut", type: "string", placeholder: DATE },
|
|
@@ -533,14 +533,14 @@ var bookFlags = flagsOf(createBookingInput, [
|
|
|
533
533
|
field: "roomId",
|
|
534
534
|
type: "string",
|
|
535
535
|
placeholder: ID,
|
|
536
|
-
description: "`roomId` from `rates`"
|
|
536
|
+
description: "`roomId` from `hotels rates`"
|
|
537
537
|
},
|
|
538
538
|
{
|
|
539
539
|
flag: "rate-plan",
|
|
540
540
|
field: "ratePlanCode",
|
|
541
541
|
type: "string",
|
|
542
542
|
placeholder: "<code>",
|
|
543
|
-
description: "`ratePlanCode` from `rates`"
|
|
543
|
+
description: "`ratePlanCode` from `hotels rates`"
|
|
544
544
|
},
|
|
545
545
|
{ flag: "check-in", field: "checkIn", type: "string", placeholder: DATE },
|
|
546
546
|
{ flag: "check-out", field: "checkOut", type: "string", placeholder: DATE },
|
|
@@ -549,14 +549,14 @@ var bookFlags = flagsOf(createBookingInput, [
|
|
|
549
549
|
field: "rooms",
|
|
550
550
|
type: "number",
|
|
551
551
|
placeholder: COUNT,
|
|
552
|
-
description: "Number of rooms, as in `rates`; every room has the same occupancy"
|
|
552
|
+
description: "Number of rooms, as in `hotels rates`; every room has the same occupancy"
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
flag: "adults",
|
|
556
556
|
field: "adults",
|
|
557
557
|
type: "number",
|
|
558
558
|
placeholder: COUNT,
|
|
559
|
-
description: "Adults per room, not in total, as in `rates` (2 rooms for 4 adults = `--rooms 2 --adults 2`)"
|
|
559
|
+
description: "Adults per room, not in total, as in `hotels rates` (2 rooms for 4 adults = `--rooms 2 --adults 2`)"
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
562
|
flag: "child-age",
|
|
@@ -564,7 +564,7 @@ var bookFlags = flagsOf(createBookingInput, [
|
|
|
564
564
|
type: "number",
|
|
565
565
|
multiple: true,
|
|
566
566
|
placeholder: "<age>",
|
|
567
|
-
description: "Age of each child in one room (0-17), per room, as in `rates`"
|
|
567
|
+
description: "Age of each child in one room (0-17), per room, as in `hotels rates`"
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
570
|
flag: "guest",
|
|
@@ -605,8 +605,12 @@ var BODY_OPTION = {
|
|
|
605
605
|
placeholder: "<json|@file.json>",
|
|
606
606
|
description: "The raw request body as a JSON object, or `@file.json` to read it from a file. Flags override its fields."
|
|
607
607
|
};
|
|
608
|
+
var COMMAND_GROUPS = [
|
|
609
|
+
{ name: "hotels", summary: "Search, price and book hotels" }
|
|
610
|
+
];
|
|
608
611
|
var COMMANDS = [
|
|
609
612
|
{
|
|
613
|
+
group: "hotels",
|
|
610
614
|
name: "search",
|
|
611
615
|
summary: "Find hotels with indicative prices",
|
|
612
616
|
tool: "search_hotels",
|
|
@@ -614,27 +618,31 @@ var COMMANDS = [
|
|
|
614
618
|
options: [BODY_OPTION]
|
|
615
619
|
},
|
|
616
620
|
{
|
|
617
|
-
|
|
621
|
+
group: "hotels",
|
|
622
|
+
name: "get",
|
|
618
623
|
summary: "Static hotel detail: description, policies, facilities and photos",
|
|
619
624
|
tool: "get_hotel",
|
|
620
625
|
flags: hotelFlags,
|
|
621
626
|
positionals: ["hotelId"]
|
|
622
627
|
},
|
|
623
628
|
{
|
|
629
|
+
group: "hotels",
|
|
624
630
|
name: "rates",
|
|
625
631
|
summary: `Live rooms and rates for up to ${LIMITS.ratesHotels} hotels`,
|
|
626
|
-
tool: "
|
|
632
|
+
tool: "get_hotel_rates",
|
|
627
633
|
flags: ratesFlags,
|
|
628
634
|
options: [BODY_OPTION]
|
|
629
635
|
},
|
|
630
636
|
{
|
|
637
|
+
group: "hotels",
|
|
631
638
|
name: "book",
|
|
632
639
|
summary: "Create an order and get a payment link",
|
|
633
|
-
tool: "
|
|
640
|
+
tool: "book_hotel",
|
|
634
641
|
flags: bookFlags,
|
|
635
642
|
options: [BODY_OPTION]
|
|
636
643
|
},
|
|
637
644
|
{
|
|
645
|
+
group: null,
|
|
638
646
|
name: "login",
|
|
639
647
|
summary: "Sign in through the browser (device code)",
|
|
640
648
|
tool: null,
|
|
@@ -648,18 +656,21 @@ var COMMANDS = [
|
|
|
648
656
|
]
|
|
649
657
|
},
|
|
650
658
|
{
|
|
659
|
+
group: null,
|
|
651
660
|
name: "logout",
|
|
652
661
|
summary: "Revoke and forget the saved token",
|
|
653
662
|
tool: null,
|
|
654
663
|
flags: []
|
|
655
664
|
},
|
|
656
665
|
{
|
|
666
|
+
group: null,
|
|
657
667
|
name: "whoami",
|
|
658
668
|
summary: "Show the signed-in account",
|
|
659
669
|
tool: null,
|
|
660
670
|
flags: []
|
|
661
671
|
},
|
|
662
672
|
{
|
|
673
|
+
group: null,
|
|
663
674
|
name: "guide",
|
|
664
675
|
summary: "Print the guide for AI agents (Markdown)",
|
|
665
676
|
tool: "get_planning_guide",
|
|
@@ -667,18 +678,22 @@ var COMMANDS = [
|
|
|
667
678
|
positionals: ["topic"]
|
|
668
679
|
},
|
|
669
680
|
{
|
|
681
|
+
group: null,
|
|
670
682
|
name: "mcp",
|
|
671
683
|
summary: "Run an MCP server over stdio for local clients, bridged to Fortrip's hosted server",
|
|
672
684
|
tool: null,
|
|
673
685
|
flags: []
|
|
674
686
|
}
|
|
675
687
|
];
|
|
688
|
+
function commandInvocation(spec) {
|
|
689
|
+
return spec.group === null ? `fortrip ${spec.name}` : `fortrip ${spec.group} ${spec.name}`;
|
|
690
|
+
}
|
|
676
691
|
var GLOBAL_FLAGS = [
|
|
677
692
|
{
|
|
678
693
|
flag: "help",
|
|
679
694
|
short: "h",
|
|
680
695
|
type: "boolean",
|
|
681
|
-
description: "Show help for the command, or for the CLI when no command is given."
|
|
696
|
+
description: "Show help for the command or group, or for the CLI when no command is given."
|
|
682
697
|
},
|
|
683
698
|
{
|
|
684
699
|
flag: "version",
|
|
@@ -690,16 +705,16 @@ var GLOBAL_FLAGS = [
|
|
|
690
705
|
|
|
691
706
|
// src/guide-data.generated.ts
|
|
692
707
|
var FRAGMENTS = {
|
|
693
|
-
"booking": '{{#if claude-skill cli}}\n## Booking\n\n{{/if}}\n- Call `{{tool:book}}` only for the rate the user picked{{#if claude-skill cli}}, with exactly the hotel, `{{arg:roomId}}`, `{{arg:ratePlanCode}}`, dates, `{{arg:rooms}}`, `{{arg:adults}}` and `{{arg:childrenAges}}` used in `{{tool:rates}}`{{/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 "First Last"` (the last word is the last name; `"First Last:2"` puts the guest in room 2){{/if}}.{{#if claude-skill cli}} At least one guest per room, no more than the room sleeps.{{/if}}\n{{#if claude-skill cli}}\n- A contact name (up to {{limit:contactName}} characters) and phone ({{limit:contactPhoneMin}}\u2013{{limit:contactPhoneMax}} characters) are required; an email is optional. Special requests must be in English and aren\'t guaranteed.\n- One booking covers at most {{limit:nights}} nights; book a longer stay as separate bookings.\n{{/if}}\n- The `{{arg:nationality}}` given to `{{tool:rates}}` isn\'t sent with the booking: a rate restricted by nationality may change or be refused.\n- `{{tool:book}}` can take up to 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 resumes the same order{{#if claude-skill cli}}, with the same or a refreshed payment link{{/if}}.\n{{#if cli}}\n- `{{tool:book}}` takes only these fields: a `--body` with any other field (such as `nationality`) is rejected with exit 2.\n{{/if}}\n',
|
|
694
|
-
"errors": "{{#if claude-skill cli}}\n## Errors\n\n{{#if claude-skill}}A tool error{{/if}}{{#if cli}}An error on stderr{{/if}} carries `error` (what went wrong) and `status`, and most carry a `reason`:\n\n| `reason` | Do this |\n|---|---|\n| `already_booked` (409) | This stay is already paid or completed: show `orderUrl` and don't book again |\n| `price_or_terms_changed` (409) | The rate changed; `changes` says how. Show the user what changed and re-run `{{tool:rates}}`; if they still want it, call `{{tool:book}}` again and confirm the new price and terms before giving the link |\n| `rate_unavailable` (422) | The rate can no longer be booked: re-run `{{tool:rates}}` and let the user choose again |\n| `supplier_unavailable` (503 or 504) | Wait `retryAfterSeconds` and retry once with the same details; if it fails again, tell the user |\n| `refused` (422) | The booking was refused (a guest name, too many attempts, bookings paused): read `error` and explain it to the user |\n{{#if claude-skill}}\n\nWithout a `reason`:\n\n- **429**: wait `retryAfterSeconds`, then retry once.\n- **503** with `retryable: true` is a brief failure on Fortrip's side (for example, the same booking started twice at once): wait `retryAfterSeconds`, then retry once with the same details.\n- **500** and **502** are generic failures: read `error` and tell the user instead of guessing.\n{{/if}}\n{{/if}}\n",
|
|
708
|
+
"booking": '{{#if claude-skill cli}}\n## Booking\n\n{{/if}}\n- Call `{{tool:hotels book}}` only for the rate the user picked{{#if claude-skill cli}}, with exactly the hotel, `{{arg:roomId}}`, `{{arg:ratePlanCode}}`, dates, `{{arg:rooms}}`, `{{arg:adults}}` and `{{arg:childrenAges}}` used in `{{tool:hotels rates}}`{{/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 "First Last"` (the last word is the last name; `"First Last:2"` puts the guest in room 2){{/if}}.{{#if claude-skill cli}} At least one guest per room, no more than the room sleeps.{{/if}}\n{{#if claude-skill cli}}\n- A contact name (up to {{limit:contactName}} characters) and phone ({{limit:contactPhoneMin}}\u2013{{limit:contactPhoneMax}} characters) are required; an email is optional. Special requests must be in English and aren\'t guaranteed.\n- One booking covers at most {{limit:nights}} nights; book a longer stay as separate bookings.\n{{/if}}\n- The `{{arg:nationality}}` given to `{{tool:hotels rates}}` isn\'t sent with the booking: a rate restricted by nationality may change or be refused.\n- `{{tool:hotels book}}` can take up to 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 resumes the same order{{#if claude-skill cli}}, with the same or a refreshed payment link{{/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',
|
|
709
|
+
"errors": "{{#if claude-skill cli}}\n## Errors\n\n{{#if claude-skill}}A tool error{{/if}}{{#if cli}}An error on stderr{{/if}} carries `error` (what went wrong) and `status`, and most carry a `reason`:\n\n| `reason` | Do this |\n|---|---|\n| `already_booked` (409) | This stay is already paid or completed: show `orderUrl` and don't book again |\n| `price_or_terms_changed` (409) | The rate changed; `changes` says how. Show the user what changed and re-run `{{tool:hotels rates}}`; if they still want it, call `{{tool:hotels book}}` again and confirm the new price and terms before giving the link |\n| `rate_unavailable` (422) | The rate can no longer be booked: re-run `{{tool:hotels rates}}` and let the user choose again |\n| `supplier_unavailable` (503 or 504) | Wait `retryAfterSeconds` and retry once with the same details; if it fails again, tell the user |\n| `refused` (422) | The booking was refused (a guest name, too many attempts, bookings paused): read `error` and explain it to the user |\n{{#if claude-skill}}\n\nWithout a `reason`:\n\n- **429**: wait `retryAfterSeconds`, then retry once.\n- **503** with `retryable: true` is a brief failure on Fortrip's side (for example, the same booking started twice at once): wait `retryAfterSeconds`, then retry once with the same details.\n- **500** and **502** are generic failures: read `error` and tell the user instead of guessing.\n{{/if}}\n{{/if}}\n",
|
|
695
710
|
"meals": "{{#if claude-skill cli}}\n## Presenting a rate\n\nGive the user, for each option:\n\n- the meal plan: `boardCode` (RO room only, BB breakfast, HB breakfast + dinner, FB breakfast + lunch + dinner, BL lunch, BD dinner, HBBL breakfast + lunch, HBLD lunch + dinner, AI all inclusive) with `boardCount`, how many guests per room the meal plan covers. Fewer than the adults per room means not everyone gets the meals (BB with `boardCount` 1 for 2 adults is breakfast for 1 of 2): say who is covered;\n- cancellation: `refundable` and `freeCancelUntil`;\n- confirmation: `isInstantConfirm`;\n- any `fees`: taxes paid at the hotel, in their own currency.\n{{/if}}\n",
|
|
696
|
-
"occupancy": "{{#if claude-skill cli}}\n## Occupancy\n\n{{/if}}\n- `{{tool:rates}}` and `{{tool:book}}` both require `{{arg:rooms}}` and `{{arg:adults}}`. `{{arg:adults}}` and `{{arg:childrenAges}}` are **per room**, the same in every room: 2 rooms for 4 adults is {{#if cli}}`--rooms 2 --adults 2`{{/if}}{{#if mcp claude-skill}}`rooms: 2, adults: 2`{{/if}}.\n{{#if claude-skill cli}}\n- If the party doesn't divide evenly across the rooms (3 adults in 2 rooms), ask the user whether to price every room for the larger number or to price and book each occupancy as its own stay.\n- Ask each child's age; `{{tool:rates}}` and `{{tool:book}}` need it.\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:nights}} nights, up to {{limit:ratesHotels}} hotels per `{{tool:rates}}` call.\n{{/if}}\n",
|
|
697
|
-
"order": '{{#if claude-skill cli}}\n## Workflow\n\n1. **Search** with `{{tool:search}}` for candidate hotels and indicative prices. It needs `{{arg:checkIn}}` and `{{arg:checkOut}}`.\n{{#if cli}}\n\n ```bash\n {{tool:search}} --query "Bangkok" --check-in 2026-11-10 --check-out 2026-11-12 \\\n --star-min 4 --sort price-asc --page-size 10\n ```\n\n{{/if}}\n2. **Details** (optional) with `{{tool:
|
|
698
|
-
"payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:book}}` returns `paymentUrl`, `statusUrl`, `orderUrl`, `amount`, `currency`, `terms` and `stay`. Nothing is charged until the user pays.\n\n1. Show the `stay` (hotel, room, dates, nights, rooms, adults and children's ages per room), the `amount` and `currency` to be charged, and every item in `terms`: meal plan (`boardCode` with `boardCount`), cancellation (`refundable`, `freeCancelUntil`, the `cancellation` ladder), confirmation (`isInstantConfirm`, `confirmByMins`) and `payAtHotelFees`.\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then give `paymentUrl` exactly as returned: don't shorten, rebuild or re-encode it. It opens a Fortrip page that recaps the booking and continues to payment on Stripe.\n\n{{/if}}\n{{#if mcp}}\n- Before you give `paymentUrl`, show the user the `stay`, `amount`, `currency` and every item in `terms` that `{{tool:book}}` returned, end that reply by asking the user to confirm, and wait for a clear yes. Then give `paymentUrl` exactly as returned, to this user only: anyone holding it can pay.\n{{/if}}\n- If `amount` or `terms` is null, don't give the link: call `{{tool:book}}` again with the same details, and if either is still null, tell the user to contact {{support}}.\n{{#if claude-skill cli}}\n- `paymentUrl` works like a payment credential: anyone holding it can pay. Give it to this user only, never in shared channels, documents, logs or tickets. It expires about 3 hours 45 minutes after it was created; for a fresh one, call `{{tool:book}}` again with the same details.\n- `statusUrl` is the same page: after payment it shows the booking's confirmation progress, without signing in. `orderUrl` is the user's signed-in order page.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only on the payment page.{{#if claude-skill cli}} A card number in a guest name, the contact name or the special requests is rejected{{#if cli}} with exit 2{{/if}}.{{/if}}\n",
|
|
699
|
-
"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, occupancy per room, confirming the terms `{{tool: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), 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\nOccupancy is per room and the same in every room, so if the party doesn't split evenly across the rooms, ask how it splits.\n\nAsk only for what changes which hotels qualify or how they rank. If children come along, ask each child's age; `{{tool:rates}}` and `{{tool:book}}` need it. Don't ask for trip type or style: infer it from the conversation or leave it general.\n\n## Evidence\n\n- A `{{tool:search}}` price is an indicative minimum, not a quote. Never call a search result available or bookable.\n- Use `{{tool:
|
|
700
|
-
"prices": "{{#if claude-skill cli}}\n## Prices and currency\n\n{{/if}}\n- In `{{tool:rates}}`, `totalPrice` is the whole stay for all rooms, and `dailyPrices` are per room per night.{{#if claude-skill cli}} To compare with a per-night or per-room budget, divide the total by the nights and rooms, or use `dailyPrices`.{{/if}}\n- Pass `{{arg:currency}}`{{#if claude-skill cli}} to `{{tool:search}}` and `{{tool:rates}}`{{/if}}: `CNY` (the default) or `USD`, to suit the user's language or location.{{#if cli}} Without `--currency`, the CLI uses the currency in `--body`, then `FORTRIP_CURRENCY`, then `CNY`.{{/if}}{{#if claude-skill cli}} Prices are converted at Stripe's exchange rate, or a fixed fallback rate when Stripe is unavailable; `fx` says which, and is `null` when nothing needed converting.{{/if}}\n{{#if claude-skill cli}}\n- `{{arg:priceMin}}` and `{{arg:priceMax}}` on `{{tool:search}}` bound the indicative nightly price, in that currency.\n{{/if}}\n- The charge is the `amount` in the `currency` that `{{tool:book}}` returns (currently USD). A converted price is a reference: never present it as the charge.{{#if claude-skill cli}} Stripe's page may also show the charge in the user's local currency, at Stripe's rate. Fees paid at the hotel are separate, in their own currency.{{/if}}\n",
|
|
701
|
-
"scope": "{{#if claude-skill cli}}\n# Fortrip hotel stays\n\n{{/if}}\nFortrip: hotel search, live rates and booking payment links.{{#if claude-skill cli}} Not for flights, activities, or changing or cancelling an existing booking.{{/if}}\n\n{{#if mcp}}\nCall order: `{{tool:search}}` \u2192 (optional) `{{tool:
|
|
702
|
-
"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:search}}`, `{{tool:rates}}` and `{{tool:book}}` also take `--body '<json>'` (or `--body @file.json`), the raw request body; flags override its fields.\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 Fortrip and sign in again.\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 CI or a sandbox 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; JSON on stdout | Continue |\n| 1 | Any other error: an error from Fortrip (see Errors), a network error or a timeout | Read `error` on stderr. If `retryable` is true, wait `retryAfterSeconds` (or a few seconds) and retry once |\n| 2 | Invalid arguments | Fix the flags; stderr `issues` 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",
|
|
711
|
+
"occupancy": "{{#if claude-skill cli}}\n## Occupancy\n\n{{/if}}\n- `{{tool:hotels rates}}` and `{{tool:hotels book}}` both require `{{arg:rooms}}` and `{{arg:adults}}`. `{{arg:adults}}` and `{{arg:childrenAges}}` are **per room**, the same in every room: 2 rooms for 4 adults is {{#if cli}}`--rooms 2 --adults 2`{{/if}}{{#if mcp claude-skill}}`rooms: 2, adults: 2`{{/if}}.\n{{#if claude-skill cli}}\n- If the party doesn't divide evenly across the rooms (3 adults in 2 rooms), ask the user whether to price every room for the larger number or to price and book each occupancy as its own stay.\n- Ask each child's age; `{{tool:hotels rates}}` and `{{tool:hotels book}}` need it.\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:nights}} nights, up to {{limit:ratesHotels}} hotels per `{{tool:hotels rates}}` call.\n{{/if}}\n",
|
|
712
|
+
"order": '{{#if claude-skill cli}}\n## Workflow\n\n1. **Search** with `{{tool:hotels search}}` for candidate hotels and indicative prices. It needs `{{arg:checkIn}}` and `{{arg:checkOut}}`.\n{{#if cli}}\n\n ```bash\n {{tool:hotels search}} --query "Bangkok" --check-in 2026-11-10 --check-out 2026-11-12 \\\n --star-min 4 --sort price-asc --page-size 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 id; otherwise find the hotel with `{{tool:hotels search}}` using the user\'s dates (ask for them if they gave none).\n{{#if cli}}\n\n ```bash\n {{tool:hotels get}} 266000 [--with-rooms]\n ```\n\n{{/if}}\n3. **Rates** with `{{tool:hotels rates}}` for a few shortlisted hotels, using the dates and occupancy the user will book. It takes about 15 seconds. A hotel is available only once this returns a live option for it.\n{{#if cli}}\n\n ```bash\n {{tool:hotels rates}} --hotel 266000 --hotel 266001 --check-in 2026-11-10 \\\n --check-out 2026-11-12 --rooms 1 --adults 2 [--child-age 6] \\\n [--nationality CN] [--board BB] [--free-cancellation] [--currency USD]\n ```\n\n{{/if}}\n4. **Book** with `{{tool:hotels book}}`, once the user has picked one rate and given the guest details (see Booking).\n{{#if cli}}\n\n ```bash\n {{tool:hotels book}} --hotel 266000 --room-id 9191658 --rate-plan "<ratePlanCode>" \\\n --check-in 2026-11-10 --check-out 2026-11-12 --rooms 1 --adults 2 \\\n --guest "John Smith" --contact-name "John Smith" \\\n --contact-phone "+8613800000000" [--contact-email john@example.com]\n ```\n\n{{/if}}\n5. **Confirm, then give the payment link**, as in "Before giving the payment link" below.\n\n## Search\n\n{{/if}}\n- Search prices come from a minimum-price feed, not live rates: quote `{{tool:hotels rates}}` prices, and never call a search result available or bookable.{{#if claude-skill cli}} When you show search prices, say they are indicative minimums, not quotes.{{/if}}\n- A search that matches too many hotels fails with `matched` and `maxMatches`: narrow it{{#if claude-skill cli}} (a city, an area, stars or a price range){{/if}}.\n{{#if claude-skill cli}}\n- Use `{{arg:near}}` for "near X"{{#if cli}} (`lat,lng,radiusKm`){{/if}}, and `{{arg:cityCode}}` when you know the city\'s code.\n- Facility names in `{{arg:facilities}}` must match the catalogue exactly (`Swimming pool`, `Parking`); near-synonyms match nothing.\n{{/if}}\n',
|
|
713
|
+
"payment-link": "{{#if claude-skill cli}}\n## Before giving the payment link\n\n`{{tool:hotels book}}` returns `paymentUrl`, `statusUrl`, `orderUrl`, `amount`, `currency`, `terms` and `stay`. Nothing is charged until the user pays.\n\n1. Show the `stay` (hotel, room, dates, nights, rooms, adults and children's ages per room), the `amount` and `currency` to be charged, and every item in `terms`: meal plan (`boardCode` with `boardCount`), cancellation (`refundable`, `freeCancelUntil`, the `cancellation` ladder), confirmation (`isInstantConfirm`, `confirmByMins`) and `payAtHotelFees`.\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then give `paymentUrl` exactly as returned: don't shorten, rebuild or re-encode it. It opens a Fortrip page that recaps the booking and continues to payment on Stripe.\n\n{{/if}}\n{{#if mcp}}\n- Before you give `paymentUrl`, show the user the `stay`, `amount`, `currency` and every item in `terms` that `{{tool:hotels book}}` returned, end that reply by asking the user to confirm, and wait for a clear yes. Then give `paymentUrl` exactly as returned, to this user only: anyone holding it can pay.\n{{/if}}\n- If `amount` or `terms` is null, don't give the link: call `{{tool:hotels book}}` again with the same details, and if either is still null, tell the user to contact {{support}}.\n{{#if claude-skill cli}}\n- `paymentUrl` works like a payment credential: anyone holding it can pay. Give it to this user only, never in shared channels, documents, logs or tickets. It expires about 3 hours 45 minutes after it was created; for a fresh one, call `{{tool:hotels book}}` again with the same details.\n- `statusUrl` is the same page: after payment it shows the booking's confirmation progress, without signing in. `orderUrl` is the user's signed-in order page.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only on the payment page.{{#if claude-skill cli}} A card number in a guest name, the contact name or the special requests is rejected{{#if cli}} with exit 2{{/if}}.{{/if}}\n",
|
|
714
|
+
"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, occupancy per room, confirming the terms `{{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), 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\nOccupancy is per room and the same in every room, so if the party doesn't split evenly across the rooms, ask how it splits.\n\nAsk only for what changes which hotels qualify or how they rank. If children come along, ask each child's age; `{{tool:hotels rates}}` and `{{tool:hotels book}}` need it. Don't ask for trip type or style: infer it from the conversation or leave it general.\n\n## Evidence\n\n- A `{{tool:hotels search}}` price is an indicative minimum, not a quote. Never call a search result available or bookable.\n- Use `{{tool:hotels get}}` only when a stated preference needs evidence (a pool, a policy, room size).\n- A hotel is available only once `{{tool:hotels rates}}` returned a live option 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 `fx`, 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.\n2. Keep only options with a live rate.\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 live room 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 (meal plan, cancellation, location, instant 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 rates}}` 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 rates}}` covers up to {{limit:ratesHotels}} hotels per call and takes about 15 seconds. 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- Urgency is not consent. Call `{{tool:hotels book}}` only for the rate the user picked, and give its payment link only after the user confirms the amount, currency, stay and terms that `{{tool:hotels book}}` returned.\n",
|
|
715
|
+
"prices": "{{#if claude-skill cli}}\n## Prices and currency\n\n{{/if}}\n- In `{{tool:hotels rates}}`, `totalPrice` is the whole stay for all rooms, and `dailyPrices` are per room per night.{{#if claude-skill cli}} To compare with a per-night or per-room budget, divide the total by the nights and rooms, or use `dailyPrices`.{{/if}}\n- Pass `{{arg:currency}}`{{#if claude-skill cli}} to `{{tool:hotels search}}` and `{{tool:hotels rates}}`{{/if}}: `CNY` (the default) or `USD`, to suit the user's language or location.{{#if cli}} Without `--currency`, the CLI uses the currency in `--body`, then `FORTRIP_CURRENCY`, then `CNY`.{{/if}}{{#if claude-skill cli}} Prices are converted at Stripe's exchange rate, or a fixed fallback rate when Stripe is unavailable; `fx` says which, and is `null` when nothing needed converting.{{/if}}\n{{#if claude-skill cli}}\n- `{{arg:priceMin}}` and `{{arg:priceMax}}` on `{{tool:hotels search}}` bound the indicative nightly price, in that currency.\n{{/if}}\n- The charge is the `amount` in the `currency` that `{{tool:hotels book}}` returns (currently USD). A converted price is a reference: never present it as the charge.{{#if claude-skill cli}} Stripe's page may also show the charge in the user's local currency, at Stripe's rate. Fees paid at the hotel are separate, in their own currency.{{/if}}\n",
|
|
716
|
+
"scope": "{{#if claude-skill cli}}\n# Fortrip hotel stays\n\n{{/if}}\nFortrip: hotel search, live rates and booking payment links.{{#if claude-skill cli}} Not for flights, activities, or changing or cancelling an existing booking.{{/if}}\n\n{{#if mcp}}\nCall order: `{{tool:hotels search}}` \u2192 (optional) `{{tool:hotels get}}` \u2192 `{{tool:hotels rates}}` \u2192 `{{tool:hotels book}}`. `{{tool:guide}}` returns Fortrip's guidance for flexible dates, budgets, split stays, several destinations or \"find the best\" requests.\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 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 by name, brand or city (`{{arg:query}}`), `{{arg:cityCode}}`, or a point and radius (`{{arg:near}}`), with indicative prices |\n| `{{tool:hotels get}}` | One hotel's address, check-in and check-out times, policies, facilities and photos; no prices |\n| `{{tool:hotels rates}}` | Live rooms, meal plans, cancellation terms and prices for up to {{limit:ratesHotels}} hotels |\n| `{{tool:hotels book}}` | An unpaid booking for one rate, with its terms and a payment link |\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",
|
|
717
|
+
"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 rates}}` and `{{tool:hotels book}}` also take `--body '<json>'` (or `--body @file.json`), the raw request body; flags override its fields.\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 Fortrip and sign in again.\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 CI or a sandbox 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; JSON on stdout | Continue |\n| 1 | Any other error: an error from Fortrip (see Errors), a network error or a timeout | Read `error` on stderr. If `retryable` is true, wait `retryAfterSeconds` (or a few seconds) and retry once |\n| 2 | Invalid arguments | Fix the flags; stderr `issues` 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",
|
|
703
718
|
"support": "{{#if claude-skill cli}}\n## Changes and support\n\n{{/if}}\n{{#if mcp claude-skill}}These tools{{/if}}{{#if cli}}The CLI{{/if}} can't change or cancel a booking: for changes, cancellations, refunds or other problems with a booking, the user emails {{support}} with the booking's `orderUrl` (never `paymentUrl` or `statusUrl`).\n"
|
|
704
719
|
};
|
|
705
720
|
|
|
@@ -788,7 +803,9 @@ function resolve(token, surface, shown) {
|
|
|
788
803
|
return String(LIMITS[name]);
|
|
789
804
|
}
|
|
790
805
|
if (kind === "tool") {
|
|
791
|
-
const spec = COMMANDS.find(
|
|
806
|
+
const spec = COMMANDS.find(
|
|
807
|
+
(command) => commandInvocation(command) === `fortrip ${name}`
|
|
808
|
+
);
|
|
792
809
|
if (spec) return shown ? toolName(spec, surface, token) : token;
|
|
793
810
|
}
|
|
794
811
|
if (kind === "arg") {
|
|
@@ -804,7 +821,7 @@ function resolve(token, surface, shown) {
|
|
|
804
821
|
throw new Error(`Unknown guide token ${token}`);
|
|
805
822
|
}
|
|
806
823
|
function toolName(spec, surface, token) {
|
|
807
|
-
if (surface === "cli") return
|
|
824
|
+
if (surface === "cli") return commandInvocation(spec);
|
|
808
825
|
if (spec.tool === null || surface === "claude-skill" && spec.tool === "get_planning_guide") {
|
|
809
826
|
throw new Error(`Guide token ${token} has no tool on ${surface}`);
|
|
810
827
|
}
|
|
@@ -918,7 +935,7 @@ var TOOLS = [
|
|
|
918
935
|
{
|
|
919
936
|
name: "search_hotels",
|
|
920
937
|
title: "Search hotels",
|
|
921
|
-
description: "Find hotels by name/brand/city text (query), catalogue cityCode or coordinates (near), with per-night prices for the dates in currency (CNY by default, or USD). Those prices come from the supplier's minimum-price feed, not live rates;
|
|
938
|
+
description: "Find hotels by name/brand/city text (query), catalogue cityCode or coordinates (near), with per-night prices for the dates in currency (CNY by default, or USD). Those prices come from the supplier's minimum-price feed, not live rates; get_hotel_rates returns the bookable price. facilities must match catalogue names exactly. Refused (422) when more than 30,000 hotels match: narrow the search.",
|
|
922
939
|
annotations: {
|
|
923
940
|
readOnlyHint: true,
|
|
924
941
|
idempotentHint: true,
|
|
@@ -942,9 +959,9 @@ var TOOLS = [
|
|
|
942
959
|
output: null
|
|
943
960
|
},
|
|
944
961
|
{
|
|
945
|
-
name: "
|
|
946
|
-
title: "Get live rates",
|
|
947
|
-
description: `Live rooms and rate plans for up to ${LIMITS.ratesHotels} hotels, prices in currency (CNY by default, or USD) at Stripe's exchange rate. rooms, adults and childrenAges are per room: every room has the same occupancy. Each room carries its catalogue facts (static) and the cheapest rate per meal plan \xD7 free-cancellation variant, with roomId and ratePlanCode for
|
|
962
|
+
name: "get_hotel_rates",
|
|
963
|
+
title: "Get live hotel rates",
|
|
964
|
+
description: `Live rooms and rate plans for up to ${LIMITS.ratesHotels} hotels, prices in currency (CNY by default, or USD) at Stripe's exchange rate. rooms, adults and childrenAges are per room: every room has the same occupancy. Each room carries its catalogue facts (static) and the cheapest rate per meal plan \xD7 free-cancellation variant, with roomId and ratePlanCode for book_hotel. boardCode is the meal plan (${MEAL_CODES}); boardCount is how many guests per room it covers: fewer than adults per room means the meals don't cover everyone (BB with boardCount 1 for 2 adults is breakfast for 1 of 2). Takes about 15 seconds; query a few hotels at a time. Returns the ${MCP_MAX_ROOMS_PER_HOTEL} cheapest rooms per hotel unless maxRoomsPerHotel says otherwise.`,
|
|
948
965
|
annotations: {
|
|
949
966
|
readOnlyHint: true,
|
|
950
967
|
idempotentHint: true,
|
|
@@ -955,9 +972,9 @@ var TOOLS = [
|
|
|
955
972
|
output: null
|
|
956
973
|
},
|
|
957
974
|
{
|
|
958
|
-
name: "
|
|
959
|
-
title: "Create booking payment link",
|
|
960
|
-
description: `Create (or resume) a booking for one rate from
|
|
975
|
+
name: "book_hotel",
|
|
976
|
+
title: "Create hotel booking payment link",
|
|
977
|
+
description: `Create (or resume) a booking for one rate from get_hotel_rates, with the same rooms, adults and childrenAges (per room). Returns the amount and currency the user will be charged, the accepted terms (meal plan, cancellation, confirmation, pay-at-hotel fees), the stay as booked, and paymentUrl: a Fortrip page that recaps the booking and continues to payment. Nothing is charged until the user pays there; anyone holding paymentUrl can pay. The same user and stay always returns the same order; a stay that is already paid returns 409. This tool can't change or cancel a booking: for changes, cancellations or refunds the user emails ${SUPPORT_EMAIL} with the booking's orderUrl. Can take up to about two minutes; if the call times out, call it again with the same details \u2014 it resumes the same order.`,
|
|
961
978
|
annotations: {
|
|
962
979
|
readOnlyHint: false,
|
|
963
980
|
idempotentHint: true,
|
|
@@ -972,8 +989,8 @@ var TOOLS = [
|
|
|
972
989
|
// package.json
|
|
973
990
|
var package_default = {
|
|
974
991
|
name: "@fortrip/agent-contract",
|
|
975
|
-
version: "
|
|
976
|
-
license: "
|
|
992
|
+
version: "2.0.0",
|
|
993
|
+
license: "Apache-2.0",
|
|
977
994
|
description: "The contract of Fortrip's agent API (/api/agent/v1): limits, paths, input schemas and field rules.",
|
|
978
995
|
type: "module",
|
|
979
996
|
repository: {
|
|
@@ -991,9 +1008,7 @@ var package_default = {
|
|
|
991
1008
|
import: "./dist/guest-name.js"
|
|
992
1009
|
}
|
|
993
1010
|
},
|
|
994
|
-
files: [
|
|
995
|
-
"dist"
|
|
996
|
-
],
|
|
1011
|
+
files: ["dist", "NOTICE"],
|
|
997
1012
|
sideEffects: false,
|
|
998
1013
|
engines: {
|
|
999
1014
|
node: ">=22"
|
|
@@ -1028,6 +1043,7 @@ export {
|
|
|
1028
1043
|
BOOKING_NEXT_STEP,
|
|
1029
1044
|
CARD_NUMBER_MESSAGE,
|
|
1030
1045
|
COMMANDS,
|
|
1046
|
+
COMMAND_GROUPS,
|
|
1031
1047
|
CONTRACT_VERSION,
|
|
1032
1048
|
CURRENCIES,
|
|
1033
1049
|
ERROR_REASONS,
|
|
@@ -1045,6 +1061,7 @@ export {
|
|
|
1045
1061
|
authConfig,
|
|
1046
1062
|
bookingResult,
|
|
1047
1063
|
childrenAges,
|
|
1064
|
+
commandInvocation,
|
|
1048
1065
|
containsCardNumber,
|
|
1049
1066
|
countIsoDateDays,
|
|
1050
1067
|
createBookingInput,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortrip/agent-contract",
|
|
3
|
-
"version": "
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
5
|
"description": "The contract of Fortrip's agent API (/api/agent/v1): limits, paths, input schemas and field rules.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
-
"dist"
|
|
23
|
+
"dist",
|
|
24
|
+
"NOTICE"
|
|
24
25
|
],
|
|
25
26
|
"sideEffects": false,
|
|
26
27
|
"engines": {
|
|
@@ -29,13 +30,6 @@
|
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
|
31
32
|
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"embed-guide": "node --import tsx scripts/embed-guide.ts",
|
|
34
|
-
"build": "pnpm embed-guide && tsup",
|
|
35
|
-
"typecheck": "tsc --noEmit",
|
|
36
|
-
"test": "pnpm build && node --import tsx --test test/*.test.ts",
|
|
37
|
-
"prepublishOnly": "pnpm typecheck && pnpm test && pnpm build"
|
|
38
|
-
},
|
|
39
33
|
"peerDependencies": {
|
|
40
34
|
"zod": "^4.4.0"
|
|
41
35
|
},
|
|
@@ -45,5 +39,11 @@
|
|
|
45
39
|
"tsx": "^4.20.0",
|
|
46
40
|
"typescript": "^5.9.0",
|
|
47
41
|
"zod": "4.4.3"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"embed-guide": "node --import tsx scripts/embed-guide.ts",
|
|
45
|
+
"build": "pnpm embed-guide && tsup",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "pnpm build && node --import tsx --test test/*.test.ts"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|