@fortrip/agent-contract 5.2.0 → 5.3.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/dist/index.d.ts +106 -1
- package/dist/index.js +34 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ interface ToolSpec {
|
|
|
83
83
|
* result's last paragraph it keeps the model from giving the link before a
|
|
84
84
|
* yes (paired eval, S6).
|
|
85
85
|
*/
|
|
86
|
-
declare const ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates,
|
|
86
|
+
declare const ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
|
|
87
87
|
/** Where a rendered result is read: an MCP client, which calls tools with
|
|
88
88
|
* JSON arguments, or the CLI, which runs commands with flags. */
|
|
89
89
|
type RenderSurface = "mcp" | "cli";
|
|
@@ -136,6 +136,11 @@ declare const MCP_OUTPUT: {
|
|
|
136
136
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
137
137
|
createdAt: z.ZodString;
|
|
138
138
|
updatedAt: z.ZodString;
|
|
139
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
email: z.ZodNullable<z.ZodString>;
|
|
142
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
143
|
+
}, z.core.$strip>>;
|
|
139
144
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
140
145
|
type: z.ZodLiteral<"hotel">;
|
|
141
146
|
hotel: z.ZodObject<{
|
|
@@ -151,7 +156,12 @@ declare const MCP_OUTPUT: {
|
|
|
151
156
|
rooms: z.ZodArray<z.ZodObject<{
|
|
152
157
|
adults: z.ZodNumber;
|
|
153
158
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
159
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
160
|
+
firstName: z.ZodString;
|
|
161
|
+
lastName: z.ZodString;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
154
163
|
}, z.core.$strip>>;
|
|
164
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
155
165
|
room: z.ZodObject<{
|
|
156
166
|
name: z.ZodNullable<z.ZodObject<{
|
|
157
167
|
text: z.ZodString;
|
|
@@ -213,7 +223,12 @@ declare const MCP_OUTPUT: {
|
|
|
213
223
|
rooms: z.ZodArray<z.ZodObject<{
|
|
214
224
|
adults: z.ZodNumber;
|
|
215
225
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
226
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
227
|
+
firstName: z.ZodString;
|
|
228
|
+
lastName: z.ZodString;
|
|
229
|
+
}, z.core.$strip>>>;
|
|
216
230
|
}, z.core.$strip>>;
|
|
231
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
217
232
|
room: z.ZodObject<{
|
|
218
233
|
name: z.ZodNullable<z.ZodObject<{
|
|
219
234
|
text: z.ZodString;
|
|
@@ -357,6 +372,11 @@ declare const MCP_OUTPUT: {
|
|
|
357
372
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
358
373
|
createdAt: z.ZodString;
|
|
359
374
|
updatedAt: z.ZodString;
|
|
375
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
376
|
+
name: z.ZodString;
|
|
377
|
+
email: z.ZodNullable<z.ZodString>;
|
|
378
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
379
|
+
}, z.core.$strip>>;
|
|
360
380
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
361
381
|
type: z.ZodLiteral<"hotel">;
|
|
362
382
|
hotel: z.ZodObject<{
|
|
@@ -372,7 +392,12 @@ declare const MCP_OUTPUT: {
|
|
|
372
392
|
rooms: z.ZodArray<z.ZodObject<{
|
|
373
393
|
adults: z.ZodNumber;
|
|
374
394
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
395
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
396
|
+
firstName: z.ZodString;
|
|
397
|
+
lastName: z.ZodString;
|
|
398
|
+
}, z.core.$strip>>>;
|
|
375
399
|
}, z.core.$strip>>;
|
|
400
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
376
401
|
room: z.ZodObject<{
|
|
377
402
|
name: z.ZodNullable<z.ZodObject<{
|
|
378
403
|
text: z.ZodString;
|
|
@@ -434,7 +459,12 @@ declare const MCP_OUTPUT: {
|
|
|
434
459
|
rooms: z.ZodArray<z.ZodObject<{
|
|
435
460
|
adults: z.ZodNumber;
|
|
436
461
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
462
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
463
|
+
firstName: z.ZodString;
|
|
464
|
+
lastName: z.ZodString;
|
|
465
|
+
}, z.core.$strip>>>;
|
|
437
466
|
}, z.core.$strip>>;
|
|
467
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
438
468
|
room: z.ZodObject<{
|
|
439
469
|
name: z.ZodNullable<z.ZodObject<{
|
|
440
470
|
text: z.ZodString;
|
|
@@ -579,6 +609,11 @@ declare const MCP_OUTPUT: {
|
|
|
579
609
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
580
610
|
createdAt: z.ZodString;
|
|
581
611
|
updatedAt: z.ZodString;
|
|
612
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
613
|
+
name: z.ZodString;
|
|
614
|
+
email: z.ZodNullable<z.ZodString>;
|
|
615
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
616
|
+
}, z.core.$strip>>;
|
|
582
617
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
583
618
|
type: z.ZodLiteral<"hotel">;
|
|
584
619
|
hotel: z.ZodObject<{
|
|
@@ -594,7 +629,12 @@ declare const MCP_OUTPUT: {
|
|
|
594
629
|
rooms: z.ZodArray<z.ZodObject<{
|
|
595
630
|
adults: z.ZodNumber;
|
|
596
631
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
632
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
633
|
+
firstName: z.ZodString;
|
|
634
|
+
lastName: z.ZodString;
|
|
635
|
+
}, z.core.$strip>>>;
|
|
597
636
|
}, z.core.$strip>>;
|
|
637
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
598
638
|
room: z.ZodObject<{
|
|
599
639
|
name: z.ZodNullable<z.ZodObject<{
|
|
600
640
|
text: z.ZodString;
|
|
@@ -656,7 +696,12 @@ declare const MCP_OUTPUT: {
|
|
|
656
696
|
rooms: z.ZodArray<z.ZodObject<{
|
|
657
697
|
adults: z.ZodNumber;
|
|
658
698
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
699
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
700
|
+
firstName: z.ZodString;
|
|
701
|
+
lastName: z.ZodString;
|
|
702
|
+
}, z.core.$strip>>>;
|
|
659
703
|
}, z.core.$strip>>;
|
|
704
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
660
705
|
room: z.ZodObject<{
|
|
661
706
|
name: z.ZodNullable<z.ZodObject<{
|
|
662
707
|
text: z.ZodString;
|
|
@@ -802,6 +847,11 @@ declare const MCP_OUTPUT: {
|
|
|
802
847
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
803
848
|
createdAt: z.ZodString;
|
|
804
849
|
updatedAt: z.ZodString;
|
|
850
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
851
|
+
name: z.ZodString;
|
|
852
|
+
email: z.ZodNullable<z.ZodString>;
|
|
853
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
854
|
+
}, z.core.$strip>>;
|
|
805
855
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
806
856
|
type: z.ZodLiteral<"hotel">;
|
|
807
857
|
hotel: z.ZodObject<{
|
|
@@ -817,7 +867,12 @@ declare const MCP_OUTPUT: {
|
|
|
817
867
|
rooms: z.ZodArray<z.ZodObject<{
|
|
818
868
|
adults: z.ZodNumber;
|
|
819
869
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
870
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
871
|
+
firstName: z.ZodString;
|
|
872
|
+
lastName: z.ZodString;
|
|
873
|
+
}, z.core.$strip>>>;
|
|
820
874
|
}, z.core.$strip>>;
|
|
875
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
821
876
|
room: z.ZodObject<{
|
|
822
877
|
name: z.ZodNullable<z.ZodObject<{
|
|
823
878
|
text: z.ZodString;
|
|
@@ -879,7 +934,12 @@ declare const MCP_OUTPUT: {
|
|
|
879
934
|
rooms: z.ZodArray<z.ZodObject<{
|
|
880
935
|
adults: z.ZodNumber;
|
|
881
936
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
937
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
938
|
+
firstName: z.ZodString;
|
|
939
|
+
lastName: z.ZodString;
|
|
940
|
+
}, z.core.$strip>>>;
|
|
882
941
|
}, z.core.$strip>>;
|
|
942
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
883
943
|
room: z.ZodObject<{
|
|
884
944
|
name: z.ZodNullable<z.ZodObject<{
|
|
885
945
|
text: z.ZodString;
|
|
@@ -1022,6 +1082,11 @@ declare const MCP_OUTPUT: {
|
|
|
1022
1082
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
1023
1083
|
createdAt: z.ZodString;
|
|
1024
1084
|
updatedAt: z.ZodString;
|
|
1085
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
1086
|
+
name: z.ZodString;
|
|
1087
|
+
email: z.ZodNullable<z.ZodString>;
|
|
1088
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
1089
|
+
}, z.core.$strip>>;
|
|
1025
1090
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
1026
1091
|
type: z.ZodLiteral<"hotel">;
|
|
1027
1092
|
hotel: z.ZodObject<{
|
|
@@ -1037,7 +1102,12 @@ declare const MCP_OUTPUT: {
|
|
|
1037
1102
|
rooms: z.ZodArray<z.ZodObject<{
|
|
1038
1103
|
adults: z.ZodNumber;
|
|
1039
1104
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
1105
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1106
|
+
firstName: z.ZodString;
|
|
1107
|
+
lastName: z.ZodString;
|
|
1108
|
+
}, z.core.$strip>>>;
|
|
1040
1109
|
}, z.core.$strip>>;
|
|
1110
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
1041
1111
|
room: z.ZodObject<{
|
|
1042
1112
|
name: z.ZodNullable<z.ZodObject<{
|
|
1043
1113
|
text: z.ZodString;
|
|
@@ -1099,7 +1169,12 @@ declare const MCP_OUTPUT: {
|
|
|
1099
1169
|
rooms: z.ZodArray<z.ZodObject<{
|
|
1100
1170
|
adults: z.ZodNumber;
|
|
1101
1171
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
1172
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1173
|
+
firstName: z.ZodString;
|
|
1174
|
+
lastName: z.ZodString;
|
|
1175
|
+
}, z.core.$strip>>>;
|
|
1102
1176
|
}, z.core.$strip>>;
|
|
1177
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
1103
1178
|
room: z.ZodObject<{
|
|
1104
1179
|
name: z.ZodNullable<z.ZodObject<{
|
|
1105
1180
|
text: z.ZodString;
|
|
@@ -2782,6 +2857,11 @@ declare const order: z.ZodObject<{
|
|
|
2782
2857
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
2783
2858
|
createdAt: z.ZodString;
|
|
2784
2859
|
updatedAt: z.ZodString;
|
|
2860
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
2861
|
+
name: z.ZodString;
|
|
2862
|
+
email: z.ZodNullable<z.ZodString>;
|
|
2863
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
2864
|
+
}, z.core.$strip>>;
|
|
2785
2865
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
2786
2866
|
type: z.ZodLiteral<"hotel">;
|
|
2787
2867
|
hotel: z.ZodObject<{
|
|
@@ -2797,7 +2877,12 @@ declare const order: z.ZodObject<{
|
|
|
2797
2877
|
rooms: z.ZodArray<z.ZodObject<{
|
|
2798
2878
|
adults: z.ZodNumber;
|
|
2799
2879
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
2880
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2881
|
+
firstName: z.ZodString;
|
|
2882
|
+
lastName: z.ZodString;
|
|
2883
|
+
}, z.core.$strip>>>;
|
|
2800
2884
|
}, z.core.$strip>>;
|
|
2885
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
2801
2886
|
room: z.ZodObject<{
|
|
2802
2887
|
name: z.ZodNullable<z.ZodObject<{
|
|
2803
2888
|
text: z.ZodString;
|
|
@@ -2859,7 +2944,12 @@ declare const order: z.ZodObject<{
|
|
|
2859
2944
|
rooms: z.ZodArray<z.ZodObject<{
|
|
2860
2945
|
adults: z.ZodNumber;
|
|
2861
2946
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
2947
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2948
|
+
firstName: z.ZodString;
|
|
2949
|
+
lastName: z.ZodString;
|
|
2950
|
+
}, z.core.$strip>>>;
|
|
2862
2951
|
}, z.core.$strip>>;
|
|
2952
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
2863
2953
|
room: z.ZodObject<{
|
|
2864
2954
|
name: z.ZodNullable<z.ZodObject<{
|
|
2865
2955
|
text: z.ZodString;
|
|
@@ -3005,6 +3095,11 @@ declare const orderList: z.ZodObject<{
|
|
|
3005
3095
|
status: z.ZodType<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown, z.core.$ZodTypeInternals<(string & {}) | "awaiting_payment" | "expired" | "confirming" | "confirmed" | "failed" | "cancelling" | "cancelled" | "needs_attention", unknown>>;
|
|
3006
3096
|
createdAt: z.ZodString;
|
|
3007
3097
|
updatedAt: z.ZodString;
|
|
3098
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
3099
|
+
name: z.ZodString;
|
|
3100
|
+
email: z.ZodNullable<z.ZodString>;
|
|
3101
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
3102
|
+
}, z.core.$strip>>;
|
|
3008
3103
|
items: z.ZodArray<z.ZodType<OpenUnionOutput<"type", readonly [z.ZodObject<{
|
|
3009
3104
|
type: z.ZodLiteral<"hotel">;
|
|
3010
3105
|
hotel: z.ZodObject<{
|
|
@@ -3020,7 +3115,12 @@ declare const orderList: z.ZodObject<{
|
|
|
3020
3115
|
rooms: z.ZodArray<z.ZodObject<{
|
|
3021
3116
|
adults: z.ZodNumber;
|
|
3022
3117
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
3118
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
3119
|
+
firstName: z.ZodString;
|
|
3120
|
+
lastName: z.ZodString;
|
|
3121
|
+
}, z.core.$strip>>>;
|
|
3023
3122
|
}, z.core.$strip>>;
|
|
3123
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
3024
3124
|
room: z.ZodObject<{
|
|
3025
3125
|
name: z.ZodNullable<z.ZodObject<{
|
|
3026
3126
|
text: z.ZodString;
|
|
@@ -3082,7 +3182,12 @@ declare const orderList: z.ZodObject<{
|
|
|
3082
3182
|
rooms: z.ZodArray<z.ZodObject<{
|
|
3083
3183
|
adults: z.ZodNumber;
|
|
3084
3184
|
childrenAges: z.ZodArray<z.ZodNumber>;
|
|
3185
|
+
guests: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
3186
|
+
firstName: z.ZodString;
|
|
3187
|
+
lastName: z.ZodString;
|
|
3188
|
+
}, z.core.$strip>>>;
|
|
3085
3189
|
}, z.core.$strip>>;
|
|
3190
|
+
specialRequests: z.ZodNullable<z.ZodString>;
|
|
3086
3191
|
room: z.ZodObject<{
|
|
3087
3192
|
name: z.ZodNullable<z.ZodObject<{
|
|
3088
3193
|
text: z.ZodString;
|
package/dist/index.js
CHANGED
|
@@ -1267,7 +1267,7 @@ var FRAGMENTS = {
|
|
|
1267
1267
|
"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',
|
|
1268
1268
|
"occupancy": "{{#if claude-skill cli}}\n## Rooms and guests\n\n- {{#if mcp claude-skill}}`stay.rooms` lists each room's party as `{ adults, childrenAges }`: two rooms of 2 adults, one with a child of 6, is `[{ adults: 2, childrenAges: [6] }, { adults: 2, childrenAges: [] }]`{{/if}}{{#if cli}}`--room <adults[:age,\u2026]>`, once per room, gives each room's party: two rooms of 2 adults, one with a child of 6, is `--room 2:6 --room 2`{{/if}}.\n- Ask each child's age; offers need it.\n- If the party doesn't split evenly across the rooms (3 adults in 2 rooms), ask the user how it splits.\n- Offers and orders take one party per call, every room the same: for different parties, order once per party. `{{tool:hotels offers}}` answers `stay_unsupported` (`mixed_occupancy`) for mixed rooms; `{{tool:hotels search}}` accepts them but prices only from the dates, with the note `party_split_required`.\n- Limits: 1\u2013{{limit:rooms}} rooms, 1\u2013{{limit:adultsPerRoom}} adults and 0\u2013{{limit:childrenPerRoom}} children (aged 0\u2013{{limit:childAgeMax}}) per room, 1\u2013{{limit:nightsSupplier}} nights, up to {{limit:offersHotels}} hotels per `{{tool:hotels offers}}` call. A longer stay answers `stay_unsupported` (`max_nights`): ask the user whether to split it into consecutive stays, each its own order.\n{{/if}}\n",
|
|
1269
1269
|
"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 (a typo such as "Shangahi" finds nothing): plurals, accents, spacing and abbreviations count ("hostel" and "hostels", "St Regis" and "Saint Regis" find different hotels). Hyphens and apostrophes don\'t (Ritz-Carlton finds Ritz Carlton).\n- In Chinese, matching follows word segmentation, so part of a name can match unrelated hotels (\u5E0C\u5C14 is not \u5E0C\u5C14\u987F).\n- Use only distinctive words: a hotel or brand name, a district or a landmark. Not "hotel", "near", "cheap" or "best".\n- Place names belong in the destination: "Maldives" as text finds a hotel named Maldives in China.\n\n### Filters\n\n- Stars run from 1 to 5 in half steps{{#if mcp claude-skill}} (`filters.stars`){{/if}}. "4 stars" as {{#if mcp claude-skill}}`{ min: 4, max: 4 }`{{/if}}{{#if cli}}`--stars-min 4 --stars-max 4`{{/if}} leaves out 4.5: unless the user means exactly 4, use {{#if mcp claude-skill}}`{ min: 4 }`{{/if}}{{#if cli}}`--stars-min 4`{{/if}} or ask. Unrated hotels are left out whenever stars are filtered.\n- `{{arg:filters.amenities}}` takes only the amenities that can filter (such as pool, parking, wifi); others, such as gym or spa, show in `{{tool:hotels get}}` but can\'t filter. A hotel matches only when it lists the amenity, and about half the hotels list no amenities at all (`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 the search\'s currency; 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',
|
|
1270
|
-
"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 the payment provider. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates,
|
|
1270
|
+
"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 the payment provider. Nothing is charged until the user pays.\n\n1. Show the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term: meals, cancellation (status, deadline, penalties) and fees payable at the property, unknowns included. Show the names and contact as the order holds them, so the user can catch a wrong one before paying; to correct one, order a new offer (see below).\n2. End that reply by asking the user to confirm, and wait for a clear yes. Urgency is not consent.\n3. Then pay one way only: give `payment.url` exactly as returned (don't shorten, rebuild or re-encode it), or use one of the ways below.\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 with each room's guests, the contact, any special requests and every term, end that reply by asking the user to confirm, and wait for a clear yes. Then give `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 or contact) needs a new offer: get offers again. When it replaces an unpaid order, tell the user to pay only the new link; the earlier one expires unpaid, or can be closed now with `{{tool:orders cancel}}`{{#if cli}} and `--close`{{/if}} once the user says they no longer want it.\n- An order `awaiting_payment` with `payment.status` `unpaid` whose `payment.url` is null has a payment being processed: read it again shortly with `{{tool:orders get}}`, and don't give an earlier link.\n{{/if}}\n- Never ask for, accept or pass on payment card details; payment happens only on `payment.url` or by a way in the order's `payment.methods`.{{#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.methods` has the `stripe_shared_payment_token` entry (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 only a USD order up to that has such an entry. Otherwise give `payment.url`, and never ask the user to create, type or paste a token.\n\n1. Confirm the order with the user as before giving the payment link: its total and currency, the stay with each room's guests, the contact, any special requests and every term, and a clear yes. The token comes from the user's wallet, never from card details.\n2. Request the token from the user's Link wallet with that entry's `handler.config.business_profile` and its `limits`: `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. 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 that entry's `limits`. `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. {{#if claude-skill}}Call{{/if}}{{#if cli}}Run{{/if}} `{{tool:orders pay}}` {{#if claude-skill}}with `method` `stripe_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. Confirm the order with the user as before giving the payment link: its total and currency, the stay with each room's guests, the contact, any special requests and every term, and a clear yes.\n2. Then show the `stripe_alipay_wechat_pay` entry of `payment.methods`: 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 the order's currency, 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 that entry's `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",
|
|
1271
1271
|
"planning": "# Planning a hotel stay\n\nRead this when the request is more than one hotel for fixed dates: flexible dates, a budget, split stays, several destinations, or \"find me the best\". The rules in {{#if mcp}}the server instructions{{/if}}{{#if claude-skill cli}}SKILL.md{{/if}} still apply{{#if mcp}} (call order, destinations, confirming the order `{{tool:hotels book}}` returns before giving the payment link){{/if}}; this covers what to ask, how to compare and how to present.{{#if cli}} As there, `fortrip` is short for `npx -y fortrip@latest`.{{/if}}\n\n## What to collect\n\nKeep track of: dates (or the flexible window), nights, destination(s) with their country, rooms and the guests in each room, room constraints (beds, connecting rooms, accessibility), budget, and what the user said matters most (cheapest, most flexible, closest to X).\n\n{{#if mcp}}\nOffers and orders take one party per call, every room the same, so if the party doesn't split evenly across the rooms, ask how it splits. Rooms for different parties are priced and ordered separately, each order with its own payment link.\n\n{{/if}}\nAsk only for what changes which hotels qualify or how they rank. \"4 stars\" as {{#if mcp claude-skill}}`{ min: 4, max: 4 }`{{/if}}{{#if cli}}`--stars-min 4 --stars-max 4`{{/if}} leaves out 4.5: unless the user means exactly 4, use {{#if mcp claude-skill}}`{ min: 4 }`{{/if}}{{#if cli}}`--stars-min 4`{{/if}} or ask.{{#if mcp}} If children come along, ask each child's age; `{{tool:hotels offers}}` needs it. When a place name is ambiguous, ask which place the user means.{{/if}} Don't ask for trip type or style: infer it from the conversation or leave it general.\n\n## Evidence\n\n- {{#if mcp}}A `{{tool:hotels search}}` price is an indicative estimate per room per night, not a quote. Never call a search result available or bookable, and once{{/if}}{{#if claude-skill cli}}Once{{/if}} you have offers, compare offers only. A hotel without a search price can still have offers.\n- Use `{{tool:hotels get}}` only when a stated preference needs evidence (a pool, a policy, room size). An amenity or policy it doesn't list is unknown, not absent.\n{{#if mcp}}\n- A hotel is available only once `{{tool:hotels offers}}` returned an offer for it.\n{{/if}}\n- Anything {{#if mcp claude-skill}}the tools{{/if}}{{#if cli}}the CLI{{/if}} didn't return, such as reviews, style, price trends or exchange rates, is unknown. Say so instead of filling it in.\n\n## Ranking\n\n1. Drop options that break a hard constraint (dates, guests, budget cap, required facility). Compare a budget in the unit the user gave it: per night, per room or for the whole stay. An offer's `price.total` covers the whole stay and every room, in the offer's currency.\n2. Keep only options with a live offer.\n3. Order by the user's stated main goal. Goals they didn't state don't count.\n4. Use other preferences only to break ties.\n\nUse the cheapest comparable offer as the baseline unless the user fixed the room type. Two or three plans usually suffice, each with its price difference from the baseline and what it trades off (meals, cancellation, location, confirmation). 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",
|
|
1272
1272
|
"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 its currency, 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",
|
|
1273
1273
|
"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 claude-skill cli}}In an offer or order, `price.total` is the whole stay for all rooms and is what is charged, in the request's `{{arg:currency}}` (`USD` by default); an{{/if}}{{#if mcp}}An{{/if}} order is in the currency of the offer it was made from.{{#if claude-skill cli}} `perNightAllRooms` is the total per night; to compare with a per-room budget, also divide by the rooms.{{/if}} On a USD order, Stripe's page may let the user pay in their card's local currency at Stripe's rate{{#if claude-skill cli}} (Adaptive Pricing): say so plainly, and that the total in that currency is the price{{/if}}.\n{{#if claude-skill cli}}\n- Every price of a response is in that one currency; don't convert it. `{{arg:currency}}`{{#if cli}} (or `FORTRIP_CURRENCY`){{/if}} is `USD` (the default) or `CNY`.\n- Each currency is paid through its own channel, with its own payment methods; the order's payment page shows them. CNY is paid through payment channels in mainland China and suits a user who pays that way.\n- A search not in CNY may carry `currencyHint` (CNY) when the request or the user's latest sign-in comes from mainland China: offer CNY prices if the user may pay that way, and then use CNY for both the search and the offers.\n- Fees payable at the property (`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",
|
|
@@ -1936,6 +1936,11 @@ var paymentMethod = openUnion("id", [
|
|
|
1936
1936
|
)
|
|
1937
1937
|
]);
|
|
1938
1938
|
var orderReference = z14.string().regex(/^FT-[2-9A-HJ-NP-Z]{6}$/);
|
|
1939
|
+
var orderRoom = stayEcho.shape.rooms.element.extend({
|
|
1940
|
+
guests: z14.array(openObject({ firstName: z14.string(), lastName: z14.string() })).nullable().describe(
|
|
1941
|
+
"The guests the order names for this room, as given when ordering. null when none are on record yet: an order started on the Fortrip website names them at checkout."
|
|
1942
|
+
)
|
|
1943
|
+
});
|
|
1939
1944
|
var hotelItem = openObject({
|
|
1940
1945
|
type: z14.literal("hotel"),
|
|
1941
1946
|
hotel: openObject({
|
|
@@ -1945,7 +1950,8 @@ var hotelItem = openObject({
|
|
|
1945
1950
|
checkIn: localDate,
|
|
1946
1951
|
checkOut: localDate,
|
|
1947
1952
|
timeZone: z14.string().nullable(),
|
|
1948
|
-
rooms:
|
|
1953
|
+
rooms: z14.array(orderRoom).min(1),
|
|
1954
|
+
specialRequests: z14.string().nullable().describe("The requests for the hotel, as given when ordering; null when none were given. Not guaranteed."),
|
|
1949
1955
|
room: openObject({
|
|
1950
1956
|
name: localizedText.nullable(),
|
|
1951
1957
|
beds: localizedText.nullable()
|
|
@@ -1966,6 +1972,13 @@ var order = openObject({
|
|
|
1966
1972
|
),
|
|
1967
1973
|
createdAt: instant,
|
|
1968
1974
|
updatedAt: instant,
|
|
1975
|
+
contact: openObject({
|
|
1976
|
+
name: z14.string().describe("The contact's full name, as given when ordering."),
|
|
1977
|
+
email: z14.string().nullable().describe("Where the confirmation is sent; null when none is on record."),
|
|
1978
|
+
phone: z14.string().nullable().describe("The contact's phone number; null when none is on record.")
|
|
1979
|
+
}).nullable().describe(
|
|
1980
|
+
"Who the hotel and the confirmation reach, as given when ordering. null when none is on record yet: an order started on the Fortrip website gives it at checkout."
|
|
1981
|
+
),
|
|
1969
1982
|
items: z14.array(openUnion("type", [hotelItem])).min(1),
|
|
1970
1983
|
price: openObject({
|
|
1971
1984
|
total: money.describe(
|
|
@@ -2229,7 +2242,7 @@ var RATE_LIMITS = {
|
|
|
2229
2242
|
|
|
2230
2243
|
// src/tools.ts
|
|
2231
2244
|
import { z as z16 } from "zod";
|
|
2232
|
-
var ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates,
|
|
2245
|
+
var ORDER_NEXT_STEP = "Before you give the user an order's payment.url, show them its total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Only after they say yes, give them payment.url exactly as returned.";
|
|
2233
2246
|
var CALLS = {
|
|
2234
2247
|
mcp: {
|
|
2235
2248
|
cancel: "call cancel_order",
|
|
@@ -2261,12 +2274,12 @@ function cancelNextStep(surface) {
|
|
|
2261
2274
|
var CANCEL_NEXT_STEP = cancelNextStep("mcp");
|
|
2262
2275
|
function payNextStep(surface) {
|
|
2263
2276
|
const c = CALLS[surface];
|
|
2264
|
-
return `To pay without the link: only if you have a tool that can request a Stripe shared payment token from the user's Link wallet (US and Canadian Link accounts), and the order's payment.methods has the stripe_shared_payment_token entry. Otherwise give payment.url, and never ask the user to create, type or paste a token. Before you ${c.pay}, show the user the order's total and currency, the stay (hotel, room, dates,
|
|
2277
|
+
return `To pay without the link: only if you have a tool that can request a Stripe shared payment token from the user's Link wallet (US and Canadian Link accounts), and the order's payment.methods has the stripe_shared_payment_token entry. Otherwise give payment.url, and never ask the user to create, type or paste a token. Before you ${c.pay}, show the user the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then end your reply by asking them to confirm, and wait for a clear yes. Then request the token for this order from the user's Link wallet with that entry's handler config.business_profile and its limits (maxAmount in cents, currency, expiresAt), and ${c.payWith}. The charge is in USD: a card in another currency may add a foreign transaction fee. Pay one way only: either give payment.url or ${c.pay}. Once ${c.paid} succeeds, payment.url stops working; a failed payment leaves it open.`;
|
|
2265
2278
|
}
|
|
2266
2279
|
var PAY_NEXT_STEP = payNextStep("mcp");
|
|
2267
2280
|
function walletNextStep(surface) {
|
|
2268
2281
|
const c = CALLS[surface];
|
|
2269
|
-
return `Before you ${c.pay}${c.payWallet}, show the user the order's total and currency, the stay (hotel, room, dates,
|
|
2282
|
+
return `Before you ${c.pay}${c.payWallet}, show the user the order's total and currency, the stay (hotel, room, dates, and each room's party and guest names), the contact (name, email, phone), any special requests and every term (meals, cancellation, fees payable at the property), then ask them to confirm, and wait for a clear yes. Then show the stripe_alipay_wechat_pay entry of payment.methods: the WeChat code as an image if you can, and both links. The user pays once, by one of them. Alipay and WeChat Pay charge at once; if the hotel can't confirm, the payment is refunded in full. Then ${c.poll}.`;
|
|
2270
2283
|
}
|
|
2271
2284
|
var WALLET_NEXT_STEP = walletNextStep("mcp");
|
|
2272
2285
|
var PRESENTATION_HINT = "Presentation: If 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 its currency, 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.";
|
|
@@ -2315,7 +2328,7 @@ var TOOLS = [
|
|
|
2315
2328
|
{
|
|
2316
2329
|
name: "book_hotel",
|
|
2317
2330
|
title: "Create order",
|
|
2318
|
-
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; 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.`,
|
|
2331
|
+
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; 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 or contact), 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.`,
|
|
2319
2332
|
annotations: {
|
|
2320
2333
|
readOnlyHint: false,
|
|
2321
2334
|
idempotentHint: false,
|
|
@@ -2357,7 +2370,7 @@ var TOOLS = [
|
|
|
2357
2370
|
{
|
|
2358
2371
|
name: "pay_order",
|
|
2359
2372
|
title: "Pay order",
|
|
2360
|
-
description: `Pay a USD order without its link, by one of its payment.methods: a Stripe shared payment token, only if you can request one from the user's Link wallet (US and Canadian accounts; never ask the user for one), or Alipay/WeChat Pay (method stripe_alipay_wechat_pay). Call it only after the user confirmed the order's total and currency, the stay and every term with a clear yes. Token: request it with the entry's handler config.business_profile and limits, and pass it with price.total; a token pays one order. Wallet: pass method and price.total, then show the entry it returns: the WeChat code as an image if you can, and both links; the user pays once, by either. A code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: success closes payment.url, a failure leaves it open, and each error says how to recover. Then poll get_order.`,
|
|
2373
|
+
description: `Pay a USD order without its link, by one of its payment.methods: a Stripe shared payment token, only if you can request one from the user's Link wallet (US and Canadian accounts; never ask the user for one), or Alipay/WeChat Pay (method stripe_alipay_wechat_pay). Call it only after the user confirmed the order's total and currency, the stay with each room's guests, the contact, any special requests and every term with a clear yes. Token: request it with the entry's handler config.business_profile and limits, and pass it with price.total; a token pays one order. Wallet: pass method and price.total, then show the entry it returns: the WeChat code as an image if you can, and both links; the user pays once, by either. A code lasts ${LIMITS.wechatCodeMinutes} minutes; then the WeChat link opens a new one, or call again. Pay one way only: success closes payment.url, a failure leaves it open, and each error says how to recover. Then poll get_order.`,
|
|
2361
2374
|
annotations: {
|
|
2362
2375
|
readOnlyHint: false,
|
|
2363
2376
|
idempotentHint: true,
|
|
@@ -2698,10 +2711,22 @@ function itemLines(item) {
|
|
|
2698
2711
|
`time zone ${h.timeZone ?? "not listed"}`
|
|
2699
2712
|
].join(" \xB7 "),
|
|
2700
2713
|
`Room: ${h.room.name ? h.room.name.text : "room name not listed"} \xB7 ${h.room.beds ? `beds: ${h.room.beds.text}` : "beds not listed"}`,
|
|
2714
|
+
guestsLine(h.rooms),
|
|
2715
|
+
`Special requests: ${h.specialRequests === null ? "none" : h.specialRequests.replace(/\s+/g, " ").trim()}`,
|
|
2701
2716
|
`Terms: ${mealsWithLabel(h.meals)} \xB7 ${cancellationText(h.cancellation)} \xB7 ${feesText(h.payAtProperty)}`,
|
|
2702
2717
|
`Hotel confirmation number: ${h.confirmationNumber ?? "none yet"}`
|
|
2703
2718
|
];
|
|
2704
2719
|
}
|
|
2720
|
+
function guestsLine(rooms) {
|
|
2721
|
+
const names2 = rooms.map((r) => (r.guests ?? []).map((g) => `${g.firstName} ${g.lastName}`).join(", "));
|
|
2722
|
+
if (names2.every((n) => n === "")) return "Guests: none named yet";
|
|
2723
|
+
if (names2.length === 1) return `Guests: ${names2[0]}`;
|
|
2724
|
+
return `Guests: ${names2.map((n, i) => `room ${i + 1} ${n || "none named yet"}`).join("; ")}`;
|
|
2725
|
+
}
|
|
2726
|
+
function contactLine(c) {
|
|
2727
|
+
if (c === null) return "Contact: none on record yet";
|
|
2728
|
+
return `Contact: ${c.name} \xB7 ${c.email ?? "no email on record"} \xB7 ${c.phone ?? "no phone on record"}`;
|
|
2729
|
+
}
|
|
2705
2730
|
function paymentLines(o, surface) {
|
|
2706
2731
|
const p = o.payment;
|
|
2707
2732
|
const lines = [
|
|
@@ -2774,6 +2799,7 @@ function orderLines(o, surface = "mcp") {
|
|
|
2774
2799
|
return [
|
|
2775
2800
|
`Order ${o.orderId} \xB7 reference ${o.reference} \xB7 ${label(ORDER_STATUS_WORDS, o.status)} \xB7 created ${when(o.createdAt, null)} \xB7 updated ${when(o.updatedAt, null)}`,
|
|
2776
2801
|
...o.items.flatMap(itemLines),
|
|
2802
|
+
contactLine(o.contact),
|
|
2777
2803
|
...paymentLines(o, surface)
|
|
2778
2804
|
];
|
|
2779
2805
|
}
|
|
@@ -3324,7 +3350,7 @@ var ME_SCOPES = { email: "email", name: "profile" };
|
|
|
3324
3350
|
// package.json
|
|
3325
3351
|
var package_default = {
|
|
3326
3352
|
name: "@fortrip/agent-contract",
|
|
3327
|
-
version: "5.
|
|
3353
|
+
version: "5.3.0",
|
|
3328
3354
|
license: "Apache-2.0",
|
|
3329
3355
|
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.",
|
|
3330
3356
|
type: "module",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortrip/agent-contract",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"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.",
|
|
6
6
|
"type": "module",
|