@curless/hotel-storefront 0.85.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/server.d.ts +1 -1
  2. package/dist/server.js +1 -1
  3. package/dist/tools/accept-terms.d.ts +4 -0
  4. package/dist/tools/accept-terms.d.ts.map +1 -0
  5. package/dist/tools/accept-terms.js +26 -0
  6. package/dist/tools/accept-terms.js.map +1 -0
  7. package/dist/tools/add-booking-addon.d.ts +4 -0
  8. package/dist/tools/add-booking-addon.d.ts.map +1 -0
  9. package/dist/tools/add-booking-addon.js +44 -0
  10. package/dist/tools/add-booking-addon.js.map +1 -0
  11. package/dist/tools/add-to-trip.d.ts +4 -0
  12. package/dist/tools/add-to-trip.d.ts.map +1 -0
  13. package/dist/tools/add-to-trip.js +49 -0
  14. package/dist/tools/add-to-trip.js.map +1 -0
  15. package/dist/tools/all-tools.d.ts +19124 -0
  16. package/dist/tools/all-tools.d.ts.map +1 -0
  17. package/dist/tools/all-tools.js +43 -0
  18. package/dist/tools/all-tools.js.map +1 -0
  19. package/dist/tools/answer.d.ts +3 -0
  20. package/dist/tools/answer.d.ts.map +1 -0
  21. package/dist/tools/answer.js +104 -0
  22. package/dist/tools/answer.js.map +1 -0
  23. package/dist/tools/args.d.ts +149 -0
  24. package/dist/tools/args.d.ts.map +1 -0
  25. package/dist/tools/args.js +176 -0
  26. package/dist/tools/args.js.map +1 -0
  27. package/dist/tools/base-output-schemas.d.ts +3 -0
  28. package/dist/tools/base-output-schemas.d.ts.map +1 -0
  29. package/dist/tools/base-output-schemas.js +396 -0
  30. package/dist/tools/base-output-schemas.js.map +1 -0
  31. package/dist/tools/book-picked.d.ts +4 -0
  32. package/dist/tools/book-picked.d.ts.map +1 -0
  33. package/dist/tools/book-picked.js +14 -0
  34. package/dist/tools/book-picked.js.map +1 -0
  35. package/dist/tools/booking-answer.d.ts +24 -0
  36. package/dist/tools/booking-answer.d.ts.map +1 -0
  37. package/dist/tools/booking-answer.js +567 -0
  38. package/dist/tools/booking-answer.js.map +1 -0
  39. package/dist/tools/buy-shop-item.d.ts +4 -0
  40. package/dist/tools/buy-shop-item.d.ts.map +1 -0
  41. package/dist/tools/buy-shop-item.js +45 -0
  42. package/dist/tools/buy-shop-item.js.map +1 -0
  43. package/dist/tools/call.d.ts +11 -0
  44. package/dist/tools/call.d.ts.map +1 -0
  45. package/dist/tools/call.js +2 -0
  46. package/dist/tools/call.js.map +1 -0
  47. package/dist/tools/cancel-facts.d.ts +281 -0
  48. package/dist/tools/cancel-facts.d.ts.map +1 -0
  49. package/dist/tools/cancel-facts.js +309 -0
  50. package/dist/tools/cancel-facts.js.map +1 -0
  51. package/dist/tools/cancel.d.ts +4 -0
  52. package/dist/tools/cancel.d.ts.map +1 -0
  53. package/dist/tools/cancel.js +415 -0
  54. package/dist/tools/cancel.js.map +1 -0
  55. package/dist/tools/capability-adjust.d.ts +31 -0
  56. package/dist/tools/capability-adjust.d.ts.map +1 -0
  57. package/dist/tools/capability-adjust.js +299 -0
  58. package/dist/tools/capability-adjust.js.map +1 -0
  59. package/dist/tools/card-addons.d.ts +4 -0
  60. package/dist/tools/card-addons.d.ts.map +1 -0
  61. package/dist/tools/card-addons.js +76 -0
  62. package/dist/tools/card-addons.js.map +1 -0
  63. package/dist/tools/change-booking.d.ts +4 -0
  64. package/dist/tools/change-booking.d.ts.map +1 -0
  65. package/dist/tools/change-booking.js +145 -0
  66. package/dist/tools/change-booking.js.map +1 -0
  67. package/dist/tools/clear-trip.d.ts +4 -0
  68. package/dist/tools/clear-trip.d.ts.map +1 -0
  69. package/dist/tools/clear-trip.js +10 -0
  70. package/dist/tools/clear-trip.js.map +1 -0
  71. package/dist/tools/compare.d.ts +4 -0
  72. package/dist/tools/compare.d.ts.map +1 -0
  73. package/dist/tools/compare.js +114 -0
  74. package/dist/tools/compare.js.map +1 -0
  75. package/dist/tools/current-trip.d.ts +70 -0
  76. package/dist/tools/current-trip.d.ts.map +1 -0
  77. package/dist/tools/current-trip.js +269 -0
  78. package/dist/tools/current-trip.js.map +1 -0
  79. package/dist/tools/deps.d.ts +229 -0
  80. package/dist/tools/deps.d.ts.map +1 -0
  81. package/dist/tools/deps.js +2 -0
  82. package/dist/tools/deps.js.map +1 -0
  83. package/dist/tools/follow-ups.d.ts +120 -0
  84. package/dist/tools/follow-ups.d.ts.map +1 -0
  85. package/dist/tools/follow-ups.js +369 -0
  86. package/dist/tools/follow-ups.js.map +1 -0
  87. package/dist/tools/forget-preferences.d.ts +4 -0
  88. package/dist/tools/forget-preferences.d.ts.map +1 -0
  89. package/dist/tools/forget-preferences.js +24 -0
  90. package/dist/tools/forget-preferences.js.map +1 -0
  91. package/dist/tools/get-hotel.d.ts +4 -0
  92. package/dist/tools/get-hotel.d.ts.map +1 -0
  93. package/dist/tools/get-hotel.js +350 -0
  94. package/dist/tools/get-hotel.js.map +1 -0
  95. package/dist/tools/hotel-choices.d.ts +132 -0
  96. package/dist/tools/hotel-choices.d.ts.map +1 -0
  97. package/dist/tools/hotel-choices.js +587 -0
  98. package/dist/tools/hotel-choices.js.map +1 -0
  99. package/dist/tools/itinerary.d.ts +4 -0
  100. package/dist/tools/itinerary.d.ts.map +1 -0
  101. package/dist/tools/itinerary.js +158 -0
  102. package/dist/tools/itinerary.js.map +1 -0
  103. package/dist/tools/list-booking-addons.d.ts +4 -0
  104. package/dist/tools/list-booking-addons.d.ts.map +1 -0
  105. package/dist/tools/list-booking-addons.js +21 -0
  106. package/dist/tools/list-booking-addons.js.map +1 -0
  107. package/dist/tools/list-bookings.d.ts +4 -0
  108. package/dist/tools/list-bookings.d.ts.map +1 -0
  109. package/dist/tools/list-bookings.js +119 -0
  110. package/dist/tools/list-bookings.js.map +1 -0
  111. package/dist/tools/list-extras.d.ts +4 -0
  112. package/dist/tools/list-extras.d.ts.map +1 -0
  113. package/dist/tools/list-extras.js +90 -0
  114. package/dist/tools/list-extras.js.map +1 -0
  115. package/dist/tools/list-hotels-ask.d.ts +133 -0
  116. package/dist/tools/list-hotels-ask.d.ts.map +1 -0
  117. package/dist/tools/list-hotels-ask.js +326 -0
  118. package/dist/tools/list-hotels-ask.js.map +1 -0
  119. package/dist/tools/list-hotels-empty.d.ts +5 -0
  120. package/dist/tools/list-hotels-empty.d.ts.map +1 -0
  121. package/dist/tools/list-hotels-empty.js +130 -0
  122. package/dist/tools/list-hotels-empty.js.map +1 -0
  123. package/dist/tools/list-hotels-home.d.ts +9 -0
  124. package/dist/tools/list-hotels-home.d.ts.map +1 -0
  125. package/dist/tools/list-hotels-home.js +181 -0
  126. package/dist/tools/list-hotels-home.js.map +1 -0
  127. package/dist/tools/list-hotels-page.d.ts +43 -0
  128. package/dist/tools/list-hotels-page.d.ts.map +1 -0
  129. package/dist/tools/list-hotels-page.js +344 -0
  130. package/dist/tools/list-hotels-page.js.map +1 -0
  131. package/dist/tools/list-hotels.d.ts +4 -0
  132. package/dist/tools/list-hotels.d.ts.map +1 -0
  133. package/dist/tools/list-hotels.js +24 -0
  134. package/dist/tools/list-hotels.js.map +1 -0
  135. package/dist/tools/list-shop-items.d.ts +4 -0
  136. package/dist/tools/list-shop-items.d.ts.map +1 -0
  137. package/dist/tools/list-shop-items.js +34 -0
  138. package/dist/tools/list-shop-items.js.map +1 -0
  139. package/dist/tools/list-shop-orders.d.ts +4 -0
  140. package/dist/tools/list-shop-orders.d.ts.map +1 -0
  141. package/dist/tools/list-shop-orders.js +22 -0
  142. package/dist/tools/list-shop-orders.js.map +1 -0
  143. package/dist/tools/look-up.d.ts +4 -0
  144. package/dist/tools/look-up.d.ts.map +1 -0
  145. package/dist/tools/look-up.js +207 -0
  146. package/dist/tools/look-up.js.map +1 -0
  147. package/dist/tools/output-schemas.d.ts +645 -0
  148. package/dist/tools/output-schemas.d.ts.map +1 -0
  149. package/dist/tools/output-schemas.js +503 -0
  150. package/dist/tools/output-schemas.js.map +1 -0
  151. package/dist/tools/paid-lines.d.ts +718 -0
  152. package/dist/tools/paid-lines.d.ts.map +1 -0
  153. package/dist/tools/paid-lines.js +359 -0
  154. package/dist/tools/paid-lines.js.map +1 -0
  155. package/dist/tools/pay-with-union-pay.d.ts +4 -0
  156. package/dist/tools/pay-with-union-pay.d.ts.map +1 -0
  157. package/dist/tools/pay-with-union-pay.js +112 -0
  158. package/dist/tools/pay-with-union-pay.js.map +1 -0
  159. package/dist/tools/payment-words.d.ts +269 -0
  160. package/dist/tools/payment-words.d.ts.map +1 -0
  161. package/dist/tools/payment-words.js +365 -0
  162. package/dist/tools/payment-words.js.map +1 -0
  163. package/dist/tools/pick-room.d.ts +4 -0
  164. package/dist/tools/pick-room.d.ts.map +1 -0
  165. package/dist/tools/pick-room.js +23 -0
  166. package/dist/tools/pick-room.js.map +1 -0
  167. package/dist/tools/policies.d.ts +4 -0
  168. package/dist/tools/policies.d.ts.map +1 -0
  169. package/dist/tools/policies.js +74 -0
  170. package/dist/tools/policies.js.map +1 -0
  171. package/dist/tools/pricing.d.ts +55 -0
  172. package/dist/tools/pricing.d.ts.map +1 -0
  173. package/dist/tools/pricing.js +260 -0
  174. package/dist/tools/pricing.js.map +1 -0
  175. package/dist/tools/put-room-line.d.ts +12 -0
  176. package/dist/tools/put-room-line.d.ts.map +1 -0
  177. package/dist/tools/put-room-line.js +347 -0
  178. package/dist/tools/put-room-line.js.map +1 -0
  179. package/dist/tools/quote-card.d.ts +234 -0
  180. package/dist/tools/quote-card.d.ts.map +1 -0
  181. package/dist/tools/quote-card.js +375 -0
  182. package/dist/tools/quote-card.js.map +1 -0
  183. package/dist/tools/refund-booking.d.ts +4 -0
  184. package/dist/tools/refund-booking.d.ts.map +1 -0
  185. package/dist/tools/refund-booking.js +112 -0
  186. package/dist/tools/refund-booking.js.map +1 -0
  187. package/dist/tools/request-booking.d.ts +4 -0
  188. package/dist/tools/request-booking.d.ts.map +1 -0
  189. package/dist/tools/request-booking.js +5 -0
  190. package/dist/tools/request-booking.js.map +1 -0
  191. package/dist/tools/request-words.d.ts +238 -0
  192. package/dist/tools/request-words.d.ts.map +1 -0
  193. package/dist/tools/request-words.js +487 -0
  194. package/dist/tools/request-words.js.map +1 -0
  195. package/dist/tools/room-choices.d.ts +64 -0
  196. package/dist/tools/room-choices.d.ts.map +1 -0
  197. package/dist/tools/room-choices.js +374 -0
  198. package/dist/tools/room-choices.js.map +1 -0
  199. package/dist/tools/session-notes.d.ts +164 -0
  200. package/dist/tools/session-notes.d.ts.map +1 -0
  201. package/dist/tools/session-notes.js +412 -0
  202. package/dist/tools/session-notes.js.map +1 -0
  203. package/dist/tools/sign-in.d.ts +4 -0
  204. package/dist/tools/sign-in.d.ts.map +1 -0
  205. package/dist/tools/sign-in.js +72 -0
  206. package/dist/tools/sign-in.js.map +1 -0
  207. package/dist/tools/sign-out.d.ts +4 -0
  208. package/dist/tools/sign-out.d.ts.map +1 -0
  209. package/dist/tools/sign-out.js +13 -0
  210. package/dist/tools/sign-out.js.map +1 -0
  211. package/dist/tools/terms-answer.d.ts +114 -0
  212. package/dist/tools/terms-answer.d.ts.map +1 -0
  213. package/dist/tools/terms-answer.js +492 -0
  214. package/dist/tools/terms-answer.js.map +1 -0
  215. package/dist/tools/tool-defs-account.d.ts +80 -0
  216. package/dist/tools/tool-defs-account.d.ts.map +1 -0
  217. package/dist/tools/tool-defs-account.js +65 -0
  218. package/dist/tools/tool-defs-account.js.map +1 -0
  219. package/dist/tools/tool-defs-addons.d.ts +251 -0
  220. package/dist/tools/tool-defs-addons.d.ts.map +1 -0
  221. package/dist/tools/tool-defs-addons.js +198 -0
  222. package/dist/tools/tool-defs-addons.js.map +1 -0
  223. package/dist/tools/tool-defs-booking.d.ts +410 -0
  224. package/dist/tools/tool-defs-booking.d.ts.map +1 -0
  225. package/dist/tools/tool-defs-booking.js +285 -0
  226. package/dist/tools/tool-defs-booking.js.map +1 -0
  227. package/dist/tools/tool-defs-browse.d.ts +444 -0
  228. package/dist/tools/tool-defs-browse.d.ts.map +1 -0
  229. package/dist/tools/tool-defs-browse.js +307 -0
  230. package/dist/tools/tool-defs-browse.js.map +1 -0
  231. package/dist/tools/tool-defs-trip.d.ts +136 -0
  232. package/dist/tools/tool-defs-trip.d.ts.map +1 -0
  233. package/dist/tools/tool-defs-trip.js +79 -0
  234. package/dist/tools/tool-defs-trip.js.map +1 -0
  235. package/dist/tools/tool-env.d.ts +64 -0
  236. package/dist/tools/tool-env.d.ts.map +1 -0
  237. package/dist/tools/tool-env.js +49 -0
  238. package/dist/tools/tool-env.js.map +1 -0
  239. package/dist/tools/tool-set.d.ts +1425 -0
  240. package/dist/tools/tool-set.d.ts.map +1 -0
  241. package/dist/tools/tool-set.js +244 -0
  242. package/dist/tools/tool-set.js.map +1 -0
  243. package/dist/tools/view-trip.d.ts +4 -0
  244. package/dist/tools/view-trip.d.ts.map +1 -0
  245. package/dist/tools/view-trip.js +7 -0
  246. package/dist/tools/view-trip.js.map +1 -0
  247. package/dist/tools.d.ts +13 -2089
  248. package/dist/tools.d.ts.map +1 -1
  249. package/dist/tools.js +11 -10685
  250. package/dist/tools.js.map +1 -1
  251. package/package.json +1 -1
