jsfe 1.91.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'),
@@ -61,6 +61,13 @@ export function isReaderFiller(text: any, templateWords?: any[]): any;
61
61
  * whole answer is an agent request and EXIT only on exit/quit/salir/abort (cancel is an answer there).
62
62
  */
63
63
  export function pickChoice(answer: any, choices: any, acceptOther: any): any;
64
+ /**
65
+ * pickChoice for a flow's own word reader, tight (owner 2026-11-24: a word inside a sentence never decides; the reply ranker
66
+ * does). A choice's phrase picks only when the rest of the answer is courtesy, connecting words, numbers or `templateWords`
67
+ * (isReaderFiller, the rule of profile.whole_phrases); otherwise ''. Keys, YES words and agent/exit picks are pickChoice's
68
+ * (already whole-answer). "where is my order, please" picks; "it says delivered but I never got it" does not.
69
+ */
70
+ export function pickWholeChoice(answer: any, choices: any, templateWords?: any[]): any;
64
71
  export namespace ANSWER_WORDS {
65
72
  let yes: string[];
66
73
  let no: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/helpers/answer.js"],"names":[],"mappings":"AA0NA;;;GAGG;AACH,wEAkBC;AAED,qHAAqH;AACrH,+CAGC;AAED;;;;GAIG;AACH,mDAIC;AAED;;;;GAIG;AACH,kDAIC;AAED,+HAA+H;AAC/H,oDAIC;AAcD,2GAA2G;AAC3G,uDAGC;AAOD;;;;;GAKG;AACH,+DAUC;AAKD;;;;GAIG;AACH,oDAEC;AAuBD;;;;;;GAMG;AACH,mDAAmF;AAEnF,kGAAkG;AAClG;;;EAqCC;AAqBD,oEAqBC;AASD,gJAAgJ;AAChJ,sEAGC;AAED;;;;;;;;;GASG;AACH,6EA4GC;;;;;;;;AA/gBD,qCAKwE"}
1
+ {"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/helpers/answer.js"],"names":[],"mappings":"AA0NA;;;GAGG;AACH,wEAkBC;AAED,qHAAqH;AACrH,+CAGC;AAED;;;;GAIG;AACH,mDAIC;AAED;;;;GAIG;AACH,kDAIC;AAED,+HAA+H;AAC/H,oDAIC;AAcD,2GAA2G;AAC3G,uDAGC;AAOD;;;;;GAKG;AACH,+DAUC;AAKD;;;;GAIG;AACH,oDAEC;AAuBD;;;;;;GAMG;AACH,mDAAmF;AAEnF,kGAAkG;AAClG;;;EAqCC;AAqBD,oEAqBC;AASD,gJAAgJ;AAChJ,sEAGC;AAED;;;;;;;;;GASG;AACH,6EA4GC;AAED;;;;;GAKG;AACH,uFAeC;;;;;;;;AAtiBD,qCAKwE"}
@@ -599,3 +599,27 @@ export function pickChoice(answer, choices, acceptOther) {
599
599
  return '';
600
600
  }
601
601
  }
