@curless/hotel-storefront 0.85.0 → 0.87.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 (251) hide show
  1. package/dist/server.d.ts +1 -1
  2. package/dist/server.js +1 -1
  3. package/dist/tools/accept-terms.d.ts +4 -0
  4. package/dist/tools/accept-terms.d.ts.map +1 -0
  5. package/dist/tools/accept-terms.js +26 -0
  6. package/dist/tools/accept-terms.js.map +1 -0
  7. package/dist/tools/add-booking-addon.d.ts +4 -0
  8. package/dist/tools/add-booking-addon.d.ts.map +1 -0
  9. package/dist/tools/add-booking-addon.js +44 -0
  10. package/dist/tools/add-booking-addon.js.map +1 -0
  11. package/dist/tools/add-to-trip.d.ts +4 -0
  12. package/dist/tools/add-to-trip.d.ts.map +1 -0
  13. package/dist/tools/add-to-trip.js +49 -0
  14. package/dist/tools/add-to-trip.js.map +1 -0
  15. package/dist/tools/all-tools.d.ts +19124 -0
  16. package/dist/tools/all-tools.d.ts.map +1 -0
  17. package/dist/tools/all-tools.js +43 -0
  18. package/dist/tools/all-tools.js.map +1 -0
  19. package/dist/tools/answer.d.ts +3 -0
  20. package/dist/tools/answer.d.ts.map +1 -0
  21. package/dist/tools/answer.js +104 -0
  22. package/dist/tools/answer.js.map +1 -0
  23. package/dist/tools/args.d.ts +149 -0
  24. package/dist/tools/args.d.ts.map +1 -0
  25. package/dist/tools/args.js +176 -0
  26. package/dist/tools/args.js.map +1 -0
  27. package/dist/tools/base-output-schemas.d.ts +3 -0
  28. package/dist/tools/base-output-schemas.d.ts.map +1 -0
  29. package/dist/tools/base-output-schemas.js +396 -0
  30. package/dist/tools/base-output-schemas.js.map +1 -0
  31. package/dist/tools/book-picked.d.ts +4 -0
  32. package/dist/tools/book-picked.d.ts.map +1 -0
  33. package/dist/tools/book-picked.js +14 -0
  34. package/dist/tools/book-picked.js.map +1 -0
  35. package/dist/tools/booking-answer.d.ts +24 -0
  36. package/dist/tools/booking-answer.d.ts.map +1 -0
  37. package/dist/tools/booking-answer.js +567 -0
  38. package/dist/tools/booking-answer.js.map +1 -0
  39. package/dist/tools/buy-shop-item.d.ts +4 -0
  40. package/dist/tools/buy-shop-item.d.ts.map +1 -0
  41. package/dist/tools/buy-shop-item.js +45 -0
  42. package/dist/tools/buy-shop-item.js.map +1 -0
  43. package/dist/tools/call.d.ts +11 -0
  44. package/dist/tools/call.d.ts.map +1 -0
  45. package/dist/tools/call.js +2 -0
  46. package/dist/tools/call.js.map +1 -0
  47. package/dist/tools/cancel-facts.d.ts +281 -0
  48. package/dist/tools/cancel-facts.d.ts.map +1 -0
  49. package/dist/tools/cancel-facts.js +309 -0
  50. package/dist/tools/cancel-facts.js.map +1 -0
  51. package/dist/tools/cancel.d.ts +4 -0
  52. package/dist/tools/cancel.d.ts.map +1 -0
  53. package/dist/tools/cancel.js +415 -0
  54. package/dist/tools/cancel.js.map +1 -0
  55. package/dist/tools/capability-adjust.d.ts +31 -0
  56. package/dist/tools/capability-adjust.d.ts.map +1 -0
  57. package/dist/tools/capability-adjust.js +299 -0
  58. package/dist/tools/capability-adjust.js.map +1 -0
  59. package/dist/tools/card-addons.d.ts +4 -0
  60. package/dist/tools/card-addons.d.ts.map +1 -0
  61. package/dist/tools/card-addons.js +76 -0
  62. package/dist/tools/card-addons.js.map +1 -0
  63. package/dist/tools/change-booking.d.ts +4 -0
  64. package/dist/tools/change-booking.d.ts.map +1 -0
  65. package/dist/tools/change-booking.js +145 -0
  66. package/dist/tools/change-booking.js.map +1 -0
  67. package/dist/tools/clear-trip.d.ts +4 -0
  68. package/dist/tools/clear-trip.d.ts.map +1 -0
  69. package/dist/tools/clear-trip.js +10 -0
  70. package/dist/tools/clear-trip.js.map +1 -0
  71. package/dist/tools/compare.d.ts +4 -0
  72. package/dist/tools/compare.d.ts.map +1 -0
  73. package/dist/tools/compare.js +114 -0
  74. package/dist/tools/compare.js.map +1 -0
  75. package/dist/tools/current-trip.d.ts +70 -0
  76. package/dist/tools/current-trip.d.ts.map +1 -0
  77. package/dist/tools/current-trip.js +269 -0
  78. package/dist/tools/current-trip.js.map +1 -0
  79. package/dist/tools/deps.d.ts +229 -0
  80. package/dist/tools/deps.d.ts.map +1 -0
  81. package/dist/tools/deps.js +2 -0
  82. package/dist/tools/deps.js.map +1 -0
  83. package/dist/tools/follow-ups.d.ts +120 -0
  84. package/dist/tools/follow-ups.d.ts.map +1 -0
  85. package/dist/tools/follow-ups.js +369 -0
  86. package/dist/tools/follow-ups.js.map +1 -0
  87. package/dist/tools/forget-preferences.d.ts +4 -0
  88. package/dist/tools/forget-preferences.d.ts.map +1 -0
  89. package/dist/tools/forget-preferences.js +24 -0
  90. package/dist/tools/forget-preferences.js.map +1 -0
  91. package/dist/tools/get-hotel.d.ts +4 -0
  92. package/dist/tools/get-hotel.d.ts.map +1 -0
  93. package/dist/tools/get-hotel.js +350 -0
  94. package/dist/tools/get-hotel.js.map +1 -0
  95. package/dist/tools/hotel-choices.d.ts +132 -0
  96. package/dist/tools/hotel-choices.d.ts.map +1 -0
  97. package/dist/tools/hotel-choices.js +587 -0
  98. package/dist/tools/hotel-choices.js.map +1 -0
  99. package/dist/tools/itinerary.d.ts +4 -0
  100. package/dist/tools/itinerary.d.ts.map +1 -0
  101. package/dist/tools/itinerary.js +158 -0
  102. package/dist/tools/itinerary.js.map +1 -0
  103. package/dist/tools/list-booking-addons.d.ts +4 -0
  104. package/dist/tools/list-booking-addons.d.ts.map +1 -0
  105. package/dist/tools/list-booking-addons.js +21 -0
  106. package/dist/tools/list-booking-addons.js.map +1 -0
  107. package/dist/tools/list-bookings.d.ts +4 -0
  108. package/dist/tools/list-bookings.d.ts.map +1 -0
  109. package/dist/tools/list-bookings.js +119 -0
  110. package/dist/tools/list-bookings.js.map +1 -0
  111. package/dist/tools/list-extras.d.ts +4 -0
  112. package/dist/tools/list-extras.d.ts.map +1 -0
  113. package/dist/tools/list-extras.js +90 -0
  114. package/dist/tools/list-extras.js.map +1 -0
  115. package/dist/tools/list-hotels-ask.d.ts +133 -0
  116. package/dist/tools/list-hotels-ask.d.ts.map +1 -0
  117. package/dist/tools/list-hotels-ask.js +326 -0
  118. package/dist/tools/list-hotels-ask.js.map +1 -0
  119. package/dist/tools/list-hotels-empty.d.ts +5 -0
  120. package/dist/tools/list-hotels-empty.d.ts.map +1 -0
  121. package/dist/tools/list-hotels-empty.js +130 -0
  122. package/dist/tools/list-hotels-empty.js.map +1 -0
  123. package/dist/tools/list-hotels-home.d.ts +9 -0
  124. package/dist/tools/list-hotels-home.d.ts.map +1 -0
  125. package/dist/tools/list-hotels-home.js +181 -0
  126. package/dist/tools/list-hotels-home.js.map +1 -0
  127. package/dist/tools/list-hotels-page.d.ts +43 -0
  128. package/dist/tools/list-hotels-page.d.ts.map +1 -0
  129. package/dist/tools/list-hotels-page.js +344 -0
  130. package/dist/tools/list-hotels-page.js.map +1 -0
  131. package/dist/tools/list-hotels.d.ts +4 -0
  132. package/dist/tools/list-hotels.d.ts.map +1 -0
  133. package/dist/tools/list-hotels.js +24 -0
  134. package/dist/tools/list-hotels.js.map +1 -0
  135. package/dist/tools/list-shop-items.d.ts +4 -0
  136. package/dist/tools/list-shop-items.d.ts.map +1 -0
  137. package/dist/tools/list-shop-items.js +34 -0
  138. package/dist/tools/list-shop-items.js.map +1 -0
  139. package/dist/tools/list-shop-orders.d.ts +4 -0
  140. package/dist/tools/list-shop-orders.d.ts.map +1 -0
  141. package/dist/tools/list-shop-orders.js +22 -0
  142. package/dist/tools/list-shop-orders.js.map +1 -0
  143. package/dist/tools/look-up.d.ts +4 -0
  144. package/dist/tools/look-up.d.ts.map +1 -0
  145. package/dist/tools/look-up.js +207 -0
  146. package/dist/tools/look-up.js.map +1 -0
  147. package/dist/tools/output-schemas.d.ts +645 -0
  148. package/dist/tools/output-schemas.d.ts.map +1 -0
  149. package/dist/tools/output-schemas.js +503 -0
  150. package/dist/tools/output-schemas.js.map +1 -0
  151. package/dist/tools/paid-lines.d.ts +718 -0
  152. package/dist/tools/paid-lines.d.ts.map +1 -0
  153. package/dist/tools/paid-lines.js +359 -0
  154. package/dist/tools/paid-lines.js.map +1 -0
  155. package/dist/tools/pay-with-union-pay.d.ts +4 -0
  156. package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
  157. package/dist/tools/pay-with-union-pay.js +112 -0
  158. package/dist/tools/pay-with-union-pay.js.map +1 -0
  159. package/dist/tools/payment-words.d.ts +269 -0
  160. package/dist/tools/payment-words.d.ts.map +1 -0
  161. package/dist/tools/payment-words.js +365 -0
  162. package/dist/tools/payment-words.js.map +1 -0
  163. package/dist/tools/pick-room.d.ts +4 -0
  164. package/dist/tools/pick-room.d.ts.map +1 -0
  165. package/dist/tools/pick-room.js +23 -0
  166. package/dist/tools/pick-room.js.map +1 -0
  167. package/dist/tools/policies.d.ts +4 -0
  168. package/dist/tools/policies.d.ts.map +1 -0
  169. package/dist/tools/policies.js +74 -0
  170. package/dist/tools/policies.js.map +1 -0
  171. package/dist/tools/pricing.d.ts +55 -0
  172. package/dist/tools/pricing.d.ts.map +1 -0
  173. package/dist/tools/pricing.js +260 -0
  174. package/dist/tools/pricing.js.map +1 -0
  175. package/dist/tools/put-room-line.d.ts +12 -0
  176. package/dist/tools/put-room-line.d.ts.map +1 -0
  177. package/dist/tools/put-room-line.js +347 -0
  178. package/dist/tools/put-room-line.js.map +1 -0
  179. package/dist/tools/quote-card.d.ts +234 -0
  180. package/dist/tools/quote-card.d.ts.map +1 -0
  181. package/dist/tools/quote-card.js +375 -0
  182. package/dist/tools/quote-card.js.map +1 -0
  183. package/dist/tools/refund-booking.d.ts +4 -0
  184. package/dist/tools/refund-booking.d.ts.map +1 -0
  185. package/dist/tools/refund-booking.js +112 -0
  186. package/dist/tools/refund-booking.js.map +1 -0
  187. package/dist/tools/request-booking.d.ts +4 -0
  188. package/dist/tools/request-booking.d.ts.map +1 -0
  189. package/dist/tools/request-booking.js +5 -0
  190. package/dist/tools/request-booking.js.map +1 -0
  191. package/dist/tools/request-words.d.ts +238 -0
  192. package/dist/tools/request-words.d.ts.map +1 -0
  193. package/dist/tools/request-words.js +487 -0
  194. package/dist/tools/request-words.js.map +1 -0
  195. package/dist/tools/room-choices.d.ts +64 -0
  196. package/dist/tools/room-choices.d.ts.map +1 -0
  197. package/dist/tools/room-choices.js +374 -0
  198. package/dist/tools/room-choices.js.map +1 -0
  199. package/dist/tools/session-notes.d.ts +164 -0
  200. package/dist/tools/session-notes.d.ts.map +1 -0
  201. package/dist/tools/session-notes.js +412 -0
  202. package/dist/tools/session-notes.js.map +1 -0
  203. package/dist/tools/sign-in.d.ts +4 -0
  204. package/dist/tools/sign-in.d.ts.map +1 -0
  205. package/dist/tools/sign-in.js +72 -0
  206. package/dist/tools/sign-in.js.map +1 -0
  207. package/dist/tools/sign-out.d.ts +4 -0
  208. package/dist/tools/sign-out.d.ts.map +1 -0
  209. package/dist/tools/sign-out.js +13 -0
  210. package/dist/tools/sign-out.js.map +1 -0
  211. package/dist/tools/terms-answer.d.ts +114 -0
  212. package/dist/tools/terms-answer.d.ts.map +1 -0
  213. package/dist/tools/terms-answer.js +492 -0
  214. package/dist/tools/terms-answer.js.map +1 -0
  215. package/dist/tools/tool-defs-account.d.ts +80 -0
  216. package/dist/tools/tool-defs-account.d.ts.map +1 -0
  217. package/dist/tools/tool-defs-account.js +65 -0
  218. package/dist/tools/tool-defs-account.js.map +1 -0
  219. package/dist/tools/tool-defs-addons.d.ts +251 -0
  220. package/dist/tools/tool-defs-addons.d.ts.map +1 -0
  221. package/dist/tools/tool-defs-addons.js +198 -0
  222. package/dist/tools/tool-defs-addons.js.map +1 -0
  223. package/dist/tools/tool-defs-booking.d.ts +410 -0
  224. package/dist/tools/tool-defs-booking.d.ts.map +1 -0
  225. package/dist/tools/tool-defs-booking.js +285 -0
  226. package/dist/tools/tool-defs-booking.js.map +1 -0
  227. package/dist/tools/tool-defs-browse.d.ts +444 -0
  228. package/dist/tools/tool-defs-browse.d.ts.map +1 -0
  229. package/dist/tools/tool-defs-browse.js +307 -0
  230. package/dist/tools/tool-defs-browse.js.map +1 -0
  231. package/dist/tools/tool-defs-trip.d.ts +136 -0
  232. package/dist/tools/tool-defs-trip.d.ts.map +1 -0
  233. package/dist/tools/tool-defs-trip.js +79 -0
  234. package/dist/tools/tool-defs-trip.js.map +1 -0
  235. package/dist/tools/tool-env.d.ts +64 -0
  236. package/dist/tools/tool-env.d.ts.map +1 -0
  237. package/dist/tools/tool-env.js +49 -0
  238. package/dist/tools/tool-env.js.map +1 -0
  239. package/dist/tools/tool-set.d.ts +1425 -0
  240. package/dist/tools/tool-set.d.ts.map +1 -0
  241. package/dist/tools/tool-set.js +244 -0
  242. package/dist/tools/tool-set.js.map +1 -0
  243. package/dist/tools/view-trip.d.ts +4 -0
  244. package/dist/tools/view-trip.d.ts.map +1 -0
  245. package/dist/tools/view-trip.js +7 -0
  246. package/dist/tools/view-trip.js.map +1 -0
  247. package/dist/tools.d.ts +13 -2089
  248. package/dist/tools.d.ts.map +1 -1
  249. package/dist/tools.js +11 -10685
  250. package/dist/tools.js.map +1 -1
  251. package/package.json +1 -1
