jsfe 1.73.1 → 1.74.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/choice-flow.js +1 -1
- package/dist/forms/flows.d.ts.map +1 -1
- package/dist/forms/flows.js +12 -2
- 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/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
|
|
@@ -279,7 +279,7 @@ export const FLOWS = [
|
|
|
279
279
|
"id": "ac_late_code_check",
|
|
280
280
|
"type": "SET",
|
|
281
281
|
"variable": "ac_late",
|
|
282
|
-
"value": "(function(t, c) { if (typeof form_context !== 'undefined' && form_context && form_context.form) { var fc=form_context, chain=formInputChain(cargo.forms,fc.form,cargo), read=readFormAnswer(t,chain,Array.isArray(fc.names)&&fc.names.length>1?{form:fc.form,names:fc.names}:{form:fc.form,name:fc.current},'',fc.questions||[]); if(read.hits.length || read.ambiguous.length || read.questions.length) return false; } t = String(t || '').trim(); c = String(c || ''); if (c.length !== 6) { return false; } var rest = t.replace(/^(?:(?:el|mi|the|my)\\s+)?(?:c[oó]digo|code)(?:\\s+(?:es|is|era|was))?\\s*[:,.-]?\\s*/i, ''); if (!/^[\\d\\s.,-]+$/.test(rest)) { return false; } var d = rest.replace(/\\D/g, ''); return d.length >= 2 && d.length <= 6 && c.indexOf(d) >= 0; })(ac_answer, ac_code)"
|
|
282
|
+
"value": "(function(t, c) { if (typeof form_context !== 'undefined' && form_context && form_context.form) { var fc=form_context, chain=formInputChain(cargo.forms,fc.form,cargo), read=readFormAnswer(t,chain,Array.isArray(fc.names)&&fc.names.length>1?{form:fc.form,names:fc.names}:{form:fc.form,name:fc.current},'',fc.questions||[]); if(read.hits.length || read.ambiguous.length || read.questions.length || (read.clarify || []).length) return false; } t = String(t || '').trim(); c = String(c || ''); if (c.length !== 6) { return false; } var rest = t.replace(/^(?:(?:el|mi|the|my)\\s+)?(?:c[oó]digo|code)(?:\\s+(?:es|is|era|was))?\\s*[:,.-]?\\s*/i, ''); if (!/^[\\d\\s.,-]+$/.test(rest)) { return false; } var d = rest.replace(/\\D/g, ''); return d.length >= 2 && d.length <= 6 && c.indexOf(d) >= 0; })(ac_answer, ac_code)"
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
"id": "ac_late_code_reask",
|
|
@@ -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)'),
|
|
@@ -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":"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"}
|
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,
|
package/dist/runtime-identity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const JSFE_RUNTIME_FINGERPRINT = "sha256:
|
|
1
|
+
export const JSFE_RUNTIME_FINGERPRINT = "sha256:a27000b2742e60c8a49cbe6d7e33125ca51b2cb364acae42de7c5731bd9c479f";
|
|
@@ -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.74.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",
|