@curless/hotel-storefront 0.86.0 → 0.88.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.
Files changed (99) hide show
  1. package/dist/card.generated.d.ts +1 -1
  2. package/dist/card.generated.js +2 -2
  3. package/dist/card.generated.js.map +1 -1
  4. package/dist/server.d.ts +1 -1
  5. package/dist/server.js +1 -1
  6. package/dist/tools/all-tools.d.ts +17954 -172
  7. package/dist/tools/all-tools.d.ts.map +1 -1
  8. package/dist/tools/all-tools.js +38 -949
  9. package/dist/tools/all-tools.js.map +1 -1
  10. package/dist/tools/base-output-schemas.d.ts.map +1 -1
  11. package/dist/tools/base-output-schemas.js +17 -1
  12. package/dist/tools/base-output-schemas.js.map +1 -1
  13. package/dist/tools/booking-answer.d.ts.map +1 -1
  14. package/dist/tools/booking-answer.js +239 -157
  15. package/dist/tools/booking-answer.js.map +1 -1
  16. package/dist/tools/cancel.d.ts +1 -1
  17. package/dist/tools/cancel.d.ts.map +1 -1
  18. package/dist/tools/cancel.js +199 -148
  19. package/dist/tools/cancel.js.map +1 -1
  20. package/dist/tools/capability-adjust.d.ts +31 -0
  21. package/dist/tools/capability-adjust.d.ts.map +1 -0
  22. package/dist/tools/capability-adjust.js +299 -0
  23. package/dist/tools/capability-adjust.js.map +1 -0
  24. package/dist/tools/current-trip.d.ts.map +1 -1
  25. package/dist/tools/current-trip.js +40 -32
  26. package/dist/tools/current-trip.js.map +1 -1
  27. package/dist/tools/get-hotel.d.ts +1 -1
  28. package/dist/tools/get-hotel.d.ts.map +1 -1
  29. package/dist/tools/get-hotel.js +151 -125
  30. package/dist/tools/get-hotel.js.map +1 -1
  31. package/dist/tools/hotel-choices.d.ts.map +1 -1
  32. package/dist/tools/hotel-choices.js +111 -82
  33. package/dist/tools/hotel-choices.js.map +1 -1
  34. package/dist/tools/itinerary.d.ts +1 -1
  35. package/dist/tools/itinerary.d.ts.map +1 -1
  36. package/dist/tools/itinerary.js +46 -36
  37. package/dist/tools/itinerary.js.map +1 -1
  38. package/dist/tools/list-hotels-ask.d.ts +133 -0
  39. package/dist/tools/list-hotels-ask.d.ts.map +1 -0
  40. package/dist/tools/list-hotels-ask.js +326 -0
  41. package/dist/tools/list-hotels-ask.js.map +1 -0
  42. package/dist/tools/list-hotels-empty.d.ts +5 -0
  43. package/dist/tools/list-hotels-empty.d.ts.map +1 -0
  44. package/dist/tools/list-hotels-empty.js +130 -0
  45. package/dist/tools/list-hotels-empty.js.map +1 -0
  46. package/dist/tools/list-hotels-home.d.ts +9 -0
  47. package/dist/tools/list-hotels-home.d.ts.map +1 -0
  48. package/dist/tools/list-hotels-home.js +181 -0
  49. package/dist/tools/list-hotels-home.js.map +1 -0
  50. package/dist/tools/list-hotels-page.d.ts +43 -0
  51. package/dist/tools/list-hotels-page.d.ts.map +1 -0
  52. package/dist/tools/list-hotels-page.js +344 -0
  53. package/dist/tools/list-hotels-page.js.map +1 -0
  54. package/dist/tools/list-hotels.d.ts +1 -1
  55. package/dist/tools/list-hotels.d.ts.map +1 -1
  56. package/dist/tools/list-hotels.js +22 -889
  57. package/dist/tools/list-hotels.js.map +1 -1
  58. package/dist/tools/look-up.d.ts +1 -1
  59. package/dist/tools/look-up.d.ts.map +1 -1
  60. package/dist/tools/look-up.js +70 -33
  61. package/dist/tools/look-up.js.map +1 -1
  62. package/dist/tools/put-room-line.d.ts.map +1 -1
  63. package/dist/tools/put-room-line.js +248 -215
  64. package/dist/tools/put-room-line.js.map +1 -1
  65. package/dist/tools/room-choices.d.ts.map +1 -1
  66. package/dist/tools/room-choices.js +74 -48
  67. package/dist/tools/room-choices.js.map +1 -1
  68. package/dist/tools/terms-answer.d.ts.map +1 -1
  69. package/dist/tools/terms-answer.js +48 -31
  70. package/dist/tools/terms-answer.js.map +1 -1
  71. package/dist/tools/tool-defs-account.d.ts +80 -0
  72. package/dist/tools/tool-defs-account.d.ts.map +1 -0
  73. package/dist/tools/tool-defs-account.js +65 -0
  74. package/dist/tools/tool-defs-account.js.map +1 -0
  75. package/dist/tools/tool-defs-addons.d.ts +251 -0
  76. package/dist/tools/tool-defs-addons.d.ts.map +1 -0
  77. package/dist/tools/tool-defs-addons.js +198 -0
  78. package/dist/tools/tool-defs-addons.js.map +1 -0
  79. package/dist/tools/tool-defs-booking.d.ts +410 -0
  80. package/dist/tools/tool-defs-booking.d.ts.map +1 -0
  81. package/dist/tools/tool-defs-booking.js +285 -0
  82. package/dist/tools/tool-defs-booking.js.map +1 -0
  83. package/dist/tools/tool-defs-browse.d.ts +444 -0
  84. package/dist/tools/tool-defs-browse.d.ts.map +1 -0
  85. package/dist/tools/tool-defs-browse.js +307 -0
  86. package/dist/tools/tool-defs-browse.js.map +1 -0
  87. package/dist/tools/tool-defs-trip.d.ts +136 -0
  88. package/dist/tools/tool-defs-trip.d.ts.map +1 -0
  89. package/dist/tools/tool-defs-trip.js +79 -0
  90. package/dist/tools/tool-defs-trip.js.map +1 -0
  91. package/dist/tools/tool-env.d.ts +64 -0
  92. package/dist/tools/tool-env.d.ts.map +1 -0
  93. package/dist/tools/tool-env.js +49 -0
  94. package/dist/tools/tool-env.js.map +1 -0
  95. package/dist/tools/tool-set.d.ts +698 -747
  96. package/dist/tools/tool-set.d.ts.map +1 -1
  97. package/dist/tools/tool-set.js +14 -267
  98. package/dist/tools/tool-set.js.map +1 -1
  99. package/package.json +1 -1
