@curless/hotel-storefront 0.71.3 → 0.71.5
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/dist/account/index.d.ts +6 -17
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +20 -47
- package/dist/account/index.js.map +1 -1
- package/dist/account/pages.d.ts +3 -7
- package/dist/account/pages.d.ts.map +1 -1
- package/dist/account/pages.js +7 -13
- package/dist/account/pages.js.map +1 -1
- package/dist/backend.d.ts +10 -0
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +14 -0
- package/dist/backend.js.map +1 -1
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -25
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +5 -16
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +109 -81
- package/dist/tools.js.map +1 -1
- package/dist/vocab.d.ts.map +1 -1
- package/dist/vocab.js +6 -1
- package/dist/vocab.js.map +1 -1
- package/package.json +1 -1
package/dist/tools.d.ts
CHANGED
|
@@ -1263,23 +1263,12 @@ export type ToolDeps = {
|
|
|
1263
1263
|
signInTool?: string;
|
|
1264
1264
|
};
|
|
1265
1265
|
/**
|
|
1266
|
-
*
|
|
1267
|
-
* 11-
|
|
1268
|
-
*
|
|
1269
|
-
*
|
|
1266
|
+
* In a market: the groups a search keeps quiet about (`data.quietGroups`, robin
|
|
1267
|
+
* 11-16 - Accor on Otaless). Not answering, or not looked up without a place, is
|
|
1268
|
+
* neither drawn on the card nor said to the guest unprompted - see `degradedOf`.
|
|
1269
|
+
* Absent: every group is said.
|
|
1270
1270
|
*/
|
|
1271
|
-
|
|
1272
|
-
whole: {
|
|
1273
|
-
name?: string;
|
|
1274
|
-
email?: string;
|
|
1275
|
-
phone?: string;
|
|
1276
|
-
};
|
|
1277
|
-
shown: {
|
|
1278
|
-
name?: true;
|
|
1279
|
-
email?: string;
|
|
1280
|
-
phone?: true;
|
|
1281
|
-
};
|
|
1282
|
-
} | undefined;
|
|
1271
|
+
quietGroups?: ReadonlySet<string>;
|
|
1283
1272
|
};
|
|
1284
1273
|
export type ToolContext = {
|
|
1285
1274
|
/** The host's `Mcp-Session-Id`, or a per-connection fallback. Never a shared constant. */
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,mBAAmB,EAazB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAa,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiB7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAqChD,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAEV,cAAc,EAgBd,QAAQ,EAER,KAAK,EACL,KAAK,EAKL,eAAe,EAOhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,UAAU,EAA+B,MAAM,YAAY,CAAC;AAuF1E,+GAA+G;AAC/G,eAAO,MAAM,WAAW,IAAI,CAAC;A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AACH,eAAO,MAAM,eAAe,oPACuN,CAAC;AAEpP;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,2aAC+Y,CAAC;AAE3a,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,kOACgM,CAAC;AAElO;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO;;;CAKV,CAAC;AAEX;;;;;;GAMG;AACH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAMrC,eAAO,MAAM,cAAc,gxBAA8xB,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { aboutLines } from './about.js';
|
|
2
|
-
import { DEFAULT_PAGE, FULL_CAPABILITIES, LASTING_REQUESTS, MAX_PAGE, REQUEST_KINDS, REQUEST_NOTE_MAX, guestTooLong, notPricedForNoAnswer, unansweredBy, unitWords, } from './backend.js';
|
|
2
|
+
import { DEFAULT_PAGE, FULL_CAPABILITIES, LASTING_REQUESTS, MAX_PAGE, REQUEST_KINDS, REQUEST_NOTE_MAX, guestTooLong, maskedEmail, notPricedForNoAnswer, unansweredBy, unitWords, wholeEmail, } from './backend.js';
|
|
3
3
|
import { PAY_WORDS, allOrEach, choiceBlock, payOf, paymentOf, saysOwn, sentenceOf, setsApart, sharedBy, spreadOf, } from './choices.js';
|
|
4
4
|
import { usedOnWords } from './coupon-words.js';
|
|
5
5
|
import { MAX_GUESTS, addDays, dateOptions, dayWords, isDay, nights as nightsBetween, stayDayWords, toDay, weekendOf, weekendWords, } from './dates.js';
|
|
@@ -1452,6 +1452,10 @@ const BOOKING_SCHEMA = {
|
|
|
1452
1452
|
/** `error`: why, as a code (`BOOKING_REFUSALS` or 'card-only') and in the guest's words. */
|
|
1453
1453
|
error: STR,
|
|
1454
1454
|
detail: STR,
|
|
1455
|
+
/** `needs-guest`: what the booking still needs, in words ('a name', 'a complete email', …). */
|
|
1456
|
+
missing: STRS,
|
|
1457
|
+
/** `needs-guest`: the email given was hidden (「•」) or not a whole address - turned away (`wholeEmail`). */
|
|
1458
|
+
emailRefused: BOOL,
|
|
1455
1459
|
/** A sign-in refusal: the groups the guest must sign in to, `{ code, name, names? }`. */
|
|
1456
1460
|
groups: ARR,
|
|
1457
1461
|
coupon: OBJ,
|
|
@@ -1546,6 +1550,10 @@ export const buildOutputSchemas = (n) => ({
|
|
|
1546
1550
|
degraded: ARR,
|
|
1547
1551
|
/** What `degraded` means, as the text says it: not that those groups have none here. */
|
|
1548
1552
|
degradedSaid: STR,
|
|
1553
|
+
/** In a market: the groups kept quiet about (`data.quietGroups`) that did not answer, or were not looked up - never drawn (`degradedOf`). */
|
|
1554
|
+
quietGroups: ARR,
|
|
1555
|
+
/** What `quietGroups` means, as the text says it: mention it only if the guest asks about that group. */
|
|
1556
|
+
quietSaid: STR,
|
|
1549
1557
|
/** Nothing found because nothing could be read - every group silent or held back (0.59.0, U4). */
|
|
1550
1558
|
unread: BOOL,
|
|
1551
1559
|
/** What was asked and not done, in the backend's own sentences - a limit of ours, too. */
|
|
@@ -1843,6 +1851,9 @@ export const buildOutputSchemas = (n) => ({
|
|
|
1843
1851
|
/** A \`city\` read in a market: the groups that did not answer in time (\`degradedOf\`). */
|
|
1844
1852
|
degraded: ARR,
|
|
1845
1853
|
degradedSaid: STR,
|
|
1854
|
+
/** The groups kept quiet about (\`data.quietGroups\`): mention them only if the guest asks (\`degradedOf\`). */
|
|
1855
|
+
quietGroups: ARR,
|
|
1856
|
+
quietSaid: STR,
|
|
1846
1857
|
/** A \`city\` not recognised as a place: what was read is not that city's (\`unplacedOf\`). */
|
|
1847
1858
|
unplaced: STR,
|
|
1848
1859
|
unplacedSaid: STR,
|
|
@@ -4234,6 +4245,8 @@ const listAnd = (xs) => xs.length > 1 ? `${xs.slice(0, -1).join(', ')} and ${xs.
|
|
|
4234
4245
|
const askLater = (card) => card
|
|
4235
4246
|
? 'Do not look again in this turn - no second call for it: tell the guest, who can press Try again (重试) on the card when they want to look again.'
|
|
4236
4247
|
: 'Do not look again in this turn - no second call for it: tell the guest, and that they can ask you to look again later.';
|
|
4248
|
+
/** No group kept quiet about - `degradedOf`'s default. */
|
|
4249
|
+
const NONE_QUIET = new Set();
|
|
4237
4250
|
/**
|
|
4238
4251
|
* The groups of a market that did not answer a search, as the sentence the
|
|
4239
4252
|
* model is told and the fields the card draws its own line from - the same
|
|
@@ -4255,10 +4268,50 @@ noun = deps.vocab.nounPlural,
|
|
|
4255
4268
|
*/
|
|
4256
4269
|
noCards = false,
|
|
4257
4270
|
/** This answer draws a card, with its 「重试」 (`askLater`) - not so for `look_up`, which draws none. */
|
|
4258
|
-
card = !noCards
|
|
4259
|
-
|
|
4260
|
-
|
|
4271
|
+
card = !noCards,
|
|
4272
|
+
/**
|
|
4273
|
+
* The groups kept quiet about here - a search's (`quietIn`), never a list of bookings.
|
|
4274
|
+
*
|
|
4275
|
+
* ⚠️ NOT A REMINDER EVERY TIME (robin 11-16: 「有 Accor 酒店的城市显示 Accor 就好了,没有的
|
|
4276
|
+
* 默认就是不显示,没必要一直提醒」). A quiet group that did not answer, or was not looked
|
|
4277
|
+
* up without a place, is left out of `degraded` - so no card draws a line for it, an
|
|
4278
|
+
* old one neither - and said in `quietSaid` as a fact, in the text alike: mention it
|
|
4279
|
+
* only if the guest asks about that group. No 「重试」, no "name a city".
|
|
4280
|
+
*/
|
|
4281
|
+
quiet = NONE_QUIET) => {
|
|
4282
|
+
const all = answer.degraded ?? [];
|
|
4283
|
+
if (all.length === 0)
|
|
4261
4284
|
return { structured: {}, said: '' };
|
|
4285
|
+
const named = (d) => withZh(d.name, d.names, noCards);
|
|
4286
|
+
const hushed = all.filter((d) => quiet.has(d.supplier));
|
|
4287
|
+
const down = all.filter((d) => !quiet.has(d.supplier));
|
|
4288
|
+
const hushedSilent = hushed.filter((d) => d.why !== 'needs-place');
|
|
4289
|
+
const hushedUnplaced = hushed.filter((d) => d.why === 'needs-place');
|
|
4290
|
+
const noneOf = (n) => `so none of ${n === 1 ? 'its' : 'their'} ${noun} is in this list`;
|
|
4291
|
+
const quietSaid = hushed.length
|
|
4292
|
+
? `${[
|
|
4293
|
+
hushedSilent.length
|
|
4294
|
+
? `${listAnd(hushedSilent.map(named))} did not answer this time, ${noneOf(hushedSilent.length)}`
|
|
4295
|
+
: '',
|
|
4296
|
+
hushedUnplaced.length
|
|
4297
|
+
? `${listAnd(hushedUnplaced.map(named))} ${hushedUnplaced.length === 1 ? 'is' : 'are'} looked up only once a country or a city is named, ${noneOf(hushedUnplaced.length)}`
|
|
4298
|
+
: '',
|
|
4299
|
+
]
|
|
4300
|
+
.filter(Boolean)
|
|
4301
|
+
.join('; ')}; mention this only if the guest asks about ${listOrWords(hushed.map(named))}.`
|
|
4302
|
+
: '';
|
|
4303
|
+
const quietPart = hushed.length
|
|
4304
|
+
? {
|
|
4305
|
+
quietGroups: hushed.map((d) => ({
|
|
4306
|
+
supplier: d.supplier,
|
|
4307
|
+
name: d.name,
|
|
4308
|
+
...(d.why ? { why: d.why } : {}),
|
|
4309
|
+
})),
|
|
4310
|
+
quietSaid,
|
|
4311
|
+
}
|
|
4312
|
+
: {};
|
|
4313
|
+
if (down.length === 0)
|
|
4314
|
+
return { structured: quietPart, said: quietSaid };
|
|
4262
4315
|
// ⚠️ A GROUP NOT LOOKED UP IS NOT A GROUP THAT DID NOT ANSWER (0.67.0, 总线程
|
|
4263
4316
|
// 11-11): Accor is found only with a country or a city named. Said as that,
|
|
4264
4317
|
// beside - not instead of - the groups that really were silent.
|
|
@@ -4283,10 +4336,24 @@ card = !noCards) => {
|
|
|
4283
4336
|
...(d.why ? { why: d.why } : {}),
|
|
4284
4337
|
})),
|
|
4285
4338
|
degradedSaid: said,
|
|
4339
|
+
...quietPart,
|
|
4286
4340
|
},
|
|
4287
|
-
said,
|
|
4341
|
+
said: [said, quietSaid].filter(Boolean).join(' '),
|
|
4288
4342
|
};
|
|
4289
4343
|
};
|
|
4344
|
+
/**
|
|
4345
|
+
* The groups a search keeps quiet about (`ToolDeps.quietGroups`) - less the one
|
|
4346
|
+
* the guest asked for (`filters.supplier`): a list of Accor's own hotels that
|
|
4347
|
+
* has none because Accor did not answer says so, with its 「重试」.
|
|
4348
|
+
*/
|
|
4349
|
+
const quietIn = (deps, asked) => {
|
|
4350
|
+
const quiet = deps.quietGroups;
|
|
4351
|
+
if (!quiet?.size)
|
|
4352
|
+
return NONE_QUIET;
|
|
4353
|
+
if (!asked || !quiet.has(asked))
|
|
4354
|
+
return quiet;
|
|
4355
|
+
return new Set([...quiet].filter((g) => g !== asked));
|
|
4356
|
+
};
|
|
4290
4357
|
/**
|
|
4291
4358
|
* A place no table here knows (`HotelSearchResult.unplaced`), as the sentence the
|
|
4292
4359
|
* model is told and the field the card draws its own line from.
|
|
@@ -4661,23 +4728,11 @@ const needsRoomIn = (t, lines, parts) => {
|
|
|
4661
4728
|
};
|
|
4662
4729
|
};
|
|
4663
4730
|
/**
|
|
4664
|
-
* The sentence that asks the guest for what a booking takes
|
|
4665
|
-
*
|
|
4666
|
-
*
|
|
4731
|
+
* The sentence that asks the guest for what a booking takes. ⚠️ NEVER FROM AN ACCOUNT
|
|
4732
|
+
* (0.71.4, robin 11-13): the Otaless account has no name and no phone to give, so its
|
|
4733
|
+
* 「用会员资料」 filled in nothing - the guest types their own, as everywhere.
|
|
4667
4734
|
*/
|
|
4668
|
-
const detailsAsked = (deps,
|
|
4669
|
-
const asked = `ask for their own ${guestDetailsFor(deps, rooms)} if they have not typed them in this conversation.`;
|
|
4670
|
-
const p = deps.guestProfile?.(key)?.shown;
|
|
4671
|
-
if (!p?.email)
|
|
4672
|
-
return asked;
|
|
4673
|
-
const has = [p.name ? 'name' : '', `email (${p.email})`, p.phone ? 'phone' : ''].filter(Boolean);
|
|
4674
|
-
// ⚠️ WHAT THE ACCOUNT DOES NOT HAVE IS STILL ASKED FOR (0.69.1, 总线程 11-12): an
|
|
4675
|
-
// account with no phone - the card's form asks for one where a group needs it, and
|
|
4676
|
-
// so does this - never left for the booking to refuse.
|
|
4677
|
-
const phone = phoneNeededFor(deps, rooms);
|
|
4678
|
-
const missing = [p.name ? '' : 'full name', p.phone || !phone ? '' : phone].filter(Boolean);
|
|
4679
|
-
return `say that the booking uses the ${listAnd(has)} on their ${deps.vocab.brand} account - do not ask for ${has.length > 1 ? 'them' : 'it'}; pass name, email or phone to ${deps.tools.requestBooking} only for ones the guest gives instead${missing.length ? `, and ask for their ${listAnd(missing)} if they have not typed ${missing.length > 1 ? 'them' : 'it'} in this conversation - the account has ${missing.length > 1 ? 'neither' : 'none'}` : ''}.`;
|
|
4680
|
-
};
|
|
4735
|
+
const detailsAsked = (deps, _key, rooms) => `ask for their own ${guestDetailsFor(deps, rooms)} if they have not typed them in this conversation.`;
|
|
4681
4736
|
/**
|
|
4682
4737
|
* Where a booking of these stays takes a phone number: "phone number" for all of
|
|
4683
4738
|
* them, "phone number for the stays with …" for some in a market - '' for none.
|
|
@@ -6342,52 +6397,6 @@ const bookingAnswer = async (deps, t, ctx, key, store, args, inTrip, lines, show
|
|
|
6342
6397
|
* member rate and under the same limits, and the trip is never read or emptied.
|
|
6343
6398
|
* `nothingThere` is what is said when the slot is empty.
|
|
6344
6399
|
*/
|
|
6345
|
-
/**
|
|
6346
|
-
* A booking's name, email and phone, with what the guest left empty taken from
|
|
6347
|
-
* their signed-in account (0.67.0, `ToolDeps.guestProfile`). What they typed
|
|
6348
|
-
* stands; a field that is empty - or masked, as the account's is shown (a model
|
|
6349
|
-
* passing back 「l•••@e•••.com」) - is the account's. `used` names what was taken,
|
|
6350
|
-
* and `shown` says it masked, for the answer.
|
|
6351
|
-
*/
|
|
6352
|
-
const withProfile = (deps, key, args) => {
|
|
6353
|
-
const p = deps.guestProfile?.(key);
|
|
6354
|
-
if (!p)
|
|
6355
|
-
return { args, used: [] };
|
|
6356
|
-
const blank = (v) => {
|
|
6357
|
-
const t = str(v).trim();
|
|
6358
|
-
return !t || t.includes('•');
|
|
6359
|
-
};
|
|
6360
|
-
const out = { ...args };
|
|
6361
|
-
const used = [];
|
|
6362
|
-
for (const k of ['name', 'email', 'phone']) {
|
|
6363
|
-
const v = p.whole[k];
|
|
6364
|
-
if (v && blank(args[k])) {
|
|
6365
|
-
out[k] = v;
|
|
6366
|
-
used.push(k);
|
|
6367
|
-
}
|
|
6368
|
-
}
|
|
6369
|
-
return {
|
|
6370
|
-
args: out,
|
|
6371
|
-
used,
|
|
6372
|
-
shown: used.includes('email') && p.shown.email ? { email: p.shown.email } : {},
|
|
6373
|
-
};
|
|
6374
|
-
};
|
|
6375
|
-
/** The answer to a booking, saying what of the account it used (masked) - see `withProfile`. */
|
|
6376
|
-
const saidProfile = (deps, answer, filled) => {
|
|
6377
|
-
if (!filled.used.length)
|
|
6378
|
-
return answer;
|
|
6379
|
-
const parts = [
|
|
6380
|
-
filled.used.includes('name') ? 'name' : '',
|
|
6381
|
-
filled.shown?.email ? `email ${filled.shown.email}` : '',
|
|
6382
|
-
filled.used.includes('phone') ? 'phone' : '',
|
|
6383
|
-
].filter(Boolean);
|
|
6384
|
-
const words = `For what the guest did not give, this booking uses their ${deps.vocab.brand} account's ${listAnd(parts)}.`;
|
|
6385
|
-
return {
|
|
6386
|
-
...answer,
|
|
6387
|
-
structured: { ...answer.structured, fromAccount: { used: filled.used, ...filled.shown } },
|
|
6388
|
-
text: `${answer.text}\n\n${words}`,
|
|
6389
|
-
};
|
|
6390
|
-
};
|
|
6391
6400
|
const bookTripLines = async (deps, t, ctx, key, store, args, nothingThere) => {
|
|
6392
6401
|
const inTrip = deps.trips.read(store);
|
|
6393
6402
|
if (inTrip.length === 0) {
|
|
@@ -6437,9 +6446,13 @@ const bookTripLines = async (deps, t, ctx, key, store, args, nothingThere) => {
|
|
|
6437
6446
|
? lines.some((l) => !!holderOf(deps, deps.backend.supplierOf?.(l.hotelId)).caps.requiresPhone)
|
|
6438
6447
|
: !!(deps.backend.capabilities ?? FULL_CAPABILITIES).requiresPhone;
|
|
6439
6448
|
const phone = str(args.phone);
|
|
6449
|
+
// ⚠️ A HIDDEN OR HALF EMAIL IS NO EMAIL (0.71.5, 总线程 11-13 P3 - `wholeEmail`): the
|
|
6450
|
+
// account's masked `x•••@c•••.ai` passed back is turned away here, with the guest asked
|
|
6451
|
+
// for the whole address - never handed to the terms page, never sent to the backend.
|
|
6452
|
+
const halfEmail = !!guest.email && !wholeEmail(guest.email);
|
|
6440
6453
|
const missing = [
|
|
6441
6454
|
!guest.name && 'a name',
|
|
6442
|
-
!guest.email
|
|
6455
|
+
!guest.email ? 'an email' : halfEmail && 'a complete email',
|
|
6443
6456
|
phoneNeeded && phone.replace(/\D/g, '').length < 6 && 'a phone number',
|
|
6444
6457
|
// Too long is as unusable as missing - see GUEST_LIMITS.
|
|
6445
6458
|
...guestTooLong({ ...guest, phone }),
|
|
@@ -6448,9 +6461,27 @@ const bookTripLines = async (deps, t, ctx, key, store, args, nothingThere) => {
|
|
|
6448
6461
|
const said = missing.length > 1
|
|
6449
6462
|
? `${missing.slice(0, -1).join(', ')} and ${missing.at(-1)}`
|
|
6450
6463
|
: (missing[0] ?? '');
|
|
6464
|
+
const detail = [
|
|
6465
|
+
`The booking needs ${said}.`,
|
|
6466
|
+
halfEmail
|
|
6467
|
+
? maskedEmail(guest.email)
|
|
6468
|
+
? 'The email given is hidden (it has "•" in it), not the guest\'s whole address - a masked email, such as the one an account answer shows, cannot be booked with.'
|
|
6469
|
+
: 'The email given is not a whole email address (name@example.com).'
|
|
6470
|
+
: '',
|
|
6471
|
+
`Ask the guest for ${missing.length > 1 ? 'them' : 'it'}${halfEmail ? ' - their full email address, typed out' : ''} - do not use a ${phoneNeeded ? 'name, email or phone number' : 'name or email'} you know from anywhere else.`,
|
|
6472
|
+
]
|
|
6473
|
+
.filter(Boolean)
|
|
6474
|
+
.join(' ');
|
|
6451
6475
|
return {
|
|
6452
|
-
structured: {
|
|
6453
|
-
|
|
6476
|
+
structured: {
|
|
6477
|
+
view: 'needs-guest',
|
|
6478
|
+
...common(deps, key),
|
|
6479
|
+
missing,
|
|
6480
|
+
...(halfEmail ? { emailRefused: true } : {}),
|
|
6481
|
+
// What the text says, word for word - a host that reads only this has it too.
|
|
6482
|
+
detail,
|
|
6483
|
+
},
|
|
6484
|
+
text: detail,
|
|
6454
6485
|
};
|
|
6455
6486
|
}
|
|
6456
6487
|
const { requests, dropped } = readRequests(args);
|
|
@@ -6886,7 +6917,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
6886
6917
|
: `${c.name} (${c.count})`)
|
|
6887
6918
|
.join(', ');
|
|
6888
6919
|
const n = deps.vocab.nounPlural;
|
|
6889
|
-
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards);
|
|
6920
|
+
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards, undefined, quietIn(deps, asked.filters?.supplier));
|
|
6890
6921
|
if (namedCountry) {
|
|
6891
6922
|
const [only] = countries;
|
|
6892
6923
|
return {
|
|
@@ -6942,7 +6973,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
6942
6973
|
};
|
|
6943
6974
|
}
|
|
6944
6975
|
if (hotels.length === 0) {
|
|
6945
|
-
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards);
|
|
6976
|
+
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards, undefined, quietIn(deps, asked.filters?.supplier));
|
|
6946
6977
|
const nearest = (answer.nearest ?? []).map((h) => ({
|
|
6947
6978
|
...h,
|
|
6948
6979
|
summary: hotelText('description', h.name, h.summary, DESCRIPTION_MAX).text,
|
|
@@ -7201,7 +7232,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7201
7232
|
priceNotes.unshift(weekend);
|
|
7202
7233
|
// Every one by name and city, and that there are no others - or, told
|
|
7203
7234
|
// only "2 hotels", the model asked for the list again to learn which.
|
|
7204
|
-
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards);
|
|
7235
|
+
const degraded = degradedOf(deps, answer, undefined, ctx?.noCards, undefined, quietIn(deps, asked.filters?.supplier));
|
|
7205
7236
|
const unplaced = unplacedOf(deps, answer, !!asked.city);
|
|
7206
7237
|
const inAll = homeList
|
|
7207
7238
|
? `There are ${total} ${branded(deps.vocab, deps.vocab.nounPlural)} here in all, and this answer lists every one: ${hotels
|
|
@@ -7611,7 +7642,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7611
7642
|
degradedFound = found;
|
|
7612
7643
|
}
|
|
7613
7644
|
// `look_up` draws no card: the guest asks again in words (`askLater`).
|
|
7614
|
-
const degraded = degradedOf(deps, degradedFound, undefined, ctx?.noCards, false);
|
|
7645
|
+
const degraded = degradedOf(deps, degradedFound, undefined, ctx?.noCards, false, quietIn(deps));
|
|
7615
7646
|
// A city no table here knows: what was read is not that city's (0.55.5).
|
|
7616
7647
|
const unplaced = unplacedOf(deps, degradedFound, true);
|
|
7617
7648
|
const unique = [...new Set(ids)];
|
|
@@ -7876,20 +7907,17 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
7876
7907
|
};
|
|
7877
7908
|
}
|
|
7878
7909
|
if (name === t.requestBooking) {
|
|
7879
|
-
|
|
7880
|
-
return saidProfile(deps, await bookTripLines(deps, t, ctx, key, key, filled.args, `There is nothing in the trip yet. ${t.addToTrip} puts room nights in it.`), filled);
|
|
7910
|
+
return bookTripLines(deps, t, ctx, key, key, args, `There is nothing in the trip yet. ${t.addToTrip} puts room nights in it.`);
|
|
7881
7911
|
}
|
|
7882
7912
|
// The card's own: the room the guest picked with Reserve, booked exactly as
|
|
7883
7913
|
// a trip is - and the trip left as it is.
|
|
7884
7914
|
if (name === t.bookPicked) {
|
|
7885
|
-
|
|
7886
|
-
const filled = withProfile(deps, key, args);
|
|
7887
|
-
const changed = pickChanged(deps, key, filled.args);
|
|
7915
|
+
const changed = pickChanged(deps, key, args);
|
|
7888
7916
|
if (changed) {
|
|
7889
7917
|
const emptied = !deps.trips.read(pickedKey(key)).some((l) => l.kind === 'room');
|
|
7890
|
-
return direct((emptied && (await bookedFromThisForm(deps, ctx, key,
|
|
7918
|
+
return direct((emptied && (await bookedFromThisForm(deps, ctx, key, args))) || changed);
|
|
7891
7919
|
}
|
|
7892
|
-
return direct(
|
|
7920
|
+
return direct(await bookTripLines(deps, t, ctx, key, pickedKey(key), args, 'Nothing is picked: the guest presses Reserve on a room first.'));
|
|
7893
7921
|
}
|
|
7894
7922
|
// The card's own: the guest pressed "Agree and continue" under a group's
|
|
7895
7923
|
// booking terms. ⚠️ THE ONLY AGREEMENT THERE IS: no tool the model sees has a
|