jsfe 1.72.4 → 1.73.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.
- package/README.md +1 -1
- package/dist/forms/contracts.d.ts +12 -0
- package/dist/forms/contracts.d.ts.map +1 -1
- package/dist/forms/flows.d.ts +27 -5
- package/dist/forms/flows.d.ts.map +1 -1
- package/dist/forms/flows.js +13 -0
- package/dist/helpers/match-inputs.d.ts.map +1 -1
- package/dist/helpers/match-inputs.js +18 -1
- package/dist/runtime-identity.js +1 -1
- package/docs/architecture-guide.md +1 -1
- package/docs/copilot-reference.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -405,7 +405,7 @@ choice for 9, or asks for an amount (ask-choice `amount`), keeps the answer. Key
|
|
|
405
405
|
|
|
406
406
|
An input with `profile.whole_phrases` (default off; `choice`, or a `pattern` that reads words) keeps its word reader only for a reply wholly made of its phrase, arguments, courtesy, connecting words and its `template_words`; any other reply goes to this ranker.
|
|
407
407
|
|
|
408
|
-
**A number that must name itself.** `input.confirm_out_of_order: {word, word_es, message, message_es}` (default off): out of order a number fills this input only beside its word, in either language ("account 5373850"). Alone it may be something else, a code said with an extra digit, so nothing is filled: the caller hears `message` (`{value}` the number, digit by digit on a call; `{word}` the word) and the current question again, which counts as an attempt at that question. It works at `collect-input` and `confirm-form` questions. At its own question the number needs no word. `authenticate-user`'s `code_confirm` takes the same declaration for a `code_validator`, whose flow reads it with the helpers `saysConfirmWord(answer, spec)` and `confirmOutOfOrderLine(spec, value, language, voice)`.
|
|
408
|
+
**A number that must name itself.** `input.confirm_out_of_order: {word, word_es, message, message_es}` (default off): out of order a number fills this input only beside its word, in either language ("account 5373850"). Alone it may be something else, a code said with an extra digit, so nothing is filled: the caller hears `message` (`{value}` the number, digit by digit on a call; `{word}` the word) and the current question again, which counts as an attempt at that question. It works at `collect-input` and `confirm-form` questions. At its own question the number needs no word. A pattern field's `asked_regex` also reads out of order beside the word ("vencimiento 0 4 3 1"); a reading of the field asked now wins over a number refused for want of its word, and no line is said. The card presets declare it on the expiration (EXPIRATION / VENCIMIENTO), the security code (SECURITY CODE / CÓDIGO DE SEGURIDAD) and the billing ZIP (owner 2026-11-17). `collect-credit-card` also checks the completed card (`validate-credit-card`): a security code whose length is not its brand's (4 for American Express, 3 for others) is asked again. `authenticate-user`'s `code_confirm` takes the same declaration for a `code_validator`, whose flow reads it with the helpers `saysConfirmWord(answer, spec)` and `confirmOutOfOrderLine(spec, value, language, voice)`.
|
|
409
409
|
|
|
410
410
|
**A number of the wrong length says so (jsfe 1.72.0, owner 2026-11-15).** A numeric field (`digits`, `phone` or `identifier` kind) that declares its length (`digits: {min, max}`) is opted in by that declaration (a pattern field reads only what its pattern matches); the `card_number`, `card_cvv`, `card_zip`, `zip`, `phone`, `account_number` and `ssn_last4` presets declare one. At the field's own question, the one number of three or more digits in the answer, when its length is outside the declaration and no other field read it or was refused for it, is a reading of that field. Its validation rejects it, and the message rides with the question that re-asks: "I heard 8 digits; a card number has 16, or 15 for American Express." A field sets the wording with `length_message` / `length_message_es` (`{heard}`, `{lengths}`); without one the message is generic. Routing is unchanged: the reading takes the path an in-range number takes. Also: when nothing read an answer's digits, a `digits` field asked now takes the one piece of a run joined across a pause that has its length ("Nuevecientos 44. 9 0 0 4 4." at a ZIP is 90044), and `card_expiration` reads four single digits with words around them ("0 6 3 0 30 se vence" is 0630) through `profile.asked_regex`: a pattern read only at the field's own question when nothing else read the answer, stored as its digits (out of order, "1 2 3 6" stays a security code). The must_complete first-task line now names how to cancel: "I understand, first let's enter your new card details. To cancel, press the asterisk key or say EXIT." ("type EXIT" in text; SALIR in Spanish).
|
|
411
411
|
|
|
@@ -222,6 +222,12 @@ export function validateFlowContracts(flows: any, tools?: any[], { externalFlows
|
|
|
222
222
|
max: number;
|
|
223
223
|
};
|
|
224
224
|
validator: string;
|
|
225
|
+
confirm_out_of_order: {
|
|
226
|
+
word: string;
|
|
227
|
+
word_es: string;
|
|
228
|
+
message: string;
|
|
229
|
+
message_es: string;
|
|
230
|
+
};
|
|
225
231
|
question: string;
|
|
226
232
|
question_es: string;
|
|
227
233
|
retry: string;
|
|
@@ -245,6 +251,12 @@ export function validateFlowContracts(flows: any, tools?: any[], { externalFlows
|
|
|
245
251
|
length_message: string;
|
|
246
252
|
length_message_es: string;
|
|
247
253
|
validator: string;
|
|
254
|
+
confirm_out_of_order: {
|
|
255
|
+
word: string;
|
|
256
|
+
word_es: string;
|
|
257
|
+
message: string;
|
|
258
|
+
message_es: string;
|
|
259
|
+
};
|
|
248
260
|
question: string;
|
|
249
261
|
question_es: string;
|
|
250
262
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/forms/contracts.js"],"names":[],"mappings":"AAgBA;;;IAGC;AACD;;;;;EAGC;AACD,qGAAqG;AACrG;;QAwCC;AAqBD;;;QAEC;AAgBD;;;;;;;;;QASC;AACD;;;;QAGC;AACD;;;;;;;;QA8BC;AAED,mHAAmH;AACnH,kDAgBC;AAED,+GAA+G;AAC/G
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/forms/contracts.js"],"names":[],"mappings":"AAgBA;;;IAGC;AACD;;;;;EAGC;AACD,qGAAqG;AACrG;;QAwCC;AAqBD;;;QAEC;AAgBD;;;;;;;;;QASC;AACD;;;;QAGC;AACD;;;;;;;;QA8BC;AAED,mHAAmH;AACnH,kDAgBC;AAED,+GAA+G;AAC/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EC"}
|
package/dist/forms/flows.d.ts
CHANGED
|
@@ -379,6 +379,12 @@ export namespace FIELD_PRESETS {
|
|
|
379
379
|
export { digits_5 as digits };
|
|
380
380
|
let validator_1: string;
|
|
381
381
|
export { validator_1 as validator };
|
|
382
|
+
export namespace confirm_out_of_order {
|
|
383
|
+
let word: string;
|
|
384
|
+
let word_es: string;
|
|
385
|
+
let message: string;
|
|
386
|
+
let message_es: string;
|
|
387
|
+
}
|
|
382
388
|
let question_10: string;
|
|
383
389
|
export { question_10 as question };
|
|
384
390
|
let question_es_10: string;
|
|
@@ -421,6 +427,17 @@ export namespace FIELD_PRESETS {
|
|
|
421
427
|
export { length_message_es_5 as length_message_es };
|
|
422
428
|
let validator_2: string;
|
|
423
429
|
export { validator_2 as validator };
|
|
430
|
+
export namespace confirm_out_of_order_1 {
|
|
431
|
+
let word_1: string;
|
|
432
|
+
export { word_1 as word };
|
|
433
|
+
let word_es_1: string;
|
|
434
|
+
export { word_es_1 as word_es };
|
|
435
|
+
let message_1: string;
|
|
436
|
+
export { message_1 as message };
|
|
437
|
+
let message_es_1: string;
|
|
438
|
+
export { message_es_1 as message_es };
|
|
439
|
+
}
|
|
440
|
+
export { confirm_out_of_order_1 as confirm_out_of_order };
|
|
424
441
|
let question_11: string;
|
|
425
442
|
export { question_11 as question };
|
|
426
443
|
let question_es_11: string;
|
|
@@ -453,12 +470,17 @@ export namespace FIELD_PRESETS {
|
|
|
453
470
|
export { length_message_6 as length_message };
|
|
454
471
|
let length_message_es_6: string;
|
|
455
472
|
export { length_message_es_6 as length_message_es };
|
|
456
|
-
export namespace
|
|
457
|
-
let
|
|
458
|
-
|
|
459
|
-
let
|
|
460
|
-
|
|
473
|
+
export namespace confirm_out_of_order_2 {
|
|
474
|
+
let word_2: string;
|
|
475
|
+
export { word_2 as word };
|
|
476
|
+
let word_es_2: string;
|
|
477
|
+
export { word_es_2 as word_es };
|
|
478
|
+
let message_2: string;
|
|
479
|
+
export { message_2 as message };
|
|
480
|
+
let message_es_2: string;
|
|
481
|
+
export { message_es_2 as message_es };
|
|
461
482
|
}
|
|
483
|
+
export { confirm_out_of_order_2 as confirm_out_of_order };
|
|
462
484
|
let question_12: string;
|
|
463
485
|
export { question_12 as question };
|
|
464
486
|
let question_es_12: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA6HA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;AAimBD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AA16BM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmJ9G,4CAEqI;AAk/BrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
|
package/dist/forms/flows.js
CHANGED
|
@@ -97,12 +97,17 @@ export const FIELD_PRESETS = {
|
|
|
97
97
|
// Read only at its own question, when nothing else read the answer: out of order, "1 2 3 6" is a security code (prod 2026-11-14 15:20).
|
|
98
98
|
asked_regex: `\\b(?:0\\s[1-9]|1\\s[0-2])\\s\\d\\s\\d\\b` }, digits: { min: 3, max: 6 },
|
|
99
99
|
validator: 'validate-card-expiration',
|
|
100
|
+
// Out of order it fills only beside its word, as the security code and the ZIP do (owner 2026-11-17).
|
|
101
|
+
confirm_out_of_order: { word: 'EXPIRATION', word_es: 'VENCIMIENTO', message: 'If {value} is the expiration date of the card, add the word {word}.', message_es: 'Si {value} es la fecha de vencimiento de la tarjeta, agregue la palabra {word}.' },
|
|
100
102
|
question: 'What is the expiration date, month and year?', question_es: '¿Cuál es la fecha de vencimiento, mes y año?',
|
|
101
103
|
retry: 'Please say or enter the expiration as four digits, month then year, like 0 9 2 8.', retry_es: 'Por favor diga o ingrese el vencimiento en cuatro dígitos, mes y año, por ejemplo 0 9 2 8.',
|
|
102
104
|
retry_text: 'Please type the expiration as four digits, month then year, like 0928.', retry_text_es: 'Por favor escriba el vencimiento en cuatro dígitos, mes y año, por ejemplo 0928.' },
|
|
103
105
|
card_cvv: { label: 'security code', label_es: 'código de seguridad', profile: { kind: 'digits', min: 3, max: 4 }, digits: { min: 3, max: 4 }, pii: true,
|
|
104
106
|
length_message: 'I heard {heard} digits; the security code has 3, or 4 on the front of an American Express card.', length_message_es: 'Escuché {heard} dígitos; el código de seguridad tiene 3, o 4 al frente de una American Express.',
|
|
105
107
|
validator: 'validate-card-cvv',
|
|
108
|
+
// A bare 3-4 digit number out of order may be a group of the card number (prod 2026-11-16: a lone 4-digit group at the card number
|
|
109
|
+
// question was stored as the code and three Visa charges were declined), so it fills the code only beside the word (owner 2026-11-17).
|
|
110
|
+
confirm_out_of_order: { word: 'SECURITY CODE', word_es: 'CÓDIGO DE SEGURIDAD', message: 'If {value} is the security code of the card, add the words {word}.', message_es: 'Si {value} es el código de seguridad de la tarjeta, agregue las palabras {word}.' },
|
|
106
111
|
question: 'What is the security code on the back of the card?', question_es: '¿Cuál es el código de seguridad al reverso de la tarjeta?' },
|
|
107
112
|
// A bare five-digit number out of order may be anything (prod 2026-11-11: it replaced an answered ZIP), so it fills the
|
|
108
113
|
// billing ZIP only beside the word (owner 2026-11-11).
|
|
@@ -937,6 +942,12 @@ const validators = [
|
|
|
937
942
|
description: 'Validator: a US or Canada phone number, 10 digits or 11 starting with 1 (validatePhone); normalizes to its 10 digits. The phone reader alone also takes an 11-13 digit international number. Params: form, input, value, values, reading (it reads value).',
|
|
938
943
|
parameters: [{ name: 'input', type: 'string', description: 'input name' }, { name: 'value', type: 'string', description: 'the reading' }],
|
|
939
944
|
steps: [SIDE('vup_check', "(function (d) { cargo.inputCheck = validatePhone(d) ? { ok: true, value: d.slice(-10) } : { ok: false, message: 'I heard ' + d.length + ' digits; a phone number has 10.', message_es: 'Escuché ' + d.length + ' dígitos; el número de teléfono tiene 10.' }; return true; })(String(value).replace(/\\D/g, ''))")] },
|
|
945
|
+
// The card as a whole (owner 2026-11-17): a security code stored before the card number was known passed as 3 or 4 digits; the
|
|
946
|
+
// completed card is checked again so a Visa never carries 4 (prod 2026-11-16: three charges declined). The code is asked again.
|
|
947
|
+
{ id: 'validate-credit-card', name: 'ValidateCreditCard', version: '1.0.0', scope: 'isolated',
|
|
948
|
+
description: 'Form validator: the security code has the length of the card brand, 4 digits for American Express (34, 37) and 3 for every other brand. Params: form, values.',
|
|
949
|
+
parameters: [{ name: 'form', type: 'string', description: 'form instance' }, { name: 'values', type: 'object', description: "the form's values" }],
|
|
950
|
+
steps: [SIDE('vcf_check', "(function (v) { var pan = String(v && v.card_number || '').replace(/\\D/g, ''); var cvv = String(v && v.card_cvv || '').replace(/\\D/g, ''); var want = /^3[47]/.test(pan) ? 4 : 3; cargo.formCheck = !pan || !cvv || cvv.length === want ? { ok: true } : want === 4 ? { ok: false, invalid: [{ name: 'card_cvv' }], message: \"That security code doesn't look right. It is the 4 digits on the front of the card.\", message_es: 'Ese código de seguridad no parece correcto. Son los 4 dígitos al frente de la tarjeta.' } : { ok: false, invalid: [{ name: 'card_cvv' }], message: \"That security code doesn't look right. It is the 3 digits on the back of the card.\", message_es: 'Ese código de seguridad no parece correcto. Son los 3 dígitos al reverso de la tarjeta.' }; return true; })(values)")] },
|
|
940
951
|
{ id: 'validate-card-cvv', name: 'ValidateCardCvv', version: '1.0.0', scope: 'isolated',
|
|
941
952
|
description: 'Validator: the security code has the length of its card brand, 4 digits for American Express (34, 37) and 3 for every other brand; with no card number yet, 3 or 4. Params: form, input, value, values, reading (it reads value and values.card_number).',
|
|
942
953
|
parameters: [{ name: 'input', type: 'string', description: 'input name' }, { name: 'value', type: 'string', description: 'the reading' }, { name: 'values', type: 'object', description: "the form's values, for the card number" }],
|
|
@@ -951,6 +962,7 @@ const subForms = [
|
|
|
951
962
|
formFlow({ id: 'collect-credit-card', name: 'CollectCreditCard', version: '1.0.0', first_task: 'enter your new card details', first_task_es: 'ingresar los datos de su tarjeta nueva',
|
|
952
963
|
description: "Sub-form: card number, expiration, security code, billing ZIP, in any order. Result (with keep_pii for the charge step): the parent's result input.",
|
|
953
964
|
inputs: [{ name: 'card_number', field: 'card_number' }, { name: 'card_expiration', field: 'card_expiration' }, { name: 'card_cvv', field: 'card_cvv' }, { name: 'card_zip', field: 'card_zip' }],
|
|
965
|
+
validator: 'validate-credit-card',
|
|
954
966
|
extraVars: { exit_context: 'your payment', exit_context_es: 'su pago' } }),
|
|
955
967
|
];
|
|
956
968
|
// collect-credit-card hands the card on WITH its pii (the charge needs it); the parent clears it after use.
|
|
@@ -1228,6 +1240,7 @@ const LIBRARY_CONTRACTS = {
|
|
|
1228
1240
|
'validate-card-number': { role: 'worker', result: { path: 'cargo.inputCheck', type: 'object' } },
|
|
1229
1241
|
'validate-card-expiration': { role: 'worker', result: { path: 'cargo.inputCheck', type: 'object' } },
|
|
1230
1242
|
'validate-card-cvv': { role: 'worker', result: { path: 'cargo.inputCheck', type: 'object' } },
|
|
1243
|
+
'validate-credit-card': { role: 'worker', result: { path: 'cargo.formCheck', type: 'object' } },
|
|
1231
1244
|
'validate-us-phone': { role: 'worker', result: { path: 'cargo.inputCheck', type: 'object' } },
|
|
1232
1245
|
'collect-address': { role: 'collector' }, 'collect-credit-card': { role: 'collector' }
|
|
1233
1246
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,sEAQC;AA2FD;;;GAGG;AACH,sFA8HC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;mHACmH;AAEnH,iEAEC;AAGD,gGAKC;AAYD,kDAGC;AAED;;;;;;;;;;;;;;;;;;;;;;EAeC;AACD;;;;;;;;;;;;;;;;;;;;;;;EA+
|
|
1
|
+
{"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,sEAQC;AA2FD;;;GAGG;AACH,sFA8HC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;mHACmH;AAEnH,iEAEC;AAGD,gGAKC;AAYD,kDAGC;AAED;;;;;;;;;;;;;;;;;;;;;;EAeC;AACD;;;;;;;;;;;;;;;;;;;;;;;EA+WC"}
|
|
@@ -594,15 +594,32 @@ export function matchInputs(answer, candidates, current, choiceKey) {
|
|
|
594
594
|
// A pattern field's asked_regex (owner 2026-11-15): a form read only at the field's own question, when nothing else read the answer,
|
|
595
595
|
// stored as its digits ("0 6 3 0 30 se vence" at the expiration is 0630). Out of order it reads nothing, so another field keeps its digits.
|
|
596
596
|
const askedRegex = own && own.profile.kind === 'pattern' && own.profile.asked_regex ? new RegExp(own.profile.asked_regex, 'gi') : null;
|
|
597
|
-
|
|
597
|
+
// A number refused out of order (confirm_out_of_order) does not stop the current field's own reading: the current field is
|
|
598
|
+
// preferred (owner 2026-11-17: "1 2 2 9, ya" at the expiration is the expiration, not a security code to name), and its clarify line is dropped.
|
|
599
|
+
const askedHits = askedRegex && !readings.length ? [...undecimal.matchAll(askedRegex)] : [];
|
|
598
600
|
if (askedHits.length === 1) {
|
|
599
601
|
const hit = askedHits[0];
|
|
602
|
+
clarify.length = 0;
|
|
600
603
|
readings.push({ form: own.form, name: own.name, value: hit[0].replace(/\s+/g, ''), known: false, repeatedChoice: false, wholeChoice: false, choice: false, narrative: false, resetOn: [], spans: [[hit.index, hit.index + hit[0].length]], keypad: false, fallback: false,
|
|
601
604
|
group: own.group, exclusive: own.exclusive === true, level: forms.indexOf(own.scope || own.form), current: true, confirm: Array.isArray(own.confirm_against) ? own.confirm_against : [] });
|
|
602
605
|
}
|
|
603
606
|
else {
|
|
604
607
|
// no asked_regex, something already read the answer, or not exactly one match
|
|
605
608
|
}
|
|
609
|
+
// Out of order, the field's confirm_out_of_order word lets its asked_regex read too ("vencimiento 0 4 3 1" at the card number
|
|
610
|
+
// question is the expiration, owner 2026-11-17); the number's other readings were refused for want of their own word.
|
|
611
|
+
for (const c of list) {
|
|
612
|
+
const regex = !isCur(c) && c.profile.kind === 'pattern' && c.profile.asked_regex && c.confirm_out_of_order && saysConfirmWord(raw, c.confirm_out_of_order) ? new RegExp(c.profile.asked_regex, 'gi') : null;
|
|
613
|
+
const hits = regex && !readings.some((reading) => reading.form === c.form && reading.name === c.name) ? [...undecimal.matchAll(regex)] : [];
|
|
614
|
+
if (hits.length === 1 && !readings.some((reading) => (reading.spans || []).some(([s, e]) => s < hits[0].index + hits[0][0].length && hits[0].index < e))) {
|
|
615
|
+
readings.push({ form: c.form, name: c.name, value: hits[0][0].replace(/\s+/g, ''), known: false, repeatedChoice: false, wholeChoice: false, choice: false, narrative: false, resetOn: [], spans: [[hits[0].index, hits[0].index + hits[0][0].length]], keypad: false, fallback: false,
|
|
616
|
+
group: c.group, exclusive: c.exclusive === true, level: forms.indexOf(c.scope || c.form), current: false, confirm: Array.isArray(c.confirm_against) ? c.confirm_against : [], rule: 'out_of_order' });
|
|
617
|
+
clarify.length = 0;
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
// not a pattern field named by its word, already read, or not exactly one free match
|
|
621
|
+
}
|
|
622
|
+
}
|
|
606
623
|
// Rule 1 by length (owner 2026-11-15): at its own question, a field that declares its length (`digits`) takes the one number
|
|
607
624
|
// of three or more digits in the answer when that number has the wrong length, words around it ignored, and nothing else read
|
|
608
625
|
// it or was refused for it (another field's number keeps its own handling: "5519936." at a 6-digit code is told how to mean the
|
package/dist/runtime-identity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const JSFE_RUNTIME_FINGERPRINT = "sha256:
|
|
1
|
+
export const JSFE_RUNTIME_FINGERPRINT = "sha256:26e0ba327e4b1f150bbfa517da37e6b2f413273c6b9248f580754788df714eb4";
|
|
@@ -358,7 +358,7 @@ it.
|
|
|
358
358
|
|
|
359
359
|
**Word readers and the ranker.** An input with `profile.whole_phrases` reads a choice from words only when the whole reply is accounted for: its phrase, another input's argument, courtesy, connecting words and the input's `template_words`. A reply with any other word goes to the ranker, so a word inside a sentence ("Quiero hacer una nueva compra" at a pay menu) never picks an option. Compound answers that carry arguments stay with the reader ("pay $50 with my Visa card"), because a picked option extracts only the arguments it declares. A proposal's confirmation offers the ranker its input's choices, so a correction ("yes, it was stolen") picks the changed candidate.
|
|
360
360
|
|
|
361
|
-
**A number that must name itself.** `input.confirm_out_of_order: {word, word_es, message, message_es}` (default off): out of order a number fills this input only beside its word, in either language ("account 5373850"). Alone it may be something else, a code said with an extra digit, so nothing is filled: the caller hears `message` (`{value}` the number, digit by digit on a call; `{word}` the word) and the current question again, which counts as an attempt at that question. It works at `collect-input` and `confirm-form` questions. At its own question the number needs no word. `authenticate-user`'s `code_confirm` takes the same declaration for a `code_validator`, whose flow reads it with the helpers `saysConfirmWord(answer, spec)` and `confirmOutOfOrderLine(spec, value, language, voice)`.
|
|
361
|
+
**A number that must name itself.** `input.confirm_out_of_order: {word, word_es, message, message_es}` (default off): out of order a number fills this input only beside its word, in either language ("account 5373850"). Alone it may be something else, a code said with an extra digit, so nothing is filled: the caller hears `message` (`{value}` the number, digit by digit on a call; `{word}` the word) and the current question again, which counts as an attempt at that question. It works at `collect-input` and `confirm-form` questions. At its own question the number needs no word. A pattern field's `asked_regex` also reads out of order beside the word ("vencimiento 0 4 3 1"); a reading of the field asked now wins over a number refused for want of its word, and no line is said. The card presets declare it on the expiration (EXPIRATION / VENCIMIENTO), the security code (SECURITY CODE / CÓDIGO DE SEGURIDAD) and the billing ZIP (owner 2026-11-17). `collect-credit-card` also checks the completed card (`validate-credit-card`): a security code whose length is not its brand's (4 for American Express, 3 for others) is asked again. `authenticate-user`'s `code_confirm` takes the same declaration for a `code_validator`, whose flow reads it with the helpers `saysConfirmWord(answer, spec)` and `confirmOutOfOrderLine(spec, value, language, voice)`.
|
|
362
362
|
|
|
363
363
|
**An amount-shaped number is no ZIP.** `profile.refuse_amount_shape: true` (digits profile, default off): "119 19" (three digits then two) is not the field's digits out of order; at its own question it reads. Declared by the `zip` and `card_zip` presets; `card_zip` also takes a bare number out of order only beside ZIP / CÓDIGO POSTAL (`confirm_out_of_order`).
|
|
364
364
|
|
|
@@ -224,7 +224,7 @@ Declarations:
|
|
|
224
224
|
| input `invites:[names]`, `form.confirm.invites` | The other inputs this question (or the read-back) also asks for ("NEW CARD, LINK, or a different amount" invites `amount`), in its form or an enclosing one; read as in order while it is asked. |
|
|
225
225
|
| profile `out_of_order:{…}` | A narrower signature for out-of-order reading: the payment card takes a bare last four when asked, but out of order only a card word or "ending in 4242". |
|
|
226
226
|
| `authenticate-user` `other_whole_answer:true` | At the code question "another account" switches only as the whole answer; inside a sentence the reply ranker decides, offered `another_account` and `no_other_account` ("I understand. We still need to secure access to your account.", then the question). Default off. |
|
|
227
|
-
| input `confirm_out_of_order:{word,word_es,message,message_es}` | Out of order a number fills this input only beside its `word`, in either language. Alone, the caller hears `message` (`{value}` is the number, `{word}` the word) and the current question again, which counts as an attempt. `authenticate-user`'s `code_confirm` is the same declaration for a `code_validator`, whose flow reads it with `saysConfirmWord` and `confirmOutOfOrderLine`: an account number at the verification-code question, where it may be a code said with an extra digit. |
|
|
227
|
+
| input `confirm_out_of_order:{word,word_es,message,message_es}` | Out of order a number fills this input only beside its `word`, in either language. Alone, the caller hears `message` (`{value}` is the number, `{word}` the word) and the current question again, which counts as an attempt. `authenticate-user`'s `code_confirm` is the same declaration for a `code_validator`, whose flow reads it with `saysConfirmWord` and `confirmOutOfOrderLine`: an account number at the verification-code question, where it may be a code said with an extra digit. A pattern field's `asked_regex` also reads out of order beside the word; the field asked now wins over a refused number. Card presets: expiration, security code and billing ZIP. |
|
|
228
228
|
| profile `refuse_amount_shape:true` (digits) | Out of order, three digits then two ("119 19") fill nothing: they read as dollars and cents. At its own question they read as the field. The `zip` and `card_zip` presets declare it. |
|
|
229
229
|
| `digits: {min,max}` with `length_message` / `length_message_es` | At its own question (a `digits`, `phone` or `identifier` field; a pattern field reads only what it matches), one number of 3+ digits whose length is outside `digits`, read by no other field: a reading of the field, rejected with "{heard} digits; it has {lengths}", said with the re-ask. The declaration is the opt-in; the length presets declare messages. |
|
|
230
230
|
| input `choices_from` | The choice's values come from prepared data (the caller's saved cards), so its signature is those values. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsfe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.73.0",
|
|
4
4
|
"description": "TypeScript workflow engine for conversational/automation apps: multi-flow orchestration, interrupt/resume, stack-based control, robust errors, and flexible tool/REST integration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ron Pinkas",
|