602
+ /**
603
+ * pickChoice for a flow's own word reader, tight (owner 2026-11-24: a word inside a sentence never decides; the reply ranker
604
+ * does). A choice's phrase picks only when the rest of the answer is courtesy, connecting words, numbers or `templateWords`
605
+ * (isReaderFiller, the rule of profile.whole_phrases); otherwise ''. Keys, YES words and agent/exit picks are pickChoice's
606
+ * (already whole-answer). "where is my order, please" picks; "it says delivered but I never got it" does not.
607
+ */
608
+ export function pickWholeChoice(answer, choices, templateWords = []) {
609
+ const key = pickChoice(answer, choices, false);
610
+ const choice = (Array.isArray(choices) ? choices : []).find((c) => c && c.key === key);
611
+ if (!key || !choice) {
612
+ return key;
613
+ }
614
+ else {
615
+ const plain = (x) => ' ' + normalize(String(x ?? '').replace(/[^\p{L}\p{N}'\s]/gu, ' ')).replace(/\s+/g, ' ').trim() + ' ';
616
+ const said = plain(answer);
617
+ const hit = (choice.phrases ?? choice.words ?? []).map(plain).filter((p) => p.trim() && said.includes(p)).sort((a, b) => b.length - a.length)[0];
618
+ if (!hit) {
619
+ return key; // a key, a YES word or a spoken key: pickChoice reads those only as the whole answer
620
+ }
621
+ else {
622
+ return isReaderFiller(said.replace(hit, ' '), templateWords) ? key : '';
623
+ }
624
+ }
625
+ }
@@ -3,7 +3,7 @@ export function sharedSandbox(): any;
3
3
  export const EXPRESSION_LIMITS: Readonly<{
4
4
  memoryBytes: number;
5
5
  stackBytes: number;
6
- timeoutMs: 500;
6
+ steps: 1000;
7
7
  }>;
8
8
  export class ExpressionSandbox {
9
9
  constructor(limits?: {});
@@ -14,8 +14,8 @@ export class ExpressionSandbox {
14
14
  compiled: Map<any, any>;
15
15
  released: boolean;
16
16
  };
17
- timeoutMs: 500;
18
- deadline: number;
17
+ stepLimit: 1000;
18
+ steps: number;
19
19
  depth: number;
20
20
  generation: number;
21
21
  owned: any[];
@@ -44,7 +44,7 @@ export class ExpressionSandbox {
44
44
  callback(index: any): (...args: any[]) => any;
45
45
  /** Calls a sandbox function with host arguments, inside the current evaluation. */
46
46
  call(f: any, args: any): any;
47
- /** One evaluation: a deadline, a fresh object table, every handle released at the end. */
47
+ /** One evaluation: a step budget, a fresh object table, every handle released at the end. */
48
48
  scope(run: any, approved: any): any;
49
49
  compile(source: any): any;
50
50
  hostGet(idH: any, kH: any): any;
@@ -1 +1 @@
1
- {"version":3,"file":"expression-sandbox.d.ts","sourceRoot":"","sources":["../../src/helpers/expression-sandbox.js"],"names":[],"mappings":"AA6dA,4FAA4F;AAC5F,qCAA8E;AArc9E;;;;GAA0H;AA4K1H;IACG,yBAuCC;IAjCE;;;;;;MAAc;IACd,eAA0B;IAC1B,iBAAiB;IACjB,cAAc;IACd,mBAAmB;IACnB,aAAe;IACf,cAAoB;IACpB,gBAAkB;IAAE,yBAA0B;IAC9C,YAAc;IAAE,qBAAsB;IACtC,iCAA+B;IAC/B,8BAA+B;IAK/B,SAAc;IAcd,SAAoB;IAMvB,kFAAkF;IAClF,gBAA4D;IAE5D,sCAOC;IAED,iBAAwC;IAExC,kFAAkF;IAClF,6BAGC;IAGD,iBAsBC;IAED,kEAAkE;IAClE,qBAIC;IAGD,iBAmBC;IAED,8BASC;IAED,qBAGC;IAED,iFAAiF;IACjF,uBAEW,GAAG,WAAI,SAKjB;IAED,mFAAmF;IACnF,6BAQC;IAED,0FAA0F;IAC1F,oCAuBC;IAED,0BAYC;IAGD,gCAGC;IACD,yCAKC;IACD,gCAAkI;IAClI,gCAAiI;IACjI,wBAA+G;IAC/G,gCAKC;IACD,oDAYC;IAGD,wHAAwH;IACxH,gFAYC;IAED;wHACoH;IACpH;;;;;YA+BC;CACH"}
1
+ {"version":3,"file":"expression-sandbox.d.ts","sourceRoot":"","sources":["../../src/helpers/expression-sandbox.js"],"names":[],"mappings":"AAkeA,4FAA4F;AAC5F,qCAA8E;AArc9E;;;;GAAuH;AA4KvH;IACG,yBAuCC;IAjCE;;;;;;MAAc;IACd,gBAAsB;IACtB,cAAe;IACf,cAAc;IACd,mBAAmB;IACnB,aAAe;IACf,cAAoB;IACpB,gBAAkB;IAAE,yBAA0B;IAC9C,YAAc;IAAE,qBAAsB;IACtC,iCAA+B;IAC/B,8BAA+B;IAK/B,SAAc;IAcd,SAAoB;IAMvB,kFAAkF;IAClF,gBAA4D;IAE5D,sCAOC;IAED,iBAAwC;IAExC,kFAAkF;IAClF,6BAGC;IAGD,iBAsBC;IAED,kEAAkE;IAClE,qBAIC;IAGD,iBAmBC;IAED,8BASC;IAED,qBAGC;IAED,iFAAiF;IACjF,uBAEW,GAAG,WAAI,SAKjB;IAED,mFAAmF;IACnF,6BAQC;IAED,6FAA6F;IAC7F,oCAuBC;IAED,0BAYC;IAGD,gCAGC;IACD,yCAKC;IACD,gCAAkI;IAClI,gCAAiI;IACjI,wBAA+G;IAC/G,gCAKC;IACD,oDAYC;IAGD,wHAAwH;IACxH,gFAYC;IAED;wHACoH;IACpH;;;;;YA+BC;CACH"}
@@ -21,7 +21,12 @@ const UNDEF = MARK + 'u', ABSENT = MARK + 'a';
21
21
  const BUILTINS = new Set(['Object', 'Date', 'Math', 'String', 'Number', 'Boolean', 'Array', 'JSON']);
22
22
  const identifier = /^[A-Za-z_$][\w$]*$/;
23
23
  const COMPILED_CACHE = 1000;
24
- export const EXPRESSION_LIMITS = Object.freeze({ memoryBytes: 256 * 1024 * 1024, stackBytes: 1024 * 1024, timeoutMs: 500 });
24
+ // steps: the interrupt handler's calls in one evaluation, which QuickJS makes at a fixed count of executed bytecode, so the
25
+ // limit is the expression's own work: the same verdict on any machine, under any load, and a trusted helper the expression
26
+ // calls (readFormAnswer, matchInputs) is not counted. Measured 2026-11-24 over 7.29 M evaluations (all AIDevelopment flow
27
+ // suites and jsfe's): at most 6 steps, 99.99% at 3 or fewer; a runaway loop makes 1.7-30 steps per ms, so 1,000 stops one
28
+ // within ~30-600 ms.
29
+ export const EXPRESSION_LIMITS = Object.freeze({ memoryBytes: 256 * 1024 * 1024, stackBytes: 1024 * 1024, steps: 1000 });
25
30
  // Guest runtime. The host functions it is given are captured and removed from the global object before anything else
26
31
  // runs; its API is the script's completion value, never a global.
27
32
  const GUEST = String.raw `(function () {
@@ -196,14 +201,14 @@ const guestError = (ctx, handle) => {
196
201
  };
197
202
  export class ExpressionSandbox {
198
203
  constructor(limits = {}) {
199
- const { memoryBytes, stackBytes, timeoutMs } = { ...EXPRESSION_LIMITS, ...limits };
204
+ const { memoryBytes, stackBytes, steps } = { ...EXPRESSION_LIMITS, ...limits };
200
205
  const rt = QuickJS.newRuntime();
201
206
  rt.setMemoryLimit(memoryBytes);
202
207
  rt.setMaxStackSize(stackBytes);
203
208
  const res = { rt, ctx: null, handles: [], compiled: new Map(), released: false };
204
209
  this.res = res;
205
- this.timeoutMs = timeoutMs;
206
- this.deadline = 0;
210
+ this.stepLimit = steps;
211
+ this.steps = -1; // -1 outside an evaluation: nothing is counted or interrupted
207
212
  this.depth = 0;
208
213
  this.generation = 0;
209
214
  this.owned = [];
@@ -215,7 +220,16 @@ export class ExpressionSandbox {
215
220
  this.namespaces = new WeakMap(); // a named-function namespace -> its guest object
216
221
  this.namespaceCache = new Map(); // compiled once per source (see defineNamespace)
217
222
  const self = new WeakRef(this);
218
- rt.setInterruptHandler(() => { const s = self.deref(); return !s || (s.deadline !== 0 && Date.now() > s.deadline); });
223
+ rt.setInterruptHandler(() => { const s = self.deref(); if (!s) {
224
+ return true;
225
+ }
226
+ else if (s.steps < 0) {
227
+ return false;
228
+ }
229
+ else {
230
+ s.steps++;
231
+ return s.steps > s.stepLimit;
232
+ } });
219
233
  const ctx = rt.newContext();
220
234
  res.ctx = ctx;
221
235
  this.ctx = ctx;
@@ -390,7 +404,7 @@ export class ExpressionSandbox {
390
404
  const encoded = this.own(this.guest('enc', r.value));
391
405
  return this.inn(JSON.parse(this.ctx.getString(encoded)));
392
406
  }
393
- /** One evaluation: a deadline, a fresh object table, every handle released at the end. */
407
+ /** One evaluation: a step budget, a fresh object table, every handle released at the end. */
394
408
  scope(run, approved) {
395
409
  const outer = this.depth === 0;
396
410
  const previousApproved = this.approved;
@@ -400,7 +414,7 @@ export class ExpressionSandbox {
400
414
  if (this.res.released)
401
415
  throw new Error('expression sandbox released');
402
416
  this.generation++;
403
- this.deadline = Date.now() + this.timeoutMs;
417
+ this.steps = 0;
404
418
  }
405
419
  this.depth++;
406
420
  try {
@@ -410,7 +424,7 @@ export class ExpressionSandbox {
410
424
  this.depth--;
411
425
  this.approved = previousApproved;
412
426
  if (outer) {
413
- this.deadline = 0;
427
+ this.steps = -1;
414
428
  for (const h of this.owned)
415
429
  if (h.alive)
416
430
  h.dispose();
@@ -52,7 +52,9 @@ export namespace STANDARD_FUNCTIONS {
52
52
  export { isAmountAnswer };
53
53
  export { amountInAnswer };
54
54
  export { pickChoice };
55
+ export { pickWholeChoice };
55
56
  export { withoutPromptEcho };
57
+ export { isReaderFiller };
56
58
  export { readEmail };
57
59
  export { emailWithoutEnding };
58
60
  export { emailEnding };
@@ -206,7 +208,9 @@ import { isSpelledFragment } from './answer.js';
206
208
  import { isAmountAnswer } from './answer.js';
207
209
  import { amountInAnswer } from './answer.js';
208
210
  import { pickChoice } from './answer.js';
211
+ import { pickWholeChoice } from './answer.js';
209
212
  import { withoutPromptEcho } from './answer.js';
213
+ import { isReaderFiller } from './answer.js';
210
214
  import { readEmail } from './contact.js';
211
215
  import { emailWithoutEnding } from './contact.js';
212
216
  import { emailEnding } from './contact.js';
@@ -310,5 +314,5 @@ import { sendables } from './sendables.js';
310
314
  import { chatTranscript } from './sendables.js';
311
315
  import { conversationCopy } from './sendables.js';
312
316
  import { CONVERSATION_KEY } from './sendables.js';
313
- 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, 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 };
314
318
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CACyC,iCAAiC;+BAIoO,wBAAwB;2CAHxP,0BAA0B;qCAA1B,0BAA0B;gCAA1B,0BAA0B;mCAC8F,qBAAqB;kCAArB,qBAAqB;iCAArB,qBAAqB;qCAArB,qBAAqB;iCAArB,qBAAqB;wCAArB,qBAAqB;mCAArB,qBAAqB;oCAArB,qBAAqB;6CAArB,qBAAqB;qCACvG,wBAAwB;2CAAxB,wBAAwB;+CAAxB,wBAAwB;uCAAxB,wBAAwB;gCACkK,wBAAwB;4BAAxB,wBAAwB;8BAAxB,wBAAwB;iCAAxB,wBAAwB;gCAAxB,wBAAwB;0CAAxB,wBAAwB;gCAAxB,wBAAwB;iCAAxB,wBAAwB;oCAAxB,wBAAwB;6BAAxB,wBAAwB;u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
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, 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, 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, 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:12b7415283ddd8f6d0f359c9a16e568cdb7d0c22f756fb1d76963213d6eaa3c7";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:6e88e2bd77a0498fccf88a255a31e92e1e8a16848d8d04f2bd5e0dc498283e42";
@@ -288,7 +288,7 @@ An unreadable answer with any words goes to the reply ranker, offered the questi
288
288
 
289
289
  `confirm_edit: true` on a `text` input of the form that holds a value: the read-back also offers the ranker ADD (the reply is appended to that text) and REPLACE (the reply takes its place, a leading "no," dropped); the form is then confirmed again.
290
290
 
291
- `whole_phrases: true` on a `choice`, or on a `pattern` that reads words: a word reading picks only when the whole reply is accounted for by its phrase, another input's argument (digits, an amount, a card), courtesy, connecting words and the input's `template_words` ("pay $50 with my Visa card"). Anything else goes to the reply ranker, offered the choices as above. Keypad keys and digit readings are arguments and read as before. Off by default.
291
+ `whole_phrases: true` on a `choice`, or on a `pattern` that reads words: a word reading picks only when the whole reply is accounted for by its phrase, another input's argument (digits, an amount, a card), courtesy, connecting words and the input's `template_words` ("pay $50 with my Visa card"). Anything else goes to the reply ranker, offered the choices as above. Keypad keys and digit readings are arguments and read as before. Off by default. A flow's own word reader gets the same rule from `pickWholeChoice(answer, choices, templateWords)`: `pickChoice`'s pick, kept only when the rest of the answer is courtesy, connecting words, numbers or `templateWords`, else `''` (the reply ranker reads it).
292
292
 
293
293
  A choice marked `current_only` is read only at its own question: neither the word reader nor the reply ranker offers it while another question is asked (a route's `done` or `switch` is never picked for a NO or a sub account said at the amount question). Written cents (`72.45`, `$72.45`, `287,15`) are an amount by shape: out of order they fill an open amount, and beside another field's reading (`51:72.45` at a sub account question) they are that amount, never digits of a security code or ZIP code.
294
294
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.91.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",