@curless/hotel-storefront 0.84.8 → 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 (229) hide show
  1. package/dist/config.d.ts +35 -2
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/config.js.map +1 -1
  4. package/dist/huazhu/ari-sync.d.ts +93 -6
  5. package/dist/huazhu/ari-sync.d.ts.map +1 -1
  6. package/dist/huazhu/ari-sync.js +303 -28
  7. package/dist/huazhu/ari-sync.js.map +1 -1
  8. package/dist/huazhu/backend.d.ts +9 -0
  9. package/dist/huazhu/backend.d.ts.map +1 -1
  10. package/dist/huazhu/backend.js +62 -22
  11. package/dist/huazhu/backend.js.map +1 -1
  12. package/dist/huazhu/catalog.d.ts +58 -1
  13. package/dist/huazhu/catalog.d.ts.map +1 -1
  14. package/dist/huazhu/catalog.js +318 -15
  15. package/dist/huazhu/catalog.js.map +1 -1
  16. package/dist/huazhu/live-asks.d.ts +63 -0
  17. package/dist/huazhu/live-asks.d.ts.map +1 -0
  18. package/dist/huazhu/live-asks.js +127 -0
  19. package/dist/huazhu/live-asks.js.map +1 -0
  20. package/dist/huazhu/make.d.ts.map +1 -1
  21. package/dist/huazhu/make.js +50 -4
  22. package/dist/huazhu/make.js.map +1 -1
  23. package/dist/server.d.ts +1 -1
  24. package/dist/server.js +1 -1
  25. package/dist/tools/accept-terms.d.ts +4 -0
  26. package/dist/tools/accept-terms.d.ts.map +1 -0
  27. package/dist/tools/accept-terms.js +26 -0
  28. package/dist/tools/accept-terms.js.map +1 -0
  29. package/dist/tools/add-booking-addon.d.ts +4 -0
  30. package/dist/tools/add-booking-addon.d.ts.map +1 -0
  31. package/dist/tools/add-booking-addon.js +44 -0
  32. package/dist/tools/add-booking-addon.js.map +1 -0
  33. package/dist/tools/add-to-trip.d.ts +4 -0
  34. package/dist/tools/add-to-trip.d.ts.map +1 -0
  35. package/dist/tools/add-to-trip.js +49 -0
  36. package/dist/tools/add-to-trip.js.map +1 -0
  37. package/dist/tools/all-tools.d.ts +1342 -0
  38. package/dist/tools/all-tools.d.ts.map +1 -0
  39. package/dist/tools/all-tools.js +954 -0
  40. package/dist/tools/all-tools.js.map +1 -0
  41. package/dist/tools/answer.d.ts +3 -0
  42. package/dist/tools/answer.d.ts.map +1 -0
  43. package/dist/tools/answer.js +104 -0
  44. package/dist/tools/answer.js.map +1 -0
  45. package/dist/tools/args.d.ts +149 -0
  46. package/dist/tools/args.d.ts.map +1 -0
  47. package/dist/tools/args.js +176 -0
  48. package/dist/tools/args.js.map +1 -0
  49. package/dist/tools/base-output-schemas.d.ts +3 -0
  50. package/dist/tools/base-output-schemas.d.ts.map +1 -0
  51. package/dist/tools/base-output-schemas.js +380 -0
  52. package/dist/tools/base-output-schemas.js.map +1 -0
  53. package/dist/tools/book-picked.d.ts +4 -0
  54. package/dist/tools/book-picked.d.ts.map +1 -0
  55. package/dist/tools/book-picked.js +14 -0
  56. package/dist/tools/book-picked.js.map +1 -0
  57. package/dist/tools/booking-answer.d.ts +24 -0
  58. package/dist/tools/booking-answer.d.ts.map +1 -0
  59. package/dist/tools/booking-answer.js +485 -0
  60. package/dist/tools/booking-answer.js.map +1 -0
  61. package/dist/tools/buy-shop-item.d.ts +4 -0
  62. package/dist/tools/buy-shop-item.d.ts.map +1 -0
  63. package/dist/tools/buy-shop-item.js +45 -0
  64. package/dist/tools/buy-shop-item.js.map +1 -0
  65. package/dist/tools/call.d.ts +11 -0
  66. package/dist/tools/call.d.ts.map +1 -0
  67. package/dist/tools/call.js +2 -0
  68. package/dist/tools/call.js.map +1 -0
  69. package/dist/tools/cancel-facts.d.ts +281 -0
  70. package/dist/tools/cancel-facts.d.ts.map +1 -0
  71. package/dist/tools/cancel-facts.js +309 -0
  72. package/dist/tools/cancel-facts.js.map +1 -0
  73. package/dist/tools/cancel.d.ts +4 -0
  74. package/dist/tools/cancel.d.ts.map +1 -0
  75. package/dist/tools/cancel.js +364 -0
  76. package/dist/tools/cancel.js.map +1 -0
  77. package/dist/tools/card-addons.d.ts +4 -0
  78. package/dist/tools/card-addons.d.ts.map +1 -0
  79. package/dist/tools/card-addons.js +76 -0
  80. package/dist/tools/card-addons.js.map +1 -0
  81. package/dist/tools/change-booking.d.ts +4 -0
  82. package/dist/tools/change-booking.d.ts.map +1 -0
  83. package/dist/tools/change-booking.js +145 -0
  84. package/dist/tools/change-booking.js.map +1 -0
  85. package/dist/tools/clear-trip.d.ts +4 -0
  86. package/dist/tools/clear-trip.d.ts.map +1 -0
  87. package/dist/tools/clear-trip.js +10 -0
  88. package/dist/tools/clear-trip.js.map +1 -0
  89. package/dist/tools/compare.d.ts +4 -0
  90. package/dist/tools/compare.d.ts.map +1 -0
  91. package/dist/tools/compare.js +114 -0
  92. package/dist/tools/compare.js.map +1 -0
  93. package/dist/tools/current-trip.d.ts +70 -0
  94. package/dist/tools/current-trip.d.ts.map +1 -0
  95. package/dist/tools/current-trip.js +261 -0
  96. package/dist/tools/current-trip.js.map +1 -0
  97. package/dist/tools/deps.d.ts +229 -0
  98. package/dist/tools/deps.d.ts.map +1 -0
  99. package/dist/tools/deps.js +2 -0
  100. package/dist/tools/deps.js.map +1 -0
  101. package/dist/tools/follow-ups.d.ts +120 -0
  102. package/dist/tools/follow-ups.d.ts.map +1 -0
  103. package/dist/tools/follow-ups.js +369 -0
  104. package/dist/tools/follow-ups.js.map +1 -0
  105. package/dist/tools/forget-preferences.d.ts +4 -0
  106. package/dist/tools/forget-preferences.d.ts.map +1 -0
  107. package/dist/tools/forget-preferences.js +24 -0
  108. package/dist/tools/forget-preferences.js.map +1 -0
  109. package/dist/tools/get-hotel.d.ts +4 -0
  110. package/dist/tools/get-hotel.d.ts.map +1 -0
  111. package/dist/tools/get-hotel.js +324 -0
  112. package/dist/tools/get-hotel.js.map +1 -0
  113. package/dist/tools/hotel-choices.d.ts +132 -0
  114. package/dist/tools/hotel-choices.d.ts.map +1 -0
  115. package/dist/tools/hotel-choices.js +558 -0
  116. package/dist/tools/hotel-choices.js.map +1 -0
  117. package/dist/tools/itinerary.d.ts +4 -0
  118. package/dist/tools/itinerary.d.ts.map +1 -0
  119. package/dist/tools/itinerary.js +148 -0
  120. package/dist/tools/itinerary.js.map +1 -0
  121. package/dist/tools/list-booking-addons.d.ts +4 -0
  122. package/dist/tools/list-booking-addons.d.ts.map +1 -0
  123. package/dist/tools/list-booking-addons.js +21 -0
  124. package/dist/tools/list-booking-addons.js.map +1 -0
  125. package/dist/tools/list-bookings.d.ts +4 -0
  126. package/dist/tools/list-bookings.d.ts.map +1 -0
  127. package/dist/tools/list-bookings.js +119 -0
  128. package/dist/tools/list-bookings.js.map +1 -0
  129. package/dist/tools/list-extras.d.ts +4 -0
  130. package/dist/tools/list-extras.d.ts.map +1 -0
  131. package/dist/tools/list-extras.js +90 -0
  132. package/dist/tools/list-extras.js.map +1 -0
  133. package/dist/tools/list-hotels.d.ts +4 -0
  134. package/dist/tools/list-hotels.d.ts.map +1 -0
  135. package/dist/tools/list-hotels.js +891 -0
  136. package/dist/tools/list-hotels.js.map +1 -0
  137. package/dist/tools/list-shop-items.d.ts +4 -0
  138. package/dist/tools/list-shop-items.d.ts.map +1 -0
  139. package/dist/tools/list-shop-items.js +34 -0
  140. package/dist/tools/list-shop-items.js.map +1 -0
  141. package/dist/tools/list-shop-orders.d.ts +4 -0
  142. package/dist/tools/list-shop-orders.d.ts.map +1 -0
  143. package/dist/tools/list-shop-orders.js +22 -0
  144. package/dist/tools/list-shop-orders.js.map +1 -0
  145. package/dist/tools/look-up.d.ts +4 -0
  146. package/dist/tools/look-up.d.ts.map +1 -0
  147. package/dist/tools/look-up.js +170 -0
  148. package/dist/tools/look-up.js.map +1 -0
  149. package/dist/tools/output-schemas.d.ts +645 -0
  150. package/dist/tools/output-schemas.d.ts.map +1 -0
  151. package/dist/tools/output-schemas.js +503 -0
  152. package/dist/tools/output-schemas.js.map +1 -0
  153. package/dist/tools/paid-lines.d.ts +718 -0
  154. package/dist/tools/paid-lines.d.ts.map +1 -0
  155. package/dist/tools/paid-lines.js +359 -0
  156. package/dist/tools/paid-lines.js.map +1 -0
  157. package/dist/tools/pay-with-union-pay.d.ts +4 -0
  158. package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
  159. package/dist/tools/pay-with-union-pay.js +112 -0
  160. package/dist/tools/pay-with-union-pay.js.map +1 -0
  161. package/dist/tools/payment-words.d.ts +269 -0
  162. package/dist/tools/payment-words.d.ts.map +1 -0
  163. package/dist/tools/payment-words.js +365 -0
  164. package/dist/tools/payment-words.js.map +1 -0
  165. package/dist/tools/pick-room.d.ts +4 -0
  166. package/dist/tools/pick-room.d.ts.map +1 -0
  167. package/dist/tools/pick-room.js +23 -0
  168. package/dist/tools/pick-room.js.map +1 -0
  169. package/dist/tools/policies.d.ts +4 -0
  170. package/dist/tools/policies.d.ts.map +1 -0
  171. package/dist/tools/policies.js +74 -0
  172. package/dist/tools/policies.js.map +1 -0
  173. package/dist/tools/pricing.d.ts +55 -0
  174. package/dist/tools/pricing.d.ts.map +1 -0
  175. package/dist/tools/pricing.js +260 -0
  176. package/dist/tools/pricing.js.map +1 -0
  177. package/dist/tools/put-room-line.d.ts +12 -0
  178. package/dist/tools/put-room-line.d.ts.map +1 -0
  179. package/dist/tools/put-room-line.js +314 -0
  180. package/dist/tools/put-room-line.js.map +1 -0
  181. package/dist/tools/quote-card.d.ts +234 -0
  182. package/dist/tools/quote-card.d.ts.map +1 -0
  183. package/dist/tools/quote-card.js +375 -0
  184. package/dist/tools/quote-card.js.map +1 -0
  185. package/dist/tools/refund-booking.d.ts +4 -0
  186. package/dist/tools/refund-booking.d.ts.map +1 -0
  187. package/dist/tools/refund-booking.js +112 -0
  188. package/dist/tools/refund-booking.js.map +1 -0
  189. package/dist/tools/request-booking.d.ts +4 -0
  190. package/dist/tools/request-booking.d.ts.map +1 -0
  191. package/dist/tools/request-booking.js +5 -0
  192. package/dist/tools/request-booking.js.map +1 -0
  193. package/dist/tools/request-words.d.ts +238 -0
  194. package/dist/tools/request-words.d.ts.map +1 -0
  195. package/dist/tools/request-words.js +487 -0
  196. package/dist/tools/request-words.js.map +1 -0
  197. package/dist/tools/room-choices.d.ts +64 -0
  198. package/dist/tools/room-choices.d.ts.map +1 -0
  199. package/dist/tools/room-choices.js +348 -0
  200. package/dist/tools/room-choices.js.map +1 -0
  201. package/dist/tools/session-notes.d.ts +164 -0
  202. package/dist/tools/session-notes.d.ts.map +1 -0
  203. package/dist/tools/session-notes.js +412 -0
  204. package/dist/tools/session-notes.js.map +1 -0
  205. package/dist/tools/sign-in.d.ts +4 -0
  206. package/dist/tools/sign-in.d.ts.map +1 -0
  207. package/dist/tools/sign-in.js +72 -0
  208. package/dist/tools/sign-in.js.map +1 -0
  209. package/dist/tools/sign-out.d.ts +4 -0
  210. package/dist/tools/sign-out.d.ts.map +1 -0
  211. package/dist/tools/sign-out.js +13 -0
  212. package/dist/tools/sign-out.js.map +1 -0
  213. package/dist/tools/terms-answer.d.ts +114 -0
  214. package/dist/tools/terms-answer.d.ts.map +1 -0
  215. package/dist/tools/terms-answer.js +475 -0
  216. package/dist/tools/terms-answer.js.map +1 -0
  217. package/dist/tools/tool-set.d.ts +1474 -0
  218. package/dist/tools/tool-set.d.ts.map +1 -0
  219. package/dist/tools/tool-set.js +497 -0
  220. package/dist/tools/tool-set.js.map +1 -0
  221. package/dist/tools/view-trip.d.ts +4 -0
  222. package/dist/tools/view-trip.d.ts.map +1 -0
  223. package/dist/tools/view-trip.js +7 -0
  224. package/dist/tools/view-trip.js.map +1 -0
  225. package/dist/tools.d.ts +13 -2089
  226. package/dist/tools.d.ts.map +1 -1
  227. package/dist/tools.js +11 -10685
  228. package/dist/tools.js.map +1 -1
  229. package/package.json +1 -1
