@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,369 @@
1
+ import { unansweredBy } from '../backend.js';
2
+ import { hotelName } from '../fence.js';
3
+ import { amountsIn, inFullCurrency, keepingAmounts } from '../money.js';
4
+ import { withTraditional } from '../names.js';
5
+ import { namesMoreThanOne } from '../present.js';
6
+ import { withReference } from '../reference.js';
7
+ import { pickedKey, tripKey } from '../trip.js';
8
+ import { branded, keyBrandOf } from '../vocab.js';
9
+ import { answerTool } from './answer.js';
10
+ import { inFailedStay, unset } from './args.js';
11
+ import { bookingAnswer } from './booking-answer.js';
12
+ import { common } from './paid-lines.js';
13
+ import { refusalAnswer } from './payment-words.js';
14
+ import { identity, notAnswered } from './session-notes.js';
15
+ const suggestionsFor = async (deps, d,
16
+ // Whose look this is, for a backend that counts its own calls by it (Otaless's limits, C6).
17
+ who) => {
18
+ const view = String(d.view ?? '');
19
+ const out = [];
20
+ const hotel = d.hotel;
21
+ const stay = d.stay;
22
+ const on = stay?.checkIn
23
+ ? { checkIn: stay.checkIn, checkOut: stay.checkOut, guests: stay.guests }
24
+ : {};
25
+ // The hotel view already has buttons for its add-ons and its policies; the
26
+ // one thing it cannot do alone is set it beside the others.
27
+ if (view === 'hotel' && hotel && Array.isArray(d.rooms) && d.rooms.length) {
28
+ const nearby = await deps.backend.searchHotels({ city: hotel.city, limit: 2 }, who);
29
+ if (nearby.total > 1)
30
+ out.push({
31
+ // The label IS what is sent: a chip that sends more than it says is
32
+ // a chip that says something else in the guest's name.
33
+ label: `Compare ${hotelName(hotel.name)} with the other ${hotelName(hotel.city)} hotels`,
34
+ say: `Compare ${hotelName(hotel.name)} with the other ${hotelName(hotel.city)} hotels`,
35
+ // (0.77.1: the card draws this one as its own action - see card.ts `isCompareChip` - and the
36
+ // answer is unchanged, byte for byte: Otaless's surface is frozen.)
37
+ });
38
+ }
39
+ // The price order is not a suggestion any more: it is the list's own sort
40
+ // row, beside its places (robin, 2026-09-28: 「价格排序的按钮也放上面吧」).
41
+ if (view === 'comparison') {
42
+ const pick = (d.columns ?? []).find((c) => c.recommended);
43
+ if (pick) {
44
+ out.push({
45
+ label: `Rooms at ${hotelName(pick.hotel.name)}`,
46
+ ask: { tool: 'getHotel', args: { hotel: pick.hotel.id, ...on } },
47
+ });
48
+ out.push({
49
+ label: `Plan the days at ${hotelName(pick.hotel.name)}`,
50
+ say: `Plan the days at ${hotelName(pick.hotel.name)}`,
51
+ });
52
+ }
53
+ }
54
+ // ⚠️ THE CARD PUTS THE STAYS IN ITSELF (robin, 2026-09-29: 「改成卡片直接加进行程
55
+ // 吧」). This chip used to send "Put the stays on this plan in the trip" to the
56
+ // chat, and the host held it under a caution banner - it cannot tell a
57
+ // card's message from an injected one - for the guest to send on. Now it is
58
+ // the card's own calls: each stay not yet in the trip or booked, on the room
59
+ // the plan priced it on, for the plan's own nights. The trip is editable and
60
+ // nothing is booked by it.
61
+ if (view === 'itinerary') {
62
+ const stays = (d.days ?? [])
63
+ .flatMap((day) => day.items)
64
+ .filter((x) => x.kind === 'hotel' &&
65
+ (x.night ?? 1) === 1 &&
66
+ x.roomId &&
67
+ x.checkIn &&
68
+ x.checkOut &&
69
+ !x.inTrip &&
70
+ !x.booked);
71
+ const PLAN_TO_TRIP = 'Put the stays on this plan in the trip';
72
+ const undated = (d.days ?? [])
73
+ .flatMap((day) => day.items)
74
+ .some((x) => x.kind === 'hotel' && !x.checkIn && !x.inTrip && !x.booked);
75
+ // A plan with no nights: there is nothing the card could add, and the
76
+ // model is the one to ask for the dates.
77
+ if (!stays.length && undated)
78
+ out.push({ label: PLAN_TO_TRIP, say: PLAN_TO_TRIP });
79
+ if (stays.length)
80
+ out.push({
81
+ say: PLAN_TO_TRIP,
82
+ label: stays.length === 1
83
+ ? `Put ${stays[0]?.name} in the trip`
84
+ : `Put these ${stays.length} stays in the trip`,
85
+ asks: stays.map((x) => ({
86
+ tool: 'addToTrip',
87
+ args: {
88
+ hotel: x.id,
89
+ room: x.roomId,
90
+ checkIn: x.checkIn,
91
+ checkOut: x.checkOut,
92
+ guests: stay?.guests ?? 2,
93
+ },
94
+ })),
95
+ });
96
+ }
97
+ if (view === 'booking') {
98
+ const all = (Array.isArray(d.bookings) ? d.bookings : [d.booking]);
99
+ for (const b of all.slice(0, 2)) {
100
+ if (!b?.hotelId)
101
+ continue;
102
+ const transfer = (await deps.backend.extrasFor(b.hotelId, b.stay)).find((e) => e.kind === 'transfer');
103
+ const has = b.quote?.lines?.some((l) => l.extraRef === transfer?.id);
104
+ // The add-on's own name, quoted: "Airport transfer, one way" unquoted
105
+ // ran on into the code as if the transfer went TO the booking. Pressed,
106
+ // it is the change PREVIEW - the booking moves only on its confirm.
107
+ // \`words\`: what the label says, for the card to say in the guest's
108
+ // language (r7 jury: English chips on a Chinese success screen); the
109
+ // label stays English, for whoever reads the answer.
110
+ if (transfer && !has)
111
+ out.push({
112
+ label: `Add "${transfer.name}" to ${b.confirmationCode}`,
113
+ words: {
114
+ kind: 'add-transfer',
115
+ ...(all.length > 1 ? { code: b.confirmationCode } : {}),
116
+ },
117
+ ask: {
118
+ tool: 'previewChange',
119
+ args: { booking: b.confirmationCode, extra: transfer.id, quantity: 1 },
120
+ },
121
+ });
122
+ }
123
+ const first = all[0];
124
+ if (first?.hotelId)
125
+ out.push({
126
+ label: `Check-in times at ${first.hotelName}`,
127
+ words: {
128
+ kind: 'check-in-times',
129
+ hotel: first.hotelName,
130
+ ...(first.hotelNames ? { names: first.hotelNames } : {}),
131
+ },
132
+ ask: { tool: 'policies', args: { hotel: first.hotelId, topic: 'check-in' } },
133
+ });
134
+ }
135
+ // ⚠️ NEVER A BUTTON FOR A TOOL THIS DEPLOYMENT DOES NOT OFFER. The card
136
+ // finds no name for it and the press fails; a suggestion the guest cannot
137
+ // act on is worse than none.
138
+ return out
139
+ .filter((s) => {
140
+ const key = s.ask?.tool;
141
+ if (!key || !deps.offered)
142
+ return true;
143
+ const name = deps.tools[key];
144
+ return !!name && deps.offered.has(name);
145
+ })
146
+ .slice(0, 3);
147
+ };
148
+ /**
149
+ * The answer when the card names a trip this connector does not know.
150
+ *
151
+ * ⚠️ NOT "EXPIRED" (华住 / robin, 2026-10-15). A trip id lives as long as its
152
+ * conversation (trip-ids.ts, `ID_TTL_MS`), and a trip emptied after
153
+ * TRIP_TTL_MS starts over under the same id - so an id nobody knows is not a
154
+ * trip that lapsed. It is a card from before the service's state moved (the
155
+ * public Huazhu's went to a new directory when it switched to the test
156
+ * system), or from a conversation quiet for longer than its id is kept. "Kept
157
+ * for 4 hours" was said over a card drawn an hour before.
158
+ *
159
+ * ⚠️ SAID, NOT PAPERED OVER. An unknown id used to fall back to the card's own
160
+ * connection - a DIFFERENT trip from the conversation's - and the card took
161
+ * that trip's id as its own. Rooms added on the card then went into a trip the
162
+ * assistant could not see, and "book it" was answered "the trip is empty"
163
+ * (2026-10-05 audit). The way back is the conversation's own trip, which the
164
+ * assistant's next answer hands the card.
165
+ */
166
+ export const tripGone = (deps) => {
167
+ const detail = 'The trip this card was showing is not known here any more - the service may have been updated since the card was drawn, or the conversation has been quiet for a long time. Ask the assistant to show the trip again.';
168
+ return {
169
+ structured: { view: 'error', ...common(deps), error: 'trip-gone', detail },
170
+ text: detail,
171
+ };
172
+ };
173
+ /**
174
+ * ⚠️ A CARD DRAWN BEFORE THE SIGN-IN, PRESSED AFTER IT (0.84.0; walkthrough 11-24 #5). Since a sign-in
175
+ * the conversation's trip goes by a new id, handed only to the card that started the sign-in (0.75.1,
176
+ * P1-a - `renewedAway` in server.ts): any other card from before it can no longer act on the trip. That
177
+ * is by design and STAYS - this only says what happened, instead of `tripGone`'s "updated, or quiet for
178
+ * a long time", which was not true a few minutes after a sign-in. Still `trip-gone` (a card holding the
179
+ * sign-in's claim asks again with it, as before), with `renewed: true` for the card's own words.
180
+ */
181
+ export const tripRenewed = (deps, o = {
182
+ pressed: 'other',
183
+ signedIn: false,
184
+ }) => {
185
+ const t = deps.tools;
186
+ const again = t.listHotels ? ` or draw the hotels again (${t.listHotels})` : '';
187
+ // ⚠️ WHAT HAPPENED, AS IT HAPPENED (总线程 11-25): never "signed in somewhere else", never "already
188
+ // signed in" unchecked. The way on is the card's own sign-in (the same account goes back to this
189
+ // conversation - server.ts `rejoins`).
190
+ const happened = o.why === 'sign-out'
191
+ ? 'This card was drawn before this conversation signed out, so it can no longer act on its trip'
192
+ : 'This card was drawn before this conversation signed in, and its trip moved on with the sign-in, so this card can no longer act on it';
193
+ const detail = `${happened} - nothing was lost, booked or changed by the press.${o.pressed === 'book' ? ' Nothing was booked.' : ''} The guest can sign in on this card to carry on with it (signed in as the same account, it is back on this conversation)${again}.`;
194
+ return {
195
+ structured: {
196
+ view: 'error',
197
+ ...common(deps),
198
+ error: 'trip-gone',
199
+ renewed: true,
200
+ renewedFor: o.pressed,
201
+ renewedWhy: o.why ?? 'sign-in',
202
+ detail,
203
+ },
204
+ text: detail,
205
+ };
206
+ };
207
+ /**
208
+ * The guest's agreement to the terms behind `ref`, and what it came to: the
209
+ * booking (with its payment page), the group's terms again, or a refusal's
210
+ * code. THE ONE AGREE STEP: the booking card's own tool (`acceptTerms`) and the
211
+ * one-time page (account/index.ts, `makeAccount({ terms })`) both end here, and
212
+ * neither is the model's. Throws the group's refusals (`terms-gone`, `sign-in` …)
213
+ * as `otaless/booking.ts` raises them: `refusalAnswer` says each.
214
+ */
215
+ export const agreeToTerms = async (deps, key, ref, ctx,
216
+ /** The card's own arguments (a coupon, a request to remember), as it sent them; the page has none. */
217
+ args = {}) => {
218
+ const t = deps.tools;
219
+ const ot = deps.backend.otalessBooking;
220
+ if (!ot)
221
+ return {
222
+ structured: { view: 'error', ...common(deps, key), error: 'not-offered' },
223
+ text: `Booking terms are not agreed to through ${deps.vocab.brand}.`,
224
+ isError: true,
225
+ };
226
+ const who = identity(deps, ctx, key);
227
+ const result = await ot.acceptTerms(ref, who);
228
+ const inTrip = deps.trips.read(key);
229
+ const answered = await bookingAnswer(deps, t, ctx, key, key, args, inTrip, inTrip, deps.trips.shown(key), result, undefined, [], true);
230
+ // The picked room's slot, when the stay was booked from there: the same stays leave it.
231
+ const slot = pickedKey(key);
232
+ const picked = deps.trips.read(slot);
233
+ if (picked.length && result.booked.length) {
234
+ const gone = (l) => result.booked.some((b) => inFailedStay(l, b));
235
+ if (picked.every(gone))
236
+ deps.trips.clear(slot);
237
+ else
238
+ for (const l of picked)
239
+ if (gone(l))
240
+ deps.trips.set(slot, unset(l));
241
+ }
242
+ return answered;
243
+ };
244
+ /**
245
+ * The conversation's tool context and identity from its key alone - for the
246
+ * one-time terms page, which has the key (account layer) and no session id. The
247
+ * key is `tripKey(session, brand)`; the identity is the same one the tools build.
248
+ */
249
+ export const contextFor = (deps, key) => {
250
+ const suffix = ` ${keyBrandOf(deps.vocab).toLowerCase()}`;
251
+ return {
252
+ session: key.endsWith(suffix) ? key.slice(0, -suffix.length) : key,
253
+ tripKey: key,
254
+ noCards: true,
255
+ termsMeta: true,
256
+ };
257
+ };
258
+ export const identityFor = (deps, key) => identity(deps, contextFor(deps, key), key);
259
+ /**
260
+ * A tool's answer - every amount in it written with its whole currency where the deployment says so
261
+ * (`fullCurrency`, 0.84.0), else exactly as before.
262
+ */
263
+ export const handleTool = (deps, name, rawArgs, ctx) => inFullCurrency(deps.fullCurrency, () => answerWithAmounts(deps, name, rawArgs, ctx));
264
+ const answerWithAmounts = async (deps, name, rawArgs, ctx) => {
265
+ const { result, written } = await keepingAmounts(async () => {
266
+ // ⚠️ A GROUP THAT DID NOT ANSWER A READ IS AN ANSWER, NOT A FAULT (2026-11-03
267
+ // review, C5/C8): the hotel page, the add-ons, the dates, a booking looked
268
+ // up. Thrown by the market past its time limit, it reached the host as "the
269
+ // connector could not answer that" - or, for a search where every group was
270
+ // silent, as the first group's name alone. Said here, naming every group.
271
+ const answer = await answerTool(deps, name, rawArgs, ctx).catch((err) => {
272
+ // The group's checkout's refusals, from any tool that can get one (a
273
+ // booking list, a cancellation, a refund, an add-on): answered with their code.
274
+ const refused = refusalAnswer(deps, ctx.tripKey ?? tripKey(ctx.session, keyBrandOf(deps.vocab)), err);
275
+ if (refused)
276
+ return refused;
277
+ const down = unansweredBy(err);
278
+ if (!down)
279
+ throw err;
280
+ // `look_up` and the policies draw no card, so there is no 「重试」 to press.
281
+ const card = !ctx.noCards && name !== deps.tools.lookUp && name !== deps.tools.policies;
282
+ return notAnswered(deps, ctx.tripKey ?? tripKey(ctx.session, keyBrandOf(deps.vocab)), down, card);
283
+ });
284
+ const suggestions = await suggestionsFor(deps, answer.structured, identity(deps, ctx, ctx.tripKey ?? tripKey(ctx.session, keyBrandOf(deps.vocab)))).catch(() => []);
285
+ return { answer, suggestions };
286
+ });
287
+ const { answer, suggestions } = result;
288
+ // Every name the card is handed, in Traditional Chinese too - see names.ts.
289
+ const named = withTraditional(suggestions.length ? { ...answer.structured, suggestions } : answer.structured);
290
+ // ⚠️ AND EVERY AMOUNT, AS WHAT IT IS (总线程 / robin, 2026-10-16: 「金额按语言
291
+ // 写」): beside the words it is written in - which stay, for the model and for
292
+ // a card from before - its minor units and currency, for the card to write
293
+ // in its reader's language. The card does no sums: every figure is ours.
294
+ const amounts = amountsIn(named, written);
295
+ // ⚠️ AND, WHERE THE DEPLOYMENT HAS REFERENCE RATES, A SMALL "≈" BESIDE EACH
296
+ // AMOUNT IN ANOTHER CURRENCY (reference.ts): the hotel's own currency is what
297
+ // is quoted and charged, and the figure is only ever beside it.
298
+ if (deps.backend.reference)
299
+ return {
300
+ ...answer,
301
+ ...withReference(deps.backend.reference, { structured: named, text: answer.text }, amounts, written),
302
+ };
303
+ const structured = Object.keys(amounts).length ? { ...named, amounts } : named;
304
+ return { ...answer, structured };
305
+ };
306
+ /**
307
+ * For each left-out name that fits more than one hotel, the sentence that says
308
+ * which - for the model, in the tool's text, never on the card (see
309
+ * `MORE_THAN_ONE`).
310
+ */
311
+ export const fitsManyOf = (deps, dropped) => dropped.flatMap((d) => d.candidates?.length
312
+ ? [`"${d.name}" ${namesMoreThanOne(d.candidates, branded(deps.vocab, deps.vocab.noun))}`]
313
+ : []);
314
+ /** A stay this long, at one hotel, is worth asking whether the days stay in one area. */
315
+ export const LONG_STAY_NIGHTS = 4;
316
+ /** The other areas a long stay's answer names - one hotel each. */
317
+ export const OTHER_AREAS_MAX = 4;
318
+ /**
319
+ * Every plan's answer ends with this: the card is the plan, and a correction
320
+ * found after drawing it is said, not drawn.
321
+ *
322
+ * ⚠️ ONE PLAN, ONE CARD - SAID WHERE THE MODEL READS IT LAST (the owner,
323
+ * 2026-10-26, live 0.47.8): the plan put the Palace Museum on a Monday, the
324
+ * model noticed after drawing it and drew the whole plan again - two plan
325
+ * cards in one answer, "以第二张卡片为准". The instructions and the description
326
+ * say to check closing days before drawing; this was said only in the answer
327
+ * of a long stay at one hotel. It is in every plan's answer now.
328
+ */
329
+ export const PLAN_DRAWN_ONCE = 'The plan on the card is this one. Something to change that you notice now - a sight closed on its day, a day too far from its hotel - goes in your reply, not in another plan: the plan is drawn again only when the guest asks for the change.';
330
+ /**
331
+ * The same place in the answer, for a client that shows no cards.
332
+ *
333
+ * ⚠️ NO CARD, SO THE REPLY IS THE PLAN (总线程, 2026-10-28, a client whose
334
+ * `initialize` declared nothing): it was told "The plan on the card is this
335
+ * one", and a model told that leaves the plan to a card the guest never sees.
336
+ */
337
+ export const PLAN_NOT_DRAWN = 'Nothing was drawn: this app shows no cards, so the guest has seen none of this plan. Tell it to them in your reply, day by day - where each day is spent, and each stay with its hotel, dates, price and terms as above. Something to change that you notice now - a sight closed on its day, a day too far from its hotel - is said in that reply, not planned again: the plan is made again only when the guest asks for the change.';
338
+ /** A comparison's answer, for a client that shows no cards - see `PLAN_NOT_DRAWN`. */
339
+ export const COMPARISON_NOT_DRAWN = "Nothing was drawn: this app shows no cards, so the guest has seen none of this comparison. Compare the hotels in your reply, with each one's price and terms as given here - each is its cheapest room that sleeps the party.";
340
+ /**
341
+ * What the model is told where the client DRAWS the card (0.55.7, 总线程 11-05,
342
+ * robin 「3.ok」): on claude.ai the hotel's card listed its four room types, and the
343
+ * reply listed them again in a table - breakfast, nightly rate, the stay, the terms.
344
+ * Said only to a client that draws cards (`ToolContext.drawsCards`), in the text and
345
+ * in the structure (`cardShows`); a client that draws none is given every room in
346
+ * words as before (规矩 9).
347
+ */
348
+ export const ON_CARD = {
349
+ hotels: 'The card shows these hotels, each with its price: reply in a sentence or two on what stands out for the guest, and do not list them again.',
350
+ rooms: 'The card shows these rooms, each with its price and terms: reply in a sentence or two on what stands out for the guest, and do not list them again.',
351
+ };
352
+ /**
353
+ * A list's answer, for a client that shows no cards - see `PLAN_NOT_DRAWN`.
354
+ *
355
+ * ⚠️ A LIST WITH NO CARD IS THE HOTELS IN WORDS (2026-10-29 audit, H4). The
356
+ * answer said "12 Huazhu hotels in 上海." and nothing else - the hotels were on
357
+ * the card - so a client that draws none had a count to tell the guest.
358
+ */
359
+ /**
360
+ * How many hotels of a list a client that draws no card shows the guest at once
361
+ * (总线程 11-06, after RollingGo's text answers): the rest are a count.
362
+ */
363
+ export const HOTEL_CHOICES_SHOWN = 6;
364
+ // ⚠️ COPIED, NOT RETOLD (总线程 11-09, Manus): told to "tell them as a numbered list",
365
+ // a model handed one Huazhu hotel wrote it as a sentence with no number, and the
366
+ // guest's next 「第1家」 had nothing to point at. The lines are the guest's as
367
+ // they stand, a single one included; the ids are after them, for the model.
368
+ export const LIST_NOT_DRAWN = `Nothing was drawn: this app shows no cards, so the guest has seen none of these hotels. Copy what follows into your reply as it stands, in this order and with these numbers: the sentence of what the hotels share where there is one, then each hotel as its own lines - its number and name in bold ("**1. …**", a single hotel too), the sentence of what sets it apart, and its tags ending in its price - with a blank line between hotels. In the guest's language, with every figure kept and nothing that is not in them; never a table, and nothing said again on a hotel that the sentence before them says - at most ${HOTEL_CHOICES_SHOWN}, and any more as a count the guest can ask for, never a pick of your own. The guest answers with a number or a name; the ids after the hotels are for your calls:`;
369
+ //# sourceMappingURL=follow-ups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"follow-ups.js","sourceRoot":"","sources":["../../src/tools/follow-ups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAA0C,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiC3D,MAAM,cAAc,GAAG,KAAK,EAC1B,IAAc,EACd,CAA0B;AAC1B,4FAA4F;AAC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AC,EAAE,EAAE,CACpB,CAAC,CAAC,UAAU,EAAE,MAAM;IAClB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IACzF,CAAC,CAAC,EAAE,CACP,CAAC;AAEJ,yFAAyF;AACzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,iPAAiP,CAAC;AAEpP;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,waAAwa,CAAC;AAE3a,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAC/B,+NAA+N,CAAC;AAElO;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EACJ,4IAA4I;IAC9I,KAAK,EACH,qJAAqJ;CAC/I,CAAC;AAEX;;;;;;GAMG;AACH;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,oFAAoF;AACpF,iFAAiF;AACjF,2EAA2E;AAC3E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,omBAAomB,mBAAmB,oKAAoK,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ToolCall } from './call.js';
2
+ import type { ToolAnswer } from './deps.js';
3
+ export declare const answerForgetPreferences: ({ deps, t, key }: ToolCall) => Promise<ToolAnswer>;
4
+ //# sourceMappingURL=forget-preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forget-preferences.d.ts","sourceRoot":"","sources":["../../src/tools/forget-preferences.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C,eAAO,MAAM,uBAAuB,GAAU,kBAAkB,QAAQ,KAAG,OAAO,CAAC,UAAU,CAoB5F,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { memberForCard } from './args.js';
2
+ import { common } from './paid-lines.js';
3
+ export const answerForgetPreferences = async ({ deps, t, key }) => {
4
+ const m = deps.members.read(key);
5
+ if (!m) {
6
+ return {
7
+ structured: { view: 'no-member', ...common(deps, key) },
8
+ text: `Nobody is signed in, so there is nothing saved to forget. ${t.signIn} signs a member in.`,
9
+ };
10
+ }
11
+ await deps.backend.rememberPreferences(m, []);
12
+ const { preferences: _gone, ...member } = m;
13
+ deps.members.set(key, member);
14
+ deps.members.setPreferences(m.number, []);
15
+ return {
16
+ structured: {
17
+ view: 'member',
18
+ ...common(deps, key),
19
+ member: memberForCard(member, deps.vocab.brand),
20
+ },
21
+ text: `Forgot the room preferences saved on ${m.programme} ${m.tier.name}. Bookings already made keep what they asked for.`,
22
+ };
23
+ };
24
+ //# sourceMappingURL=forget-preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forget-preferences.js","sourceRoot":"","sources":["../../src/tools/forget-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAY,EAAuB,EAAE;IAC/F,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;YACvD,IAAI,EAAE,6DAA6D,CAAC,CAAC,MAAM,qBAAqB;SACjG,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1C,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,GAAG,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;YACpB,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;SAChD;QACD,IAAI,EAAE,wCAAwC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,mDAAmD;KAC5H,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ToolCall } from './call.js';
2
+ import type { ToolAnswer } from './deps.js';
3
+ export declare const answerGetHotel: ({ deps, args, ctx, t, key, }: ToolCall) => Promise<ToolAnswer>;
4
+ //# sourceMappingURL=get-hotel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-hotel.d.ts","sourceRoot":"","sources":["../../src/tools/get-hotel.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAwB5C,eAAO,MAAM,cAAc,GAAU,8BAMlC,QAAQ,KAAG,OAAO,CAAC,UAAU,CA4V/B,CAAC"}