@curless/hotel-storefront 0.27.5 → 0.27.6
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.
- package/README.md +18 -8
- package/dist/fence.d.ts +12 -1
- package/dist/fence.d.ts.map +1 -1
- package/dist/fence.js +0 -0
- package/dist/fence.js.map +1 -1
- package/dist/legal.js +1 -1
- package/dist/legal.js.map +1 -1
- package/dist/money.d.ts +2 -0
- package/dist/money.d.ts.map +1 -1
- package/dist/money.js +43 -6
- package/dist/money.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +9 -1
- package/dist/server.js.map +1 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +3 -2
- package/dist/sessions.js.map +1 -1
- package/dist/surface.d.ts +2 -0
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +10 -1
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +4 -4
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +21 -8
- package/dist/tools.js.map +1 -1
- package/dist/trip-ids.js +1 -1
- package/dist/trip-ids.js.map +1 -1
- package/package.json +2 -2
- package/dist/__tests__/__fixtures__/huazhu-fake.d.ts +0 -2
- package/dist/__tests__/__fixtures__/huazhu-fake.d.ts.map +0 -1
- package/dist/__tests__/__fixtures__/huazhu-fake.js +0 -3
- package/dist/__tests__/__fixtures__/huazhu-fake.js.map +0 -1
- package/dist/__tests__/__helpers__/sessions.d.ts +0 -10
- package/dist/__tests__/__helpers__/sessions.d.ts.map +0 -1
- package/dist/__tests__/__helpers__/sessions.js +0 -40
- package/dist/__tests__/__helpers__/sessions.js.map +0 -1
- package/dist/__tests__/audit-p0.test.d.ts +0 -2
- package/dist/__tests__/audit-p0.test.d.ts.map +0 -1
- package/dist/__tests__/audit-p0.test.js +0 -274
- package/dist/__tests__/audit-p0.test.js.map +0 -1
- package/dist/__tests__/audit-p2.test.d.ts +0 -2
- package/dist/__tests__/audit-p2.test.d.ts.map +0 -1
- package/dist/__tests__/audit-p2.test.js +0 -98
- package/dist/__tests__/audit-p2.test.js.map +0 -1
- package/dist/__tests__/card-contract.test.d.ts +0 -2
- package/dist/__tests__/card-contract.test.d.ts.map +0 -1
- package/dist/__tests__/card-contract.test.js +0 -282
- package/dist/__tests__/card-contract.test.js.map +0 -1
- package/dist/__tests__/data.test.d.ts +0 -2
- package/dist/__tests__/data.test.d.ts.map +0 -1
- package/dist/__tests__/data.test.js +0 -210
- package/dist/__tests__/data.test.js.map +0 -1
- package/dist/__tests__/dates.test.d.ts +0 -2
- package/dist/__tests__/dates.test.d.ts.map +0 -1
- package/dist/__tests__/dates.test.js +0 -107
- package/dist/__tests__/dates.test.js.map +0 -1
- package/dist/__tests__/demo-hotels.test.d.ts +0 -2
- package/dist/__tests__/demo-hotels.test.d.ts.map +0 -1
- package/dist/__tests__/demo-hotels.test.js +0 -765
- package/dist/__tests__/demo-hotels.test.js.map +0 -1
- package/dist/__tests__/huazhu-audit.test.d.ts +0 -2
- package/dist/__tests__/huazhu-audit.test.d.ts.map +0 -1
- package/dist/__tests__/huazhu-audit.test.js +0 -234
- package/dist/__tests__/huazhu-audit.test.js.map +0 -1
- package/dist/__tests__/huazhu-backend.test.d.ts +0 -2
- package/dist/__tests__/huazhu-backend.test.d.ts.map +0 -1
- package/dist/__tests__/huazhu-backend.test.js +0 -1326
- package/dist/__tests__/huazhu-backend.test.js.map +0 -1
- package/dist/__tests__/huazhu-cancel-policy.test.d.ts +0 -2
- package/dist/__tests__/huazhu-cancel-policy.test.d.ts.map +0 -1
- package/dist/__tests__/huazhu-cancel-policy.test.js +0 -82
- package/dist/__tests__/huazhu-cancel-policy.test.js.map +0 -1
- package/dist/__tests__/huazhu-sandbox.test.d.ts +0 -2
- package/dist/__tests__/huazhu-sandbox.test.d.ts.map +0 -1
- package/dist/__tests__/huazhu-sandbox.test.js +0 -195
- package/dist/__tests__/huazhu-sandbox.test.js.map +0 -1
- package/dist/__tests__/huazhu-sellable.test.d.ts +0 -2
- package/dist/__tests__/huazhu-sellable.test.d.ts.map +0 -1
- package/dist/__tests__/huazhu-sellable.test.js +0 -192
- package/dist/__tests__/huazhu-sellable.test.js.map +0 -1
- package/dist/__tests__/present.test.d.ts +0 -2
- package/dist/__tests__/present.test.d.ts.map +0 -1
- package/dist/__tests__/present.test.js +0 -367
- package/dist/__tests__/present.test.js.map +0 -1
- package/dist/__tests__/prose.test.d.ts +0 -2
- package/dist/__tests__/prose.test.d.ts.map +0 -1
- package/dist/__tests__/prose.test.js +0 -171
- package/dist/__tests__/prose.test.js.map +0 -1
- package/dist/__tests__/server.test.d.ts +0 -2
- package/dist/__tests__/server.test.d.ts.map +0 -1
- package/dist/__tests__/server.test.js +0 -557
- package/dist/__tests__/server.test.js.map +0 -1
- package/dist/__tests__/state.test.d.ts +0 -2
- package/dist/__tests__/state.test.d.ts.map +0 -1
- package/dist/__tests__/state.test.js +0 -204
- package/dist/__tests__/state.test.js.map +0 -1
- package/dist/__tests__/tool-descriptions.test.d.ts +0 -2
- package/dist/__tests__/tool-descriptions.test.d.ts.map +0 -1
- package/dist/__tests__/tool-descriptions.test.js +0 -220
- package/dist/__tests__/tool-descriptions.test.js.map +0 -1
- package/dist/__tests__/tools.test.d.ts +0 -2
- package/dist/__tests__/tools.test.d.ts.map +0 -1
- package/dist/__tests__/tools.test.js +0 -1598
- package/dist/__tests__/tools.test.js.map +0 -1
package/dist/tools.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_PAGE, FULL_CAPABILITIES, LASTING_REQUESTS, MAX_PAGE, REQUEST_KINDS, REQUEST_NOTE_MAX, guestTooLong, unitWords, } from './backend.js';
|
|
2
2
|
import { MAX_GUESTS, isDay, nights as nightsBetween } from './dates.js';
|
|
3
3
|
import { FACILITIES } from './facilities.js';
|
|
4
|
-
import { DESCRIPTION_MAX, POLICY_MAX, hotelText } from './fence.js';
|
|
4
|
+
import { DESCRIPTION_MAX, POLICY_MAX, guestText, hotelText } from './fence.js';
|
|
5
5
|
import { formatMoney, money, multiplyMoney, toMinor } from './money.js';
|
|
6
6
|
import { MAX_COMPARED, MAX_CONS, MAX_DAYS, MAX_ITEMS_PER_DAY, MAX_MOMENTS, MAX_PROS, buildItinerary, compareHotels, } from './present.js';
|
|
7
7
|
import { regionOf } from './regions.js';
|
|
@@ -45,6 +45,18 @@ const edits = (title, openWorld) => ({
|
|
|
45
45
|
idempotentHint: true,
|
|
46
46
|
openWorldHint: openWorld,
|
|
47
47
|
});
|
|
48
|
+
/**
|
|
49
|
+
* Writes over something that was there - the whole trip, or a booking's nights.
|
|
50
|
+
* Repeating it changes nothing more, but what it replaced is gone (2026-10-05
|
|
51
|
+
* audit, P3: these two said `destructiveHint: false`).
|
|
52
|
+
*/
|
|
53
|
+
const replaces = (title, openWorld) => ({
|
|
54
|
+
title,
|
|
55
|
+
readOnlyHint: false,
|
|
56
|
+
destructiveHint: true,
|
|
57
|
+
idempotentHint: true,
|
|
58
|
+
openWorldHint: openWorld,
|
|
59
|
+
});
|
|
48
60
|
/** Asks the hotel to hold rooms. Takes no money, and undoing it is what the cancel tools are for. */
|
|
49
61
|
const books = (title, openWorld) => ({
|
|
50
62
|
title,
|
|
@@ -347,7 +359,7 @@ const allTools = (n, v) => {
|
|
|
347
359
|
{
|
|
348
360
|
name: n.clearTrip,
|
|
349
361
|
description: 'Empties the trip.',
|
|
350
|
-
annotations:
|
|
362
|
+
annotations: replaces(`Clear the ${v.brand} trip`, open),
|
|
351
363
|
inputSchema: { type: 'object', properties: {} },
|
|
352
364
|
},
|
|
353
365
|
{
|
|
@@ -407,7 +419,7 @@ const allTools = (n, v) => {
|
|
|
407
419
|
},
|
|
408
420
|
{
|
|
409
421
|
name: n.previewCancellation,
|
|
410
|
-
description: 'What cancelling a booking would cost
|
|
422
|
+
description: 'What cancelling a booking would cost, with the rule it was worked out from and the free-cancellation deadline where the rate has one. Nothing is cancelled.',
|
|
411
423
|
annotations: reads('Preview a cancellation', open),
|
|
412
424
|
inputSchema: {
|
|
413
425
|
type: 'object',
|
|
@@ -427,7 +439,7 @@ const allTools = (n, v) => {
|
|
|
427
439
|
// directory attestation covers descriptions that instruct about other
|
|
428
440
|
// tools. The preview it returns is the same payload the preview tool
|
|
429
441
|
// returns, which is a fact about THIS tool's answer.
|
|
430
|
-
description: 'Cancels a booking. Called without `confirmed` it returns the cancellation preview - the fee
|
|
442
|
+
description: 'Cancels a booking. Called without `confirmed` it returns the cancellation preview - the fee and the rule behind it - and cancels nothing; it cancels only when `confirmed` is true.',
|
|
431
443
|
annotations: cancels('Cancel a booking', open),
|
|
432
444
|
inputSchema: {
|
|
433
445
|
type: 'object',
|
|
@@ -493,7 +505,7 @@ const allTools = (n, v) => {
|
|
|
493
505
|
{
|
|
494
506
|
name: n.changeBooking,
|
|
495
507
|
description: 'Moves a booking to other nights, another room type or a different number of rooms, or sets one of its add-ons (`extra` and `quantity`; 0 takes it off). Called without `confirmed` it returns the same preview - the two stays and the difference - and changes nothing; it changes only when `confirmed` is true. The confirmation code stays the same.',
|
|
496
|
-
annotations:
|
|
508
|
+
annotations: replaces('Change a booking', open),
|
|
497
509
|
inputSchema: {
|
|
498
510
|
type: 'object',
|
|
499
511
|
properties: {
|
|
@@ -1225,7 +1237,7 @@ const requestLines = (b, dropped, checkInFrom) => {
|
|
|
1225
1237
|
out.push(`Asked for on the booking: ${words.join(', ')}. The desk meets what it can on the day; none of it is held.`);
|
|
1226
1238
|
}
|
|
1227
1239
|
if (r.note)
|
|
1228
|
-
out.push(`Passed to the hotel
|
|
1240
|
+
out.push(`Passed to the hotel:\n${guestText('note for the hotel', r.note, REQUEST_NOTE_MAX)}`);
|
|
1229
1241
|
if (r.kinds.includes('accessible-room')) {
|
|
1230
1242
|
out.push(`An accessible room is a room type, and this booking does not hold one - ${b.hotelName} confirms accessible rooms directly, quoting ${b.confirmationCode}.`);
|
|
1231
1243
|
}
|
|
@@ -3068,7 +3080,9 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
3068
3080
|
...common(deps, key),
|
|
3069
3081
|
booking: { id: preview.bookingId, confirmationCode: preview.confirmationCode },
|
|
3070
3082
|
fee: formatMoney(preview.fee),
|
|
3071
|
-
|
|
3083
|
+
// ⚠️ NO "REFUND": nothing was ever paid here - a demonstration takes no
|
|
3084
|
+
// money and a hotel's own booking is paid at the hotel - so a figure
|
|
3085
|
+
// called a refund is money that is not coming back (2026-10-05 audit, P3).
|
|
3072
3086
|
rule: preview.rule,
|
|
3073
3087
|
freeUntil: preview.freeUntil,
|
|
3074
3088
|
cancellable: preview.cancellable,
|
|
@@ -3122,7 +3136,6 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
3122
3136
|
...common(deps, key),
|
|
3123
3137
|
booking: { ...cancelled, quote: quoteForCard(cancelled.quote) },
|
|
3124
3138
|
fee: formatMoney(charged),
|
|
3125
|
-
refund: formatMoney(preview.refund),
|
|
3126
3139
|
rule: preview.rule,
|
|
3127
3140
|
cancellable: false,
|
|
3128
3141
|
},
|