@@ -0,0 +1,324 @@
1
+ import { aboutLines } from '../about.js';
2
+ import { FULL_CAPABILITIES } from '../backend.js';
3
+ import { addDays, dayWords, stayDayWords, weekendOf, weekendWords } from '../dates.js';
4
+ import { DESCRIPTION_MAX, hotelText } from '../fence.js';
5
+ import { formatMoney, multiplyMoney } from '../money.js';
6
+ import { candidatesFor, namesMoreThanOne } from '../present.js';
7
+ import { activeKeysOf, facetsOf, matchesTerms, optionsOf, roomTermsOf, termWords, } from '../room-filters.js';
8
+ import { MAX_ROOMS_PER_LINE } from '../trip.js';
9
+ import { branded } from '../vocab.js';
10
+ import { answerTool } from './answer.js';
11
+ import { asStay, str } from './args.js';
12
+ import { ON_CARD } from './follow-ups.js';
13
+ import { common } from './paid-lines.js';
14
+ import { freeUntilText, memberRatesOf, withZh } from './quote-card.js';
15
+ import { groupNameOf, guestsOf, notBookableOf, notOnSaleWords, notSoldHereWords, offerCount, unpaidBookingWords, } from './request-words.js';
16
+ import { roomChoicesOf, roomsText, stayDefaultWords, todayOfHotel } from './room-choices.js';
17
+ import { askLater, identity } from './session-notes.js';
18
+ import { HOTEL_GEO_META_KEY, HOTEL_PHOTOS_META_KEY, ROOM_PHOTOS_META_KEY, dateFlex, hotelFactsText, soldOutTypesOf, } from './terms-answer.js';
19
+ export const answerGetHotel = async ({ deps, args, ctx, t, key, }) => {
20
+ const wanted = str(args.hotel);
21
+ const who = identity(deps, ctx, key);
22
+ // Today's rooms by the hour, on the hotel's own date - see `hourlyRooms`.
23
+ const byTheHour = args.hourly === true && !!deps.backend.hourlyRooms;
24
+ const detail = byTheHour
25
+ ? await deps.backend.hourlyRooms?.(wanted, guestsOf(args), who)
26
+ : await deps.backend.getHotel(wanted, asStay(args), who);
27
+ const stay = byTheHour ? detail?.stay : asStay(args);
28
+ if (!detail) {
29
+ const candidates = candidatesFor(deps.backend, wanted);
30
+ return {
31
+ structured: {
32
+ view: 'hotel-not-found',
33
+ ...common(deps, key),
34
+ query: wanted,
35
+ ...(candidates.length ? { candidates } : {}),
36
+ },
37
+ text: candidates.length
38
+ ? `"${wanted}" ${namesMoreThanOne(candidates, branded(deps.vocab, deps.vocab.noun))}`
39
+ : `No ${branded(deps.vocab, deps.vocab.noun)} by that name. ${t.listHotels} lists them.`,
40
+ };
41
+ }
42
+ const h = detail.hotel;
43
+ const description = hotelText('description', h.name,
44
+ // Its 【…】 parts a line each, the words as they came (`aboutLines`).
45
+ aboutLines(h.summary), DESCRIPTION_MAX, deps.vocab.demo);
46
+ // ⚠️ NO POLICIES WHERE THE POLICIES TOOL IS NOT OFFERED (总线程 11-04): Atour's
47
+ // single store (`policies: false`) still listed its topics on every hotel, and
48
+ // the card drew six rows of 「入住须知」 that each opened on "could not load
49
+ // this policy". Not read, not in the answer - the model is not told of a
50
+ // policy nobody can open either.
51
+ const offersPolicies = (deps.backend.capabilities ?? FULL_CAPABILITIES).policies !== false;
52
+ const policies = offersPolicies ? await deps.backend.policies(h.id) : [];
53
+ const extras = await deps.backend.extrasFor(h.id, stay);
54
+ const base = {
55
+ ...common(deps, key),
56
+ hotel: {
57
+ ...h,
58
+ // The hotel's own phone, years and room count: the model reads them (`HotelFacts`).
59
+ ...(detail.facts ?? {}),
60
+ summary: description.text,
61
+ fromNightly: h.fromNightly ? formatMoney(h.fromNightly) : undefined,
62
+ },
63
+ extras: extras.map((e) => ({ ...e, price: formatMoney(e.price) })),
64
+ ...(offersPolicies
65
+ ? { policies: policies.map((p) => ({ topic: p.topic, title: p.title })) }
66
+ : {}),
67
+ };
68
+ const aboutSaid = hotelFactsText(detail.facts);
69
+ // The photographs and the place, for the card alone (`HOTEL_PHOTOS_META_KEY`, `HOTEL_GEO_META_KEY`).
70
+ const hotelMeta = ctx.drawsCards
71
+ ? {
72
+ ...(detail.hotelPhotos && detail.hotelPhotos.photos.length > 1
73
+ ? { [HOTEL_PHOTOS_META_KEY]: { [h.id]: detail.hotelPhotos } }
74
+ : {}),
75
+ ...(detail.geo ? { [HOTEL_GEO_META_KEY]: { [h.id]: detail.geo } } : {}),
76
+ }
77
+ : {};
78
+ const metaWith = (more = {}) => {
79
+ const all = { ...hotelMeta, ...more };
80
+ return Object.keys(all).length ? { meta: all } : {};
81
+ };
82
+ // ⚠️ TO A CLIENT THAT DRAWS NO CARD, NO DATES IS TONIGHT, PRICED - AND SAID
83
+ // (robin 11-06, with 总线程 after RollingGo and robin's Manus run): the card
84
+ // fills in tonight itself, so a guest who can tap sees rooms at once; in
85
+ // words, "which nights?" was a turn with nothing to look at. Tonight on the
86
+ // hotel's own calendar, as the card and a short list open (robin 10-30:
87
+ // 「默认今晚并直接出价」); the answer opens on that default and on this
88
+ // weekend and next by their dates - see `stayDefaultWords`.
89
+ if (!stay && ctx.noCards && !byTheHour) {
90
+ const today = todayOfHotel(h, deps.trips.now());
91
+ const priced = await answerTool(deps, t.getHotel, {
92
+ ...args,
93
+ hotel: h.id,
94
+ checkIn: today,
95
+ checkOut: addDays(today, 1),
96
+ guests: guestsOf(args),
97
+ }, ctx);
98
+ const stayDefault = stayDefaultWords(today, guestsOf(args), args.rooms, 'rooms');
99
+ return {
100
+ ...priced,
101
+ // In both, in the same words: the model reads the structure.
102
+ structured: { ...priced.structured, stayDefault },
103
+ // The hotel's own words stay: a dateless question is often "what is it like".
104
+ text: [stayDefault, description.fenced, priced.text].filter(Boolean).join('\n\n'),
105
+ };
106
+ }
107
+ if (!stay) {
108
+ return {
109
+ ...metaWith(),
110
+ // ⚠️ THE FILTERS RIDE ALONG WITHOUT DATES: the card prices the dates
111
+ // itself and draws its chips from this answer, so a model that asked
112
+ // for breakfast before any night was named still has it asked.
113
+ structured: {
114
+ view: 'hotel',
115
+ ...base,
116
+ needsDates: true,
117
+ activeFilters: activeKeysOf(roomTermsOf(args)),
118
+ },
119
+ text: [
120
+ `**${ctx.noCards ? withZh(h.name, h.names?.name, true) : h.name}** · ${[h.area, h.city].filter(Boolean).join(', ')}`,
121
+ description.fenced,
122
+ aboutSaid,
123
+ 'Rooms and prices need the dates - which nights is the guest staying?',
124
+ ]
125
+ .filter(Boolean)
126
+ .join('\n\n'),
127
+ };
128
+ }
129
+ // ⚠️ THE ROOM COUNT FILTERS THE LIST, it does not just ride along. A guest
130
+ // who needs two rooms and is shown a type with one left finds out when the
131
+ // trip drops the line, which is later and worse than not offering it.
132
+ const roomsWanted = Math.max(1, Math.min(MAX_ROOMS_PER_LINE, Math.floor(Number(args.rooms) || 1)));
133
+ // ⚠️ ONLY WHEN SHIFTING THE DATES COULD HELP. `detail.rooms` is undefined
134
+ // for the two reasons a different arrival cannot fix - the dates are not
135
+ // bookable at all, or no room type here sleeps this party - and offering a
136
+ // week of alternatives to either is noise dressed as help.
137
+ // Other arrival dates mean nothing to a room sold for today only.
138
+ const dates = detail.rooms && !byTheHour
139
+ ? await deps.backend.datesAround(h.id, stay, { rooms: roomsWanted, span: 3 }, who)
140
+ : [];
141
+ const flex = dateFlex(dates, stay);
142
+ if (detail.noRooms || !detail.rooms) {
143
+ // ⚠️ NOTHING ON SALE HERE SAYS WHERE TO BOOK IT (T5): the same sentence
144
+ // in the text and in `noRooms`, which the card does not draw for this code
145
+ // (it says it in the guest's language from `noRoomsCode`).
146
+ const said = detail.noRooms && detail.noRoomsCode === 'none-on-sale'
147
+ ? notOnSaleWords(groupNameOf(deps, h.id), detail.noRooms)
148
+ : // Rooms that could not be read just now: asked for again by the guest.
149
+ detail.noRooms && detail.noRoomsCode === 'unreachable'
150
+ ? `${detail.noRooms} ${askLater(!ctx.noCards)}`
151
+ : detail.noRooms;
152
+ return {
153
+ ...metaWith(),
154
+ structured: {
155
+ view: 'no-rooms',
156
+ ...base,
157
+ stay,
158
+ noRooms: said,
159
+ ...(detail.noRoomsCode ? { noRoomsCode: detail.noRoomsCode } : {}),
160
+ ...(detail.noRoomsArgs ? { noRoomsArgs: detail.noRoomsArgs } : {}),
161
+ ...flex.structured,
162
+ },
163
+ text: [said ?? 'Nothing is available for those nights.', flex.text, aboutSaid]
164
+ .filter(Boolean)
165
+ .join(' '),
166
+ };
167
+ }
168
+ const enough = detail.rooms.filter((r) => r.roomsLeft >= roomsWanted);
169
+ if (enough.length === 0) {
170
+ return {
171
+ ...metaWith(),
172
+ structured: {
173
+ view: 'no-rooms',
174
+ ...base,
175
+ stay,
176
+ rooms_wanted: roomsWanted,
177
+ noRooms: `No room type here has ${roomsWanted} left for those nights.`,
178
+ noRoomsCode: 'sold-out',
179
+ noRoomsArgs: { rooms: roomsWanted },
180
+ ...flex.structured,
181
+ },
182
+ text: [
183
+ `No room type at ${h.name} has ${roomsWanted} left for ${stay.checkIn} to ${stay.checkOut}.`,
184
+ flex.text,
185
+ aboutSaid,
186
+ ]
187
+ .filter(Boolean)
188
+ .join(' '),
189
+ };
190
+ }
191
+ // ⚠️ THE CARD KEEPS EVERY ROOM, THE TEXT KEEPS THE ONES THAT MATCH. The
192
+ // filters narrow what the assistant is told; the card is sent all of them
193
+ // with what is true of each (`facets`), so a chip switched on or off on the
194
+ // card needs no call to the server.
195
+ const terms = roomTermsOf(args);
196
+ const soldOut = soldOutTypesOf(detail, enough, roomsWanted);
197
+ // Rates paid in advance booked here without payment (0.77.5) - said beside, never instead of,
198
+ // what is said of the ones not booked here.
199
+ const unpaidHere = enough.some((r) => r.paymentNotConnected)
200
+ ? unpaidBookingWords(groupNameOf(deps, h.id))
201
+ : '';
202
+ const notSold = enough.some((r) => r.notSoldHere)
203
+ ? notSoldHereWords(groupNameOf(deps, h.id), !!unpaidHere)
204
+ : '';
205
+ const rooms = enough.map(({ roomsLeft, refundable, ...r }) => ({
206
+ ...r,
207
+ // ⚠️ NO COUNT WHERE THE SUPPLIER GIVES NONE, and no yes / no on
208
+ // cancelling beside its own sentence (`Room.uncounted`, `Room.terms`).
209
+ ...(r.uncounted ? {} : { roomsLeft }),
210
+ ...(r.terms !== undefined ? {} : { refundable }),
211
+ facets: facetsOf({ ...r, roomsLeft, refundable }),
212
+ nightly: formatMoney(r.nightly),
213
+ // The room charges for the stay, where `nightly` is a rounded average (0.79.1).
214
+ ...(r.roomCharges ? { roomCharges: formatMoney(r.roomCharges) } : {}),
215
+ // ⚠️ NO STAY TOTAL WHERE IT IS OURS (总线程 11-13, `Room.stayTotalUnquoted`):
216
+ // absent here, so neither the card nor the model reads nights times a night
217
+ // as a price the group gave for the stay.
218
+ // (Undefined, so the key does not travel: the answer is JSON.)
219
+ stayTotal: r.stayTotalUnquoted ? undefined : formatMoney(r.stayTotal),
220
+ // ⚠️ "INCLUDED", NOT "¥0", where the supplier's price has its taxes in and
221
+ // gives no split (`Room.terms`, Otaless): told "taxesAndFees ¥0", the
222
+ // model said "税费 ¥0" - no tax - of a price the group says includes it.
223
+ taxesAndFees: r.terms !== undefined && r.taxesAndFees.minor === 0
224
+ ? 'Included'
225
+ : formatMoney(r.taxesAndFees),
226
+ // ⚠️ THE NUMBER THE GUEST IS LOOKING AT HAS TO BE THE ONE THEY ASKED FOR.
227
+ // With two rooms picked, the card was still showing one room's total and
228
+ // nothing said so - robin changed the count and watched the price not
229
+ // move (2026-09-18). Multiplied HERE, in minor units, because the card
230
+ // holds formatted strings and must never do arithmetic on money.
231
+ ...(roomsWanted > 1 && !r.stayTotalUnquoted
232
+ ? { roomsTotal: formatMoney(multiplyMoney(r.stayTotal, roomsWanted)) }
233
+ : {}),
234
+ // ⚠️ THE PUBLIC RATE IS MONEY TOO. It went out as a raw
235
+ // `{ minor, currency }` and the card would have drawn "[object Object]"
236
+ // through the middle with a line - caught by the test that asserted the
237
+ // string, not by anyone looking at it.
238
+ ...(r.publicNightly ? { publicNightly: formatMoney(r.publicNightly) } : {}),
239
+ ...(r.publicStayTotal ? { publicStayTotal: formatMoney(r.publicStayTotal) } : {}),
240
+ // ⚠️ AND STRUCK THROUGH FOR AS MANY ROOMS AS THE PRICE BESIDE IT. One
241
+ // room's public rate drawn over two rooms' member rate put a "was" price
242
+ // BELOW the price a member pays (2026-10-05 audit).
243
+ ...(r.publicStayTotal && roomsWanted > 1
244
+ ? { publicRoomsTotal: formatMoney(multiplyMoney(r.publicStayTotal, roomsWanted)) }
245
+ : {}),
246
+ ...(r.freeCancellationUntil ? { freeCancellationLocal: freeUntilText(r) } : {}),
247
+ }));
248
+ const memberRates = memberRatesOf(enough, roomsWanted);
249
+ // To a client that draws no card, the rooms are numbered choices - in the
250
+ // text and, word for word, here: the model reads the structure.
251
+ const choosable = terms ? enough.filter((r) => matchesTerms(r, terms)) : enough;
252
+ // The other arrivals are priced on the cheapest room of any kind.
253
+ const flexSaid = terms && flex.text
254
+ ? `${flex.text} (That is the cheapest room of any kind, not only one with ${termWords(terms)}.)`
255
+ : flex.text;
256
+ // ⚠️ BEFORE THE LIST, NOT AFTER IT (总线程 11-06, robin's Manus run): "arriving
257
+ // the 18th is ¥253 less", last in the answer, was never passed on. (Rates not booked
258
+ // here are no longer said before it - 0.75.1, `notSoldHereWords`.)
259
+ const before = flexSaid ? `${flexSaid} Say that in one sentence before the list too.` : '';
260
+ const saidWhen = byTheHour
261
+ ? `today, ${dayWords(stay.checkIn)}, ${stay.guests} ${stay.guests === 1 ? 'guest' : 'guests'}`
262
+ : `${stayDayWords(stay.checkIn, stay.checkOut)}, ${stay.guests} ${stay.guests === 1 ? 'guest' : 'guests'}${roomsWanted > 1 ? `, ${roomsWanted} rooms` : ''}`;
263
+ const notBookable = notBookableOf(deps);
264
+ const roomChoices = ctx.noCards && choosable.length
265
+ ? roomChoicesOf(choosable, roomsWanted, saidWhen, before, groupNameOf(deps, h.id), !!notBookable).join('\n')
266
+ : undefined;
267
+ // ⚠️ 「这周末」 WORKED OUT AS SATURDAY NIGHT (总线程 11-09, claude.ai and Manus
268
+ // both) is said back first, in both - see `weekendOf`.
269
+ const weekendFor = byTheHour
270
+ ? null
271
+ : weekendOf(stay.checkIn, stay.checkOut, todayOfHotel(h, deps.trips.now()));
272
+ const weekend = weekendFor ? weekendWords(weekendFor) : '';
273
+ // Each listed type's photographs, for the card alone (`ROOM_PHOTOS_META_KEY`).
274
+ const galleries = Object.fromEntries(Object.entries(detail.roomPhotos ?? {}).filter(([id, list]) => list.length > 1 && enough.some((r) => (r.roomType?.id ?? r.id) === id)));
275
+ return {
276
+ ...metaWith(ctx.drawsCards && Object.keys(galleries).length
277
+ ? { [ROOM_PHOTOS_META_KEY]: { [h.id]: galleries } }
278
+ : {}),
279
+ structured: {
280
+ view: 'hotel',
281
+ ...base,
282
+ stay,
283
+ ...(weekend ? { weekend } : {}),
284
+ ...(roomChoices ? { roomChoices } : {}),
285
+ rooms,
286
+ rooms_wanted: roomsWanted,
287
+ roomFilters: optionsOf(enough),
288
+ activeFilters: activeKeysOf(terms),
289
+ // Types with no room to book for these nights, said and not left out.
290
+ ...(byTheHour || !soldOut.length ? {} : { soldOut }),
291
+ ...(unpaidHere ? { bookedWithoutPayment: unpaidHere } : {}),
292
+ ...(notSold ? { notSoldHere: notSold } : {}),
293
+ ...(memberRates ? { memberRates } : {}),
294
+ ...flex.structured,
295
+ ...(ctx.drawsCards && enough.length ? { cardShows: ON_CARD.rooms } : {}),
296
+ ...(notBookable ? { notBookable } : {}),
297
+ // ⚠️ THE GROUP'S TWO PRICE ANSWERS DISAGREE (总线程 11-13): in both, the model reads either.
298
+ ...(detail.priceNotes?.length ? { priceNotes: detail.priceNotes } : {}),
299
+ },
300
+ text: [
301
+ weekend,
302
+ memberRates?.said ?? '',
303
+ notBookable,
304
+ aboutSaid,
305
+ ...(detail.priceNotes ?? []),
306
+ ...roomsText(ctx.noCards ? withZh(h.name, h.names?.name, true) : h.name, byTheHour
307
+ ? (rs) => `${rs.length} ${rs.length === 1 ? 'room' : 'rooms'} by the hour for today, ${stay.checkIn}, ${stay.guests} guests`
308
+ : (rs) =>
309
+ // ⚠️ THE WEEKDAYS, to a client that draws no card: the dates
310
+ // the model worked out of 「下周五住两晚」 are said back as the
311
+ // guest can check them (robin 11-06).
312
+ `${offerCount(rs)} for ${ctx.noCards ? `${stayDayWords(stay.checkIn, stay.checkOut)}, ${stay.checkIn} to ${stay.checkOut}` : `${stay.checkIn} to ${stay.checkOut}`}, ${stay.guests} guests${roomsWanted > 1 ? `, ${roomsWanted} rooms` : ''}`, byTheHour ? `today, ${stay.checkIn}` : `${stay.checkIn} to ${stay.checkOut}`, enough, roomsWanted, terms, ctx.noCards, saidWhen, before, groupNameOf(deps, h.id), !!notBookable),
313
+ // Said before the list to a client that draws no card (`before`).
314
+ ctx.noCards && choosable.length ? '' : flexSaid,
315
+ // After the rooms, never before them: for when the guest wants one (0.75.1).
316
+ unpaidHere,
317
+ notSold,
318
+ ctx.drawsCards && enough.length ? ON_CARD.rooms : '',
319
+ ]
320
+ .filter(Boolean)
321
+ .join('\n'),
322
+ };
323
+ };
324
+ //# sourceMappingURL=get-hotel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-hotel.js","sourceRoot":"","sources":["../../src/tools/get-hotel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,WAAW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,EACX,KAAK,EACL,GAAG,CAAC,OAAO,EACX,QAAQ,EACR,MAAM,EACN,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EACvB,CAAC,CAAC,WAAW,CACd;YACD,kEAAkE;YAClE,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;YAC/C,6EAA6E;YAC7E,UAAU;YACV,OAAO;YACP,GAAG,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;SACrD;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC;KACd,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { type SupplierInfo } from '../backend.js';
2
+ import { type ComparedColumn, type ItineraryDay, type ItineraryItem } from '../present.js';
3
+ import type { Booking, Hotel, HotelDetail, Identity } from '../types.js';
4
+ import type { ToolAnswer, ToolContext, ToolDeps } from './deps.js';
5
+ /**
6
+ * A list's hotels as the numbered choices a client that shows no cards tells
7
+ * the guest - one paragraph each (robin 11-09; see choices.ts): its name; a
8
+ * sentence of where it is, its group where the name does not carry it, its
9
+ * rating, a few of its own facilities and the room it is priced at; two tags
10
+ * at most and its price. What every hotel here has - the same facilities, the
11
+ * same terms, how the prices are paid - is said once before them.
12
+ *
13
+ * ⚠️ ONLY WHAT THE GROUP SAYS OF IT (总线程 11-06): never a word the data does not
14
+ * carry - a distance is not given, so "nearest" is not said.
15
+ *
16
+ * ⚠️ WHETHER EACH PRICE CAN BE BOOKED HERE CAN BE TOLD (2026-11-02 audit, P1-5): a
17
+ * Huazhu hotel whose only rate tonight is paid in advance was listed as
18
+ * "¥783.02 for the stay" - a model reading the line could tell the guest it can
19
+ * be booked. See `paymentOf`.
20
+ */
21
+ export declare const hotelChoicesBlock: (hotels: Hotel[],
22
+ /** The first hotel's number less one - a list is numbered across its pages. */
23
+ offset: number,
24
+ /** The group a hotel is with, in a market - its name is ours, not the backend's code. */
25
+ groupOf: (h: Hotel) => SupplierInfo | undefined,
26
+ /** The deployment's group, where a hotel's own is not known. */
27
+ group: string,
28
+ /** Nothing can be booked here (`capabilities.readOnly`): said once, and no payment told apart. */
29
+ readOnly?: boolean) => {
30
+ said: string;
31
+ blocks: string[];
32
+ notes: string[];
33
+ };
34
+ /**
35
+ * What a client that draws no card is told of a list asked for without dates
36
+ * (总线程 11-06, robin's Manus run: an Atour list said only "from ¥368 a night",
37
+ * and the model asked the dates, the party, the rooms, the area, the budget,
38
+ * breakfast and cancelling all at once). Its prices are from-prices, said in
39
+ * the reply's first sentence with the nights they could be priced for by their
40
+ * dates (`dateOptions`) - and nothing asked before the list. A list is not
41
+ * priced for tonight as a hotel's page is: a city is up to twenty quotes, and the
42
+ * guest opens one hotel next, which is. In both, in the same words (`stayDefault`).
43
+ */
44
+ export declare const fromPricesWords: (today: string) => string;
45
+ /**
46
+ * One column of a comparison as a line, for a client that shows no cards:
47
+ * what the card's rows say - where, the rating, the room, the price - and the
48
+ * terms the rows only answer yes or no to.
49
+ */
50
+ export declare const comparedInWords: (c: ComparedColumn) => string;
51
+ /**
52
+ * For each priced stay of four nights or more, the other areas of its city that
53
+ * have a hotel - for the model, in the tool's text, never on the card or in the
54
+ * schema.
55
+ *
56
+ * ⚠️ A WEEK AT ONE HOTEL WAS THE PLAN, AND THE MODEL NEVER SAW WHAT ELSE THE
57
+ * CITY HAS (the owner, 2026-10-26, on the live Atour connector: both Beijing
58
+ * weeks, all six nights at one hotel). The instructions say a long stay in a big
59
+ * city usually spans areas; this is the answer saying it at the moment the plan
60
+ * has just been drawn that way, with the hotels of the other areas by id, so the
61
+ * model can plan the stay in parts - or offer the move - without a second
62
+ * look-up. Nothing where the city has no other area, or the backend cannot say:
63
+ * a nudge that guesses is worse than none.
64
+ *
65
+ * ⚠️ AND A WHOLE TRIP AT ONE HOTEL SAYS WHEN THAT FITS (0.47.9, after live
66
+ * 0.47.8: six nights in Dongcheng, "only one day is far, not worth a move").
67
+ * One hotel throughout is the plan only when every day is within about 45
68
+ * minutes of it; otherwise the reply names the split as the other way. A day
69
+ * whose own words name another area's hotel is named here - also for a trip
70
+ * shorter than four nights - so the model does not have to find it again.
71
+ */
72
+ export declare const longStayNudges: (deps: ToolDeps, stays: ItineraryItem[], days: ItineraryDay[], who?: Identity) => Promise<string[]>;
73
+ /** The hotel a call named - or the answer that says there is none, or several by that name. */
74
+ export declare const hotelNamed: (deps: ToolDeps, key: string, wanted: string) => Promise<{
75
+ detail: HotelDetail;
76
+ } | {
77
+ answer: ToolAnswer;
78
+ }>;
79
+ /** An answer of the card's own pick: it says so, so the card knows it never touched the trip. */
80
+ export declare const direct: (a: ToolAnswer) => ToolAnswer;
81
+ /**
82
+ * The booking form's room, when it is NOT the room picked now: the refusal to
83
+ * book it. Undefined when the form books what it shows.
84
+ *
85
+ * ⚠️ THE PICK IS THE CONVERSATION'S, THE FORM IS ONE CARD'S (2026-10-27 audit,
86
+ * F1). Two cards of one conversation share the slot (`pickedKey`): Reserve on
87
+ * the second replaced the first's room, and the first card's form then booked
88
+ * the second's room under its own picture of another. The form says which room
89
+ * it shows; one that is not the slot's - or a slot emptied since, by a booking
90
+ * or "Don't book" on the other card - books nothing, and `again` is the pick
91
+ * that would put the form's room back.
92
+ *
93
+ * A form that names no room is a card from before 0.48.0, booked as before.
94
+ */
95
+ export declare const pickChanged: (deps: ToolDeps, key: string, args: Record<string, unknown>) => ToolAnswer | undefined;
96
+ /**
97
+ * A coupon asked for on a booking that was already made, without it - or
98
+ * nothing.
99
+ *
100
+ * ⚠️ NEVER SILENT THAT THE COUPON WAS NOT USED (2026-11-03 review, C3). The
101
+ * same stay asked for again within minutes is answered with the first
102
+ * booking (`repeat`); a member who first booked without a coupon and then said
103
+ * "use the 满500减50" was handed the first booking at its first price, with
104
+ * nothing said of the coupon they had just agreed to. The coupon is NOT put in
105
+ * the repeat key - that would book the stay twice - so the answer says it:
106
+ * the booking stands as it was, the coupon was not spent, and what it takes to
107
+ * use it is cancelling this one (free until when, or what it costs) and
108
+ * booking again. In the structure as `couponNotUsed` and in the same words.
109
+ */
110
+ export declare const couponNotUsedOf: (deps: ToolDeps, key: string, asked: string | undefined,
111
+ /** The bookings that were asked for before and returned as they were. */
112
+ reusedBookings: Booking[],
113
+ /** Every booking in the answer: the coupon may have gone on one made now. */
114
+ answered: Booking[]) => {
115
+ structured: Record<string, unknown>;
116
+ said: string;
117
+ } | undefined;
118
+ /**
119
+ * The booking this very form made a few minutes ago, when the slot is empty
120
+ * because of it - or undefined.
121
+ *
122
+ * ⚠️ THE GUEST'S OWN BOOKING IS NOT "ANOTHER CARD'S" (2026-10-29 audit, H2c).
123
+ * A booking empties the pick; when its answer is lost on the way (a host that
124
+ * gives up before 华住 has answered), the guest presses again on the same form
125
+ * and was told another card had booked or let go of the room - about the
126
+ * booking they had just made. A live booking of this conversation, for this
127
+ * email, this room, these nights and this count, made within the minutes a
128
+ * repeat is recognised in (`SAME_BOOKING_MS`), is that booking: said as one,
129
+ * and nothing is booked again.
130
+ */
131
+ export declare const bookedFromThisForm: (deps: ToolDeps, ctx: ToolContext, key: string, args: Record<string, unknown>) => Promise<ToolAnswer | undefined>;
132
+ //# sourceMappingURL=hotel-choices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hotel-choices.d.ts","sourceRoot":"","sources":["../../src/tools/hotel-choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAiB5D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAGnB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAA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