@curless/hotel-storefront 0.85.0 → 0.86.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 (207) 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 +1342 -0
  16. package/dist/tools/all-tools.d.ts.map +1 -0
  17. package/dist/tools/all-tools.js +954 -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 +380 -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 +485 -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 +364 -0
  54. package/dist/tools/cancel.js.map +1 -0
  55. package/dist/tools/card-addons.d.ts +4 -0
  56. package/dist/tools/card-addons.d.ts.map +1 -0
  57. package/dist/tools/card-addons.js +76 -0
  58. package/dist/tools/card-addons.js.map +1 -0
  59. package/dist/tools/change-booking.d.ts +4 -0
  60. package/dist/tools/change-booking.d.ts.map +1 -0
  61. package/dist/tools/change-booking.js +145 -0
  62. package/dist/tools/change-booking.js.map +1 -0
  63. package/dist/tools/clear-trip.d.ts +4 -0
  64. package/dist/tools/clear-trip.d.ts.map +1 -0
  65. package/dist/tools/clear-trip.js +10 -0
  66. package/dist/tools/clear-trip.js.map +1 -0
  67. package/dist/tools/compare.d.ts +4 -0
  68. package/dist/tools/compare.d.ts.map +1 -0
  69. package/dist/tools/compare.js +114 -0
  70. package/dist/tools/compare.js.map +1 -0
  71. package/dist/tools/current-trip.d.ts +70 -0
  72. package/dist/tools/current-trip.d.ts.map +1 -0
  73. package/dist/tools/current-trip.js +261 -0
  74. package/dist/tools/current-trip.js.map +1 -0
  75. package/dist/tools/deps.d.ts +229 -0
  76. package/dist/tools/deps.d.ts.map +1 -0
  77. package/dist/tools/deps.js +2 -0
  78. package/dist/tools/deps.js.map +1 -0
  79. package/dist/tools/follow-ups.d.ts +120 -0
  80. package/dist/tools/follow-ups.d.ts.map +1 -0
  81. package/dist/tools/follow-ups.js +369 -0
  82. package/dist/tools/follow-ups.js.map +1 -0
  83. package/dist/tools/forget-preferences.d.ts +4 -0
  84. package/dist/tools/forget-preferences.d.ts.map +1 -0
  85. package/dist/tools/forget-preferences.js +24 -0
  86. package/dist/tools/forget-preferences.js.map +1 -0
  87. package/dist/tools/get-hotel.d.ts +4 -0
  88. package/dist/tools/get-hotel.d.ts.map +1 -0
  89. package/dist/tools/get-hotel.js +324 -0
  90. package/dist/tools/get-hotel.js.map +1 -0
  91. package/dist/tools/hotel-choices.d.ts +132 -0
  92. package/dist/tools/hotel-choices.d.ts.map +1 -0
  93. package/dist/tools/hotel-choices.js +558 -0
  94. package/dist/tools/hotel-choices.js.map +1 -0
  95. package/dist/tools/itinerary.d.ts +4 -0
  96. package/dist/tools/itinerary.d.ts.map +1 -0
  97. package/dist/tools/itinerary.js +148 -0
  98. package/dist/tools/itinerary.js.map +1 -0
  99. package/dist/tools/list-booking-addons.d.ts +4 -0
  100. package/dist/tools/list-booking-addons.d.ts.map +1 -0
  101. package/dist/tools/list-booking-addons.js +21 -0
  102. package/dist/tools/list-booking-addons.js.map +1 -0
  103. package/dist/tools/list-bookings.d.ts +4 -0
  104. package/dist/tools/list-bookings.d.ts.map +1 -0
  105. package/dist/tools/list-bookings.js +119 -0
  106. package/dist/tools/list-bookings.js.map +1 -0
  107. package/dist/tools/list-extras.d.ts +4 -0
  108. package/dist/tools/list-extras.d.ts.map +1 -0
  109. package/dist/tools/list-extras.js +90 -0
  110. package/dist/tools/list-extras.js.map +1 -0
  111. package/dist/tools/list-hotels.d.ts +4 -0
  112. package/dist/tools/list-hotels.d.ts.map +1 -0
  113. package/dist/tools/list-hotels.js +891 -0
  114. package/dist/tools/list-hotels.js.map +1 -0
  115. package/dist/tools/list-shop-items.d.ts +4 -0
  116. package/dist/tools/list-shop-items.d.ts.map +1 -0
  117. package/dist/tools/list-shop-items.js +34 -0
  118. package/dist/tools/list-shop-items.js.map +1 -0
  119. package/dist/tools/list-shop-orders.d.ts +4 -0
  120. package/dist/tools/list-shop-orders.d.ts.map +1 -0
  121. package/dist/tools/list-shop-orders.js +22 -0
  122. package/dist/tools/list-shop-orders.js.map +1 -0
  123. package/dist/tools/look-up.d.ts +4 -0
  124. package/dist/tools/look-up.d.ts.map +1 -0
  125. package/dist/tools/look-up.js +170 -0
  126. package/dist/tools/look-up.js.map +1 -0
  127. package/dist/tools/output-schemas.d.ts +645 -0
  128. package/dist/tools/output-schemas.d.ts.map +1 -0
  129. package/dist/tools/output-schemas.js +503 -0
  130. package/dist/tools/output-schemas.js.map +1 -0
  131. package/dist/tools/paid-lines.d.ts +718 -0
  132. package/dist/tools/paid-lines.d.ts.map +1 -0
  133. package/dist/tools/paid-lines.js +359 -0
  134. package/dist/tools/paid-lines.js.map +1 -0
  135. package/dist/tools/pay-with-union-pay.d.ts +4 -0
  136. package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
  137. package/dist/tools/pay-with-union-pay.js +112 -0
  138. package/dist/tools/pay-with-union-pay.js.map +1 -0
  139. package/dist/tools/payment-words.d.ts +269 -0
  140. package/dist/tools/payment-words.d.ts.map +1 -0
  141. package/dist/tools/payment-words.js +365 -0
  142. package/dist/tools/payment-words.js.map +1 -0
  143. package/dist/tools/pick-room.d.ts +4 -0
  144. package/dist/tools/pick-room.d.ts.map +1 -0
  145. package/dist/tools/pick-room.js +23 -0
  146. package/dist/tools/pick-room.js.map +1 -0
  147. package/dist/tools/policies.d.ts +4 -0
  148. package/dist/tools/policies.d.ts.map +1 -0
  149. package/dist/tools/policies.js +74 -0
  150. package/dist/tools/policies.js.map +1 -0
  151. package/dist/tools/pricing.d.ts +55 -0
  152. package/dist/tools/pricing.d.ts.map +1 -0
  153. package/dist/tools/pricing.js +260 -0
  154. package/dist/tools/pricing.js.map +1 -0
  155. package/dist/tools/put-room-line.d.ts +12 -0
  156. package/dist/tools/put-room-line.d.ts.map +1 -0
  157. package/dist/tools/put-room-line.js +314 -0
  158. package/dist/tools/put-room-line.js.map +1 -0
  159. package/dist/tools/quote-card.d.ts +234 -0
  160. package/dist/tools/quote-card.d.ts.map +1 -0
  161. package/dist/tools/quote-card.js +375 -0
  162. package/dist/tools/quote-card.js.map +1 -0
  163. package/dist/tools/refund-booking.d.ts +4 -0
  164. package/dist/tools/refund-booking.d.ts.map +1 -0
  165. package/dist/tools/refund-booking.js +112 -0
  166. package/dist/tools/refund-booking.js.map +1 -0
  167. package/dist/tools/request-booking.d.ts +4 -0
  168. package/dist/tools/request-booking.d.ts.map +1 -0
  169. package/dist/tools/request-booking.js +5 -0
  170. package/dist/tools/request-booking.js.map +1 -0
  171. package/dist/tools/request-words.d.ts +238 -0
  172. package/dist/tools/request-words.d.ts.map +1 -0
  173. package/dist/tools/request-words.js +487 -0
  174. package/dist/tools/request-words.js.map +1 -0
  175. package/dist/tools/room-choices.d.ts +64 -0
  176. package/dist/tools/room-choices.d.ts.map +1 -0
  177. package/dist/tools/room-choices.js +348 -0
  178. package/dist/tools/room-choices.js.map +1 -0
  179. package/dist/tools/session-notes.d.ts +164 -0
  180. package/dist/tools/session-notes.d.ts.map +1 -0
  181. package/dist/tools/session-notes.js +412 -0
  182. package/dist/tools/session-notes.js.map +1 -0
  183. package/dist/tools/sign-in.d.ts +4 -0
  184. package/dist/tools/sign-in.d.ts.map +1 -0
  185. package/dist/tools/sign-in.js +72 -0
  186. package/dist/tools/sign-in.js.map +1 -0
  187. package/dist/tools/sign-out.d.ts +4 -0
  188. package/dist/tools/sign-out.d.ts.map +1 -0
  189. package/dist/tools/sign-out.js +13 -0
  190. package/dist/tools/sign-out.js.map +1 -0
  191. package/dist/tools/terms-answer.d.ts +114 -0
  192. package/dist/tools/terms-answer.d.ts.map +1 -0
  193. package/dist/tools/terms-answer.js +475 -0
  194. package/dist/tools/terms-answer.js.map +1 -0
  195. package/dist/tools/tool-set.d.ts +1474 -0
  196. package/dist/tools/tool-set.d.ts.map +1 -0
  197. package/dist/tools/tool-set.js +497 -0
  198. package/dist/tools/tool-set.js.map +1 -0
  199. package/dist/tools/view-trip.d.ts +4 -0
  200. package/dist/tools/view-trip.d.ts.map +1 -0
  201. package/dist/tools/view-trip.js +7 -0
  202. package/dist/tools/view-trip.js.map +1 -0
  203. package/dist/tools.d.ts +13 -2089
  204. package/dist/tools.d.ts.map +1 -1
  205. package/dist/tools.js +11 -10685
  206. package/dist/tools.js.map +1 -1
  207. package/package.json +1 -1
