jsfe 1.73.2 → 1.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/forms/flows.d.ts.map +1 -1
- package/dist/forms/flows.js +12 -2
- package/dist/forms/identity-flows.d.ts.map +1 -1
- package/dist/forms/identity-flows.js +8 -3
- package/dist/helpers/contact.d.ts +6 -0
- package/dist/helpers/contact.d.ts.map +1 -1
- package/dist/helpers/contact.js +48 -5
- package/dist/helpers/form-conversation.d.ts +13 -0
- package/dist/helpers/form-conversation.d.ts.map +1 -1
- package/dist/helpers/form-conversation.js +38 -0
- package/dist/helpers/form-state.d.ts.map +1 -1
- package/dist/helpers/form-state.js +8 -0
- package/dist/helpers/index.d.ts +7 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +3 -3
- package/dist/helpers/match-inputs.d.ts.map +1 -1
- package/dist/helpers/match-inputs.js +10 -2
- package/dist/runtime-identity.js +1 -1
- package/docs/architecture-guide.md +8 -0
- package/docs/copilot-reference.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -409,6 +409,14 @@ An input with `profile.whole_phrases` (default off; `choice`, or a `pattern` tha
|
|
|
409
409
|
|
|
410
410
|
**A number of the wrong length says so (jsfe 1.72.0, owner 2026-11-15).** A numeric field (`digits`, `phone` or `identifier` kind) that declares its length (`digits: {min, max}`) is opted in by that declaration (a pattern field reads only what its pattern matches); the `card_number`, `card_cvv`, `card_zip`, `zip`, `phone`, `account_number` and `ssn_last4` presets declare one. At the field's own question, the one number of three or more digits in the answer, when its length is outside the declaration and no other field read it or was refused for it, is a reading of that field. Its validation rejects it, and the message rides with the question that re-asks: "I heard 8 digits; a card number has 16, or 15 for American Express." A field sets the wording with `length_message` / `length_message_es` (`{heard}`, `{lengths}`); without one the message is generic. Routing is unchanged: the reading takes the path an in-range number takes. Also: when nothing read an answer's digits, a `digits` field asked now takes the one piece of a run joined across a pause that has its length ("Nuevecientos 44. 9 0 0 4 4." at a ZIP is 90044), and `card_expiration` reads four single digits with words around them ("0 6 3 0 30 se vence" is 0630) through `profile.asked_regex`: a pattern read only at the field's own question when nothing else read the answer, stored as its digits (out of order, "1 2 3 6" stays a security code). The must_complete first-task line now names how to cancel: "I understand, first let's enter your new card details. To cancel, press the asterisk key or say EXIT." ("type EXIT" in text; SALIR in Spanish).
|
|
411
411
|
|
|
412
|
+
**A conflict the request carried is asked at its input (jsfe 1.74.0, owner 2026-11-17).** When values given at activation
|
|
413
|
+
(nothing asked yet) compete for one exclusive group, such as an amount and a payment option, the conflict is kept on the form
|
|
414
|
+
(`deferFormClarification`) and asked in place of the question of its input when the form reaches it (`takeFormClarification`,
|
|
415
|
+
run-form), like a validator's line. A form that stops or ends first never asks it; a value accepted for that input or its group
|
|
416
|
+
settles it. A flow that fills inputs on its own treats `formClarificationKept(cargo, form, name)` like a pending value. A
|
|
417
|
+
conflict in a reply is the caller answering now and is still asked at once. Prod 2026-11-16: a payment with nothing due said so
|
|
418
|
+
and, in the same reply, asked "Is 1500 your amount or your payment option?".
|
|
419
|
+
|
|
412
420
|
**An amount-shaped number is no ZIP (jsfe 1.43.0, owner 2026-11-11).** `profile.refuse_amount_shape: true` on a `digits` profile (default off): out of order, three digits then two ("119 19") read as dollars and cents as readily as one number, so they are not this field's digits; at its own question the field was asked for, and it reads. The `zip` and `card_zip` presets declare it, and `card_zip` also declares `confirm_out_of_order` (word ZIP / CÓDIGO POSTAL): out of order a bare five-digit number fills the billing ZIP only beside the word (prod 2026-11-11: "119 19." at the save-card question replaced an answered billing ZIP and the charge failed AVS).
|
|
413
421
|
|
|
414
422
|
**Declared choices (`responseChoices`, jsfe 1.14):** a step may name a flow variable of type array holding
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA6HA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA6HA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;AA2mBD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AAp7BM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmJ9G,4CAEqI;AA4/BrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
|
package/dist/forms/flows.js
CHANGED
|
@@ -382,7 +382,7 @@ const runForm = {
|
|
|
382
382
|
id: 'run-form', name: 'RunForm', version: '1.0.0',
|
|
383
383
|
description: "Worker (shared scope, called by a form flow): the FORM loop. Merges the form's activation parameters into cargo.forms[rf_form] once, then each pass finds the first missing input whose `when` holds, collects it (collect-input) or runs its sub-form, and replaces itself until nothing is missing. Sets rf_status: 'complete' | 'stopped' (a path in rf_stop was set) | 'unwound'. Reads the form's `inputs`, `parent_form`, `result_input`, `questions`, `provides`, `exit_context(_es)`.",
|
|
384
384
|
parameters: [{ name: 'rf_resume_parent', type: 'boolean', description: 'Yield a context collector when its owning form accepts a change' }, { name: 'rf_form', type: 'string', description: 'The form id (the calling form flow id)' }, { name: 'rf_resume', type: 'string', description: "'true' on the loop's own replays" }, { name: 'rf_stop', type: 'string', description: 'A cargo path (or list) that ends the form when set' }],
|
|
385
|
-
variables: vars({ rf_stop: '', rf_resume: '', rf_resume_parent: false, rf_parent_resume: null, rf_status: '', rf_next: '', rf_next_form: '', rf_questions: [], rf_provides: null, rf_max: 0, rf_pending: [], rf_deferred: [], rf_proposal: null, rf_proposal_readings: [] }),
|
|
385
|
+
variables: vars({ rf_stop: '', rf_resume: '', rf_resume_parent: false, rf_parent_resume: null, rf_status: '', rf_next: '', rf_next_form: '', rf_questions: [], rf_provides: null, rf_max: 0, rf_pending: [], rf_deferred: [], rf_proposal: null, rf_proposal_readings: [], rf_clarify: null }),
|
|
386
386
|
steps: [
|
|
387
387
|
SIDE('rf_resume_policy', '(rf_resume_parent === true && cargo.forms[rf_form] && cargo.forms[rf_form].context_only ? (cargo.forms[rf_form].resume_on_parent_change=true) : true, true)'),
|
|
388
388
|
SET('rf_ancestor_resume', 'rf_parent_resume', 'formParentResume(cargo,rf_form,rf_resume_parent,nextFormProposal)'),
|
|
@@ -411,6 +411,10 @@ const runForm = {
|
|
|
411
411
|
SET('rf_find_form', 'rf_next_form', "rf_next ? ((cargo.forms[rf_form].specs || []).filter(function (i) { return i.name === rf_next; })[0] || {}).form || '' : ''"),
|
|
412
412
|
SET('rf_done', 'rf_status', "(function () { var stops = [].concat(typeof rf_stop !== 'undefined' && rf_stop ? rf_stop : []); return stops.some(function (p) { return !!formPath({cargo:cargo},p); }) ? 'stopped' : (rf_next ? '' : 'complete'); })()"),
|
|
413
413
|
WHEN('rf_complete', "rf_status === 'complete' || rf_status === 'stopped'", END('rf_complete_end')),
|
|
414
|
+
// A conflict kept from the request is asked now, in place of the question of its input (deferFormClarification).
|
|
415
|
+
SET('rf_clarify_take', 'rf_clarify', 'takeFormClarification(cargo, rf_form, rf_next)'),
|
|
416
|
+
WHEN('rf_clarify_ask', 'rf_clarify', FLOW('rf_clarify_flow', 'disambiguate-input', 'call', { readings: '{{rf_clarify}}', hits: [], remaining: [] })),
|
|
417
|
+
WHEN('rf_clarify_repeat', 'rf_clarify', FLOW('rf_clarify_again', 'run-form', 'replace', { rf_form: '{{rf_form}}', rf_resume: 'true', rf_stop: '{{rf_stop}}', rf_resume_parent: '{{rf_resume_parent}}' })),
|
|
414
418
|
SET('rf_questions', 'rf_questions', 'cargo.forms[rf_form].questions'),
|
|
415
419
|
SET('rf_provides', 'rf_provides', 'cargo.forms[rf_form].providers'),
|
|
416
420
|
{ id: 'rf_collect', type: 'CASE', branches: {
|
|
@@ -752,10 +756,16 @@ const accept = {
|
|
|
752
756
|
id: 'collect-input-accept', name: 'CollectInputAccept', version: '2.0.0', scope: 'isolated',
|
|
753
757
|
description: 'Worker: validate all readings, commit accepted changes once with transitive invalidation, then acknowledge and run declared callbacks.',
|
|
754
758
|
parameters: [{ name: 'hits', type: 'array' }],
|
|
755
|
-
variables: vars({ ca_ordered: [], ca_results: [], ca_partition: null }),
|
|
759
|
+
variables: vars({ ca_ordered: [], ca_results: [], ca_partition: null, ca_defer: false }),
|
|
756
760
|
steps: [
|
|
757
761
|
SET('ca_expand', 'hits', 'expandFormActivations(cargo, hits)'),
|
|
758
762
|
SET('ca_partition', 'ca_partition', 'exclusiveFormReadings(cargo, hits)'),
|
|
763
|
+
// Values the request carried (nothing asked yet) that conflict are asked when the form asks their input (owner 2026-11-17,
|
|
764
|
+
// deferFormClarification); the rest of the batch is accepted now. A conflict in a reply is asked at once, below.
|
|
765
|
+
SET('ca_defer_check', 'ca_defer', "ca_partition.ambiguous.length > 1 && ca_partition.ambiguous.every(function (h) { return h.origin === 'activation'; })"),
|
|
766
|
+
WHEN('ca_defer_store', 'ca_defer', SIDE('ca_defer_keep', 'deferFormClarification(cargo, ca_partition.ambiguous)')),
|
|
767
|
+
WHEN('ca_defer_rest', 'ca_defer && ca_partition.hits.length > 0', FLOW('ca_defer_accept', 'collect-input-accept', 'call', { hits: '{{ca_partition.hits}}' })),
|
|
768
|
+
WHEN('ca_defer_return', 'ca_defer', END('ca_deferred_end')),
|
|
759
769
|
WHEN('ca_ambiguous', 'ca_partition.ambiguous.length > 0', FLOW('ca_clarify', 'disambiguate-input', 'call', { readings: '{{ca_partition.ambiguous}}', hits: '{{ca_partition.hits}}' })),
|
|
760
770
|
WHEN('ca_ambiguity_return', 'ca_partition.ambiguous.length > 0', END('ca_clarified_end')),
|
|
761
771
|
SET('ca_order', 'ca_ordered', 'orderFormReadings(cargo, hits)'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AAgDA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,6CAMC;AACD,qHAQC;AASD,4EAMC;AAkGD,2DAOC;AACD,4DAOC;AACD,gHAAgH;AAChH,8DAGC;AAyJD,8EAGC;AA4BD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AApQD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AAuRzC,0BAAsK"}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { defineWorker, defineForm } from './contracts.js';
|
|
3
3
|
import { OTP_EXPIRY_MS } from '../helpers/otp-check.js';
|
|
4
4
|
// maskEmail is a standard function: these functions run as flow expressions too, where it is in scope by name.
|
|
5
|
-
import { maskEmail } from '../helpers/contact.js';
|
|
5
|
+
import { maskEmail, emailAttempt } from '../helpers/contact.js';
|
|
6
|
+
// an answer that tries to give an email is never a phone number (prod 2026-11-17); inlined, so it needs no host function
|
|
7
|
+
const emailTry = `(${emailAttempt.toString()})(contact_text)`;
|
|
6
8
|
const vars = o => Object.fromEntries(Object.entries(o).map(([k, v]) => [k, { type: Array.isArray(v) ? 'array' : v === null || typeof v === 'object' ? 'object' : typeof v, value: v }]));
|
|
7
9
|
const param = (name, description, type = 'string') => ({ name, type, description });
|
|
8
10
|
const set = (id, variable, value) => ({ id, type: 'SET', variable, value });
|
|
@@ -104,6 +106,8 @@ export function contactError(kind, options, es = false) {
|
|
|
104
106
|
const account = options.account_pattern ? (es ? options.account_name_es || options.account_name : options.account_name) : '';
|
|
105
107
|
if (kind === 'international')
|
|
106
108
|
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.";
|
|
109
|
+
if (kind === 'invalid_email')
|
|
110
|
+
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.";
|
|
107
111
|
if (kind === 'invalid_phone')
|
|
108
112
|
return es ? 'El número de teléfono que proporcionó no es válido.' : "Sorry, the phone number you provided isn't valid.";
|
|
109
113
|
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.';
|
|
@@ -132,7 +136,7 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
|
|
|
132
136
|
call('identity_contact_collect', 'collect-service-answer', { profiles: '{{contact_profiles}}', question: '{{contact_question}}', question_es: '{{contact_question_es}}', keypad: '{{contact_keypad}}', prefill: '{{contact_prefill}}', parent_form: '{{contact_options.parent_form}}', context: 'account verification', context_es: 'verificación de cuenta' }),
|
|
133
137
|
set('identity_contact_answer', 'contact_text', expression(contactAnswer, 'cargo.serviceAnswer')),
|
|
134
138
|
set('identity_contact_spoken', 'contact_digits', `(${serviceDigits.toString()})(contact_text)`),
|
|
135
|
-
set('identity_contact_piece', 'contact_digits', "!/@/.test(contact_text) && !readEmail(contact_text) && /^[^0-9]*[0-9][0-9\\s.,-]*[^0-9]*$/.test(contact_digits) ? contact_digits.replace(/\\D/g,'') : ''"),
|
|
139
|
+
set('identity_contact_piece', 'contact_digits', "!/@/.test(contact_text) && !readEmail(contact_text) && !" + emailTry + " && /^[^0-9]*[0-9][0-9\\s.,-]*[^0-9]*$/.test(contact_digits) ? contact_digits.replace(/\\D/g,'') : ''"),
|
|
136
140
|
set('identity_contact_join', 'contact_text', "contact_partial && contact_digits ? String(cargo.gcePartial)+contact_digits : contact_text"),
|
|
137
141
|
set('identity_contact_join_digits', 'contact_digits', "contact_partial && contact_digits ? String(cargo.gcePartial)+contact_digits : contact_digits"), effect('identity_contact_piece_consumed', "(cargo.gcePartial='',cargo.contactIntroSkip=false,true)"),
|
|
138
142
|
when('identity_contact_split', "contact_options.merge_partials && contact_digits && (contact_options.account_shape || []).some(function(s){return String(s.first || '').includes(contact_digits.charAt(0)) && contact_digits.length < Math.min.apply(null,s.lengths || [0]);})", effect('identity_contact_hold', '(cargo.gcePartial=contact_digits,true)')),
|
|
@@ -140,7 +144,7 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
|
|
|
140
144
|
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')),
|
|
141
145
|
set('identity_contact_identifier', 'contact_id', "contact_options.account_pattern ? readIdentifier(contact_text,contact_options.account_pattern) : null"),
|
|
142
146
|
set('identity_contact_phone', 'contact_phone', "readPhone(contact_text) || (validatePhone(contact_digits) ? contact_digits : '')"), set('identity_contact_email', 'contact_mail', 'readEmail(contact_text)'),
|
|
143
|
-
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' : 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' : contact_text.trim().split(/\\s+/).length>=3 && !/[0-9@]/.test(contact_text) ? 'unmapped' : 'invalid'"),
|
|
147
|
+
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' : contact_text.trim().split(/\\s+/).length>=3 && !/[0-9@]/.test(contact_text) ? 'unmapped' : 'invalid'"),
|
|
144
148
|
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.'})"),
|
|
145
149
|
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')),
|
|
146
150
|
cases('identity_contact_route', {
|
|
@@ -152,6 +156,7 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
|
|
|
152
156
|
"condition: contact_kind === 'names_account'": contactReplay('identity_contact_names_account', { contact_options: '{{contact_named_options}}' }),
|
|
153
157
|
"condition: contact_kind === 'international'": contactMiss('identity_contact_international'),
|
|
154
158
|
"condition: contact_kind === 'invalid_phone'": contactMiss('identity_contact_invalid_phone'),
|
|
159
|
+
"condition: contact_kind === 'invalid_email'": contactMiss('identity_contact_invalid_email'),
|
|
155
160
|
"condition: contact_kind === 'unmapped'": { id: 'identity_contact_off_topic', type: 'DISPATCH', onResponse: 'continue', responseContext: 'account identifier: phone number, email address or account number (teléfono, correo o número de cuenta)', outcome: 'unresolved', reason: 'auth_prompt_off_topic' },
|
|
156
161
|
"condition: contact_kind === 'invalid'": contactMiss('identity_contact_missing'), default: effect('identity_contact_typed', 'true')
|
|
157
162
|
}),
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
export function readEmail(text: any, { literal }?: {
|
|
11
11
|
literal?: boolean | undefined;
|
|
12
12
|
}): string;
|
|
13
|
+
/**
|
|
14
|
+
* True when an answer tries to give an email address that could not be read: an @, "arroba", or a known provider's name
|
|
15
|
+
* ("at gmail", "Yahoo"), so the caller hears the email was incomplete rather than that a phone number was invalid (prod
|
|
16
|
+
* 2026-11-17: "Juana Perez 12 34 at gmail." heard "the phone number you provided isn't valid").
|
|
17
|
+
*/
|
|
18
|
+
export function emailAttempt(text: any): boolean;
|
|
13
19
|
/**
|
|
14
20
|
* The 10-digit North American number in the answer (a leading 1 dropped), or ''. A caller who restates the number
|
|
15
21
|
* ("Area code 21. 213 555 0147.", "Area code, 213 555. Area code 213-555-0147.") is read by the last complete number
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/helpers/contact.js"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH;;
|
|
1
|
+
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/helpers/contact.js"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH;;WAiDC;AAoBD;;;;GAIG;AACH,iDAEC;AAID;;;;;GAKG;AACH,0CAWC;AAED;;;;;GAKG;AACH,0DAgBC;AAED,qHAAqH;AACrH,2DAIC;AAED;;;;GAIG;AACH;;;SAmBC;AAED;;;GAGG;AACH,sDAOC;AAED;;;;;GAKG;AACH,yEAUC;AAQD;;;;;GAKG;AACH,qDAIC;AAED,mHAAmH;AACnH,oDAIC"}
|
package/dist/helpers/contact.js
CHANGED
|
@@ -30,11 +30,24 @@ export function readEmail(text, { literal = false } = {}) {
|
|
|
30
30
|
if (addresses.length)
|
|
31
31
|
return new Set(addresses).size === 1 ? addresses[0] : '';
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
let spoken = String(text ?? '')
|
|
34
|
+
// how speech engines write the commonest providers and endings (prod 2026-11-10..17): "g mail", "Gmaildot",
|
|
35
|
+
// "punt com", "ponto com", "Gmail com"
|
|
36
|
+
.replace(/\b(?:g[\s-]mail|gee\s?mail|gmai|gmial|gamil|gmaill)\b/gi, 'gmail')
|
|
37
|
+
.replace(/\b(gmail|hotmail|yahoo|outlook|icloud|aol)dot\b/gi, '$1') // its "com" was lost: read as the bare provider
|
|
38
|
+
.replace(/(?:^|\s+)(?:at|arroba)\s+/gi, ' @ ')
|
|
39
|
+
.replace(/\s+(?:dot|punto|punt|ponto)\s+/gi, '.')
|
|
40
|
+
.replace(/\b(gmail|hotmail|yahoo|outlook|icloud|aol)\s+(?:com|con)\b/gi, '$1.com')
|
|
36
41
|
.replace(/\s+(?:underscore|gui[oó]n bajo)[.,]?(?:\s+|$)/gi, '_')
|
|
37
42
|
.replace(/\s+(?:dash|hyphen|gui[oó]n)[.,]?(?:\s+|$)/gi, '-');
|
|
43
|
+
// a provider with its ending and no "at" (the speech engine dropped it): "Castillo Mónica 22 Gmail punto com"
|
|
44
|
+
const inferred = !spoken.includes('@') && PROVIDER_WITH_ENDING.test(spoken);
|
|
45
|
+
if (inferred) {
|
|
46
|
+
spoken = spoken.replace(PROVIDER_WITH_ENDING, ' @ $1');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// the @ was said or typed, or there is none
|
|
50
|
+
}
|
|
38
51
|
const at = spoken.lastIndexOf('@'); // a speech engine may write an @ inside the name too: the last one is the address's
|
|
39
52
|
if (at < 0) {
|
|
40
53
|
return '';
|
|
@@ -55,9 +68,39 @@ export function readEmail(text, { literal = false } = {}) {
|
|
|
55
68
|
local.unshift(pieces[k]);
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
// "gmail dot" cut short (a window of "gmail dot com") is no bare gmail
|
|
72
|
+
const fixed = /^\s*(?:dot|punto|punt|ponto)\b/i.test(after.slice(after.toLowerCase().indexOf(domain.toLowerCase()) + domain.length)) ? domain : providerDomain(domain);
|
|
73
|
+
const email = (local.join('') + '@' + fixed).toLowerCase();
|
|
74
|
+
// a guessed @ or ending needs a name with a letter: "8 4 Gmail punto com" is the end of an address given across turns
|
|
75
|
+
const guessed = inferred || fixed !== domain.toLowerCase();
|
|
76
|
+
return /^[a-z0-9][a-z0-9._%+-]*@[a-z0-9.-]+\.[a-z]{2,}$/.test(email) && (!guessed || /[a-z]/i.test(local.join(''))) ? email : '';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const PROVIDER_WITH_ENDING = /\s+((?:gmail|hotmail|yahoo|outlook|icloud|aol)\.(?:com|net|es|com\.mx|co\.uk)\b)/i;
|
|
80
|
+
/**
|
|
81
|
+
* A provider's domain as callers say it: "gmail" alone is gmail.com (the one consumer Gmail address), and a misheard
|
|
82
|
+
* ending of a known provider (".con", ".cmo") is ".com". Another provider without its ending is left alone: hotmail and
|
|
83
|
+
* yahoo have country domains, so the caller is asked again (owner 2026-11-17).
|
|
84
|
+
*/
|
|
85
|
+
function providerDomain(domain) {
|
|
86
|
+
const d = domain.toLowerCase();
|
|
87
|
+
if (d === 'gmail') {
|
|
88
|
+
return 'gmail.com';
|
|
60
89
|
}
|
|
90
|
+
else if (/^(?:gmail|hotmail|yahoo|outlook|icloud|aol)\.(?:con|cmo|calm|come|comm|om)$/.test(d)) {
|
|
91
|
+
return d.replace(/\.[a-z]+$/, '.com');
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return d;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* True when an answer tries to give an email address that could not be read: an @, "arroba", or a known provider's name
|
|
99
|
+
* ("at gmail", "Yahoo"), so the caller hears the email was incomplete rather than that a phone number was invalid (prod
|
|
100
|
+
* 2026-11-17: "Juana Perez 12 34 at gmail." heard "the phone number you provided isn't valid").
|
|
101
|
+
*/
|
|
102
|
+
export function emailAttempt(text) {
|
|
103
|
+
return /@|\barroba\b|\b(?:g\s?mail|gmai|hotmail|hot mail|yahoo|outlook|icloud|aol)\b/i.test(String(text ?? ''));
|
|
61
104
|
}
|
|
62
105
|
const northAmerican = (digits) => digits.length === 11 && digits.startsWith('1') ? digits.slice(1) : digits.length === 10 ? digits : '';
|
|
63
106
|
/**
|
|
@@ -6,6 +6,19 @@ export function clearFormMisses(cargo: any, id: any, input: any): boolean;
|
|
|
6
6
|
* exited never says one later (owner 2026-11-14).
|
|
7
7
|
*/
|
|
8
8
|
export function keepFormLine(cargo: any, id: any, message: any, message_es: any): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Which input an activation value belongs to is asked when the form asks that input, never when the form opens (owner
|
|
11
|
+
* 2026-11-17; prod 2026-11-16 18:15: a payment request carrying 1500 and the monthly option said "nothing is due" and, in the
|
|
12
|
+
* same reply, "Is 1500 your amount or your payment option?"). The conflicting readings are kept on their form; run-form asks
|
|
13
|
+
* them in place of the question of the first of their inputs it reaches (takeFormClarification). A form that stops, ends or
|
|
14
|
+
* fills those inputs first never asks. A conflict in a reply is the caller answering now and is still asked at once.
|
|
15
|
+
*/
|
|
16
|
+
export function deferFormClarification(cargo: any, readings: any): boolean;
|
|
17
|
+
/** The kept clarification for input `next` of form `id` (one of its readings is `next` or a member of its group), removed from the form; else null. */
|
|
18
|
+
export function takeFormClarification(cargo: any, id: any, next: any): any;
|
|
19
|
+
/** Whether a conflict kept from the request names input `name` of form `id`: the caller gave a value for it, so a flow that
|
|
20
|
+
* fills inputs on its own (a default plan) leaves it for the form to ask, as it does for a pending value. */
|
|
21
|
+
export function formClarificationKept(cargo: any, id: any, name: any): any;
|
|
9
22
|
/** Start of a turn: lines kept by the last turn are obsolete (said with a question then, or never to be said). */
|
|
10
23
|
export function clearFormLines(cargo: any): boolean;
|
|
11
24
|
export function missFormInput(cargo: any, id: any, input: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/form-conversation.js"],"names":[],"mappings":"AAMA,0EAGC;AACD;;;;;GAKG;AACH,0FAKC;AAYD,kHAAkH;AAClH,oDAGC;AACD,oEAGC;AACD;;qGAEqG;AACrG,2EAWC;AAKD;;0GAE0G;AAC1G,gFAIC;AACD;;;;;GAKG;AACH;;;SAQC;AACD;+CAC+C;AAC/C,sEAGC;AACD;;;GAGG;AACH,+GAaC;AAMD,oEAOC;AACD,8EAKC;AAED,yGAAyG;AACzG;;;;;;;;;;;;;;;;;;;;EAUC;AAED,sGAAsG;AACtG;;;;;;;;;;;;;;;;;;;;EAeC;AAED;2HAC2H;AAC3H,8EAOC"}
|
|
1
|
+
{"version":3,"file":"form-conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/form-conversation.js"],"names":[],"mappings":"AAMA,0EAGC;AACD;;;;;GAKG;AACH,0FAKC;AACD;;;;;;GAMG;AACH,2EAOC;AACD,uJAAuJ;AACvJ,2EAUC;AACD;6GAC6G;AAC7G,2EAGC;AAYD,kHAAkH;AAClH,oDAGC;AACD,oEAGC;AACD;;qGAEqG;AACrG,2EAWC;AAKD;;0GAE0G;AAC1G,gFAIC;AACD;;;;;GAKG;AACH;;;SAQC;AACD;+CAC+C;AAC/C,sEAGC;AACD;;;GAGG;AACH,+GAaC;AAMD,oEAOC;AACD,8EAKC;AAED,yGAAyG;AACzG;;;;;;;;;;;;;;;;;;;;EAUC;AAED,sGAAsG;AACtG;;;;;;;;;;;;;;;;;;;;EAeC;AAED;2HAC2H;AAC3H,8EAOC"}
|
|
@@ -26,6 +26,44 @@ export function keepFormLine(cargo, id, message, message_es) {
|
|
|
26
26
|
(state.lines ||= []).push({ message: en, message_es: String(message_es || '').trim() || en });
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Which input an activation value belongs to is asked when the form asks that input, never when the form opens (owner
|
|
31
|
+
* 2026-11-17; prod 2026-11-16 18:15: a payment request carrying 1500 and the monthly option said "nothing is due" and, in the
|
|
32
|
+
* same reply, "Is 1500 your amount or your payment option?"). The conflicting readings are kept on their form; run-form asks
|
|
33
|
+
* them in place of the question of the first of their inputs it reaches (takeFormClarification). A form that stops, ends or
|
|
34
|
+
* fills those inputs first never asks. A conflict in a reply is the caller answering now and is still asked at once.
|
|
35
|
+
*/
|
|
36
|
+
export function deferFormClarification(cargo, readings) {
|
|
37
|
+
const list = Array.isArray(readings) ? readings.filter(Boolean) : [];
|
|
38
|
+
const state = cargo.forms?.[list[0]?.form];
|
|
39
|
+
if (!state || list.length < 2)
|
|
40
|
+
throw new Error('A deferred clarification needs two or more readings of an open form');
|
|
41
|
+
if (list.some(r => r.form !== state.id))
|
|
42
|
+
throw new Error('A deferred clarification must belong to one form');
|
|
43
|
+
(state.clarify ||= []).push(list.map(r => ({ ...r })));
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
/** The kept clarification for input `next` of form `id` (one of its readings is `next` or a member of its group), removed from the form; else null. */
|
|
47
|
+
export function takeFormClarification(cargo, id, next) {
|
|
48
|
+
const state = cargo.forms?.[id];
|
|
49
|
+
if (!state || !next || !Array.isArray(state.clarify) || !state.clarify.length)
|
|
50
|
+
return null;
|
|
51
|
+
const spec = (state.specs || []).find(s => s.name === next);
|
|
52
|
+
const names = new Set([next, ...((spec && spec.any_of) || []).map(i => i.name)]);
|
|
53
|
+
const i = state.clarify.findIndex(group => group.some(r => names.has(r.name)));
|
|
54
|
+
if (i < 0)
|
|
55
|
+
return null;
|
|
56
|
+
const [group] = state.clarify.splice(i, 1);
|
|
57
|
+
if (!state.clarify.length)
|
|
58
|
+
delete state.clarify;
|
|
59
|
+
return group;
|
|
60
|
+
}
|
|
61
|
+
/** Whether a conflict kept from the request names input `name` of form `id`: the caller gave a value for it, so a flow that
|
|
62
|
+
* fills inputs on its own (a default plan) leaves it for the form to ask, as it does for a pending value. */
|
|
63
|
+
export function formClarificationKept(cargo, id, name) {
|
|
64
|
+
const state = cargo.forms?.[id];
|
|
65
|
+
return !!state && Array.isArray(state.clarify) && state.clarify.some(group => group.some(r => r.name === name));
|
|
66
|
+
}
|
|
29
67
|
/** The forms whose lines the question of form `id` says: every open form of its task (the same root form), outermost first. */
|
|
30
68
|
function formRoot(cargo, id) {
|
|
31
69
|
const seen = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-state.d.ts","sourceRoot":"","sources":["../../src/helpers/form-state.js"],"names":[],"mappings":"AAQA,qDAKC;AAKD,oDAEC;AAED,qFAAqF;AACrF,oEAgCC;AA0CD,2FAEC;AACD,8FAcC;AACD,2DAOC;AACD,uEA8CC;AAED;6GAC6G;AAC7G,mFAKC;AACD,kGAAkG;AAClG,2GAQC;AACD,0HAA0H;AAC1H,uEAwBC;AACD,8HAA8H;AAC9H;;;;;EAeC;AACD,uGAAuG;AACvG;;;;;;;;;;;;;;;;;;QA+CC;AAED,0FAA0F;AAC1F;;;SAIC;AACD,gGAAgG;AAChG;;;;;;;;;;;EAQC;AAED,sGAAsG;AACtG,2DAIC;AACD;;;GAGG;AACH;;;;;;;SAkBC;AAED,2FAA2F;AAC3F,oGAIC;AACD,gFAgCC;AAED,2GAA2G;AAC3G;;;EASC;AACD,mEAoBC;AACD,mEAGC;AACD,sEAUC;AACD,+EAEC;AAoCD,qFAYC;AACD,oGAqCC;AACD;;;SAKC;AACD,qEAGC;AACD,gEAgBC;AACD;;uGAEuG;AACvG,sEAGC;AACD,2DAQC;AACD,oGAUC;AAED,uEAAuE;AACvE,wHA+BC;AAED,uHAAuH;AACvH,6EAaC;AACD,mHAAmH;AACnH,
|
|
1
|
+
{"version":3,"file":"form-state.d.ts","sourceRoot":"","sources":["../../src/helpers/form-state.js"],"names":[],"mappings":"AAQA,qDAKC;AAKD,oDAEC;AAED,qFAAqF;AACrF,oEAgCC;AA0CD,2FAEC;AACD,8FAcC;AACD,2DAOC;AACD,uEA8CC;AAED;6GAC6G;AAC7G,mFAKC;AACD,kGAAkG;AAClG,2GAQC;AACD,0HAA0H;AAC1H,uEAwBC;AACD,8HAA8H;AAC9H;;;;;EAeC;AACD,uGAAuG;AACvG;;;;;;;;;;;;;;;;;;QA+CC;AAED,0FAA0F;AAC1F;;;SAIC;AACD,gGAAgG;AAChG;;;;;;;;;;;EAQC;AAED,sGAAsG;AACtG,2DAIC;AACD;;;GAGG;AACH;;;;;;;SAkBC;AAED,2FAA2F;AAC3F,oGAIC;AACD,gFAgCC;AAED,2GAA2G;AAC3G;;;EASC;AACD,mEAoBC;AACD,mEAGC;AACD,sEAUC;AACD,+EAEC;AAoCD,qFAYC;AACD,oGAqCC;AACD;;;SAKC;AACD,qEAGC;AACD,gEAgBC;AACD;;uGAEuG;AACvG,sEAGC;AACD,2DAQC;AACD,oGAUC;AAED,uEAAuE;AACvE,wHA+BC;AAED,uHAAuH;AACvH,6EAaC;AACD,mHAAmH;AACnH,iGA6DC;AACD;;;GAGG;AACH;;;SAcC;AACD,+EASC;AACD,8EAeC;AA9rBM,8CAAmE;AAGnE,+DAA4H"}
|
|
@@ -955,6 +955,14 @@ export function acceptFormReadings(cargo, hits, additionalCandidates = []) {
|
|
|
955
955
|
for (const [id, readings] of groups) {
|
|
956
956
|
const state = cargo.forms[id];
|
|
957
957
|
const cleared = [];
|
|
958
|
+
// A conflict kept from the request (deferFormClarification) is settled once any input it names, or a member of that input's
|
|
959
|
+
// exclusive group, takes a value: it is never asked later, even if the input is reset.
|
|
960
|
+
if (Array.isArray(state.clarify)) {
|
|
961
|
+
const settled = new Set(readings.flatMap(h => { const group = state.specs.find(s => s.any_of && s.any_of.some(i => i.name === h.name)); return [h.name, ...(group ? group.any_of.map(i => i.name) : [])]; }));
|
|
962
|
+
state.clarify = state.clarify.filter(group => !group.some(r => settled.has(r.name)));
|
|
963
|
+
if (!state.clarify.length)
|
|
964
|
+
delete state.clarify;
|
|
965
|
+
}
|
|
958
966
|
for (const group of state.specs.filter(s => s.exclusive && s.any_of)) {
|
|
959
967
|
const selected = readings.filter(h => group.any_of.some(i => i.name === h.name));
|
|
960
968
|
if (new Set(selected.map(h => h.name)).size > 1)
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ export namespace STANDARD_FUNCTIONS {
|
|
|
28
28
|
export { formAcknowledges };
|
|
29
29
|
export { consumeFormFeedback };
|
|
30
30
|
export { keepFormLine };
|
|
31
|
+
export { deferFormClarification };
|
|
32
|
+
export { takeFormClarification };
|
|
33
|
+
export { formClarificationKept };
|
|
31
34
|
export { clearFormLines };
|
|
32
35
|
export { formConversationOutcome };
|
|
33
36
|
export { readMoneyAmount };
|
|
@@ -166,6 +169,9 @@ import { formConcernLine } from './form-conversation.js';
|
|
|
166
169
|
import { formAcknowledges } from './form-conversation.js';
|
|
167
170
|
import { consumeFormFeedback } from './form-conversation.js';
|
|
168
171
|
import { keepFormLine } from './form-conversation.js';
|
|
172
|
+
import { deferFormClarification } from './form-conversation.js';
|
|
173
|
+
import { takeFormClarification } from './form-conversation.js';
|
|
174
|
+
import { formClarificationKept } from './form-conversation.js';
|
|
169
175
|
import { clearFormLines } from './form-conversation.js';
|
|
170
176
|
import { formConversationOutcome } from './form-conversation.js';
|
|
171
177
|
import { readMoneyAmount } from './money.js';
|
|
@@ -284,5 +290,5 @@ import { sendables } from './sendables.js';
|
|
|
284
290
|
import { chatTranscript } from './sendables.js';
|
|
285
291
|
import { conversationCopy } from './sendables.js';
|
|
286
292
|
import { CONVERSATION_KEY } from './sendables.js';
|
|
287
|
-
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, 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, 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, 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, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY };
|
|
293
|
+
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, 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, 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, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY };
|
|
288
294
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.js"],"names":[],"mappings":"
|
|
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;uCAAxB,wBAAwB;sCAAxB,wBAAwB;sCAAxB,wBAAwB;+BAAxB,wBAAwB;wCAAxB,wBAAwB;gCAoBvM,YAAY;8BAAZ,YAAY;kCAAZ,YAAY;uCAAZ,YAAY;qCAAZ,YAAY;qCAAZ,YAAY;gCAnB3G,mBAAmB;gCA2BqF,mBAAmB;4BAAnB,mBAAmB;sCAAnB,mBAAmB;8BAT7H,qBAAqB;6BAEkJ,aAAa;8BAAb,aAAa;yBAAb,aAAa;+BAAb,aAAa;8BAAb,aAAa;6BAAb,aAAa;+BAAb,aAAa;kCAAb,aAAa;+BAAb,aAAa;+BAAb,aAAa;2BAAb,aAAa;kCAAb,aAAa;0BACzD,cAAc;0BAAd,cAAc;uCAAd,cAAc;+BAAd,cAAc;sBAAd,cAAc;0BAAd,cAAc;iCAAd,cAAc;gCAAd,cAAc;sCAAd,cAAc;wCAC/H,cAAc;6BACiC,cAAc;wBAAd,cAAc;wBAAd,cAAc;+BAAd,cAAc;0BAAd,cAAc;4BAAd,cAAc;4BACzE,iBAAiB;+BACd,uBAAuB;mCACC,kBAAkB;mCAAlB,kBAAkB;qCAxB+I,mBAAmB;yCAAnB,mBAAmB;8BAAnB,mBAAmB;iCAAnB,mBAAmB;oCAAnB,mBAAmB;kCAAnB,mBAAmB;wCAAnB,mBAAmB;gCAAnB,mBAAmB;iCAAnB,mBAAmB;mCAAnB,mBAAmB;gCAe1I,mBAAmB;mCAAnB,mBAAmB;sCAAnB,mBAAmB;qCAAnB,mBAAmB;4BAUoB,mBAAmB;+BAAnB,mBAAmB;iCAAnB,mBAAmB;oCAAnB,mBAAmB;kCAC6kB,iBAAiB;iCAAjB,iBAAiB;gCAAjB,iBAAiB;8BAAjB,iBAAiB;+BAAjB,iBAAiB;iCAAjB,iBAAiB;8CAAjB,iBAAiB;sCAAjB,iBAAiB;uCAAjB,iBAAiB;iCAAjB,iBAAiB;oCAAjB,iBAAiB;kCAAjB,iBAAiB;mCAAjB,iBAAiB;oCAAjB,iBAAiB;wCAAjB,iBAAiB;sCAAjB,iBAAiB;kCAAjB,iBAAiB;sCAAjB,iBAAiB;sCAAjB,iBAAiB;sCAAjB,iBAAiB;gCAAjB,iBAAiB;6BAAjB,iBAAiB;yBAAjB,iBAAiB;gCAAjB,iBAAiB;iCAAjB,iBAAiB;oCAAjB,iBAAiB;gCAAjB,iBAAiB;kCAAjB,iBAAiB;oCAAjB,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;4BAE7B,iBAAiB;oCAAjB,iBAAiB;iCADI,oBAAoB;iCAApB,oBAAoB;kCAApB,oBAAoB;iCA9BM,gBAAgB;0BAAhB,gBAAgB;+BAAhB,gBAAgB;iCAAhB,gBAAgB;iCAAhB,gBAAgB"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { continuationSafetyProtocol } from '../forms/continuation-safety.js';
|
|
|
3
3
|
import { contextualResponseProtocol, validateFormResponse, hasFormResponse } from './contextual-response.js';
|
|
4
4
|
import { formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation } from './form-proposals.js';
|
|
5
5
|
import { formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor } from './proposal-contract.js';
|
|
6
|
-
import { cancelFormTask, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome } from './form-conversation.js';
|
|
6
|
+
import { cancelFormTask, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome } from './form-conversation.js';
|
|
7
7
|
import { takeChoiceOffer } from './choice-offer.js';
|
|
8
8
|
import { registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY } from './sendables.js';
|
|
9
9
|
import { consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified } from './form-actions.js';
|
|
@@ -37,12 +37,12 @@ import { checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS } from
|
|
|
37
37
|
import { validateDigits, validatePhone, validateEmail } from './validators.js';
|
|
38
38
|
import { joinSpokenDigits, spokenDigitsText, wholeSpokenNumber } from './spoken-digits.js';
|
|
39
39
|
import { urlToSpeech, textWithUrlToSpeech } from './url-speech.js';
|
|
40
|
-
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, 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, 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, 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, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY, };
|
|
40
|
+
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, 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, 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, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY, };
|
|
41
41
|
/** The functions flows call by name, ready to spread into a host's approved functions. */
|
|
42
42
|
export const STANDARD_FUNCTIONS = {
|
|
43
43
|
continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse,
|
|
44
44
|
formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor,
|
|
45
|
-
clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome,
|
|
45
|
+
clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, deferFormClarification, takeFormClarification, formClarificationKept, clearFormLines, formConversationOutcome,
|
|
46
46
|
readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, confirmOutOfOrderLine, matchesChoice, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho,
|
|
47
47
|
readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational,
|
|
48
48
|
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, 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,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,sEAQC;
|
|
1
|
+
{"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,sEAQC;AAkGD;;;GAGG;AACH,sFA8HC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;mHACmH;AAEnH,iEAEC;AAGD,gGAOC;AAYD,kDAGC;AAED;;;;;;;;;;;;;;;;;;;;;;EAeC;AACD;;;;;;;;;;;;;;;;;;;;;;;EAgXC"}
|
|
@@ -106,8 +106,16 @@ function emailSpans(raw, value) {
|
|
|
106
106
|
const spans = [];
|
|
107
107
|
for (let i = 0; i + size <= tokens.length; i++) {
|
|
108
108
|
const a = tokens[i].index, b = tokens[i + size - 1].index + tokens[i + size - 1][0].length;
|
|
109
|
-
if (readEmail(raw.slice(a, b)) === value)
|
|
110
|
-
|
|
109
|
+
if (readEmail(raw.slice(a, b)) === value) {
|
|
110
|
+
// "juan at gmail" already reads as gmail.com: the spoken ending after it belongs to the same address
|
|
111
|
+
let j = i + size;
|
|
112
|
+
while (j < tokens.length && /^(?:dot|punto|punt|ponto|com|con|\.com)[.,;:!?]*$/i.test(tokens[j][0]))
|
|
113
|
+
j++;
|
|
114
|
+
spans.push([a, j > i + size ? tokens[j - 1].index + tokens[j - 1][0].length : b]);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
// this window is not the address
|
|
118
|
+
}
|
|
111
119
|
}
|
|
112
120
|
if (spans.length)
|
|
113
121
|
return spans;
|
package/dist/runtime-identity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const JSFE_RUNTIME_FINGERPRINT = "sha256:
|
|
1
|
+
export const JSFE_RUNTIME_FINGERPRINT = "sha256:48e6e2c4fceae55d0e1cf8184768c712140e1b03251a75d54ca307412312d33a";
|
|
@@ -360,6 +360,14 @@ it.
|
|
|
360
360
|
|
|
361
361
|
**A number that must name itself.** `input.confirm_out_of_order: {word, word_es, message, message_es}` (default off): out of order a number fills this input only beside its word, in either language ("account 5373850"). Alone it may be something else, a code said with an extra digit, so nothing is filled: the caller hears `message` (`{value}` the number, digit by digit on a call; `{word}` the word) and the current question again, which counts as an attempt at that question. It works at `collect-input` and `confirm-form` questions. At its own question the number needs no word. A pattern field's `asked_regex` also reads out of order beside the word ("vencimiento 0 4 3 1"); a reading of the field asked now wins over a number refused for want of its word, and no line is said. The card presets declare it on the expiration (EXPIRATION / VENCIMIENTO), the security code (SECURITY CODE / CÓDIGO DE SEGURIDAD) and the billing ZIP (owner 2026-11-17). `collect-credit-card` also checks the completed card (`validate-credit-card`): a security code whose length is not its brand's (4 for American Express, 3 for others) is asked again. `authenticate-user`'s `code_confirm` takes the same declaration for a `code_validator`, whose flow reads it with the helpers `saysConfirmWord(answer, spec)` and `confirmOutOfOrderLine(spec, value, language, voice)`.
|
|
362
362
|
|
|
363
|
+
**A conflict the request carried is asked at its input (jsfe 1.74.0, owner 2026-11-17).** When values given at activation
|
|
364
|
+
(nothing asked yet) compete for one exclusive group, such as an amount and a payment option, the conflict is kept on the form
|
|
365
|
+
(`deferFormClarification`) and asked in place of the question of its input when the form reaches it (`takeFormClarification`,
|
|
366
|
+
run-form), like a validator's line. A form that stops or ends first never asks it; a value accepted for that input or its group
|
|
367
|
+
settles it. A flow that fills inputs on its own treats `formClarificationKept(cargo, form, name)` like a pending value. A
|
|
368
|
+
conflict in a reply is the caller answering now and is still asked at once. Prod 2026-11-16: a payment with nothing due said so
|
|
369
|
+
and, in the same reply, asked "Is 1500 your amount or your payment option?".
|
|
370
|
+
|
|
363
371
|
**An amount-shaped number is no ZIP.** `profile.refuse_amount_shape: true` (digits profile, default off): "119 19" (three digits then two) is not the field's digits out of order; at its own question it reads. Declared by the `zip` and `card_zip` presets; `card_zip` also takes a bare number out of order only beside ZIP / CÓDIGO POSTAL (`confirm_out_of_order`).
|
|
364
372
|
|
|
365
373
|
**A number of the wrong length says so.** A numeric field (`digits`, `phone` or `identifier` kind) that declares `digits` takes, at its own question, the one 3+ digit number of the wrong length that no other field read or refused; validation rejects it with the count heard and the count it takes (`length_message`), said with the question that re-asks. Routing is unchanged.
|
|
@@ -208,7 +208,7 @@ Profiles:
|
|
|
208
208
|
|
|
209
209
|
Matching depends on policy. With `exact:true`, a phrase must form the whole normalized answer, allowing the engine's bounded courtesy/affirmation wrappers; questions and additional substantive corrections do not consent. Thus exact `here` does not accept `pay here`. Without exact, ordinary positive named choices may match within an unnegated clause: do not assume whole-answer matching. Keypad aliases, YES and NO-type answers have stricter rules regardless. `keys` are current-field-only whole-answer keypad aliases; they must not steal a monetary answer or identify a different field. `neutral` is not consent. Use exact choices for sensitive finite decisions.
|
|
210
210
|
|
|
211
|
-
JSFE resolves valid current-field evidence first, then a unique match in the nearest owning form, then ancestors; genuine competing claims are clarified. Independent spans can fill independent fields. Typed evidence outranks arbitrary text. `confirm_against` deliberately retains ambiguity. A child result uses the same acceptance/invalidation transition as a leaf. Pending dependent candidates wait for valid prerequisites; invalid data cannot authorize an action. Narrative mode does not turn fragments or bare structured identifiers into business explanations.
|
|
211
|
+
JSFE resolves valid current-field evidence first, then a unique match in the nearest owning form, then ancestors; genuine competing claims are clarified. A conflict in a reply is asked at once; a conflict among values the request carried (activation, nothing asked yet) is kept on its form and asked in place of the question of its input when the form reaches it, so a form that stops or ends first never asks it, and a value given for that input settles it. A flow that fills inputs on its own (a default) treats `formClarificationKept(cargo, form, name)` like a pending value. Independent spans can fill independent fields. Typed evidence outranks arbitrary text. `confirm_against` deliberately retains ambiguity. A child result uses the same acceptance/invalidation transition as a leaf. Pending dependent candidates wait for valid prerequisites; invalid data cannot authorize an action. Narrative mode does not turn fragments or bare structured identifiers into business explanations.
|
|
212
212
|
|
|
213
213
|
### Context-aware acceptance
|
|
214
214
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsfe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.75.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",
|