jsfe 1.88.0 → 1.89.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 CHANGED
@@ -541,7 +541,7 @@ const engine = new WorkflowEngine(logger, aiCallback, flows, tools,
541
541
  - Checks: `validateDigits(input, min, max)` (digits only, length in range), `validatePhone(phone, acceptInternational)`
542
542
  (10 digits, or 11 with a leading 1; with `acceptInternational`, any 11 to 15), `validateEmail` (`x@y.z`, no spaces),
543
543
  `validateCardNumber` (12 to 19 digits passing Luhn), `validateExpiration(MM, YY)` (a real month, not expired, at most
544
- 20 years out), and the async `validateOTP(code, container)`, which accepts a code whose SHA-256 matches
544
+ 6 years out), and the async `validateOTP(code, container)`, which accepts a code whose SHA-256 matches
545
545
  `container.otpHash` within 10 minutes of `container.otpTimestamp`, or a second code emailed beside it
546
546
  (`otpAltHash` / `otpAltTimestamp`, jsfe 1.17.0) on its own clock; accepting either clears both (`clearOtp`).
547
547
  Accepting sets `container.otpVerified` and `otpVerifiedAt`; an expired code is cleared. A refusal leaves its
@@ -1 +1 @@
1
- {"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AAkDA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,0CAWC;AACD,qHAQC;AASD,qHAAqH;AACrH,6FAKC;AACD,4EAMC;AAkHD,2DAOC;AACD,4DAOC;AACD,gHAAgH;AAChH,8DAGC;AA4JD,8EAGC;AAgCD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AA3QD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AA8RzC,0BAAsK"}
1
+ {"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AAkDA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,0CAWC;AACD,qHAQC;AASD,qHAAqH;AACrH,6FAKC;AACD,4EAMC;AAkHD,2DAOC;AACD,4DAOC;AACD,gHAAgH;AAChH,8DAGC;AAgKD,8EAGC;AAgCD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AA/QD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AAkSzC,0BAAsK"}
@@ -236,7 +236,7 @@ const auth = worker('authenticate-user', 'AuthenticateUser', 'Authenticate a con
236
236
  when('auth_join_challenge', 'auth_join', call('auth_join_collect', 'get-and-validate-otp-code')),
237
237
  when('auth_join_release', 'auth_join', call('auth_join_gate_end', 'task-gate', { form: '{{parent_form}}', gate: 'authenticate-user', active: false })),
238
238
  when('auth_join_return', 'auth_join', end('auth_join_complete')),
239
- effect('auth_challenge_init', "(cargo.otpLateCode='',cargo.otpResends=0,cargo.otpMismatches=0,cargo.otpFormatMisses=0,cargo.otpWordMisses=0,cargo.otp_cell_number=cell_number || '',cargo.otp_email=email || '',cargo.otpAltSent=false,cargo.otpAltHash=null,cargo.otpAltTimestamp=null,true)"),
239
+ effect('auth_challenge_init', "(cargo.otpLateCode='',cargo.otpResends=0,cargo.otpMismatches=0,cargo.otpFormatMisses=0,cargo.otpWordMisses=0,cargo.otpCodeHolds=0,cargo.otp_cell_number=cell_number || '',cargo.otp_email=email || '',cargo.otpAltSent=false,cargo.otpAltHash=null,cargo.otpAltTimestamp=null,true)"),
240
240
  when('auth_send_limit', `((cargo.otpSendsTo || {})[${OTP_DESTINATION_JS}] || 0) >= ${MAX_OTP_SENDS_PER_CONTACT}`, call('auth_send_limit_end', 'verification-failed', { form: '{{cargo.authOptions.parent_form}}' }, 'reboot')),
241
241
  call('auth_send', 'send-otp-code'), when('auth_send_failed', 'cargo.otpSendFailure', call('auth_send_failure', 'otp-send-failed', undefined, 'replace')),
242
242
  call('auth_code', 'get-and-validate-otp-code'),
@@ -317,7 +317,7 @@ function otpPhoneUnavailable(value) {
317
317
  // What the reply ranker may take at the code question beside the code: the step's offers. Email and another account are
318
318
  // offered only where the step offers them (a code sent by text; a caller-ID preselection).
319
319
  const OTP_REPLY_CHOICES = [{ key: 'email', label: 'use the email on the account instead of the phone' }, { key: 'another_account', label: 'use another account' }, { key: 'no_other_account', label: 'says they have no other account, this is their only one' },
320
- { key: 'where', label: 'asks where the code was sent' }, { key: 'cannot_find', label: 'cannot find the code, or it is not there' }, { key: 'another_way', label: 'asks for another way to get the code or to verify' }, { key: 'resend', label: 'the code did not arrive; send it again' }, { key: 'no_phone', label: 'no longer has that phone or number' }, { key: '__agent', label: 'speak with a person (a live agent)' }];
320
+ { key: 'where', label: 'asks where the code was sent' }, { key: 'cannot_find', label: 'cannot find the code, or it is not there' }, { key: 'another_way', label: 'asks for another way to get the code or to verify' }, { key: 'resend', label: 'the code did not arrive; send it again' }, { key: 'has_code', label: 'has the code now or is getting it (here it is, one moment, let me look)' }, { key: 'no_phone', label: 'no longer has that phone or number' }, { key: '__agent', label: 'speak with a person (a live agent)' }];
321
321
  const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a challenge response with explicit bounded retries, alternate-contact handling and tenant callbacks.', { loopBound: '3 mismatches, 3 format misses, 2 resends, 3 sends per contact', variables: vars({ otp_phrases: OTP_WORDS, email_too: false, no_code_given: false, wants_other_account: false, other_account_given: false, otp_validation_result: false, whatsapp_invite_sent: false, invite_text: '', otp_cancel: 'contact-support', answer_key: '', answer_value: '', otp_reply_choices: OTP_REPLY_CHOICES, otp_offers: [], otp_reply: {}, otp_where: '', otp_where_es: '' }), contract: { role: 'gate', summary: 'Validate the active one-time challenge', tools: ['validate-otp', 'send-whatsapp-invite'], result: { path: 'cargo.otpVerified', type: 'boolean' } }, steps: [
322
322
  set('otp_cancel', 'otp_cancel', "cargo.authCancelFlow || 'contact-support'"),
323
323
  set('otp_email_too_ready', 'email_too', "!!(cargo.otp_cell_number && cargo.otpAltSent !== true && cargo.otpAltSent !== 'failed' && validateEmail(String(cargo.otpAltEmail || '')))"),
@@ -364,12 +364,16 @@ const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a
364
364
  when('otp_off_topic', 'no_code_given', { id: 'otp_reply_rank', type: 'DISPATCH', onResponse: 'continue', responseContext: 'Please say the 6-digit verification code I sent you. (Por favor diga el código de verificación de 6 dígitos que le envié.)', responseChoices: 'otp_offers', responseVariable: 'otp_reply', onNoIntent: 'stay' }),
365
365
  set('otp_where', 'otp_where', expression(otpWhere, 'cargo')), set('otp_where_es', 'otp_where_es', expression(otpWhere, 'cargo', 'true')),
366
366
  set('otp_reply_picked', 'no_code_given', "no_code_given && !(otp_reply && otp_reply.key && String(otp_reply.key).indexOf('usecase:') !== 0)"),
367
+ // "Aquí está", "one moment, let me look" (owner 2026-11-23; prod 11-22 11:48 ended verification as a third word miss): the caller
368
+ // is answering, so it is no miss. Its own bound: from the fourth, it counts as a word miss again.
369
+ set('otp_hold_cap', 'no_code_given', "no_code_given || !!(otp_reply && otp_reply.key === 'has_code' && (cargo.otpCodeHolds=Number(cargo.otpCodeHolds || 0)+1) > 3)"),
367
370
  cases('otp_reply_route', {
368
371
  "condition: !no_code_given && email_too && otp_reply && ['email','resend','cannot_find','another_way'].includes(otp_reply.key)": call('otp_ranked_email_too', 'send-otp-email-too'),
369
372
  "condition: !no_code_given && otp_reply && otp_reply.key === 'email'": toParent(call('otp_ranked_email', 'authenticate-user', { cell_number: '', email: '', retrying: true, declined_caller: true }, 'replace')),
370
373
  "condition: !no_code_given && otp_reply && otp_reply.key === 'another_account'": toParent(call('otp_ranked_account', 'authenticate-user', { cell_number: '', email: '', retrying: true, declined_caller: true }, 'replace')),
371
374
  "condition: !no_code_given && otp_reply && (otp_reply.key === 'where' || otp_reply.key === 'cannot_find')": say('otp_ranked_where', '{{otp_where}}', '{{otp_where_es}}'),
372
375
  "condition: !no_code_given && otp_reply && otp_reply.key === 'another_way'": say('otp_ranked_no_other_way', '{{otp_where}} To reach a person, {{cargo.verb}} AGENT.', '{{otp_where_es}} Para hablar con una persona, {{cargo.verb_es}} AGENTE.'),
376
+ "condition: !no_code_given && otp_reply && otp_reply.key === 'has_code'": say('otp_ranked_has_code', 'Go ahead. Read me the six digits when you have them.', 'Adelante. Dígame los seis dígitos cuando los tenga.'),
373
377
  "condition: !no_code_given && otp_reply && otp_reply.key === 'resend'": call('otp_ranked_resend', 'resend-otp-code', { resend_reason: 'requested' }),
374
378
  "condition: !no_code_given && otp_reply && otp_reply.key === 'no_phone'": otpMenu('otp_ranked_no_phone', "No problem. Then the code can't reach you there. You can use the email on your account instead, or {{cargo.verb}} AGENT to reach a person.", 'No hay problema. Entonces el código no le puede llegar ahí. Puede usar el correo electrónico de su cuenta, o {{cargo.verb_es}} AGENTE para hablar con una persona.', false),
375
379
  "condition: !no_code_given && otp_reply && otp_reply.key === 'no_other_account'": say('otp_ranked_no_other_account', 'I understand. We still need to secure access to your account.', 'Entiendo. Aún necesitamos asegurar el acceso a su cuenta.'),
@@ -3,6 +3,10 @@
3
3
  */
4
4
  /** 12–19 digits passing the Luhn checksum (catches nearly every typo, on every network). */
5
5
  export function validateCardNumber(input: any): boolean;
6
- /** MM and YY (two digits each), a real month, not expired, at most 20 years out. `now` is for tests. */
6
+ /** MM and YY (two digits each), a real month, not expired, at most 6 years out (owner 2026-11-23: issuers set at most 5;
7
+ * one more for safety). `now` is for tests. */
7
8
  export function validateExpiration(month: any, year: any, now?: Date): boolean;
9
+ /** A spoken or typed expiration's digits as MMYY when they are a valid one (validateExpiration), else ''. Month then year,
10
+ * as the card expiration validator reads digits: "0929", "929", "150" (01/50, past the window: ''), "09 2029", "09029". */
11
+ export function expirationDigits(value: any, now?: Date): string;
8
12
  //# sourceMappingURL=card-checks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card-checks.d.ts","sourceRoot":"","sources":["../../src/helpers/card-checks.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4FAA4F;AAC5F,wDAoBC;AAED,wGAAwG;AACxG,+EAYC"}
1
+ {"version":3,"file":"card-checks.d.ts","sourceRoot":"","sources":["../../src/helpers/card-checks.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4FAA4F;AAC5F,wDAoBC;AAED;+CAC+C;AAC/C,+EAYC;AAED;2HAC2H;AAC3H,iEAKC"}
@@ -26,7 +26,8 @@ export function validateCardNumber(input) {
26
26
  return sum % 10 === 0;
27
27
  }
28
28
  }
29
- /** MM and YY (two digits each), a real month, not expired, at most 20 years out. `now` is for tests. */
29
+ /** MM and YY (two digits each), a real month, not expired, at most 6 years out (owner 2026-11-23: issuers set at most 5;
30
+ * one more for safety). `now` is for tests. */
30
31
  export function validateExpiration(month, year, now = new Date()) {
31
32
  const m = String(month || '').replace(/\D/g, '');
32
33
  const y = String(year || '').replace(/\D/g, '');
@@ -42,5 +43,13 @@ export function validateExpiration(month, year, now = new Date()) {
42
43
  return false;
43
44
  if (yNum === curYear && mNum < curMonth)
44
45
  return false;
45
- return yNum <= curYear + 20;
46
+ return yNum <= curYear + 6;
47
+ }
48
+ /** A spoken or typed expiration's digits as MMYY when they are a valid one (validateExpiration), else ''. Month then year,
49
+ * as the card expiration validator reads digits: "0929", "929", "150" (01/50, past the window: ''), "09 2029", "09029". */
50
+ export function expirationDigits(value, now = new Date()) {
51
+ const digits = String(value ?? '').replace(/\D/g, '');
52
+ const m = /^(0?[1-9]|1[0-2])(?:20)?(\d{2})$/.exec(digits) || /^(0[1-9])0(\d{2})$/.exec(digits);
53
+ const mm = m ? m[1].padStart(2, '0') : '';
54
+ return m && validateExpiration(mm, m[2], now) ? mm + m[2] : '';
46
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,sEAQC;AAoGD;;;GAGG;AACH,sFAiIC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;mHACmH;AAEnH,iEAEC;AAGD,gGAOC;AAYD,kDAGC;AAED;;;;;;;GAOG;AACH;;;;SAcC;AACD;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;EAaC;AACD;;;;;;;;;;;;;;;;;;;;;;EAeC;AAqCD;;;;;;;;;;;;;;;;;;;;;;;EAsYC"}
1
+ {"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,sEAQC;AAoGD;;;GAGG;AACH,sFAiIC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;mHACmH;AAEnH,iEAEC;AAID,gGAQC;AAYD,kDAGC;AAED;;;;;;;GAOG;AACH;;;;SAcC;AACD;;;;;GAKG;AACH;;;;;;;;;;;;;;;;;;;;;;EAaC;AACD;;;;;;;;;;;;;;;;;;;;;;EAeC;AAyDD;;;;;;;;;;;;;;;;;;;;;;;EAiZC"}
@@ -15,7 +15,8 @@ import { readSpokenMoney } from './spoken-money.js';
15
15
  import { readMoneyAmount, isPartialMoneyAnswer } from './money.js';
16
16
  import { pickProviderQuestion } from './form-sources.js';
17
17
  import { spokenDigitsText, wholeSpokenNumber } from './spoken-digits.js';
18
- import { DIGIT_RUN, findNumbers, assignNumbers, NUMBER_KINDS } from './numbers.js';
18
+ import { DIGIT_RUN, findNumbers, assignNumbers, NUMBER_KINDS, presetValid } from './numbers.js';
19
+ import { expirationDigits, validateExpiration } from './card-checks.js';
19
20
  /**
20
21
  * This turn's acceptance decisions for the host to log, appended per match: fields filled out of order, in a compound
21
22
  * answer or as an invited input, and every refused reading, by form, field and rule. Field names and rules only, never
@@ -325,12 +326,14 @@ export function readInputProfile(profile, answer, isCurrent = true) {
325
326
  export function saysConfirmWord(answer, spec) {
326
327
  return [spec?.word, spec?.word_es].some((word) => word && matchesChoice(String(answer ?? ''), [String(word).toLowerCase()]));
327
328
  }
328
- // confirm_out_of_order's line: {value} the number (digit by digit on a call), {word} its word.
329
+ // confirm_out_of_order's line: {value} the number (digit by digit on a call, unless spec.say_digits is false: an amount is
330
+ // said as a number), {word} its word.
329
331
  export function confirmOutOfOrderLine(spec, value, language, voice) {
330
332
  const es = language === 'es';
331
333
  const line = String((es && spec?.message_es) || spec?.message || '');
332
334
  const word = String((es && spec?.word_es) || spec?.word || '');
333
- const own = line.replace('{value}', String(value ?? '').split('').join(voice ? ' ' : '')).replace('{word}', word);
335
+ const said = spec?.say_digits === false ? String(value ?? '').replace(/\.0+$/, '') : String(value ?? '').split('').join(voice ? ' ' : '');
336
+ const own = line.replace('{value}', said).replace('{word}', word);
334
337
  // The same number may name several fields ("1234": an expiration or a security code): each one's line is said (owner 2026-11-17).
335
338
  return [own, ...(Array.isArray(spec?.also) ? spec.also.map((other) => confirmOutOfOrderLine({ ...other, also: undefined }, other.value, language, voice)) : [])].filter(Boolean).join(' ');
336
339
  }
@@ -472,6 +475,31 @@ function numericSplit(raw, list, own) {
472
475
  }
473
476
  return out;
474
477
  }
478
+ // Rule 1, a valid value (owner 2026-11-23): out of order a number is read as a field only when it is a valid value of that field.
479
+ // The card expiration is month then year within the card window ("150" is 01/50 and "300" is 03/00: neither); a month said by
480
+ // name is judged by its year. Every other preset by its own check (the card number's check digit, a code's length), a digits
481
+ // field by its declared length, an amount when it is more than zero. Any other field: its reader already decided.
482
+ function validOutOfOrder(field, value) {
483
+ const text = String(value ?? ''), digits = text.replace(/\D/g, '');
484
+ if (field.field === 'card_expiration' && /\p{L}/u.test(text)) {
485
+ return digits.length >= 2 && validateExpiration('12', digits.slice(-2));
486
+ }
487
+ else if (field.field === 'card_expiration') {
488
+ return !!expirationDigits(text);
489
+ }
490
+ else if (NUMBER_KINDS.includes(field.field) && presetValid(field.field, digits) !== null) {
491
+ return presetValid(field.field, digits);
492
+ }
493
+ else if (field.profile.kind === 'digits') {
494
+ return digits.length >= Number(field.profile.min || 1) && digits.length <= Number(field.profile.max || field.profile.min || digits.length);
495
+ }
496
+ else if (field.profile.kind === 'amount') {
497
+ return Number(text.replace(/[^\d.]/g, '')) > 0;
498
+ }
499
+ else {
500
+ return true;
501
+ }
502
+ }
475
503
  export function matchInputs(answer, candidates, current, choiceKey) {
476
504
  const raw = asText(answer);
477
505
  const list = Array.isArray(candidates) ? candidates.filter((c) => c && c.name && c.profile) : [];
@@ -581,7 +609,9 @@ export function matchInputs(answer, candidates, current, choiceKey) {
581
609
  refused.push({ form: reading.form, name: reading.name, value: reading.value, rule: 'prerequisite_unmet', spans: reading.spans });
582
610
  return false;
583
611
  }
584
- else if (bare(reading) && fieldOf(reading).profile.kind === 'amount') {
612
+ else if (bare(reading) && fieldOf(reading).profile.kind === 'amount' && !fieldOf(reading).confirm_out_of_order) {
613
+ // An amount that declares confirm_out_of_order is named among the number's fields below (owner 2026-11-23: a number
614
+ // is matched to every field it is valid for, and the caller is told how to mean each).
585
615
  refused.push({ form: reading.form, name: reading.name, value: reading.value, rule: 'bare_amount_out_of_order', spans: reading.spans });
586
616
  return false;
587
617
  }
@@ -645,10 +675,20 @@ export function matchInputs(answer, candidates, current, choiceKey) {
645
675
  // input.confirm_out_of_order {word, word_es, message, message_es}: out of order a number fills this input only beside its
646
676
  // word ("account 5373850"). Alone it may be anything (a code said with an extra digit, owner 2026-11-02), so the caller is
647
677
  // told how to mean it and the current question is asked again.
678
+ readings = readings.filter((reading) => {
679
+ if (reading.rule !== 'out_of_order' || validOutOfOrder(fieldOf(reading), reading.value)) {
680
+ return true;
681
+ }
682
+ else {
683
+ refused.push({ form: reading.form, name: reading.name, value: reading.value, rule: 'invalid_out_of_order', spans: reading.spans });
684
+ return false;
685
+ }
686
+ });
648
687
  const clarify = [];
649
688
  readings = readings.filter((reading) => {
650
689
  const field = fieldOf(reading);
651
- if (reading.rule !== 'out_of_order' || !field.confirm_out_of_order || saysConfirmWord(raw, field.confirm_out_of_order)) {
690
+ // An amount asks its word only of a bare number (owner 2026-11-18): "109 con 47", "$150" or "150 dollars" is the amount.
691
+ if (reading.rule !== 'out_of_order' || !field.confirm_out_of_order || field.profile.kind === 'amount' && !bare(reading) || saysConfirmWord(raw, field.confirm_out_of_order)) {
652
692
  return true;
653
693
  }
654
694
  else {
@@ -12,6 +12,9 @@ export function findNumbers(answer: any): {
12
12
  restarts: any[];
13
13
  groups: string[];
14
14
  }[];
15
+ /** A preset field's own value check (a kind read with no spec: card_number, card_expiration, card_cvv, zip...): true when the
16
+ * digits are a valid value of it, false when not, null for a kind that needs its spec (date, pattern, digits). */
17
+ export function presetValid(kind: any, digits: any): boolean | null;
15
18
  export function assignNumbers(numbers: any, specs: any, options: any): {
16
19
  values: {};
17
20
  ambiguous: any[];
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/helpers/numbers.js"],"names":[],"mappings":"AAoGA;;;;;GAKG;AACH;;;;;;;IAsBC;AAwGD;;;;EAmCC;AAED;mFACmF;AACnF,qEASC;AA5QD;;;4EAG4E;AAC5E,+BAAqF;AAsJrF,oCAAqD"}
1
+ {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/helpers/numbers.js"],"names":[],"mappings":"AAoGA;;;;;GAKG;AACH;;;;;;;IAsBC;AAuCD;kHACkH;AAClH,oEAEC;AAkED;;;;EAmCC;AAED;mFACmF;AACnF,qEASC;AAjRD;;;4EAG4E;AAC5E,+BAAqF;AAsJrF,oCAAqD"}
@@ -194,6 +194,11 @@ const KNOWN_KINDS = {
194
194
  digits: (spec) => length(Number(spec.min), Number(spec.max ?? spec.min))
195
195
  };
196
196
  export const NUMBER_KINDS = Object.keys(KNOWN_KINDS);
197
+ /** A preset field's own value check (a kind read with no spec: card_number, card_expiration, card_cvv, zip...): true when the
198
+ * digits are a valid value of it, false when not, null for a kind that needs its spec (date, pattern, digits). */
199
+ export function presetValid(kind, digits) {
200
+ return Object.hasOwn(KNOWN_KINDS, kind) && !['date', 'pattern', 'digits'].includes(kind) ? !!KNOWN_KINDS[kind]({})(String(digits ?? '')) : null;
201
+ }
197
202
  /** specs → [{name, read}]. A spec list is the documented form; a {name: (digits) => false | true | value} object (jsfe
198
203
  * 1.81-1.83) is still read the same way. An unknown kind, a pattern without its regex, digits without min, or a repeated
199
204
  * name throws: a reader declared wrong fails where it is declared, never by reading nothing. */
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:0ae44a665a24ada501c56e254ed6920f3feb879ec0b3f181707043cb00665fa7";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:df2aef8397134376b8abc730555c4de6ba14116f1953c16067c0d88fc5423857";
@@ -364,7 +364,7 @@ it.
364
364
 
365
365
  **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.
366
366
 
367
- **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)`.
367
+ **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. Out of order a number is read, and named, only as a field it is a valid value of (owner 2026-11-23): the expiration month then year within the card window ("150" is 01/50, "300" is 03/00: neither), every other preset by its own check, a digits field by its length, an amount above zero. A number valid for several fields names each ("1230": the expiration and the security code). An amount that declares it is named too (a bare amount out of order is otherwise refused silently); `say_digits: false` says its `{value}` as a number on a call. 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)`.
368
368
 
369
369
  **A conflict the request carried is asked at its input (jsfe 1.74.0, owner 2026-11-17).** When values given at activation
370
370
  (nothing asked yet) compete for one exclusive group, such as an amount and a payment option, the conflict is kept on the form
@@ -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. 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. |
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. A number names only a field it is a valid value of, and every such field; an amount that declares it is named too. `say_digits:false` says `{value}` as a number on a call (an amount). |
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
  | profile `in_sentence:true` (digits) | At its own question a `digits` field takes its number only when the number is the whole answer (courtesy, connecting words and the field's own words aside, or a compound answer other fields read); any other sentence goes to the reply ranker, which extracts the field through the input's `rank_parameters`. `in_sentence` reads the number wherever it is said: the one-time code (the OTP profiles declare it). The `zip`, `card_zip` presets declare `rank_parameters`. |
230
230
  | `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. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.88.0",
3
+ "version": "1.89.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",