@@ -0,0 +1,251 @@
1
+ import type { ToolEnv } from './tool-env.js';
2
+ export declare const listBookingAddonsTool: ({ n, open }: ToolEnv) => {
3
+ readonly name: `list_${string}booking_addons`;
4
+ readonly description: "What can be added to a booking made here after it was made - an airport transfer and the like - each with its id, name, price and the details it needs. Only a booking made here has any.";
5
+ readonly annotations: {
6
+ readonly title: string;
7
+ readonly readOnlyHint: true;
8
+ readonly destructiveHint: false;
9
+ readonly idempotentHint: true;
10
+ readonly openWorldHint: boolean;
11
+ };
12
+ readonly inputSchema: {
13
+ readonly type: "object";
14
+ readonly properties: {
15
+ readonly booking: {
16
+ readonly type: "string";
17
+ readonly description: "The confirmation code or order id, as the booking answer gave it";
18
+ };
19
+ };
20
+ readonly required: readonly ["booking"];
21
+ };
22
+ };
23
+ export declare const addBookingAddonTool: ({ n, open }: ToolEnv) => {
24
+ readonly name: `add_${string}booking_addon`;
25
+ readonly description: "Prepares adding one add-on to a booking made here, at the price the add-on list gave. It does NOT add it: the answer gives a one-time page address for the guest to open in the browser signed in to their account, where they see the add-on, the price, the total and the booking, and press confirm themselves. Pass that link on; never say the add-on was added until the guest has confirmed it and the booking says so. It checks the id, the details and the price again as it prepares, and refuses a booking that is not theirs or is over.";
26
+ readonly annotations: {
27
+ readonly title: string;
28
+ readonly readOnlyHint: false;
29
+ readonly destructiveHint: false;
30
+ readonly idempotentHint: false;
31
+ readonly openWorldHint: boolean;
32
+ };
33
+ readonly inputSchema: {
34
+ readonly type: "object";
35
+ readonly properties: {
36
+ readonly booking: {
37
+ readonly type: "string";
38
+ readonly description: "The confirmation code or order id, as the booking answer gave it";
39
+ };
40
+ readonly addon: {
41
+ readonly type: "string";
42
+ readonly description: "The add-on id, as the add-on list gave it";
43
+ };
44
+ readonly direction: {
45
+ readonly type: "string";
46
+ readonly enum: readonly ["arrival", "departure", "round_trip"];
47
+ readonly description: "For a transfer: to the hotel, from it, or both";
48
+ };
49
+ readonly flightNo: {
50
+ readonly type: "string";
51
+ readonly description: "For a transfer: the flight number, e.g. MU5101";
52
+ };
53
+ readonly pickupTime: {
54
+ readonly type: "string";
55
+ readonly description: "For a transfer: the pick-up time, HH:MM";
56
+ };
57
+ readonly date: {
58
+ readonly type: "string";
59
+ readonly description: "The date it is for, YYYY-MM-DD";
60
+ };
61
+ readonly quantity: {
62
+ readonly type: "integer";
63
+ readonly minimum: 1;
64
+ readonly maximum: 10;
65
+ readonly description: "How many, 1 to 10, for an add-on that is bought by the piece. Default 1";
66
+ };
67
+ readonly partySize: {
68
+ readonly type: "integer";
69
+ readonly minimum: 1;
70
+ readonly maximum: 10;
71
+ readonly description: "For a transfer: how many passengers, 1 to 10. Default 1";
72
+ };
73
+ };
74
+ readonly required: readonly ["booking", "addon"];
75
+ };
76
+ };
77
+ export declare const shopItemsTools: ({ n, open }: ToolEnv) => readonly [] | readonly [{
78
+ readonly name: string;
79
+ readonly description: "The value-added services (增值服务): goods in Otaless's shop to buy for a stay, not rooms - each with its id, name, price and currency, whether it is available and its options. With `item` it opens one item. It only reads the shop; nothing is ordered.";
80
+ readonly annotations: {
81
+ readonly title: string;
82
+ readonly readOnlyHint: true;
83
+ readonly destructiveHint: false;
84
+ readonly idempotentHint: true;
85
+ readonly openWorldHint: boolean;
86
+ };
87
+ readonly inputSchema: {
88
+ readonly type: "object";
89
+ readonly properties: {
90
+ readonly query: {
91
+ readonly type: "string";
92
+ readonly description: "Words in the item name";
93
+ };
94
+ readonly category: {
95
+ readonly type: "string";
96
+ readonly description: "One of the shop's categories";
97
+ };
98
+ readonly maxPrice: {
99
+ readonly type: "number";
100
+ readonly minimum: 0;
101
+ readonly description: "The highest price, in the shop's currency (US dollars)";
102
+ };
103
+ readonly item: {
104
+ readonly type: "string";
105
+ readonly description: "An item id, as this tool listed it, for that one item in detail";
106
+ };
107
+ };
108
+ };
109
+ }];
110
+ export declare const shopOrdersTools: ({ n, open }: ToolEnv) => readonly [] | readonly [{
111
+ readonly name: string;
112
+ readonly description: "The value-added service orders (增值服务订单) of the Otaless account signed in here: goods bought from the Otaless shop to go with a stay - not hotel bookings. 增值服务订单, 商城订单, shop orders and add-on orders are all the same thing. Each order comes with its item, total and currency, status, order id, the hotel booking it was bought with where that is known, and when it was ordered and paid where that is known (in UTC); cancelled ones are listed as the shop has them. It only reads: nothing is ordered, paid or cancelled. Nothing is listed when no account is signed in.";
113
+ readonly annotations: {
114
+ readonly title: string;
115
+ readonly readOnlyHint: true;
116
+ readonly destructiveHint: false;
117
+ readonly idempotentHint: true;
118
+ readonly openWorldHint: boolean;
119
+ };
120
+ readonly inputSchema: {
121
+ readonly type: "object";
122
+ readonly properties: {};
123
+ };
124
+ }];
125
+ export declare const buyShopItemTools: ({ n, open }: ToolEnv) => readonly [] | readonly [{
126
+ readonly name: string;
127
+ readonly description: "Prepares buying one value-added service (增值服务: a shop item) to go with the guest's own hotel booking. It does NOT order or charge anything: the answer gives a one-time page address for the guest to open in the browser signed in to their account, where they see the item, the quantity and the total and press confirm themselves - and when they do, the backend charges a card linked to their account, or gives a payment link if there is none. Pass that link on; never say the item was ordered or paid until the guest confirmed and the shop says so. It checks the price against the one the guest was shown and refuses a booking that is not theirs or is over.";
128
+ readonly annotations: {
129
+ readonly title: string;
130
+ readonly readOnlyHint: false;
131
+ readonly destructiveHint: false;
132
+ readonly idempotentHint: false;
133
+ readonly openWorldHint: boolean;
134
+ };
135
+ readonly inputSchema: {
136
+ readonly type: "object";
137
+ readonly properties: {
138
+ readonly item: {
139
+ readonly type: "string";
140
+ readonly description: "The item id, as the shop listing gave it";
141
+ };
142
+ readonly option: {
143
+ readonly type: "string";
144
+ readonly description: "One of the item's options, exactly as listed - for an item that has options";
145
+ };
146
+ readonly quantity: {
147
+ readonly type: "integer";
148
+ readonly minimum: 1;
149
+ readonly maximum: 10;
150
+ readonly description: "How many, 1 to 10";
151
+ };
152
+ readonly booking: {
153
+ readonly type: "string";
154
+ readonly description: "The confirmation code of the guest's own hotel booking this goes with";
155
+ };
156
+ readonly unitPrice: {
157
+ readonly type: "number";
158
+ readonly exclusiveMinimum: 0;
159
+ readonly description: "The price of one, as the guest was shown it";
160
+ };
161
+ readonly currency: {
162
+ readonly type: "string";
163
+ readonly description: "Its currency code, as the guest was shown it";
164
+ };
165
+ };
166
+ readonly required: readonly ["item", "quantity", "booking", "unitPrice", "currency"];
167
+ };
168
+ }];
169
+ export declare const cardAddonsTools: ({ n, open }: ToolEnv) => readonly [] | readonly [{
170
+ readonly name: string;
171
+ readonly description: "The card's own steps for the value-added services (增值服务) of a booking made here: `view` reads what can be added (the shop's goods, and the hotel's own services where they are offered) fresh; `buy_shop_item` (and `book_hotel_addon`, where hotel services are offered) is the guest's press on a confirm screen that showed the item, the quantity and the total - each answers with `addonResult` and a fresh `addonsView`; `shop_status` reads whether a shop `order` the guest is paying for is paid yet (a read, nothing changes). Never the assistant's: nothing here is called without the guest's press.";
172
+ readonly annotations: {
173
+ readonly title: string;
174
+ readonly readOnlyHint: false;
175
+ readonly destructiveHint: true;
176
+ readonly idempotentHint: false;
177
+ readonly openWorldHint: boolean;
178
+ };
179
+ readonly inputSchema: {
180
+ readonly type: "object";
181
+ readonly properties: {
182
+ readonly action: {
183
+ readonly type: "string";
184
+ readonly enum: readonly ["view", "book_hotel_addon", "buy_shop_item", "shop_status"];
185
+ };
186
+ readonly booking: {
187
+ readonly type: "string";
188
+ readonly description: "The confirmation code of the guest's own booking";
189
+ };
190
+ readonly catalogId: {
191
+ readonly type: "string";
192
+ readonly description: "book_hotel_addon: the add-on id";
193
+ };
194
+ readonly direction: {
195
+ readonly type: "string";
196
+ readonly enum: readonly ["arrival", "departure", "round_trip"];
197
+ };
198
+ readonly flightNo: {
199
+ readonly type: "string";
200
+ };
201
+ readonly pickupTime: {
202
+ readonly type: "string";
203
+ readonly description: "HH:MM";
204
+ };
205
+ readonly date: {
206
+ readonly type: "string";
207
+ readonly description: "YYYY-MM-DD";
208
+ };
209
+ readonly quantity: {
210
+ readonly type: "integer";
211
+ readonly minimum: 1;
212
+ readonly maximum: 10;
213
+ };
214
+ readonly partySize: {
215
+ readonly type: "integer";
216
+ readonly minimum: 1;
217
+ readonly maximum: 10;
218
+ };
219
+ readonly shownTotal: {
220
+ readonly type: "string";
221
+ readonly description: "book_hotel_addon: the total the confirm screen showed, 2 decimals";
222
+ };
223
+ readonly currency: {
224
+ readonly type: "string";
225
+ readonly description: "The currency the screen showed";
226
+ };
227
+ readonly item: {
228
+ readonly type: "string";
229
+ readonly description: "buy_shop_item: the shop item id";
230
+ };
231
+ readonly order: {
232
+ readonly type: "string";
233
+ readonly description: "shop_status: the shop order id buy_shop_item answered with";
234
+ };
235
+ readonly option: {
236
+ readonly type: "string";
237
+ readonly description: "buy_shop_item: the option, as listed";
238
+ };
239
+ readonly shownUnit: {
240
+ readonly type: "string";
241
+ readonly description: "buy_shop_item: the price of one the screen showed, 2 decimals";
242
+ };
243
+ readonly press: {
244
+ readonly type: "string";
245
+ readonly description: "Made once per confirm screen and sent again unchanged on a retry of the same screen";
246
+ };
247
+ };
248
+ readonly required: readonly ["action", "booking"];
249
+ };
250
+ }];
251
+ //# sourceMappingURL=tool-defs-addons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-defs-addons.d.ts","sourceRoot":"","sources":["../../src/tools/tool-defs-addons.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAK7C,eAAO,MAAM,qBAAqB,GAAI,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;CAgB7C,CAAC;AAEd,eAAO,MAAM,mBAAmB,GAAI,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C3C,CAAC;AAGd,eAAO,MAAM,cAAc,GAAI,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BlD,CAAC;AAIF,eAAO,MAAM,eAAe,GAAI,aAAa,OAAO;;;;;;;;;;;;;;EAWnD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CpD,CAAC;AAKF,eAAO,MAAM,eAAe,GAAI,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDnD,CAAC"}
@@ -0,0 +1,198 @@
1
+ import { SHOP_ORDERS_DESCRIPTION } from './output-schemas.js';
2
+ import { books, orders, reads } from './tool-set.js';
3
+ // The tools of the add-ons of a booking, and of the add-on shop.
4
+ export const listBookingAddonsTool = ({ n, open }) => ({
5
+ name: n.listBookingAddons,
6
+ description: 'What can be added to a booking made here after it was made - an airport transfer and the like - each with its id, name, price and the details it needs. Only a booking made here has any.',
7
+ annotations: reads('Add-ons for a booking', open),
8
+ inputSchema: {
9
+ type: 'object',
10
+ properties: {
11
+ booking: {
12
+ type: 'string',
13
+ description: 'The confirmation code or order id, as the booking answer gave it',
14
+ },
15
+ },
16
+ required: ['booking'],
17
+ },
18
+ });
19
+ export const addBookingAddonTool = ({ n, open }) => ({
20
+ name: n.addBookingAddon,
21
+ // ⚠️ 0.82.0: THIS TOOL NEVER ADDS ANYTHING. It prepares the add-on and answers with a one-time page
22
+ // the GUEST opens and presses confirm on (the same press the card's button is): nothing is sent to the
23
+ // group, and nothing is ever said to be added, until that press.
24
+ description: 'Prepares adding one add-on to a booking made here, at the price the add-on list gave. It does NOT add it: the answer gives a one-time page address for the guest to open in the browser signed in to their account, where they see the add-on, the price, the total and the booking, and press confirm themselves. Pass that link on; never say the add-on was added until the guest has confirmed it and the booking says so. It checks the id, the details and the price again as it prepares, and refuses a booking that is not theirs or is over.',
25
+ annotations: books('Prepare an add-on for a booking', open),
26
+ inputSchema: {
27
+ type: 'object',
28
+ properties: {
29
+ booking: {
30
+ type: 'string',
31
+ description: 'The confirmation code or order id, as the booking answer gave it',
32
+ },
33
+ addon: { type: 'string', description: 'The add-on id, as the add-on list gave it' },
34
+ direction: {
35
+ type: 'string',
36
+ enum: ['arrival', 'departure', 'round_trip'],
37
+ description: 'For a transfer: to the hotel, from it, or both',
38
+ },
39
+ flightNo: {
40
+ type: 'string',
41
+ description: 'For a transfer: the flight number, e.g. MU5101',
42
+ },
43
+ pickupTime: { type: 'string', description: 'For a transfer: the pick-up time, HH:MM' },
44
+ date: { type: 'string', description: 'The date it is for, YYYY-MM-DD' },
45
+ quantity: {
46
+ type: 'integer',
47
+ minimum: 1,
48
+ maximum: 10,
49
+ description: 'How many, 1 to 10, for an add-on that is bought by the piece. Default 1',
50
+ },
51
+ partySize: {
52
+ type: 'integer',
53
+ minimum: 1,
54
+ maximum: 10,
55
+ description: 'For a transfer: how many passengers, 1 to 10. Default 1',
56
+ },
57
+ },
58
+ required: ['booking', 'addon'],
59
+ },
60
+ });
61
+ // The add-on shop (`capabilities.shop`): goods sold beside the rooms. Not instructions - what the tools do.
62
+ export const shopItemsTools = ({ n, open }) => {
63
+ return n.listShopItems
64
+ ? [
65
+ {
66
+ name: n.listShopItems,
67
+ description: "The value-added services (增值服务): goods in Otaless's shop to buy for a stay, not rooms - each with its id, name, price and currency, whether it is available and its options. With `item` it opens one item. It only reads the shop; nothing is ordered.",
68
+ annotations: reads('Shop items', open),
69
+ inputSchema: {
70
+ type: 'object',
71
+ properties: {
72
+ query: { type: 'string', description: 'Words in the item name' },
73
+ category: { type: 'string', description: "One of the shop's categories" },
74
+ maxPrice: {
75
+ type: 'number',
76
+ minimum: 0,
77
+ description: "The highest price, in the shop's currency (US dollars)",
78
+ },
79
+ item: {
80
+ type: 'string',
81
+ description: 'An item id, as this tool listed it, for that one item in detail',
82
+ },
83
+ },
84
+ },
85
+ },
86
+ ]
87
+ : [];
88
+ };
89
+ // ⚠️ THE ACCOUNT'S VALUE-ADDED SERVICE ORDERS ON THEIR OWN (0.84.1, robin 11-25: 「首选把我酒店预订订单先
90
+ // 出来,然后没有时间」): asked for its shop orders, the model read the hotel bookings first. Read only.
91
+ export const shopOrdersTools = ({ n, open }) => {
92
+ return n.listShopOrders
93
+ ? [
94
+ {
95
+ name: n.listShopOrders,
96
+ description: SHOP_ORDERS_DESCRIPTION,
97
+ annotations: reads('Value-added service orders', open),
98
+ inputSchema: { type: 'object', properties: {} },
99
+ },
100
+ ]
101
+ : [];
102
+ };
103
+ export const buyShopItemTools = ({ n, open }) => {
104
+ return n.buyShopItem
105
+ ? [
106
+ {
107
+ name: n.buyShopItem,
108
+ description: "Prepares buying one value-added service (增值服务: a shop item) to go with the guest's own hotel booking. It does NOT order or charge anything: the answer gives a one-time page address for the guest to open in the browser signed in to their account, where they see the item, the quantity and the total and press confirm themselves - and when they do, the backend charges a card linked to their account, or gives a payment link if there is none. Pass that link on; never say the item was ordered or paid until the guest confirmed and the shop says so. It checks the price against the one the guest was shown and refuses a booking that is not theirs or is over.",
109
+ annotations: books('Prepare a shop purchase', open),
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties: {
113
+ item: { type: 'string', description: 'The item id, as the shop listing gave it' },
114
+ option: {
115
+ type: 'string',
116
+ description: "One of the item's options, exactly as listed - for an item that has options",
117
+ },
118
+ quantity: {
119
+ type: 'integer',
120
+ minimum: 1,
121
+ maximum: 10,
122
+ description: 'How many, 1 to 10',
123
+ },
124
+ booking: {
125
+ type: 'string',
126
+ description: "The confirmation code of the guest's own hotel booking this goes with",
127
+ },
128
+ unitPrice: {
129
+ type: 'number',
130
+ exclusiveMinimum: 0,
131
+ description: 'The price of one, as the guest was shown it',
132
+ },
133
+ currency: {
134
+ type: 'string',
135
+ description: 'Its currency code, as the guest was shown it',
136
+ },
137
+ },
138
+ required: ['item', 'quantity', 'booking', 'unitPrice', 'currency'],
139
+ },
140
+ },
141
+ ]
142
+ : [];
143
+ };
144
+ // ⚠️ THE CARD'S OWN STEPS FOR ADDING TO A BOOKING (0.82.0, app-only: server.ts). Every write needs the
145
+ // guest's own press on the confirm screen: its `press` is made once per screen, and a value the
146
+ // screen did not show is `used`. No parameter here means "confirmed" - the press is the whole yes.
147
+ export const cardAddonsTools = ({ n, open }) => {
148
+ return n.cardAddons
149
+ ? [
150
+ {
151
+ name: n.cardAddons,
152
+ description: `The card's own steps for the value-added services (增值服务) of a booking made here: \`view\` reads what can be added (the shop's goods, and the hotel's own services where they are offered) fresh; \`buy_shop_item\` (and \`book_hotel_addon\`, where hotel services are offered) is the guest's press on a confirm screen that showed the item, the quantity and the total - each answers with \`addonResult\` and a fresh \`addonsView\`; \`shop_status\` reads whether a shop \`order\` the guest is paying for is paid yet (a read, nothing changes). Never the assistant's: nothing here is called without the guest's press.`,
153
+ annotations: orders('Add to a booking', open),
154
+ inputSchema: {
155
+ type: 'object',
156
+ properties: {
157
+ action: {
158
+ type: 'string',
159
+ enum: ['view', 'book_hotel_addon', 'buy_shop_item', 'shop_status'],
160
+ },
161
+ booking: {
162
+ type: 'string',
163
+ description: "The confirmation code of the guest's own booking",
164
+ },
165
+ catalogId: { type: 'string', description: 'book_hotel_addon: the add-on id' },
166
+ direction: { type: 'string', enum: ['arrival', 'departure', 'round_trip'] },
167
+ flightNo: { type: 'string' },
168
+ pickupTime: { type: 'string', description: 'HH:MM' },
169
+ date: { type: 'string', description: 'YYYY-MM-DD' },
170
+ quantity: { type: 'integer', minimum: 1, maximum: 10 },
171
+ partySize: { type: 'integer', minimum: 1, maximum: 10 },
172
+ shownTotal: {
173
+ type: 'string',
174
+ description: 'book_hotel_addon: the total the confirm screen showed, 2 decimals',
175
+ },
176
+ currency: { type: 'string', description: 'The currency the screen showed' },
177
+ item: { type: 'string', description: 'buy_shop_item: the shop item id' },
178
+ order: {
179
+ type: 'string',
180
+ description: 'shop_status: the shop order id buy_shop_item answered with',
181
+ },
182
+ option: { type: 'string', description: 'buy_shop_item: the option, as listed' },
183
+ shownUnit: {
184
+ type: 'string',
185
+ description: 'buy_shop_item: the price of one the screen showed, 2 decimals',
186
+ },
187
+ press: {
188
+ type: 'string',
189
+ description: 'Made once per confirm screen and sent again unchanged on a retry of the same screen',
190
+ },
191
+ },
192
+ required: ['action', 'booking'],
193
+ },
194
+ },
195
+ ]
196
+ : [];
197
+ };
198
+ //# sourceMappingURL=tool-defs-addons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-defs-addons.js","sourceRoot":"","sources":["../../src/tools/tool-defs-addons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAErD,iEAAiE;AAEjE,MAAM,CAA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