@@ -0,0 +1,114 @@
1
+ import { compareHotels } from '../present.js';
2
+ import { catalogue } from '../vocab.js';
3
+ import { asStay, str } from './args.js';
4
+ import { COMPARISON_NOT_DRAWN, fitsManyOf } from './follow-ups.js';
5
+ import { comparedInWords } from './hotel-choices.js';
6
+ import { common } from './paid-lines.js';
7
+ import { notBookableOf } from './request-words.js';
8
+ import { askLater, identity } from './session-notes.js';
9
+ export const answerCompare = async ({ deps, args, ctx, key }) => {
10
+ const asks = Array.isArray(args.entries) ? args.entries : [];
11
+ const comparison = await compareHotels(deps.backend, asks.map((e) => ({
12
+ hotel: str(e.hotel),
13
+ bestFor: typeof e.bestFor === 'string' ? e.bestFor : undefined,
14
+ pros: e.pros,
15
+ cons: e.cons,
16
+ })), {
17
+ stay: asStay(args),
18
+ recommended: str(args.recommended) || undefined,
19
+ title: str(args.title) || undefined,
20
+ // The member's rate, like the list and the hotel beside it: without
21
+ // it the comparison quoted HK$5,424 where both said HK$4,610.
22
+ who: identity(deps, ctx, key),
23
+ });
24
+ if (comparison.columns.length === 0) {
25
+ // A group that did not answer is not "not ours" (2026-11-03 review, C5):
26
+ // its hotels are said as left out for that.
27
+ const silent = comparison.dropped.filter((d) => d.code === 'supplier-timeout');
28
+ // A hotel with no room for the nights is one of ours too (`code` 'no-rooms'): left out, said as that.
29
+ const noRooms = comparison.dropped.filter((d) => d.code === 'no-rooms');
30
+ const unknown = comparison.dropped.filter((d) => !d.candidates?.length && d.code !== 'supplier-timeout' && d.code !== 'no-rooms');
31
+ const fitsMany = fitsManyOf(deps, comparison.dropped);
32
+ return {
33
+ structured: {
34
+ view: 'nothing-to-compare',
35
+ ...common(deps, key),
36
+ dropped: comparison.dropped,
37
+ },
38
+ // A name that fits several IS one of ours - only the rest are "none".
39
+ text: [
40
+ ...(unknown.length || (!fitsMany.length && !silent.length && !noRooms.length)
41
+ ? [
42
+ `None of those are ${catalogue(deps.vocab)}: ${unknown.map((d) => d.name).join(', ')}.`,
43
+ ]
44
+ : []),
45
+ ...fitsMany,
46
+ ...noRooms.map((d) => `Left out: ${d.name} — ${d.why}`),
47
+ ...silent.map((d) => `Left out: ${d.name} — ${d.why}`),
48
+ silent.length ? askLater(!ctx.noCards) : '',
49
+ ]
50
+ .filter(Boolean)
51
+ .join('\n'),
52
+ };
53
+ }
54
+ const stayWords = comparison.stay
55
+ ? ` for ${comparison.stay.checkIn} to ${comparison.stay.checkOut}`
56
+ : '';
57
+ const notBookable = notBookableOf(deps);
58
+ return {
59
+ structured: {
60
+ view: 'comparison',
61
+ ...common(deps, key),
62
+ ...comparison,
63
+ columns: comparison.columns.map((c) => ({
64
+ ...c,
65
+ hotel: { ...c.hotel, fromNightly: undefined },
66
+ })),
67
+ // In both, like the itinerary's: a host with no card may hand its
68
+ // model this rather than the text.
69
+ ...(ctx.noCards ? { notDrawn: COMPARISON_NOT_DRAWN } : {}),
70
+ ...(notBookable ? { notBookable } : {}),
71
+ },
72
+ text: [
73
+ notBookable,
74
+ // The card carries the table; the text carries only what the model
75
+ // could not see before it asked - what was dropped, and why.
76
+ //
77
+ // ⚠️ UNLESS THERE IS NO CARD (总线程, 2026-10-28): a client that shows
78
+ // none was answered "2 side by side" and nothing else, and its model
79
+ // could not say what either hotel cost. Then the table is said here,
80
+ // one line a hotel, from the same records the card's rows are read off.
81
+ //
82
+ // ⚠️ A COMPARISON OF ONE IS NOT "1 SIDE BY SIDE" (总线程 11-13): when the
83
+ // others were left out, say how many were asked for and that only one
84
+ // could be compared - the "Left out" lines below say why.
85
+ ...(ctx.noCards
86
+ ? [
87
+ comparison.columns.length === 1 && comparison.dropped.length > 0
88
+ ? `Only 1 of the ${comparison.columns.length + comparison.dropped.length} could be compared${stayWords}. ${COMPARISON_NOT_DRAWN}`
89
+ : `${comparison.columns.length} compared${stayWords}. ${COMPARISON_NOT_DRAWN}`,
90
+ ...comparison.columns.map(comparedInWords),
91
+ ]
92
+ : [
93
+ comparison.columns.length === 1 && comparison.dropped.length > 0
94
+ ? `Only 1 of the ${comparison.columns.length + comparison.dropped.length} could be compared${stayWords}.`
95
+ : `${comparison.columns.length} side by side${stayWords}.`,
96
+ ]),
97
+ // ⚠️ SAY IT IN THE TEXT TOO. The card carries the warning for whoever is
98
+ // looking at it; this line is for the model, which is about to describe
99
+ // the table in prose and would otherwise read "¥67,500" against
100
+ // "€1,060" as a price difference and say which one is cheaper.
101
+ comparison.currencies
102
+ ? `These are priced in different currencies (${comparison.currencies.join(', ')}) and nothing here converts them — do not call one cheaper than another.`
103
+ : '',
104
+ // ⚠️ THE GROUP'S TWO PRICE ANSWERS DISAGREE (总线程 11-13, `HotelDetail.priceNotes`).
105
+ ...(comparison.priceNotes ?? []),
106
+ ...comparison.dropped.map((d) => `Left out: ${d.name} — ${d.why}`),
107
+ ...fitsManyOf(deps, comparison.dropped),
108
+ comparison.dropped.some((d) => d.code === 'supplier-timeout') ? askLater(!ctx.noCards) : '',
109
+ ]
110
+ .filter(Boolean)
111
+ .join('\n'),
112
+ };
113
+ };
114
+ //# sourceMappingURL=compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/tools/compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAY,EAAuB,EAAE;IAC7F,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,OAAqC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,UAAU,GAAG,MAAM,aAAa,CACpC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACf,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QAC9D,IAAI,EAAE,CAAC,CAAC,IAA4B;QACpC,IAAI,EAAE,CAAC,CAAC,IAA4B;KACrC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M,gBAAgB,SAAS,GAAG;iBAC7D,CAAC;YACN,yEAAyE;YACzE,wEAAwE;YACxE,gEAAgE;YAChE,+DAA+D;YAC/D,UAAU,CAAC,UAAU;gBACnB,CAAC,CAAC,6CAA6C,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,0EAA0E;gBACzJ,CAAC,CAAC,EAAE;YACN,mFAAmF;YACnF,GAAG,CAAC,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;YAChC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;YAClE,GAAG,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;YACvC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;SAC5F;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC;KACd,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ import type { HotelFilters, HotelSearchResult, Identity } from '../types.js';
2
+ import type { ToolAnswer, ToolContext, ToolDeps } from './deps.js';
3
+ /**
4
+ * The lines in one slot of the trip store, priced - the trip itself, or (with
5
+ * `store`) the picked room's slot. `key` stays the conversation's trip key: it
6
+ * is the one `common` reads, so a header's trip count never counts a pick.
7
+ */
8
+ export declare const currentTrip: (deps: ToolDeps, key: string, who?: Identity, store?: string, coupon?: string, ctx?: ToolContext) => Promise<ToolAnswer>;
9
+ /** The filters a list call asked for, or undefined when it asked for none. */
10
+ export declare const filtersOf: (args: Record<string, unknown>) => HotelFilters | undefined;
11
+ /** The filters in words, for the one line the model reads. */
12
+ export declare const filterWords: (f: HotelFilters) => string;
13
+ /** What to say when the filters left nothing - one filter said plainly, several as "together". */
14
+ export declare const emptiedBy: (f: HotelFilters, before: number, nouns: string) => string;
15
+ /**
16
+ * The filter chips a list offers, each with what it would leave.
17
+ *
18
+ * ⚠️ ONLY WHAT NARROWS. A chip every hotel on the list passes - breakfast
19
+ * where every hotel has a breakfast rate, one brand where only one is here -
20
+ * changes nothing when pressed, and a panel of those is a panel of noise. One
21
+ * that is ON always shows, so it can be turned off again.
22
+ */
23
+ export declare const refineFor: (r: NonNullable<HotelSearchResult["refine"]>, on: HotelFilters | undefined, total: number,
24
+ /**
25
+ * A dated list. There a room term changes which room is PRICED even where
26
+ * every hotel keeps one - so free cancellation and breakfast always show.
27
+ */
28
+ dated?: boolean) => {
29
+ brands: {
30
+ on: boolean;
31
+ name: string;
32
+ count: number;
33
+ names?: import("../types.js").Names;
34
+ }[];
35
+ facilities: {
36
+ on: boolean;
37
+ key: string;
38
+ label: string;
39
+ count: number;
40
+ }[];
41
+ room: {
42
+ key: string;
43
+ label: string;
44
+ count: number;
45
+ on: boolean;
46
+ }[];
47
+ groups?: {
48
+ on: boolean;
49
+ id: string;
50
+ count: number;
51
+ }[] | undefined;
52
+ };
53
+ /**
54
+ * From how many cities a country is a list of cities to choose from rather
55
+ * than a list of hotels. China is forty; Malaysia's six hotels in three cities
56
+ * read better as hotels, grouped by city.
57
+ */
58
+ export declare const CITY_PICKER_MIN = 4;
59
+ /**
60
+ * Up to how many hotels a whole deployment is a list rather than places to
61
+ * choose from. Huazhu's production had two, in two cities, and "where to?"
62
+ * over two city chips and "browse all 2" had the model list them all again -
63
+ * two cards for one question (robin, 2026-10-30). Six is what the card shows
64
+ * whole at every width, with no "Next" (its inline page is five rows on a
65
+ * phone and lets two more in - see the card's `pageSize`): a place picker
66
+ * over that many saves no one a tap. A group of nine in four cities still
67
+ * chooses a city first.
68
+ */
69
+ export declare const HOME_LIST_MAX = 6;
70
+ //# sourceMappingURL=current-trip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-trip.d.ts","sourceRoot":"","sources":["../../src/tools/current-trip.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAY,MAAM,aAAa,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMnE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,QAAQ,EACd,KAAK,MAAM,EACX,MAAM,QAAQ,EACd,QAAO,MAAY,EACnB,SAAS,MAAM,EACf,MAAM,WAAW,KAChB,OAAO,CAAC,UAAU,CA0GpB,CAAC;AA6DF,8EAA8E;AAC9E,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,YAAY,GAAG,SAexE,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,WAAW,GAAI,GAAG,YAAY,KAAG,MAY/B,CAAC;AAEhB,kGAAkG;AAClG,eAAO,MAAM,SAAS,GAAI,GAAG,YAAY,EAAE,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,MAc1E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GACpB,GAAG,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,EAC3C,IAAI,YAAY,GAAG,SAAS,EAC5B,OAAO,MAAM;AACb;;;GAGG;AACH,eAAa;;;;;;;;;;;;;;;;;;;;;;;;CAuCd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC"}
@@ -0,0 +1,269 @@
1
+ import { FULL_CAPABILITIES } from '../backend.js';
2
+ import { FACILITIES } from '../facilities.js';
3
+ import { hotelName } from '../fence.js';
4
+ import { overlapsOf } from '../overlap.js';
5
+ import { shownOf, stampOf } from '../trip.js';
6
+ import { place, str } from './args.js';
7
+ import { common } from './paid-lines.js';
8
+ import { detailsAsked, needsRoomIn, noPrice, quoteParts, refreshMember } from './pricing.js';
9
+ import { quoteForCard, tripText } from './quote-card.js';
10
+ import { readOnlyWords } from './tool-set.js';
11
+ /**
12
+ * The lines in one slot of the trip store, priced - the trip itself, or (with
13
+ * `store`) the picked room's slot. `key` stays the conversation's trip key: it
14
+ * is the one `common` reads, so a header's trip count never counts a pick.
15
+ */
16
+ export const currentTrip = async (deps, key, who, store = key, coupon, ctx) => {
17
+ await refreshMember(deps, key);
18
+ const member = deps.members.read(key);
19
+ const lines = deps.trips.read(store);
20
+ const parts = await quoteParts(deps, lines, who && member ? { ...who, member } : who, coupon);
21
+ // ⚠️ WHAT THE GUEST IS SHOWN IS WHAT IS BOOKED - see `ShownQuote`. Every
22
+ // priced trip answer goes through here: add_to_trip, view_trip, and the
23
+ // card's own trip view.
24
+ if (lines.length)
25
+ deps.trips.show(store, shownOf(parts));
26
+ // What this answer drew, for the card's form to send back - see `stampOf`.
27
+ const stamp = lines.length ? { stamp: stampOf(lines, deps.trips.shown(store)) } : {};
28
+ const [only] = parts;
29
+ const orphans = needsRoomIn(deps.tools, lines, parts);
30
+ const needs = orphans.needsRoom.length ? { needsRoom: orphans.needsRoom } : {};
31
+ const groupOf = deps.backend.supplierOf
32
+ ? (id) => deps.backend.supplierOf?.(id)
33
+ : undefined;
34
+ const overlaps = overlapsInTrip(parts);
35
+ const overlapping = overlaps.length ? { overlaps } : {};
36
+ const nextStep = nextStepWords(deps, key, ctx, lines, parts);
37
+ if (parts.length === 1 && only) {
38
+ return {
39
+ structured: {
40
+ view: 'trip',
41
+ ...common(deps, key),
42
+ ...(only.lines.length === 0 && only.dropped?.length
43
+ ? noPrice(quoteForCard(only, groupOf))
44
+ : quoteForCard(only, groupOf)),
45
+ ...needs,
46
+ ...stamp,
47
+ ...overlapping,
48
+ count: lines.length,
49
+ ...(nextStep ? { nextStep } : {}),
50
+ },
51
+ text: [tripText(only, ctx?.noCards), ...overlaps.map((o) => o.said), orphans.line, nextStep]
52
+ .filter(Boolean)
53
+ .join('\n'),
54
+ };
55
+ }
56
+ const shaped = parts.map((p) => quoteForCard(p, groupOf));
57
+ const bookable = parts.map((p) => p.lines.some((l) => l.kind === 'room'));
58
+ // Every line of every currency left out: no total to name, no zero to show. Each
59
+ // group says the currency its hotels are listed in; the words are what was left out.
60
+ if (parts.every((p) => p.lines.length === 0)) {
61
+ return {
62
+ structured: {
63
+ view: 'trip',
64
+ ...common(deps, key),
65
+ lines: [],
66
+ groups: shaped.map((p, i) => ({ ...noPrice(p), currency: parts[i]?.total.currency })),
67
+ currencies: [...new Set(parts.map((p) => p.total.currency))],
68
+ dropped: shaped.flatMap((p) => p.dropped ?? []),
69
+ ...stamp,
70
+ ...overlapping,
71
+ count: lines.length,
72
+ },
73
+ text: parts
74
+ .map((q) => tripText(q, ctx?.noCards))
75
+ .filter(Boolean)
76
+ .join('\n'),
77
+ };
78
+ }
79
+ return {
80
+ structured: {
81
+ view: 'trip',
82
+ ...common(deps, key),
83
+ lines: shaped.flatMap((p) => p.lines),
84
+ // One block per currency, each with its own taxes and total. `total` is
85
+ // the totals side by side for anything that reads one string - a list,
86
+ // never a sum.
87
+ //
88
+ // ⚠️ A CURRENCY OF ADD-ONS ALONE IS NOT PART OF WHAT IS BOOKED. A
89
+ // transfer at a Paris hotel with no Paris room made its own € block, and
90
+ // the trip's total read "HK$8,588 · €347" for a request that refuses
91
+ // the €347 (2026-09-28 audit). It is drawn, marked, and left out.
92
+ groups: shaped.map((p, i) => ({
93
+ ...p,
94
+ currency: parts[i]?.total.currency,
95
+ ...(bookable[i] ? {} : { goesWithAStay: true }),
96
+ })),
97
+ currencies: parts.map((p) => p.total.currency),
98
+ // Side by side with a dot, not a plus: "HK$8,588 + ¥152,550" reads as
99
+ // a sum nobody can do.
100
+ total: (shaped.filter((_, i) => bookable[i]).length
101
+ ? shaped.filter((_, i) => bookable[i])
102
+ : shaped)
103
+ .map((p) => p.total)
104
+ .join(' · '),
105
+ ...needs,
106
+ ...(shaped.some((p) => p.dropped) ? { dropped: shaped.flatMap((p) => p.dropped ?? []) } : {}),
107
+ ...stamp,
108
+ ...overlapping,
109
+ count: lines.length,
110
+ ...(nextStep ? { nextStep } : {}),
111
+ },
112
+ text: [
113
+ `This trip is in ${parts.length} currencies, priced separately and not converted - each hotel is booked and paid in its own.`,
114
+ ...parts.map((q) => tripText(q, ctx?.noCards)),
115
+ ...overlaps.map((o) => o.said),
116
+ orphans.line,
117
+ nextStep,
118
+ ]
119
+ .filter(Boolean)
120
+ .join('\n\n'),
121
+ };
122
+ };
123
+ /** The stays of the trip that overlap, said - and structured for the card. */
124
+ // Two hotels on the same nights - said, never refused (overlap.ts). In
125
+ // both, in the same words.
126
+ const overlapsInTrip = (parts) => {
127
+ return overlapsOf(parts.flatMap((p) => p.lines.flatMap((l) => l.kind === 'room' && l.stay && !l.hourly
128
+ ? [
129
+ {
130
+ hotelId: l.hotelId,
131
+ name: hotelName(l.hotelName),
132
+ checkIn: l.stay.checkIn,
133
+ checkOut: l.stay.checkOut,
134
+ },
135
+ ]
136
+ : [])));
137
+ };
138
+ // ⚠️ WHAT COMES NEXT, IN WORDS (2026-11-02 audit, P2-4): the card has a
139
+ // Book button under the trip, and the words had nothing in its place.
140
+ //
141
+ // ⚠️ AND A PHONE NUMBER WHERE THE TRIP'S GROUP NEEDS ONE (the 0.52.0 gap): the
142
+ // card's form asks for it, and this sentence - the whole of the card for a
143
+ // client that draws none - said only "name and email", so the first booking
144
+ // came back "needs a phone number". Whose need it is is the trip's groups',
145
+ // as `requestBooking` judges it.
146
+ //
147
+ // ⚠️ AND SAID BACK ONCE BEFORE IT IS BOOKED (robin 11-06: 确认下单): the card
148
+ // shows the stay beside its Book button, and a guest who picked "the second
149
+ // one" or "next Friday for two nights" in words has not seen what that came
150
+ // to. One message - every stay, its nights by weekday, the room, the party,
151
+ // the total and what cancelling costs - and a yes, or what to change. A
152
+ // guest whose own words already named all of it, dates and all, has said it.
153
+ const nextStepWords = (deps, key, ctx, lines, parts) => {
154
+ const nextStep = ctx?.noCards && parts.some((p) => p.lines.some((l) => l.kind === 'room'))
155
+ ? (deps.backend.capabilities ?? FULL_CAPABILITIES).readOnly
156
+ ? readOnlyWords(deps.vocab)
157
+ : `Nothing in the trip is booked yet. Before booking, say it back to the guest once, in one message: each ${deps.vocab.noun}, its nights with their weekdays, the room, the guests, the total and the cancellation terms, as this answer gives them - and ask them to reply "confirm" (确认) to book it, or to say what to change. In the same message, ${detailsAsked(deps, key, lines.filter((l) => l.kind === 'room'))} Call ${deps.tools.requestBooking} only after that yes - unless the guest's own message just now named all of it (the ${deps.vocab.noun}, the room, the nights as dates) and asked for it to be booked, which is the yes. A guest changing the room or the nights is not adding a stay: take the old line out (its rooms to 0).`
158
+ : '';
159
+ return nextStep;
160
+ };
161
+ /** The filters a list call asked for, or undefined when it asked for none. */
162
+ export const filtersOf = (args) => {
163
+ const keys = FACILITIES.map((x) => x.key);
164
+ const facilities = Array.isArray(args.facilities)
165
+ ? [...new Set(args.facilities.map(String).filter((k) => keys.includes(k)))]
166
+ : [];
167
+ const f = {
168
+ ...(str(args.brand) ? { brand: str(args.brand) } : {}),
169
+ ...(place(args.group) ? { supplier: place(args.group) } : {}),
170
+ ...(facilities.length ? { facilities } : {}),
171
+ ...(args.freeCancellation === true ? { freeCancellation: true } : {}),
172
+ ...(args.breakfast === true ? { breakfast: true } : {}),
173
+ ...(args.bed === 'king' || args.bed === 'twin' ? { bed: args.bed } : {}),
174
+ ...(args.hourly === true ? { hourly: true } : {}),
175
+ };
176
+ return Object.keys(f).length ? f : undefined;
177
+ };
178
+ /** The filters in words, for the one line the model reads. */
179
+ export const filterWords = (f) => [
180
+ f.brand,
181
+ ...(f.facilities ?? []).map((k) => FACILITIES.find((x) => x.key === k)?.label.toLowerCase()),
182
+ f.freeCancellation ? 'free cancellation' : '',
183
+ f.breakfast ? 'breakfast included' : '',
184
+ f.bed === 'king' ? 'king beds' : f.bed === 'twin' ? 'twin beds' : '',
185
+ f.hourly ? 'rooms by the hour today' : '',
186
+ ]
187
+ .filter(Boolean)
188
+ .join(', ');
189
+ /** What to say when the filters left nothing - one filter said plainly, several as "together". */
190
+ export const emptiedBy = (f, before, nouns) => {
191
+ const terms = (f.brand ? 1 : 0) +
192
+ (f.facilities?.length ?? 0) +
193
+ (f.freeCancellation ? 1 : 0) +
194
+ (f.breakfast ? 1 : 0) +
195
+ (f.bed ? 1 : 0) +
196
+ // By the hour is a term like the others: alone, it is said alone - not
197
+ // "has rooms by the hour today together" (huazhu, 2026-10-13).
198
+ (f.hourly ? 1 : 0);
199
+ if (terms === 1 && f.brand)
200
+ return `None of the ${before} ${nouns} here is ${f.brand}. Another brand, or none, lists them.`;
201
+ if (terms === 1)
202
+ return `None of the ${before} ${nouns} here has ${filterWords(f)}.`;
203
+ return `None of the ${before} ${nouns} here has ${filterWords(f)} together. Taking one of those off widens it.`;
204
+ };
205
+ /**
206
+ * The filter chips a list offers, each with what it would leave.
207
+ *
208
+ * ⚠️ ONLY WHAT NARROWS. A chip every hotel on the list passes - breakfast
209
+ * where every hotel has a breakfast rate, one brand where only one is here -
210
+ * changes nothing when pressed, and a panel of those is a panel of noise. One
211
+ * that is ON always shows, so it can be turned off again.
212
+ */
213
+ export const refineFor = (r, on, total,
214
+ /**
215
+ * A dated list. There a room term changes which room is PRICED even where
216
+ * every hotel keeps one - so free cancellation and breakfast always show.
217
+ */
218
+ dated = false) => {
219
+ const narrows = (count, active) => active || (count > 0 && count < total);
220
+ // ⚠️ A BRAND OR A GROUP IS ONE AT A TIME: with one picked, each other one is
221
+ // a switch to it, not a narrowing of this list - so it shows whenever it has
222
+ // any. Measured against the picked one's total it vanished: with Huazhu's 5
223
+ // picked, Shangri-La's 6 was "no narrower" and the guest could not get back
224
+ // (Marketplace, 2026-10-08); a brand bigger than the one picked, the same.
225
+ const switches = (count, active, picked) => picked ? active || count > 0 : narrows(count, active);
226
+ const brands = r.brands.filter((b) => switches(b.count, b.name === on?.brand, !!on?.brand));
227
+ // In a market: the groups, by id - the card names them from `market`.
228
+ const groups = (r.suppliers ?? []).filter((x) => switches(x.count, x.id === on?.supplier, !!on?.supplier));
229
+ return {
230
+ ...(r.suppliers
231
+ ? {
232
+ groups: groups.length > 1 || on?.supplier
233
+ ? groups.map((x) => ({ ...x, on: x.id === on?.supplier }))
234
+ : [],
235
+ }
236
+ : {}),
237
+ brands: brands.length > 1 || on?.brand ? brands.map((b) => ({ ...b, on: b.name === on?.brand })) : [],
238
+ facilities: r.facilities
239
+ .filter((x) => narrows(x.count, !!on?.facilities?.includes(x.key)))
240
+ .map((x) => ({ ...x, on: !!on?.facilities?.includes(x.key) })),
241
+ room: [
242
+ {
243
+ key: 'freeCancellation',
244
+ label: 'Free cancellation',
245
+ count: r.freeCancellation,
246
+ on: !!on?.freeCancellation,
247
+ },
248
+ { key: 'breakfast', label: 'Breakfast included', count: r.breakfast, on: !!on?.breakfast },
249
+ ].filter((x) => narrows(x.count, x.on) || (dated && x.count > 0)),
250
+ };
251
+ };
252
+ /**
253
+ * From how many cities a country is a list of cities to choose from rather
254
+ * than a list of hotels. China is forty; Malaysia's six hotels in three cities
255
+ * read better as hotels, grouped by city.
256
+ */
257
+ export const CITY_PICKER_MIN = 4;
258
+ /**
259
+ * Up to how many hotels a whole deployment is a list rather than places to
260
+ * choose from. Huazhu's production had two, in two cities, and "where to?"
261
+ * over two city chips and "browse all 2" had the model list them all again -
262
+ * two cards for one question (robin, 2026-10-30). Six is what the card shows
263
+ * whole at every width, with no "Next" (its inline page is five rows on a
264
+ * phone and lets two more in - see the card's `pageSize`): a place picker
265
+ * over that many saves no one a tap. A group of nine in four cities still
266
+ * chooses a city first.
267
+ */
268
+ export const HOME_LIST_MAX = 6;
269
+ //# sourceMappingURL=current-trip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-trip.js","sourceRoot":"","sources":["../../src/tools/current-trip.ts"],"names":[],"m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