jsfe 1.92.0 → 1.93.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.
@@ -1 +1 @@
1
- {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AAoIA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;AAynBD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AAz8BM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0J9G,4CAEqI;AA0gCrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AAqIA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;AA0nBD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AA38BM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2J9G,4CAEqI;AA2gCrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
@@ -97,8 +97,9 @@ export const FIELD_PRESETS = {
97
97
  // Up to two words between month and year ("el mes 06 año 31", prod 2026-10-28 21:54, was asked again); a month by name.
98
98
  // A spoken separator with the digits apart: "0 4 guion 3 1" (owner 2026-11-02; prod 2026-11-01 15:19 was asked again),
99
99
  // with STT's punctuation around it: "10, diagonal 31." (prod 2026-11-15 16:37 was asked again).
100
+ // STT's comma or period between month and year: "Es mes 2, 2027." (owner 2026-11-25; prod 2026-11-24 20:05 got the ZIP hint).
100
101
  // Four single digits, month then year, with words around them: "0 6 3 0 30 se vence" (owner 2026-11-15; prod 2026-11-14): asked_regex.
101
- profile: { kind: 'pattern', regex: `\\b(0?[1-9]|1[0-2]|${MONTH_RE})\\.?(?:\\s*(?:/|-|del?|año|ano|year|of)(?=[\\s\\d])){0,2}\\s*(?:20)?(\\d{2})\\b|\\b0[1-9]0\\s+(?:20)?\\d{2}\\b|\\b(?:0\\s?[1-9]|1\\s?[0-2]|[1-9])[\\s,.]*(?:gui[oó]n|dash|hyphen|slash|barra|diagonal)[\\s,.]*(?:2\\s?0\\s?)?\\d\\s?\\d\\b`,
102
+ profile: { kind: 'pattern', regex: `\\b(0?[1-9]|1[0-2]|${MONTH_RE})\\.?(?:[\\s,.]*(?:/|-|del?|año|ano|year|of)(?=[\\s\\d])){0,2}[\\s,.]*(?:20)?(\\d{2})\\b|\\b0[1-9]0\\s+(?:20)?\\d{2}\\b|\\b(?:0\\s?[1-9]|1\\s?[0-2]|[1-9])[\\s,.]*(?:gui[oó]n|dash|hyphen|slash|barra|diagonal)[\\s,.]*(?:2\\s?0\\s?)?\\d\\s?\\d\\b`,
102
103
  // 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).
103
104
  asked_regex: `\\b(?:0\\s[1-9]|1\\s[0-2])\\s\\d\\s\\d\\b` }, digits: { min: 3, max: 6 },
104
105
  validator: 'validate-card-expiration',
@@ -967,8 +968,9 @@ const validators = [
967
968
  steps: [SIDE('vcn_check', "(cargo.inputCheck = validateCardNumber(value) ? { ok: true, value: String(value).replace(/\\D/g, '') } : { ok: false, message: \"That card number doesn't look right.\", message_es: 'Ese número de tarjeta no parece correcto.' }, true)")] },
968
969
  { id: 'validate-card-expiration', name: 'ValidateCardExpiration', version: '1.0.0', scope: 'isolated',
969
970
  description: 'Validator: month (a number or its English or Spanish name) and year, a real month, not expired (validateExpiration). Normalizes to MMYY. Params: form, input, value, values, reading (it reads value).',
970
- parameters: [{ name: 'input', type: 'string', description: 'input name' }, { name: 'value', type: 'string', description: 'the reading' }],
971
- steps: [SIDE('vce_check', "(function (v) { var names = " + JSON.stringify(MONTH_NAMES.map(([n]) => n)) + "; var nums = " + JSON.stringify(MONTH_NAMES.map(([, k]) => k)) + "; var w = new RegExp('\\\\b(' + names.join('|') + ')\\\\b', 'i').exec(String(v)); if (w) { v = String(v).replace(w[0], ' ' + nums[names.indexOf(w[1].toLowerCase())] + ' '); } var m = /^(0?[1-9]|1[0-2])\\D*(?:20)?(\\d{2})$/.exec(String(v).replace(/\\s+/g, '').replace(/de/gi, '')) || /^(\\d{2})(\\d{2})$/.exec(String(v).replace(/\\D/g, '')) || /^(0[1-9])0(\\d{2})$/.exec(String(v).replace(/\\D/g, '')); var mm = m ? ('0' + m[1]).slice(-2) : ''; var yy = m ? m[2] : ''; cargo.inputCheck = m && validateExpiration(mm, yy) ? { ok: true, value: mm + yy } : { ok: false, message: \"That expiration date doesn't look right.\", message_es: 'Esa fecha de vencimiento no parece correcta.' }; return true; })(value)")] },
971
+ parameters: [{ name: 'input', type: 'string', description: 'input name' }, { name: 'value', type: 'string', description: 'the reading' }, { name: 'reading', type: 'object', description: 'the reading, with the answer as said (raw)' }],
972
+ // A month named in the answer must be the month read (owner 2026-11-25; prod 2026-11-24 14:55: "Noviembre Año 230" was read as 02/30 from its digits).
973
+ steps: [SIDE('vce_check', "(function (v, said) { var names = " + JSON.stringify(MONTH_NAMES.map(([n]) => n)) + "; var nums = " + JSON.stringify(MONTH_NAMES.map(([, k]) => k)) + "; var re = new RegExp('\\\\b(' + names.join('|') + ')\\\\b', 'i'); var w = re.exec(String(v)); if (w) { v = String(v).replace(w[0], ' ' + nums[names.indexOf(w[1].toLowerCase())] + ' '); } var m = /^(0?[1-9]|1[0-2])\\D*(?:20)?(\\d{2})$/.exec(String(v).replace(/\\s+/g, '').replace(/de/gi, '')) || /^(\\d{2})(\\d{2})$/.exec(String(v).replace(/\\D/g, '')) || /^(0[1-9])0(\\d{2})$/.exec(String(v).replace(/\\D/g, '')); var mm = m ? ('0' + m[1]).slice(-2) : ''; var yy = m ? m[2] : ''; var named = re.exec(String(said)); var agrees = !named || ('0' + nums[names.indexOf(named[1].toLowerCase())]).slice(-2) === mm; cargo.inputCheck = m && agrees && validateExpiration(mm, yy) ? { ok: true, value: mm + yy } : { ok: false, message: \"That expiration date doesn't look right.\", message_es: 'Esa fecha de vencimiento no parece correcta.' }; return true; })(value, reading && (reading.raw || reading.utterance) || '')")] },
972
974
  { id: 'validate-us-phone', name: 'ValidateUsPhone', version: '1.0.0', scope: 'isolated',
973
975
  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).',
974
976
  parameters: [{ name: 'input', type: 'string', description: 'input name' }, { name: 'value', type: 'string', description: 'the reading' }],
@@ -7,6 +7,13 @@ export function contactPrompt(cargo: any, options: any, callerAllowed: any, part
7
7
  /** The line a ranked pick at the contact question is answered with, before the question again (owner 2026-11-18). */
8
8
  export function rankedContactLine(kind: any, options: any, cargo: any, es?: boolean): string;
9
9
  export function contactError(kind: any, options: any, es?: boolean): string;
10
+ /** A phone, email or account number the reply ranker extracted from the caller's sentence (owner 2026-11-25), kept only when
11
+ * the caller's own words hold it (its digits in the spoken digits, the email's name in the text) and it is a valid identifier. */
12
+ export function contactGiven(reply: any, spoken: any, text: any, options: any): {
13
+ acct_number: string;
14
+ cell_number: string;
15
+ email: string;
16
+ } | null;
10
17
  export function otpWhere(cargo: any, es?: boolean): string;
11
18
  export function otpPrompt(cargo: any, es?: boolean): string;
12
19
  /** What the caller hears when a second code goes to the account's email, masked by maskEmail (jsfe/helpers). */
@@ -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;AAgKD,8EAGC;AAgCD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AA/QD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AAkSzC,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,4EAYC;AAED;kIACkI;AAClI;;;;SAUC;AAwHD,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"}
@@ -124,12 +124,34 @@ export function contactError(kind, options, es = false) {
124
124
  return es ? "Un número fuera de EE. UU. y Canadá no se puede usar aquí. Por favor indique el correo de su cuenta" + (account ? ', o ' + account : '') + ", o un celular de EE. UU. o Canadá." : "A number outside the US and Canada can't be used here. Please give the email on your account" + (account ? ', or ' + account : '') + ", or a US or Canadian mobile number.";
125
125
  if (kind === 'invalid_email')
126
126
  return es ? 'Lo siento, no entendí el correo electrónico completo, por ejemplo: nombre arroba gmail punto com.' : "Sorry, I didn't get the whole email address, for example: name at gmail dot com.";
127
- if (kind === 'invalid_phone')
128
- return es ? 'El número de teléfono que proporcionó no es válido.' : "Sorry, the phone number you provided isn't valid.";
127
+ // A number said alone that is no identifier (owner 2026-11-25). Named an account number: the tenant's account shape, said.
128
+ if (kind === 'invalid_account') {
129
+ const shapes = options.account_shape || [], first = [...new Set(shapes.flatMap(shape => String(shape.first || '').split('')))], lengths = [...new Set(shapes.flatMap(shape => shape.lengths || []))].sort((a, b) => a - b);
130
+ const list = (items, or) => items.length > 1 ? items.slice(0, -1).join(', ') + ' ' + or(items[items.length - 1]) + ' ' + items[items.length - 1] : String(items[0]);
131
+ return es ? 'Ese no es un número de cuenta válido. Los números de cuenta empiezan con ' + list(first, () => 'o') + ' y tienen ' + list(lengths, n => /^(8|11)/.test(String(n)) ? 'u' : 'o') + ' dígitos.' : "That isn't a valid account number. Account numbers start with " + list(first, () => 'or') + ' and are ' + list(lengths, () => 'or') + ' digits long.';
132
+ }
133
+ if (kind === 'invalid_number')
134
+ return options.account_pattern ? (es ? 'Esto no parece ser un número de teléfono o de cuenta válido. Por favor revíselo e intente de nuevo.' : "This doesn't seem to be a valid phone or account number. Please check it and try again.") : (es ? 'Esto no parece ser un número de teléfono válido. Por favor revíselo e intente de nuevo.' : "This doesn't seem to be a valid phone number. Please check it and try again.");
129
135
  return es ? 'Lo siento, necesito el teléfono o correo electrónico asociado con su cuenta' + (account ? ', o ' + account : '') + ' para continuar.' : 'Sorry, I do need the phone or email associated with your account' + (account ? ', or ' + account : '') + ' to proceed.';
130
136
  }
137
+ /** A phone, email or account number the reply ranker extracted from the caller's sentence (owner 2026-11-25), kept only when
138
+ * the caller's own words hold it (its digits in the spoken digits, the email's name in the text) and it is a valid identifier. */
139
+ export function contactGiven(reply, spoken, text, options) {
140
+ const args = reply && reply.arguments || {}, digits = String(spoken || '').replace(/\D/g, '');
141
+ const grounded = value => { const d = String(value || '').replace(/\D/g, ''); return d.length >= 7 && digits.includes(d) ? d : ''; };
142
+ const account = options.account_pattern ? grounded(args.account_number) : '';
143
+ if (account && new RegExp(options.account_pattern).test(account))
144
+ return { acct_number: account, cell_number: '', email: '' };
145
+ const phone = grounded(args.phone);
146
+ if (phone && validatePhone(phone))
147
+ return { acct_number: '', cell_number: phone.slice(-10), email: '' };
148
+ const mail = args.email ? readEmail(String(args.email)) : '';
149
+ if (mail && String(text || '').toLowerCase().replace(/\s+/g, '').includes(String(mail).split('@')[0].toLowerCase()))
150
+ return { acct_number: '', cell_number: '', email: String(mail) };
151
+ return null;
152
+ }
131
153
  const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a supplied contact or account number; collect missing data through a FORM, with caller-ID eligibility and bounded contact validation.', {
132
- parameters: contactParams, variables: vars({ ...contactDefaults, contact_profiles_base: contactProfiles, contact_named_options: null, contact_rank_asked: '', contact_rank_offers: [], contact_rank_reply: null, contact_rank_kind: '', contact_rank_options: null, contact_rank_first: false, contact_names_account: ['número de cuenta', 'numero de cuenta', 'mi número de cuenta', 'mi numero de cuenta', 'con mi número de cuenta', 'con mi numero de cuenta', 'con el número de cuenta', 'con el numero de cuenta', 'account number', 'my account number', 'with my account number', 'with the account number'] }), contract: { role: 'collector', summary: 'Contact identification with FORM ancestry', result: { paths: ['cell_number', 'email', 'acct_number', 'cargo.contactKind', 'cargo.contactValue'], type: 'object' } },
154
+ parameters: contactParams, variables: vars({ ...contactDefaults, contact_profiles_base: contactProfiles, contact_named_options: null, contact_rank_asked: '', contact_rank_offers: [], contact_rank_reply: null, contact_rank_kind: '', contact_rank_options: null, contact_rank_first: false, contact_given: null, contact_number_words: ['account', 'number', 'cuenta', 'numero', 'número', 'phone', 'telephone', 'cell', 'teléfono', 'telefono', 'celular', 'yes', 'yeah', 'si', 'sí', 'it', 'es', 'is', 'was', 'era'], contact_names_account: ['número de cuenta', 'numero de cuenta', 'mi número de cuenta', 'mi numero de cuenta', 'con mi número de cuenta', 'con mi numero de cuenta', 'con el número de cuenta', 'con el numero de cuenta', 'account number', 'my account number', 'with my account number', 'with the account number'] }), contract: { role: 'collector', summary: 'Contact identification with FORM ancestry', result: { paths: ['cell_number', 'email', 'acct_number', 'cargo.contactKind', 'cargo.contactValue'], type: 'object' } },
133
155
  steps: [
134
156
  set('identity_contact_options', 'contact_options', "contact_options || (retrying && cargo.contactOptions ? Object.assign({},cargo.contactOptions,{fromMenu:true,intro:'',intro_es:''}) : {retry_flow:retry_flow || 'authenticate-user',cancel_flow:cancel_flow || 'contact-support',account_pattern:account_pattern,account_name:account_name,account_name_es:account_name_es,account_shape:account_shape,intro:intro,intro_es:intro_es,caller_on_file:caller_on_file,retry_call_type:retry_call_type || 'reboot',validate_flow:validate_flow,merge_partials:merge_partials === true || merge_partials === 'true',parent_form:parent_form})"),
135
157
  // options carried from an earlier verification may name a task the caller has since closed; opening under it fails
@@ -160,13 +182,13 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
160
182
  when('identity_contact_split_overshoot', "contact_partial && contact_digits.length > (contact_options.account_shape || []).reduce(function(max,s){return Math.max(max,Math.max.apply(null,s.lengths || [0]));},0)", call('identity_contact_restart_split', 'contact-split-failed', { contact_options: '{{contact_options}}' }, 'replace')),
161
183
  set('identity_contact_identifier', 'contact_id', "contact_options.account_pattern ? readIdentifier(contact_text,contact_options.account_pattern) : null"),
162
184
  set('identity_contact_phone', 'contact_phone', "readPhone(contact_text) || (validatePhone(contact_digits) ? contact_digits : '')"), set('identity_contact_email', 'contact_mail', 'readEmail(contact_text)'),
163
- set('identity_contact_classify', 'contact_kind', "contact_id && contact_id.kind === 'account' ? 'account' : contact_phone ? 'phone' : contact_mail ? 'email' : contact_options.account_pattern && !contact_digits && matchesChoice(contact_text,contact_names_account) ? 'names_account' : readInternationalPhone(contact_text) ? 'international' : isAgentRequest(contact_text) ? 'agent' : isExitRequest(contact_text) ? 'exit' : " + emailTry + " ? 'invalid_email' : contact_allowed && /^(?:no|nope|nah)\\b/i.test(contact_text.trim()) && !/[0-9@]/.test(contact_text) ? 'decline' : contact_allowed && cargo.serviceAnswer && cargo.serviceAnswer.values.caller_decision === 'yes' ? 'caller' : contact_digits ? 'invalid_phone' : /[a-záéíóúñü]/i.test(contact_text) ? 'unmapped' : 'invalid'"),
185
+ set('identity_contact_classify', 'contact_kind', "contact_id && contact_id.kind === 'account' ? 'account' : contact_phone ? 'phone' : contact_mail ? 'email' : contact_options.account_pattern && !contact_digits && matchesChoice(contact_text,contact_names_account) ? 'names_account' : readInternationalPhone(contact_text) ? 'international' : isAgentRequest(contact_text) ? 'agent' : isExitRequest(contact_text) ? 'exit' : " + emailTry + " ? 'invalid_email' : contact_allowed && /^(?:no|nope|nah)\\b/i.test(contact_text.trim()) && !/[0-9@]/.test(contact_text) ? 'decline' : contact_allowed && cargo.serviceAnswer && cargo.serviceAnswer.values.caller_decision === 'yes' ? 'caller' : contact_digits ? (isReaderFiller(contact_text,contact_number_words) ? (contact_options.account_pattern && (contact_options.account_shape || []).length && /\\b(?:account|cuenta)\\b/i.test(contact_text) ? 'invalid_account' : 'invalid_number') : 'unmapped') : /[a-záéíóúñü]/i.test(contact_text) ? 'unmapped' : 'invalid'"),
164
186
  set('identity_contact_named', 'contact_named_options', "Object.assign({},contact_options,{fromMenu:false,intro:'Sure, your account number.',intro_es:'Claro, su número de cuenta.'})"),
165
187
  set('identity_contact_error', 'contact_error', expression(contactError, 'contact_kind', 'contact_options')), set('identity_contact_error_es', 'contact_error_es', expression(contactError, 'contact_kind', 'contact_options', 'true')),
166
188
  // A reply with letters and no identifier goes to the reply ranker with the question's own options (owner 2026-11-18): the
167
189
  // identifiers above are read lexically anywhere in the reply; the ranker only picks one of these, never an identifier.
168
190
  set('identity_contact_rank_asked', 'contact_rank_asked', "language === 'es' ? contact_question_es : contact_question"),
169
- set('identity_contact_rank_offers', 'contact_rank_offers', "[{key:'no_identifier',label:'does not know or does not have the phone number, email or account number on the account'},{key:'other_contact',label:'has or wants to give a different phone number or email'},{key:'__agent',label:'speak with a person (a live agent)'},{key:'exit',label:'does not want to continue and stops here'}].concat(callerTextNumber(cargo) ? [{key:'text',label:'continue by text message'}] : [])"),
191
+ set('identity_contact_rank_offers', 'contact_rank_offers', "[{key:'gives_contact',label:'gives a phone number, email or account number for the account',parameters:[{name:'phone',type:'string',description:'The phone number the caller gave, as said; empty if none.'},{name:'email',type:'string',description:'The email address the caller gave, as said; empty if none.'}].concat(contact_options.account_pattern ? [{name:'account_number',type:'string',description:'The account number the caller gave, as said; empty if none.'}] : [])},{key:'no_identifier',label:'does not know or does not have the phone number, email or account number on the account'},{key:'other_contact',label:'has or wants to give a different phone number or email'},{key:'__agent',label:'speak with a person (a live agent)'},{key:'exit',label:'does not want to continue and stops here'}].concat(callerTextNumber(cargo) ? [{key:'text',label:'continue by text message'}] : [])"),
170
192
  set('identity_contact_rank_clear', 'contact_rank_reply', 'null'),
171
193
  cases('identity_contact_route', {
172
194
  "condition: contact_kind === 'agent'": call('identity_contact_agent', 'live-agent-requested', undefined, 'reboot'),
@@ -176,7 +198,8 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
176
198
  // failure menu, and the number keyed next was taken for other fields): the question again, acknowledged.
177
199
  "condition: contact_kind === 'names_account'": contactReplay('identity_contact_names_account', { contact_options: '{{contact_named_options}}' }),
178
200
  "condition: contact_kind === 'international'": contactMiss('identity_contact_international'),
179
- "condition: contact_kind === 'invalid_phone'": contactMiss('identity_contact_invalid_phone'),
201
+ "condition: contact_kind === 'invalid_account'": contactMiss('identity_contact_invalid_account'),
202
+ "condition: contact_kind === 'invalid_number'": contactMiss('identity_contact_invalid_number'),
180
203
  "condition: contact_kind === 'invalid_email'": contactMiss('identity_contact_invalid_email'),
181
204
  "condition: contact_kind === 'unmapped'": { id: 'identity_contact_off_topic', type: 'DISPATCH', onResponse: 'continue', responseContext: 'Current question: {{contact_rank_asked}}', responseChoices: 'contact_rank_offers', responseVariable: 'contact_rank_reply', outcome: 'unresolved', reason: 'auth_prompt_off_topic' },
182
205
  "condition: contact_kind === 'invalid'": contactMiss('identity_contact_missing'), default: effect('identity_contact_typed', 'true')
@@ -187,8 +210,13 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
187
210
  set('identity_contact_rank_first', 'contact_rank_first', '!!contact_rank_options && !cargo.gceRanked'),
188
211
  effect('identity_contact_rank_mark', '(contact_rank_options ? cargo.gceRanked=true : true,true)'),
189
212
  set('identity_contact_rank_line', 'contact_error', 'contact_rank_options ? contact_rank_options.intro : contact_error'), set('identity_contact_rank_line_es', 'contact_error_es', 'contact_rank_options ? contact_rank_options.intro_es : contact_error_es'),
213
+ set('identity_contact_given', 'contact_given', "contact_rank_kind === 'gives_contact' ? " + expression(contactGiven, 'contact_rank_reply', `(${serviceDigits.toString()})(contact_text)`, 'contact_text', 'contact_options') + " : null"),
214
+ set('identity_contact_given_line', 'contact_error', "contact_rank_kind === 'gives_contact' && !contact_given ? " + expression(contactError, "'invalid_number'", 'contact_options') + " : contact_error"), set('identity_contact_given_line_es', 'contact_error_es', "contact_rank_kind === 'gives_contact' && !contact_given ? " + expression(contactError, "'invalid_number'", 'contact_options', 'true') + " : contact_error_es"),
190
215
  // A classified response is not authority to abandon identification: the question again, then the bounded recovery menu.
191
216
  cases('identity_contact_unmapped_retry', {
217
+ // a valid identifier the ranker found in the caller's words is the answer; one that is not valid is a miss, with why
218
+ "condition: contact_rank_kind === 'gives_contact' && !!contact_given": contactReplay('identity_contact_rank_given', { acct_number: '{{contact_given.acct_number}}', cell_number: '{{contact_given.cell_number}}', email: '{{contact_given.email}}' }),
219
+ "condition: contact_rank_kind === 'gives_contact'": contactMiss('identity_contact_rank_given_invalid'),
192
220
  "condition: contact_rank_kind === '__agent'": call('identity_contact_rank_agent', 'live-agent-requested', undefined, 'reboot'),
193
221
  "condition: contact_rank_kind === 'exit'": call('identity_contact_rank_exit', '{{contact_options.cancel_flow}}', undefined, 'reboot'),
194
222
  "condition: contact_rank_kind === 'text'": call('identity_contact_rank_text', 'switch-to-text', undefined, 'reboot'),
@@ -54,6 +54,7 @@ export namespace STANDARD_FUNCTIONS {
54
54
  export { pickChoice };
55
55
  export { pickWholeChoice };
56
56
  export { withoutPromptEcho };
57
+ export { isReaderFiller };
57
58
  export { readEmail };
58
59
  export { emailWithoutEnding };
59
60
  export { emailEnding };
@@ -209,6 +210,7 @@ import { amountInAnswer } from './answer.js';
209
210
  import { pickChoice } from './answer.js';
210
211
  import { pickWholeChoice } from './answer.js';
211
212
  import { withoutPromptEcho } from './answer.js';
213
+ import { isReaderFiller } from './answer.js';
212
214
  import { readEmail } from './contact.js';
213
215
  import { emailWithoutEnding } from './contact.js';
214
216
  import { emailEnding } from './contact.js';
@@ -312,5 +314,5 @@ import { sendables } from './sendables.js';
312
314
  import { chatTranscript } from './sendables.js';
313
315
  import { conversationCopy } from './sendables.js';
314
316
  import { CONVERSATION_KEY } from './sendables.js';
315
- export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho, readEmail, emailWithoutEnding, emailEnding, emailSaid, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readArgument, groundAmount, joinSpokenNumbers, findNumbers, assignNumbers, addressDraft, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, numberAlone, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY };
317
+ export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho, isReaderFiller, readEmail, emailWithoutEnding, emailEnding, emailSaid, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readArgument, groundAmount, joinSpokenNumbers, findNumbers, assignNumbers, addressDraft, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, numberAlone, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY };
316
318
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,iBAAiB;8BAAjB,iBAAiB;wCAAjB,iBAAiB;mCAAjB,iBAAiB;qCAAjB,iBAAiB;mCAAjB,iBAAiB;oCAAjB,iBAAiB;iCAAjB,iBAAiB;kCAAjB,iBAAiB;yBACzqB,gBAAgB;yBAAhB,gBAAgB;gCAAhB,gBAAgB;4BAAhB,gBAAgB;8BAAhB,gBAAgB;+BACnC,iBAAiB;8BAAjB,iBAAiB;8BAAjB,iBAAiB;4BAI7B,iBAAiB;oCAAjB,iBAAiB;iCAHiB,oBAAoB;iCAApB,oBAAoB;kCAApB,oBAAoB;4BAApB,oBAAoB;iCA9BP,gBAAgB;0BAAhB,gBAAgB;+BAAhB,gBAAgB;iCAAhB,gBAAgB;iCAAhB,gBAAgB"}
@@ -24,7 +24,7 @@ import { consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFo
24
24
  import { sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion } from './form-sources.js';
25
25
  import { matchesChoice } from './matches-choice.js';
26
26
  import { readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions } from './money.js';
27
- import { ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho } from './answer.js';
27
+ import { ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho, isReaderFiller } from './answer.js';
28
28
  import { readEmail, emailWithoutEnding, emailEnding, emailSaid, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational } from './contact.js';
29
29
  import { normalizeAndFindCapture } from './capture.js';
30
30
  import { anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb } from './phrases.js';
@@ -39,13 +39,13 @@ import { joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, numberAlone } fr
39
39
  import { findNumbers, assignNumbers, joinSpokenNumbers } from './numbers.js';
40
40
  import { addressDraft } from './address.js';
41
41
  import { urlToSpeech, textWithUrlToSpeech } from './url-speech.js';
42
- export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho, readEmail, emailWithoutEnding, emailEnding, emailSaid, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readArgument, groundAmount, joinSpokenNumbers, findNumbers, assignNumbers, addressDraft, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, numberAlone, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY, };
42
+ export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho, isReaderFiller, readEmail, emailWithoutEnding, emailEnding, emailSaid, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readArgument, groundAmount, joinSpokenNumbers, findNumbers, assignNumbers, addressDraft, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, numberAlone, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY, };
43
43
  /** The functions flows call by name, ready to spread into a host's approved functions. */
44
44
  export const STANDARD_FUNCTIONS = {
45
45
  continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse,
46
46
  formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor,
47
47
  clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome,
48
- readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, confirmOutOfOrderLine, matchesChoice, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho,
48
+ readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, confirmOutOfOrderLine, matchesChoice, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, pickWholeChoice, withoutPromptEcho, isReaderFiller,
49
49
  readEmail, emailWithoutEnding, emailEnding, emailSaid, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational,
50
50
  normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readArgument, groundAmount, joinSpokenNumbers, findNumbers, assignNumbers, addressDraft, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance,
51
51
  validateOTP, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, wholeSpokenNumber, numberAlone,
@@ -1 +1 @@
1
- {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../src/helpers/money.js"],"names":[],"mappings":"AAIA,gHAAgH;AAChH,wDAGC;AAuBD;8FAC8F;AAC9F,oEAIC;AACD,+FAA+F;AAC/F,0DAEC;AACD;oGACoG;AACpG,4DAGC;AAWD;;;GAGG;AACH,+DAYC;AACD,4FAA4F;AAC5F,iEAAsG"}
1
+ {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../src/helpers/money.js"],"names":[],"mappings":"AAIA,gHAAgH;AAChH,wDAGC;AAwBD;8FAC8F;AAC9F,oEAIC;AACD,+FAA+F;AAC/F,0DAEC;AACD;oGACoG;AACpG,4DAGC;AAWD;;;GAGG;AACH,+DAYC;AACD,4FAA4F;AAC5F,iEAAsG"}
@@ -15,7 +15,8 @@ const NUMERIC_MONEY = /^(?:\$\s*)?(?:\d{1,3}(?:[,.]\d{3})+|\d+)(?:[.,]\d{1,2})?(
15
15
  // recovery offer 'Pago de 100 dólares.' was asked whether 100 was the card's expiration date).
16
16
  const PAYMENT_PREFIX = /^(?:(?:(?:i (?:want to|would like to|will) |i['’]d like to |i['’]ll )?make )?(?:a )?payment(?: of)?|(?:i (?:want to|would like to|can|am able to|will) |i['’]d like to )?pay|(?:quiero |quisiera |puedo |s[ií] puedo |voy a )?(?:pagar|abonar)|(?:no,?\s+)?make it|(?:(?:quiero |quisiera |voy a )?hacer )?(?:un )?(?:pago|abono)(?: de)?)\s*(?=\$|\d|[a-záéíóúüñ])/i;
17
17
  // The field named with its value ("100 amount", "the amount is 100", "monto 100"): the amount, said as such.
18
- const AMOUNT_LABEL_PREFIX = /^(?:(?:the|el|la)\s+)?(?:amount|monto|cantidad)(?:\s+(?:is|of|es|de))?[:\s]+(?=\$|\d)/i;
18
+ // 'la suma de 220 dólares' (owner 2026-11-25; prod 2026-11-24 12:45 got the security-code hint) and 'the sum of'.
19
+ const AMOUNT_LABEL_PREFIX = /^(?:(?:the|el|la)\s+)?(?:amount|sum|monto|cantidad|suma)(?:\s+(?:is|of|es|de))?[:\s]+(?=\$|\d)/i;
19
20
  const AMOUNT_LABEL_SUFFIX = /(?<=\d|\$)\s+(?:(?:as\s+)?(?:the\s+)?amount|(?:de\s+|el\s+)?monto|(?:de\s+|la\s+)?cantidad)$/i;
20
21
  const ACCOUNT_PREFIX = /^(?:(?:sub[ -]?account|subcuenta|cuenta)\s+\d{1,8}\s*,\s*)/i;
21
22
  const DIGIT_WORD = '(?:zero|one|two|three|four|five|six|seven|eight|nine|cero|uno|dos|tres|cuatro|cinco|seis|siete|ocho|nueve)';
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:0476062be5f39ae4a8e4509c87fa8381d08105852a61d92c5f72889a76bb18b6";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:6e88e2bd77a0498fccf88a255a31e92e1e8a16848d8d04f2bd5e0dc498283e42";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.92.0",
3
+ "version": "1.93.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",