@@ -0,0 +1,285 @@
1
+ import { MAX_EXTRA_QUANTITY, MAX_ROOMS_PER_LINE } from '../trip.js';
2
+ import { aBrandOf } from '../vocab.js';
3
+ import { REFUND_REASON_MAX } from './output-schemas.js';
4
+ import { books, cancels, orders, reads, replaces } from './tool-set.js';
5
+ // The tools that book and deal with a booking: asking for the rooms, finding, cancelling, changing, refunding - and the card's own steps beside them.
6
+ export const requestBookingTool = ({ n, v, open, guestProps }) => ({
7
+ name: n.requestBooking,
8
+ // ⚠️ A DEMONSTRATION BOOKING IS SAID AS ONE (2026-10-05 audit, P2):
9
+ // "asks Shangri-La to hold the rooms" read as a real hold, and a guest
10
+ // could take the code to the real hotel.
11
+ description: v.market
12
+ ? // ⚠️ THE GROUP HOLDS THE BOOKING, NOT THE MARKET - and what a booking
13
+ // makes is the group's: a hold, a booking that holds no room, or a
14
+ // reservation paid at the hotel. The answer says which, stay by stay.
15
+ // ⚠️ NO "DEMONSTRATION" / "TEST" / "SIMULATED" (robin, 2026-11-03).
16
+ `Books the trip's rooms for a named guest with the hotel group each stay belongs to, one group at a time: a trip holding two groups' hotels is booked group by group. What a booking makes is that group's - a hold that lapses on its own and is not sent to the group, a booking that holds no room for anyone, or the hotel's own reservation paid at the hotel - and the answer says which for every stay. No payment is taken here and no card is collected. Preferences - a bed type, a floor, a late arrival - ride along on the booking as requests.`
17
+ : v.demo
18
+ ? `Makes a booking request for the trip's rooms, for a named guest: it returns a confirmation code and the moment the hold lapses on its own. ${v.brand} does not receive it and no real room is held. No payment is taken and no card is collected. Preferences - a bed type, a floor, a late arrival - ride along on the request.`
19
+ : `Asks ${v.brand} to hold the trip's rooms for a named guest and returns a confirmation code and the moment the hold lapses. No payment is taken and no card is collected; the rooms are held, not paid for. Preferences - a bed type, a floor, a late arrival - ride along on the booking as requests the desk tries to meet.`,
20
+ annotations: orders(v.market ? `Request a booking on ${v.brand}` : `Request ${aBrandOf(v)} booking`, open),
21
+ inputSchema: {
22
+ type: 'object',
23
+ properties: {
24
+ ...guestProps,
25
+ // A booking is made with one group at a time; a trip holding two
26
+ // groups' hotels is booked group by group (Marketplace, §6-1).
27
+ ...(v.market
28
+ ? {
29
+ group: {
30
+ type: 'string',
31
+ description: "The hotel group to book now, by name, when the trip holds more than one group's hotels. Its stays are booked and the others stay in the trip",
32
+ },
33
+ }
34
+ : {}),
35
+ },
36
+ required: ['name', 'email'],
37
+ },
38
+ });
39
+ export const bookPickedTool = ({ n, v, open, stayProps, guestProps }) => ({
40
+ // ⚠️ THE CARD'S, NEVER THE MODEL'S - the booking form's submit for the
41
+ // picked room. The same booking as request_booking's; only where the
42
+ // room comes from differs (`bookTripLines`).
43
+ name: n.bookPicked,
44
+ description: "The card's own step when the guest submits the booking form for the room they picked with Reserve: books that one room for the named guest, the way a trip's rooms are booked. Leaves the trip as it is.",
45
+ annotations: orders(v.market ? `Book the picked room on ${v.brand}` : `Book the picked ${v.brand} room`, open),
46
+ inputSchema: {
47
+ type: 'object',
48
+ properties: {
49
+ ...guestProps,
50
+ // The room the form shows, as pick_room returned it - see `pickChanged`.
51
+ hotel: { type: 'string', description: `The ${v.noun} id on the form` },
52
+ room: { type: 'string', description: 'The room type id on the form' },
53
+ rooms: {
54
+ type: 'integer',
55
+ minimum: 1,
56
+ maximum: MAX_ROOMS_PER_LINE,
57
+ description: 'How many of that room type the form shows',
58
+ },
59
+ ...stayProps,
60
+ startTime: {
61
+ type: 'string',
62
+ description: 'For a room by the hour: the start the form shows, HH:MM',
63
+ },
64
+ },
65
+ required: ['name', 'email'],
66
+ },
67
+ });
68
+ export const acceptTermsTool = ({ n, v, open }) => ({
69
+ // ⚠️ THE CARD'S, NEVER THE MODEL'S (`ui.visibility: ['app']`, server.ts),
70
+ // AND NO PARAMETER HERE (OR ON ANY TOOL) MEANS "AGREED": the guest's
71
+ // press on "Agree and continue" is the whole of the agreement, and
72
+ // `ref` only says which terms the card was showing.
73
+ name: n.acceptTerms,
74
+ description: `The card's own step when the guest presses "Agree and continue" under a hotel group's booking terms: it sends the guest's agreement to the terms behind \`ref\` and the stay is then booked with the group. It answers like a booking: the booking's payment page, the terms again, or why nothing was booked.`,
75
+ annotations: orders(`Agree to booking terms on ${v.brand}`, open),
76
+ inputSchema: {
77
+ type: 'object',
78
+ properties: {
79
+ ref: {
80
+ type: 'string',
81
+ description: 'The terms the card is showing, by the reference the booking answer gave',
82
+ },
83
+ },
84
+ required: ['ref'],
85
+ },
86
+ });
87
+ export const payWithUnionPayTool = ({ n, v }) => ({
88
+ // ⚠️ THE CARD'S, NEVER THE MODEL'S (`ui.visibility: ['app']`, server.ts):
89
+ // a step of the payment screen a guest pressed. Offered only where the
90
+ // backend pays with UnionPay (`capabilities.unionpay`).
91
+ name: n.payWithUnionPay,
92
+ description: `Pays ${aBrandOf(v)} stay that is waiting for its payment with UnionPay instead of the card page. Answers UnionPay's own page to confirm it on - or, when that email has no UnionPay card on file, UnionPay's page to add one first. Nothing is charged by this call: the guest confirms on UnionPay's page, and the hotel charges the one-time card UnionPay issues for the stay.`,
93
+ annotations: {
94
+ title: 'Pay with UnionPay',
95
+ readOnlyHint: false,
96
+ destructiveHint: false,
97
+ idempotentHint: true,
98
+ openWorldHint: true,
99
+ },
100
+ inputSchema: {
101
+ type: 'object',
102
+ properties: {
103
+ booking: {
104
+ type: 'string',
105
+ description: 'The confirmation code of the stay waiting for its payment',
106
+ },
107
+ email: { type: 'string', description: 'The email the stay was booked with' },
108
+ },
109
+ required: ['booking', 'email'],
110
+ },
111
+ });
112
+ export const listBookingsTool = ({ n, v, open }) => ({
113
+ name: n.listBookings,
114
+ description: 'The bookings made in this conversation, newest to oldest, with their status, dates and confirmation codes. A booking made elsewhere is read and shown as well when both its confirmation code and the email it was made with are given; nothing is changed.',
115
+ annotations: reads(`My ${v.brand} bookings`, open),
116
+ inputSchema: {
117
+ type: 'object',
118
+ properties: {
119
+ booking: {
120
+ type: 'string',
121
+ description: 'A confirmation code, with `email`, for a booking made elsewhere',
122
+ },
123
+ email: { type: 'string', description: 'The email that booking was made with' },
124
+ limit: { type: 'number', description: 'Default 10' },
125
+ },
126
+ },
127
+ });
128
+ export const previewCancellationTool = ({ n, open }) => ({
129
+ name: n.previewCancellation,
130
+ description: 'What cancelling a booking would cost, with the rule it was worked out from and the free-cancellation deadline where the rate has one. Nothing is cancelled.',
131
+ annotations: reads('Preview a cancellation', open),
132
+ inputSchema: {
133
+ type: 'object',
134
+ properties: {
135
+ booking: { type: 'string', description: 'The confirmation code or booking id' },
136
+ email: {
137
+ type: 'string',
138
+ description: 'The email the booking was made with, when it was made elsewhere',
139
+ },
140
+ },
141
+ required: ['booking'],
142
+ },
143
+ });
144
+ export const cancelBookingTool = ({ n, open }) => ({
145
+ name: n.cancelBooking,
146
+ // No other tool is named here, and that is not a stylistic choice: the
147
+ // directory attestation covers descriptions that instruct about other
148
+ // tools. The preview it returns is the same payload the preview tool
149
+ // returns, which is a fact about THIS tool's answer.
150
+ description: 'Cancels a booking. Called without `confirmed` it returns the cancellation preview - the fee and the rule behind it - and cancels nothing; it cancels only when `confirmed` is true.',
151
+ annotations: cancels('Cancel a booking', open),
152
+ inputSchema: {
153
+ type: 'object',
154
+ properties: {
155
+ booking: { type: 'string', description: 'The confirmation code or booking id' },
156
+ confirmed: {
157
+ type: 'boolean',
158
+ description: 'True cancels. Anything else returns the preview',
159
+ },
160
+ reason: { type: 'string', description: 'Optional, kept on the booking' },
161
+ email: {
162
+ type: 'string',
163
+ description: 'The email the booking was made with, when it was made elsewhere',
164
+ },
165
+ },
166
+ required: ['booking'],
167
+ },
168
+ });
169
+ export const previewChangeTool = ({ n, v, open }) => ({
170
+ name: n.previewChange,
171
+ description: `What moving a booking to other nights, another room type or a different number of rooms - or putting an add-on on it, taking one off or changing how many - would cost: what it holds now, what it would hold, and the difference between them. The new nights are priced at what those nights cost today, not at the rate the booking was made on. A rate that cannot be moved, a ${v.noun} that has no room left for the new nights and a booking that is already gone are each said in those words. Nothing is changed.`,
172
+ annotations: reads('Preview a booking change', open),
173
+ inputSchema: {
174
+ type: 'object',
175
+ properties: {
176
+ booking: { type: 'string', description: 'The confirmation code or booking id' },
177
+ checkIn: {
178
+ type: 'string',
179
+ description: 'The new check-in, YYYY-MM-DD. Leave out to keep it',
180
+ },
181
+ checkOut: {
182
+ type: 'string',
183
+ description: 'The new check-out, YYYY-MM-DD. Leave out to keep it',
184
+ },
185
+ rooms: {
186
+ type: 'integer',
187
+ minimum: 1,
188
+ maximum: MAX_ROOMS_PER_LINE,
189
+ description: `How many of that room type, 1 to ${MAX_ROOMS_PER_LINE}. Leave out to keep it`,
190
+ },
191
+ room: {
192
+ type: 'string',
193
+ description: 'A different room type at the same hotel, by id or name',
194
+ },
195
+ extra: {
196
+ type: 'string',
197
+ description: `An add-on at this ${v.noun}, by id or name, to put on the booking, take off or change - with \`quantity\``,
198
+ },
199
+ quantity: {
200
+ type: 'integer',
201
+ minimum: 0,
202
+ maximum: MAX_EXTRA_QUANTITY,
203
+ description: `How many of that add-on the booking should hold, 0 to ${MAX_EXTRA_QUANTITY}; 0 takes it off`,
204
+ },
205
+ email: {
206
+ type: 'string',
207
+ description: 'The email the booking was made with, when it was made elsewhere',
208
+ },
209
+ },
210
+ required: ['booking'],
211
+ },
212
+ });
213
+ export const changeBookingTool = ({ n, v, open }) => ({
214
+ name: n.changeBooking,
215
+ description: 'Moves a booking to other nights, another room type or a different number of rooms, or sets one of its add-ons (`extra` and `quantity`; 0 takes it off). Called without `confirmed` it returns the same preview - the two stays and the difference - and changes nothing; it changes only when `confirmed` is true. The confirmation code stays the same.',
216
+ annotations: replaces('Change a booking', open),
217
+ inputSchema: {
218
+ type: 'object',
219
+ properties: {
220
+ booking: { type: 'string', description: 'The confirmation code or booking id' },
221
+ checkIn: {
222
+ type: 'string',
223
+ description: 'The new check-in, YYYY-MM-DD. Leave out to keep it',
224
+ },
225
+ checkOut: {
226
+ type: 'string',
227
+ description: 'The new check-out, YYYY-MM-DD. Leave out to keep it',
228
+ },
229
+ rooms: {
230
+ type: 'integer',
231
+ minimum: 1,
232
+ maximum: MAX_ROOMS_PER_LINE,
233
+ description: `How many of that room type, 1 to ${MAX_ROOMS_PER_LINE}. Leave out to keep it`,
234
+ },
235
+ room: {
236
+ type: 'string',
237
+ description: 'A different room type at the same hotel, by id or name',
238
+ },
239
+ extra: {
240
+ type: 'string',
241
+ description: `An add-on at this ${v.noun}, by id or name, to put on the booking, take off or change - with \`quantity\``,
242
+ },
243
+ quantity: {
244
+ type: 'integer',
245
+ minimum: 0,
246
+ maximum: MAX_EXTRA_QUANTITY,
247
+ description: `How many of that add-on the booking should hold, 0 to ${MAX_EXTRA_QUANTITY}; 0 takes it off`,
248
+ },
249
+ email: {
250
+ type: 'string',
251
+ description: 'The email the booking was made with, when it was made elsewhere',
252
+ },
253
+ confirmed: {
254
+ type: 'boolean',
255
+ description: 'True makes the change. Anything else returns the preview',
256
+ },
257
+ },
258
+ required: ['booking'],
259
+ },
260
+ });
261
+ export const refundBookingTool = ({ n, open }) => ({
262
+ name: n.refundBooking,
263
+ description: "Asks the hotel group to refund, in full, a booking made here that has been paid. TWO STEPS: the first call (no `confirmed`) only previews - the amount and the group's own refund terms - and asks nothing of the group; say them to the guest, and only when they say yes call again with `confirmed: true`. The second answer says what the group did with the request.",
264
+ annotations: cancels('Refund a booking', open),
265
+ inputSchema: {
266
+ type: 'object',
267
+ properties: {
268
+ booking: {
269
+ type: 'string',
270
+ description: 'The confirmation code or order id, as the booking answer gave it',
271
+ },
272
+ reason: {
273
+ type: 'string',
274
+ maxLength: REFUND_REASON_MAX,
275
+ description: `Optional, the guest's reason in their own words, up to ${REFUND_REASON_MAX} characters`,
276
+ },
277
+ confirmed: {
278
+ type: 'boolean',
279
+ description: 'true only after the guest was shown the refund preview this tool answers with and said yes. Without it, the answer is that preview and nothing is asked of the group.',
280
+ },
281
+ },
282
+ required: ['booking'],
283
+ },
284
+ });
285
+ //# sourceMappingURL=tool-defs-booking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-defs-booking.js","sourceRoot":"","sources":["../../src/tools/tool-defs-booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAExE,sJAAsJ;AAEtJ,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAW,EAAE,EAAE,CACxE,CAAC;IACC,IAAI,EAAE,CAAC,CAAC,cAAc;IACtB,oEAAoE;IACpE,uEAAuE;IACvE,yCAAyC;IACzC,WAAW,EAAE,CAAC,CA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