@@ -0,0 +1,281 @@
1
+ import type { CancelFacts, CancelOutcome } from '../account/cancel-pages.js';
2
+ import { type BackendCapabilities } from '../backend.js';
3
+ import type { Booking, BookingPayment, CancellationPreview } from '../types.js';
4
+ import type { ToolDeps } from './deps.js';
5
+ /** Who a booking or a hotel is with, and what that group makes of a booking. */
6
+ export type Holder = {
7
+ name: string;
8
+ caps: BackendCapabilities;
9
+ demo: boolean;
10
+ sandbox: boolean;
11
+ /** The group's own test system - see `Vocabulary.test`. */
12
+ test: boolean;
13
+ /**
14
+ * A group whose bookings here are never sent to it (a demonstration file, a
15
+ * simulated copy of its system): said as the fact - not sent to the group, no room
16
+ * held, nothing charged - and never as 演示 / 模拟 / 测试 (robin, 2026-11-03: 「不用特意
17
+ * 写不是真的」, every deployment as a market's). Its own test system is `test`: the
18
+ * booking reaches it and holds no room for anyone.
19
+ */
20
+ notReal: boolean;
21
+ };
22
+ /**
23
+ * On a group's own connector, the connector itself. In a market, the supplier
24
+ * named on the booking or the hotel.
25
+ *
26
+ * ⚠️ NEVER THE MARKET. "Asks Otaless to hold the rooms" or "Otaless's own
27
+ * reservation" would send a guest to a desk that has never heard of Otaless,
28
+ * and a market holding a demonstration beside a group's real system must not
29
+ * call either by the other's terms (robin, 2026-10-07).
30
+ */
31
+ export declare const holderOf: (deps: ToolDeps, supplier?: string) => Holder;
32
+ /**
33
+ * What was made, in one sentence - which depends on what asking MAKES here.
34
+ *
35
+ * ⚠️ HELD IS NOT BOOKED, AND BOOKED IS NOT PAID. The demonstration holds rooms
36
+ * until a moment and then lets them go; a group's own system makes its own
37
+ * reservation, kept until cancelled and paid at the hotel. Saying "held until"
38
+ * of a reservation invents a deadline, and saying "booked" of a hold invents a
39
+ * room - and a booking whose confirmation has not come back yet is neither,
40
+ * and is said as exactly that.
41
+ */
42
+ /**
43
+ * A booking as the card is given it: its money as strings, like every other
44
+ * price - the card never does arithmetic, and an amount sent as
45
+ * `{ minor, currency }` was drawn as "[object Object]" (香格里拉, 2026-10-12).
46
+ */
47
+ export declare const bookingForCard: (b: Booking) => {
48
+ payment?: BookingPayment | {
49
+ quotedAs?: string | import("../types.js").Money | undefined;
50
+ refundAmountText?: string | undefined;
51
+ amount: string;
52
+ payByWords?: string | undefined;
53
+ linkClosed?: true | undefined;
54
+ linkClosedSaid?: string | undefined;
55
+ host?: string | undefined;
56
+ method: import("../types.js").PaymentMethod;
57
+ status: "awaiting" | "issued" | "paid" | "lapsed" | "refunding" | "refunded" | "hotel-refunds";
58
+ url?: string;
59
+ payBy?: string;
60
+ payByLocal?: string;
61
+ payByLocalIso?: import("../types.js").LocalIso;
62
+ refundReason?: string;
63
+ refundAmount?: import("../types.js").Money;
64
+ refundStuck?: boolean;
65
+ groupReviews?: true;
66
+ refundUnsure?: true;
67
+ chargedWhenBooked?: true;
68
+ amountUnsaid?: true;
69
+ cancelledUnpaid?: true;
70
+ } | undefined;
71
+ cancellationFeeText?: string | undefined;
72
+ quote: {
73
+ dropped?: import("../types.js").DroppedLine[] | undefined;
74
+ stay?: import("../types.js").Stay | undefined;
75
+ coupons?: {
76
+ spend?: string | import("../types.js").Money | undefined;
77
+ off?: string | import("../types.js").Money | undefined;
78
+ minSpend?: string | import("../types.js").Money | undefined;
79
+ maxOff?: string | import("../types.js").Money | undefined;
80
+ amountOff?: string | import("../types.js").Money | undefined;
81
+ id: string;
82
+ kind: import("../types.js").CouponKind;
83
+ name: string;
84
+ names?: import("../types.js").Names;
85
+ percentOff?: number;
86
+ brands?: {
87
+ name: string;
88
+ names?: import("../types.js").Names;
89
+ }[];
90
+ hotels?: {
91
+ id: string;
92
+ name: string;
93
+ names?: import("../types.js").Names;
94
+ }[];
95
+ validFrom: string;
96
+ validUntil: string;
97
+ state: "usable" | "used" | "expired" | "not-yet";
98
+ usedOn?: {
99
+ code?: string;
100
+ stands: boolean;
101
+ };
102
+ }[] | undefined;
103
+ couponRefused?: {
104
+ spend?: string | import("../types.js").Money | undefined;
105
+ minSpend?: string | import("../types.js").Money | undefined;
106
+ id: string;
107
+ name?: string;
108
+ names?: import("../types.js").Names;
109
+ code: import("../types.js").CouponRefusal;
110
+ why: string;
111
+ } | undefined;
112
+ coupon?: {
113
+ off: string;
114
+ id: string;
115
+ name: string;
116
+ names?: import("../types.js").Names;
117
+ kind: import("../types.js").CouponKind;
118
+ hotelId: string;
119
+ hotelName: string;
120
+ hotelNames?: import("../types.js").Names;
121
+ checkIn: string;
122
+ checkOut: string;
123
+ validUntil: string;
124
+ } | undefined;
125
+ memberSaving?: {
126
+ memberTotal: string;
127
+ roomSaved?: string | undefined;
128
+ saved: string;
129
+ publicTotal: string;
130
+ publicSubtotal: string;
131
+ programme: string;
132
+ tier: string;
133
+ points: number;
134
+ } | undefined;
135
+ lines: {
136
+ day: string | undefined;
137
+ paymentNotConnected?: boolean | undefined;
138
+ payment?: "at-hotel" | "prepaid" | undefined;
139
+ freeCancellationLocalIso?: string | undefined;
140
+ freeCancellationLocal?: string | undefined;
141
+ freeCancellationUntil: string | undefined;
142
+ terms?: string | undefined;
143
+ refundable: boolean | undefined;
144
+ totalWithTaxes?: string | undefined;
145
+ total: string;
146
+ publicUnit?: string | undefined;
147
+ roomCharges?: string | undefined;
148
+ unit: string;
149
+ ordered?: number | undefined;
150
+ quantity: number | undefined;
151
+ hourly?: import("../types.js").HourlyStay | undefined;
152
+ stay: import("../types.js").Stay | undefined;
153
+ nights: number | undefined;
154
+ rate?: {
155
+ name: string;
156
+ kind?: import("../types.js").RateKind;
157
+ } | undefined;
158
+ meal?: import("../types.js").MealPlan | undefined;
159
+ window?: import("../types.js").WindowKind | undefined;
160
+ bedTypes?: import("../types.js").BedType[] | undefined;
161
+ detail: string | undefined;
162
+ titleNames?: Partial<Record<import("../types.js").NameLang, string>> | undefined;
163
+ roomRef: string | undefined;
164
+ extraRef: string | undefined;
165
+ title: string;
166
+ hotelNames?: Partial<Record<import("../types.js").NameLang, string>> | undefined;
167
+ hotelName: string;
168
+ supplier?: string | undefined;
169
+ kind: "room" | "extra";
170
+ hotelId: string;
171
+ }[];
172
+ subtotal: string;
173
+ taxesAndFees: string;
174
+ total: string;
175
+ };
176
+ couponNotReturnedBecause?: import("../types.js").CouponKeptWhy;
177
+ id: string;
178
+ supplier?: string;
179
+ confirmationCode: string;
180
+ status: import("../types.js").BookingStatus;
181
+ unverifiable?: true;
182
+ needsPerson?: "paid-amount" | "release";
183
+ termsChanged?: true;
184
+ confirmAsked?: true;
185
+ noTermsGiven?: true;
186
+ confirmUnseen?: true;
187
+ groupTermsAutoAccepted?: true;
188
+ termsUntil?: string;
189
+ rebookable?: true;
190
+ createdAt: string;
191
+ holdUntil?: string;
192
+ holdUntilLocal?: string;
193
+ holdUntilLocalIso?: import("../types.js").LocalIso;
194
+ hotelId: string;
195
+ hotelName: string;
196
+ hotelNames?: import("../types.js").Names;
197
+ stay: import("../types.js").Stay;
198
+ hourly?: import("../types.js").HourlyStay;
199
+ paymentNotConnected?: true;
200
+ orderNumber?: string;
201
+ guest: import("../types.js").Guest;
202
+ cancelledAt?: string;
203
+ cancellationFee?: import("../types.js").Money;
204
+ couponReturned?: boolean;
205
+ changedAt?: string;
206
+ requests?: import("../types.js").RoomRequests;
207
+ };
208
+ /**
209
+ * What was paid here in advance on a booking being cancelled, and what
210
+ * cancelling it now gives back - as facts for the card to say in the guest's
211
+ * language (2026-10-21 re-audit, T2-2).
212
+ *
213
+ * ⚠️ WHY THE CARD NEEDS THEM. For a booking with terms as facts the card does
214
+ * not show `rule`, and "paid ¥300, all of it goes back to the card" / "nothing
215
+ * goes back, the fee is the whole stay" is only in `rule`: a guest who had
216
+ * paid ¥300 saw "Cancelling would cost ¥300" on the screen where they decide,
217
+ * and could read it as a second payment. `rule` stays for the model, word for
218
+ * word; these are the same facts, as data. The shape is the booking's own
219
+ * payment (`method`, `amount` as text) with what cancelling now does to it:
220
+ * `refund` is `all`, `part` (and `refundAmount` says how much) or `none`.
221
+ *
222
+ * Only where money was paid HERE and the booking can be cancelled now: paid in
223
+ * advance by card, or paid with UnionPay - which the hotel charged, and gives
224
+ * back to that card, not through this connector. A booking paid at the hotel,
225
+ * a demonstration's hold, a page not paid yet and a booking that cannot be
226
+ * cancelled have none, and the card says nothing of money for them.
227
+ */
228
+ /**
229
+ * A cancellation preview as a string the guest's press must find again (0.84.2, P1-8 - the cancel page):
230
+ * the fee and whether it is known, the terms, the reason, what was paid and what goes back. Anything of it
231
+ * different at the press - a fee moved, the terms changed, the booking paid meanwhile - and nothing is
232
+ * sent. In memory only, never shown.
233
+ */
234
+ export declare const cancelShapeOf: (preview: CancellationPreview, refundAsked: {
235
+ amount: string;
236
+ } | undefined, paid: PaidFacts | undefined, booked: Booking | null) => string;
237
+ /** What the cancel page shows (0.84.2, P1-8): the preview the tool made, as facts - `until` is the account's to set. */
238
+ export declare const cancelFactsOf: (deps: ToolDeps, preview: CancellationPreview, booked: Booking | null, which: {
239
+ hotelName?: string;
240
+ hotelNames?: unknown;
241
+ stay?: unknown;
242
+ }, refundAsked: {
243
+ amount: string;
244
+ } | undefined, paid: PaidFacts | undefined, shown: Record<string, unknown>, shape: string) => CancelFacts;
245
+ /**
246
+ * ⚠️ THE GUEST'S PRESS ON THE ONE-TIME CANCEL PAGE (0.84.2, the 11-25 code audit's P1-8 - account/index.ts
247
+ * `cancels`): the cancel tool's own confirmed cancel - the same 9, 9.1 and value-added service orders as
248
+ * a card's button - for the conversation the link was made in, and only if the preview is still the one
249
+ * the page showed (`facts.shape`). How it came out, for the page. Throws only what the tool throws.
250
+ */
251
+ export declare const cancelOnPage: (deps: ToolDeps, key: string, facts: CancelFacts) => Promise<CancelOutcome>;
252
+ export type PaidFacts = {
253
+ method: BookingPayment['method'];
254
+ /** What was paid, as text like every amount the card is given. */
255
+ amount: string;
256
+ /** What cancelling now gives back of it. */
257
+ refund: 'all' | 'part' | 'none';
258
+ /** How much of `amount`, as text - only when `refund` is `part`. */
259
+ refundAmount?: string;
260
+ };
261
+ export declare const paidFactsOf: (booked: Booking | null, preview: CancellationPreview) => PaidFacts | undefined;
262
+ /**
263
+ * A booking paid in advance, as the guest is told it - where its money stands.
264
+ * Undefined for any other booking.
265
+ *
266
+ * ⚠️ THE BOOKING FIRST, THEN THE MONEY (2026-10-16 audit, P0-C). This read the
267
+ * payment alone, so a stay cancelled after its free time - whose fee is all of
268
+ * it, and nothing goes back - was told "the hotel has not confirmed it; if it
269
+ * does not take it, all of it goes back", every time; and a UnionPay stay
270
+ * cancelled was told "cancelled. undefined". Each state of each way of paying
271
+ * is said here, and a cancelled stay by what the cancellation kept (`fee`,
272
+ * the hotel's own figure where it gave one).
273
+ */
274
+ /**
275
+ * A refund asked of the hotel group (`groupReviews`, Otaless 9.1 - 0.74.2, robin 11-17 through
276
+ * 总线程): submitted, and back on the card it was paid with once the group has reviewed it -
277
+ * or, held up, not submitted at all: the booking stays cancelled and a person takes it up.
278
+ * Undefined for any other refund.
279
+ */
280
+ export declare const groupRefundWords: (p: BookingPayment, group: string, back: string, whole: boolean, amount: string) => string | undefined;
281
+ //# sourceMappingURL=cancel-facts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-facts.d.ts","sourceRoot":"","sources":["../../src/tools/cancel-facts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,KAAK,mBAAmB,EAAqB,MAA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AAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EACnE,aAAa;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAC3C,MAAM,SAAS,GAAG,SAAS,EAC3B,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,MAAM,KACZ,WAwCF,CAAC;AAoFF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,QAAQ,EACd,KAAK,MAAM,EACX,OAAO,WAAW,KACjB,OAAO,CAAC,aAAa,CAQvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAChC,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAQ,OAAO,GAAG,IAAI,EACtB,SAAS,mBAAmB,KAC3B,SAAS,GAAG,SAWd,CAAC;AAEF;;;;;;;;;;;GAWG;AACH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,GAAG,cAAc,EACjB,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,OAAO,OAAO,EACd,QAAQ,MAAM,KACb,MAAM,GAAG,SAOgL,CAAC"}
@@ -0,0 +1,309 @@
1
+ import { FULL_CAPABILITIES } from '../backend.js';
2
+ import { formatMoney } from '../money.js';
3
+ import { contextFor, handleTool } from './follow-ups.js';
4
+ import { LINK_CLOSED_WORDS, hostOf, payByWords } from './payment-words.js';
5
+ import { quoteForCard } from './quote-card.js';
6
+ /**
7
+ * On a group's own connector, the connector itself. In a market, the supplier
8
+ * named on the booking or the hotel.
9
+ *
10
+ * ⚠️ NEVER THE MARKET. "Asks Otaless to hold the rooms" or "Otaless's own
11
+ * reservation" would send a guest to a desk that has never heard of Otaless,
12
+ * and a market holding a demonstration beside a group's real system must not
13
+ * call either by the other's terms (robin, 2026-10-07).
14
+ */
15
+ export const holderOf = (deps, supplier) => {
16
+ const s = supplier ? deps.backend.suppliers?.().find((x) => x.id === supplier) : undefined;
17
+ if (s)
18
+ return {
19
+ name: s.name,
20
+ caps: s.capabilities,
21
+ demo: s.mode !== 'live',
22
+ sandbox: s.mode === 'sandbox',
23
+ test: s.mode === 'test',
24
+ notReal: s.mode !== 'live' && s.mode !== 'test',
25
+ };
26
+ return {
27
+ name: deps.vocab.brand,
28
+ caps: deps.backend.capabilities ?? FULL_CAPABILITIES,
29
+ demo: deps.vocab.demo,
30
+ sandbox: !!deps.vocab.sandbox,
31
+ test: !!deps.vocab.test,
32
+ notReal: deps.vocab.demo && !deps.vocab.test,
33
+ };
34
+ };
35
+ /**
36
+ * ⚠️ A BOOKING MADE CARRIES NO CANCELLATION TERMS, TO THE CARD OR THE MODEL (0.74.2, robin
37
+ * 11-17: 「成功页不需要显示,取消的时候显示就行」). Atour's 8 answered its `cancelPolicy` with its test
38
+ * system's own notes - 「Confirming books the stay and pays it at once … refund_atour_booking files
39
+ * the request …」, a tool's name in it - and the booked page drew them under the room, word for
40
+ * word. A booking's terms are said where it is cancelled: the cancellation preview reads them
41
+ * from the order itself (`rule`), as the group gave them. The order keeps them (`QuoteLine.terms`,
42
+ * the check that they are the ones the guest agreed to included); only this shape drops them.
43
+ *
44
+ * (0.67.0, 总线程's review of 0.66.0, 5: a held booking's new terms were a stranger's text in the
45
+ * structure the model reads - they reach the card as the terms to agree to, `TERMS_META_KEY`.)
46
+ */
47
+ const heldQuoteForCard = (_b, q) => ({
48
+ ...q,
49
+ lines: q.lines.map(({ terms: _terms, ...rest }) => rest),
50
+ });
51
+ /**
52
+ * What was made, in one sentence - which depends on what asking MAKES here.
53
+ *
54
+ * ⚠️ HELD IS NOT BOOKED, AND BOOKED IS NOT PAID. The demonstration holds rooms
55
+ * until a moment and then lets them go; a group's own system makes its own
56
+ * reservation, kept until cancelled and paid at the hotel. Saying "held until"
57
+ * of a reservation invents a deadline, and saying "booked" of a hold invents a
58
+ * room - and a booking whose confirmation has not come back yet is neither,
59
+ * and is said as exactly that.
60
+ */
61
+ /**
62
+ * A booking as the card is given it: its money as strings, like every other
63
+ * price - the card never does arithmetic, and an amount sent as
64
+ * `{ minor, currency }` was drawn as "[object Object]" (香格里拉, 2026-10-12).
65
+ */
66
+ export const bookingForCard = (b) => ({
67
+ ...b,
68
+ // A booking cancelled before the reason was kept: a coupon not returned could
69
+ // then only have run out (C10) - said so, as the text says it.
70
+ ...(b.couponReturned === false && !b.couponNotReturnedBecause
71
+ ? { couponNotReturnedBecause: 'expired' }
72
+ : {}),
73
+ quote: heldQuoteForCard(b, quoteForCard(b.quote)),
74
+ // What a cancelled booking was charged to cancel, as text like every amount the
75
+ // card is given: "Cancelled" in My bookings says it beside the struck-out total
76
+ // (r10 #21). `cancellationFee` stays the money it was.
77
+ ...(b.cancellationFee ? { cancellationFeeText: formatMoney(b.cancellationFee) } : {}),
78
+ ...(b.payment
79
+ ? {
80
+ payment: {
81
+ ...b.payment,
82
+ // ⚠️ WHERE THE GUEST IS SENT AND BY WHEN, in words (Otaless 0.63.0, all
83
+ // brands): the host of the payment page, and the pay-by moment with its
84
+ // offset - never a bare ISO string. The card and the model read the same.
85
+ ...(hostOf(b.payment.url) ? { host: hostOf(b.payment.url) } : {}),
86
+ // The page closed on its own (Otaless 0.63.2): said, not left to a missing url.
87
+ // …or is held back for the group's new terms (0.66.0): not "closed".
88
+ ...(b.payment.status === 'awaiting' &&
89
+ !b.payment.url &&
90
+ b.payment.method === 'card' &&
91
+ !b.termsChanged &&
92
+ !b.confirmAsked
93
+ ? { linkClosed: true, linkClosedSaid: LINK_CLOSED_WORDS }
94
+ : {}),
95
+ ...(payByWords(b.payment) ? { payByWords: payByWords(b.payment) } : {}),
96
+ amount: formatMoney(b.payment.amount),
97
+ // What goes back, where it is not the whole amount, as text too - the
98
+ // cancelled page says "¥1,601 of the ¥3,202 paid" from it (robin,
99
+ // 2026-10-22). `refundAmount` stays the money it was.
100
+ ...(b.payment.refundAmount
101
+ ? { refundAmountText: formatMoney(b.payment.refundAmount) }
102
+ : {}),
103
+ // The price shown, where what is paid or asked is not it (Otaless 0.84.2), as text.
104
+ ...(b.payment.quotedAs ? { quotedAs: formatMoney(b.payment.quotedAs) } : {}),
105
+ },
106
+ }
107
+ : {}),
108
+ });
109
+ /**
110
+ * What was paid here in advance on a booking being cancelled, and what
111
+ * cancelling it now gives back - as facts for the card to say in the guest's
112
+ * language (2026-10-21 re-audit, T2-2).
113
+ *
114
+ * ⚠️ WHY THE CARD NEEDS THEM. For a booking with terms as facts the card does
115
+ * not show `rule`, and "paid ¥300, all of it goes back to the card" / "nothing
116
+ * goes back, the fee is the whole stay" is only in `rule`: a guest who had
117
+ * paid ¥300 saw "Cancelling would cost ¥300" on the screen where they decide,
118
+ * and could read it as a second payment. `rule` stays for the model, word for
119
+ * word; these are the same facts, as data. The shape is the booking's own
120
+ * payment (`method`, `amount` as text) with what cancelling now does to it:
121
+ * `refund` is `all`, `part` (and `refundAmount` says how much) or `none`.
122
+ *
123
+ * Only where money was paid HERE and the booking can be cancelled now: paid in
124
+ * advance by card, or paid with UnionPay - which the hotel charged, and gives
125
+ * back to that card, not through this connector. A booking paid at the hotel,
126
+ * a demonstration's hold, a page not paid yet and a booking that cannot be
127
+ * cancelled have none, and the card says nothing of money for them.
128
+ */
129
+ /**
130
+ * A cancellation preview as a string the guest's press must find again (0.84.2, P1-8 - the cancel page):
131
+ * the fee and whether it is known, the terms, the reason, what was paid and what goes back. Anything of it
132
+ * different at the press - a fee moved, the terms changed, the booking paid meanwhile - and nothing is
133
+ * sent. In memory only, never shown.
134
+ */
135
+ export const cancelShapeOf = (preview, refundAsked, paid, booked) => JSON.stringify([
136
+ preview.bookingId,
137
+ preview.fee.minor,
138
+ preview.fee.currency,
139
+ preview.feeUnknown === true,
140
+ preview.feeIsCap === true,
141
+ preview.termsNew === true,
142
+ preview.reason ?? '',
143
+ preview.rule,
144
+ preview.freeUntil ?? '',
145
+ refundAsked?.amount ?? '',
146
+ paid?.refund ?? '',
147
+ paid?.refundAmount ?? '',
148
+ booked?.payment?.status ?? '',
149
+ ]);
150
+ /** What the cancel page shows (0.84.2, P1-8): the preview the tool made, as facts - `until` is the account's to set. */
151
+ export const cancelFactsOf = (deps, preview, booked, which, refundAsked, paid, shown, shape) => {
152
+ const unpaid = preview.reason === 'unpaid';
153
+ const stay = which.stay;
154
+ return {
155
+ booking: { id: preview.bookingId, code: preview.confirmationCode },
156
+ ...(which.hotelName ? { hotelName: which.hotelName } : {}),
157
+ ...(which.hotelNames && typeof which.hotelNames === 'object'
158
+ ? { hotelNames: which.hotelNames }
159
+ : {}),
160
+ ...(stay ? { stay } : {}),
161
+ group: holderOf(deps, preview.supplier).name,
162
+ ...(unpaid
163
+ ? { unpaid: true }
164
+ : preview.feeUnknown
165
+ ? { feeUnknown: true }
166
+ : {
167
+ fee: formatMoney(preview.fee),
168
+ ...(preview.feeIsCap ? { feeIsCap: true } : {}),
169
+ }),
170
+ // ⚠️ THE GROUP'S OWN TERMS, AS IT GAVE THEM, only where `rule` is that (Otaless: a fee not known
171
+ // before the group cancels, under terms it sent) - never our words for the model.
172
+ ...(preview.feeUnknown && !preview.termsNew && preview.rule
173
+ ? { groupTerms: preview.rule }
174
+ : {}),
175
+ ...(preview.termsNew ? { termsNew: true } : {}),
176
+ ...(refundAsked ? { refundWithCancel: { amount: refundAsked.amount } } : {}),
177
+ ...(paid
178
+ ? {
179
+ payment: {
180
+ amount: paid.amount,
181
+ refund: paid.refund,
182
+ ...(paid.refundAmount ? { refundAmount: paid.refundAmount } : {}),
183
+ },
184
+ }
185
+ : {}),
186
+ ...(booked ? { bookingTotal: formatMoney(booked.quote.total) } : {}),
187
+ ...addOnRowsOf(shown),
188
+ shape,
189
+ until: '',
190
+ };
191
+ };
192
+ /** The value-added service orders an answer carries (shop-answers.ts `addOnRow`), as the cancel page lists them. */
193
+ const addOnRowsOf = (s) => {
194
+ const rows = Array.isArray(s.addOnOrders)
195
+ ? s.addOnOrders.map((o) => ({
196
+ name: String(o.name ?? ''),
197
+ total: String(o.total ?? ''),
198
+ fate: String(o.fate ?? ''),
199
+ }))
200
+ : [];
201
+ return {
202
+ ...(rows.length ? { addOns: rows } : {}),
203
+ ...(s.addOnOrdersUnavailable === true ? { addOnsUnread: true } : {}),
204
+ };
205
+ };
206
+ /** The refusals that leave a booking as it was - anything else the cancel answers with is not known. */
207
+ const NOT_CANCELLED = new Set([
208
+ 'not-cancelled',
209
+ 'unconfirmed',
210
+ 'sign-in',
211
+ 'link-redo',
212
+ 'signed-out',
213
+ 'session-expired',
214
+ ]);
215
+ /** How the cancel tool's answer came out, for the cancel page (0.84.2, P1-8). Anything not read is "not known". */
216
+ const cancelOutcomeOf = (s) => {
217
+ const view = s.view;
218
+ if (view === 'cancellation-preview')
219
+ return { outcome: 'changed' };
220
+ if (view === 'booking-not-found')
221
+ return { outcome: 'gone' };
222
+ if (view === 'error')
223
+ return NOT_CANCELLED.has(String(s.error)) ? { outcome: 'refused' } : { outcome: 'unknown' };
224
+ if (view !== 'cancelled')
225
+ return { outcome: 'unknown' };
226
+ const b = (s.booking ?? {});
227
+ const p = b.payment;
228
+ const back = p?.refundAmountText ?? p?.amount ?? '';
229
+ // ⚠️ NEVER "REFUNDED" OR "NOTHING CHARGED" ON A GUESS: a payment state not read here is "being checked".
230
+ const money = !p
231
+ ? b.paymentUnknown
232
+ ? { kind: 'payment-unknown' }
233
+ : undefined
234
+ : p.status === 'refunding'
235
+ ? p.refundUnsure
236
+ ? { kind: 'refund-unsure' }
237
+ : p.refundStuck
238
+ ? { kind: 'refund-stuck' }
239
+ : p.groupReviews
240
+ ? { kind: 'refund-submitted', back }
241
+ : { kind: 'refunding', back }
242
+ : p.status === 'refunded'
243
+ ? { kind: 'refunded', back }
244
+ : p.status === 'awaiting' || p.status === 'lapsed'
245
+ ? { kind: 'not-paid' }
246
+ : p.status === 'paid'
247
+ ? { kind: 'paid-settling', amount: p.amount ?? '' }
248
+ : { kind: 'payment-unknown' };
249
+ return {
250
+ outcome: 'cancelled',
251
+ code: String(b.confirmationCode ?? ''),
252
+ ...(money ? { money } : {}),
253
+ ...(s.feeUnknown === true
254
+ ? { feeUnknown: true }
255
+ : typeof s.fee === 'string'
256
+ ? { fee: s.fee }
257
+ : {}),
258
+ ...addOnRowsOf(s),
259
+ };
260
+ };
261
+ /**
262
+ * ⚠️ THE GUEST'S PRESS ON THE ONE-TIME CANCEL PAGE (0.84.2, the 11-25 code audit's P1-8 - account/index.ts
263
+ * `cancels`): the cancel tool's own confirmed cancel - the same 9, 9.1 and value-added service orders as
264
+ * a card's button - for the conversation the link was made in, and only if the preview is still the one
265
+ * the page showed (`facts.shape`). How it came out, for the page. Throws only what the tool throws.
266
+ */
267
+ export const cancelOnPage = async (deps, key, facts) => {
268
+ const said = await handleTool(deps, deps.tools.cancelBooking, { booking: facts.booking.id, confirmed: true }, { ...contextFor(deps, key), cancelPressed: facts.shape });
269
+ return cancelOutcomeOf(said.structured);
270
+ };
271
+ export const paidFactsOf = (booked, preview) => {
272
+ const p = booked?.payment;
273
+ if (!p || p.status !== 'paid' || !preview.cancellable)
274
+ return undefined;
275
+ const back = preview.refund.minor;
276
+ const refund = back <= 0 ? 'none' : back >= p.amount.minor ? 'all' : 'part';
277
+ return {
278
+ method: p.method,
279
+ amount: formatMoney(p.amount),
280
+ refund,
281
+ ...(refund === 'part' ? { refundAmount: formatMoney(preview.refund) } : {}),
282
+ };
283
+ };
284
+ /**
285
+ * A booking paid in advance, as the guest is told it - where its money stands.
286
+ * Undefined for any other booking.
287
+ *
288
+ * ⚠️ THE BOOKING FIRST, THEN THE MONEY (2026-10-16 audit, P0-C). This read the
289
+ * payment alone, so a stay cancelled after its free time - whose fee is all of
290
+ * it, and nothing goes back - was told "the hotel has not confirmed it; if it
291
+ * does not take it, all of it goes back", every time; and a UnionPay stay
292
+ * cancelled was told "cancelled. undefined". Each state of each way of paying
293
+ * is said here, and a cancelled stay by what the cancellation kept (`fee`,
294
+ * the hotel's own figure where it gave one).
295
+ */
296
+ /**
297
+ * A refund asked of the hotel group (`groupReviews`, Otaless 9.1 - 0.74.2, robin 11-17 through
298
+ * 总线程): submitted, and back on the card it was paid with once the group has reviewed it -
299
+ * or, held up, not submitted at all: the booking stays cancelled and a person takes it up.
300
+ * Undefined for any other refund.
301
+ */
302
+ export const groupRefundWords = (p, group, back, whole, amount) => !p.groupReviews
303
+ ? undefined
304
+ : p.refundUnsure
305
+ ? `Whether the refund of the ${amount} paid reached ${group} is not known yet: ${group} did not answer the request in time. The cancellation stands; a person here is checking the refund with ${group} - do not say it was submitted, or that it failed.`
306
+ : p.refundStuck
307
+ ? `The refund of the ${amount} paid was NOT submitted: ${group} did not take the request, so nothing is on its way back yet. The cancellation stands; a person here is taking the refund up with ${group}.`
308
+ : `A refund of ${whole ? `all ${back}` : `${back} of the ${amount} paid`} has been submitted to ${group}: once ${group} has reviewed it, it goes back to the card it was paid with.`;
309
+ //# sourceMappingURL=cancel-facts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-facts.js","sourceRoot":"","sources":["../../src/tools/cancel-facts.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAoB/C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAc,EAAE,QAAiB,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K,UAAU,KAAK,8DAA8D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ToolCall } from './call.js';
2
+ import type { ToolAnswer } from './deps.js';
3
+ export declare const answerCancel: ({ deps, name, args, ctx, t, key, }: ToolCall) => Promise<ToolAnswer>;
4
+ //# sourceMappingURL=cancel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../src/tools/cancel.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAQ1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAQ5C,eAAO,MAAM,YAAY,GAAU,oCAOhC,QAAQ,KAAG,OAAO,CAAC,UAAU,CAoY/B,CAAC"}