jsfe 1.7.4 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA0FA;;;;;;GAMG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DC;AACD;;;GAGG;AACH;;;;;;EAGC;AA8VD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AAjgBM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkrB9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA0FA;;;;;;GAMG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DC;AACD;;;GAGG;AACH;;;;;;EAGC;AA8VD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AAjgBM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqrB9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
@@ -619,7 +619,10 @@ const providerMenu = {
619
619
  SET('pm_question_es', 'pm_q_es', `(function () { ${RENDER_JS} var m = provides.menu; var t = cargo.voice && (m.question_voice_es || m.question_voice) ? (m.question_voice_es || m.question_voice) : (m.question_es || m.question); return (retry === '1' ? 'Disculpe, no le entendí. ' : '') + fill(t, {}, null, 'es', { name: pm_who, verb: cargo.verb_es || (cargo.voice ? 'diga' : 'escriba') }); })()`),
620
620
  SET('pm_build', 'pm_choices', "provides.facts.concat(provides.sets || []).filter(function (f) { return Array.isArray(f.words) && f.words.length; }).map(function (f) { return { key: 'fact:' + f.key, words: f.words }; }).concat((provides.menu.choices || []).map(function (c) { return { key: 'act:' + c.key, words: c.words, exact: c.exact === true }; })).concat(provides.menu.done ? [{ key: 'done', words: provides.menu.done.words, exact: true }] : [])"),
621
621
  FLOW('pm_ask', 'ask-choice', 'call', { question: '{{pm_q}}', question_es: '{{pm_q_es}}', choices: '{{pm_choices}}', accept_other: true, digits: { min: 1, max: 1 }, exit_context: '{{provides.subject}}', exit_context_es: '{{provides.subject_es}}' }),
622
- SET('pm_take', 'pm_key', "String(cargo.choice || '').indexOf('fact:') === 0 ? pickProviderQuestion(cargo.choiceText, pm_choices.filter(function (c) { return c.key.indexOf('fact:') === 0; })) : String(cargo.choice || '')"),
622
+ // A declared terminal phrase (for example "no thanks") may also fit a shorter action
623
+ // after courtesy stripping ("no"). Resolve only that overlap; fact ownership and the
624
+ // existing reserved done fallback retain their normal behavior.
625
+ SET('pm_take', 'pm_key', "(function(){var key=String(cargo.choice || '');if(key.indexOf('fact:')===0)return pickProviderQuestion(cargo.choiceText,pm_choices.filter(function(c){return c.key.indexOf('fact:')===0;}));if(key.indexOf('act:')===0 && provides.menu.done && pickChoice(cargo.choiceText,[{key:'terminal:done',words:provides.menu.done.words,exact:true}],true)==='terminal:done')return 'done';return key;})()"),
623
626
  SET('pm_fact_keys', 'pm_keys', "pm_key.indexOf('fact:') === 0 ? (function (k) { var s = (provides.sets || []).filter(function (x) { return x.key === k; })[0]; return s ? s.facts.slice() : [k]; })(pm_key.slice(5)) : []"),
624
627
  SET('pm_closing', 'pm_close', "pm_keys.length > 0 && pm_keys.every(function (key) { var fact = provides.facts.find(function (f) { return f.key === key; }); return !!fact && fact.close === true; })"),
625
628
  SET('pm_action_flow', 'pm_flow', "pm_key.indexOf('act:') === 0 ? (function (c) { if (c && c.set) { Object.keys(c.set).forEach(function (k) { cargo[k] = c.set[k]; }); } else { /* nothing to set */ } return c ? c.flow : ''; })((provides.menu.choices || []).filter(function (x) { return 'act:' + x.key === pm_key; })[0]) : ''"),
@@ -1 +1 @@
1
- {"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/helpers/answer.js"],"names":[],"mappings":"AA8IA;;;GAGG;AACH,wEAkBC;AAED,+HAA+H;AAC/H,oDAIC;AAcD,2GAA2G;AAC3G,uDAGC;AAOD;;;;;GAKG;AACH,+DAUC;AAKD;;;;GAIG;AACH,oDAEC;AAiBD;;;;;;GAMG;AACH,mDAAmF;AAEnF,kGAAkG;AAClG;;;EA6BC;AAUD;;;;;;;;;GASG;AACH,6EAyGC;;;;;;;;AA3WD,qCAKiD"}
1
+ {"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/helpers/answer.js"],"names":[],"mappings":"AAuLA;;;GAGG;AACH,wEAkBC;AAED,+HAA+H;AAC/H,oDAIC;AAcD,2GAA2G;AAC3G,uDAGC;AAOD;;;;;GAKG;AACH,+DAUC;AAKD;;;;GAIG;AACH,oDAEC;AAiBD;;;;;;GAMG;AACH,mDAAmF;AAEnF,kGAAkG;AAClG;;;EA6BC;AAUD;;;;;;;;;GASG;AACH,6EAyGC;;;;;;;;AApZD,qCAKiD"}
@@ -50,11 +50,6 @@ export const CONFIRM_WORDS = ['yes', 'yeah', 'yep', 'yup', 'sure', 'of course',
50
50
  // AGENT words that also mean something else inside a sentence ("quiero pagar mi servicio", "someone else will pay"): they
51
51
  // ask for a person only as the whole answer (AGENT_ONLY), never from inside one.
52
52
  const AGENT_AMBIGUOUS = new Set(['servicio', 'support', 'someone', 'somebody', 'alguien', 'persona', 'a person', 'gente', 'al cliente']);
53
- // TEXT words that name the message itself inside a sentence ("dónde me llegó en este mensaje", "the text you sent me"): they
54
- // ask to switch to text only as the whole answer (TEXT_ONLY), never from inside one. Prod 2026-10-20: two callers looking for
55
- // the code we had texted were switched to SMS and the call ended.
56
- const TEXT_AMBIGUOUS = new Set(['text', 'texto', 'sms', 'message', 'mensaje', 'mensaje de texto', 'por texto', 'by text', 'whatsapp']);
57
- const TEXT_ONLY = /^(?:(?:by|via|por|en|a|to)\s+)?(?:text|texto|sms|message|text message|mensaje|mensaje de texto|whatsapp)(?:\s+(?:please|por favor))?[.!?]*$/;
58
53
  // A word that negates what follows it in its clause ("not sure", "no quiero un agente").
59
54
  const NEGATIONS = ['no', 'not', 'nope', 'nah', 'never', 'dont', 'doesnt', 'didnt', 'cant', 'cannot', 'wont', 'nunca', 'ni',
60
55
  'tampoco', 'jamas', 'jamás'];
@@ -85,6 +80,8 @@ const CONFIRM_FILLER = CONFIRM_WORDS.map(normalize).map((w) => w.split(' '));
85
80
  const ARTICLES = ['the', 'my', 'el', 'la', 'mi'].map((w) => [w]);
86
81
  const YES_SET = new Set(ANSWER_WORDS.yes.map(normalize));
87
82
  const collapse = (w) => w.replace(/([aeiouáéíóúü])\1+/g, '$1').replace(/(\p{L})\1{2,}/gu, '$1');
83
+ const phraseAt = (tokens, i, phrase) => phrase.every((w, j) => tokens[i + j] === w
84
+ || (!/(\p{L})\1/u.test(w) && collapse(tokens[i + j] || '') === w));
88
85
  /**
89
86
  * Whether the answer, with courtesy around it removed (please / thanks / gracias, um, uh, ma'am, señora…), holds NOTHING but
90
87
  * words from `words` — at least one of them. A YES that acts must be the whole answer (owner rule, 2026-10-14): "Yeah, sure,
@@ -99,7 +96,7 @@ function onlyAffirmative(b, words, needOne = true, filler = []) {
99
96
  }
100
97
  const tk = String(b).replace(/\./g, ' ').split(' ').filter(Boolean);
101
98
  const own = words.map(normalize).filter(Boolean).map((w) => w.split(' '));
102
- const at = (i, phrase) => phrase.every((w, j) => tk[i + j] === w || (!/(\p{L})\1/u.test(w) && collapse(tk[i + j] || '') === w));
99
+ const at = (i, phrase) => phraseAt(tk, i, phrase);
103
100
  let i = 0;
104
101
  let saw = false;
105
102
  while (i < tk.length) {
@@ -118,6 +115,62 @@ function onlyAffirmative(b, words, needOne = true, filler = []) {
118
115
  }
119
116
  return saw || !needOne;
120
117
  }
118
+ // Channel nouns select a channel only inside a complete request. The remainder must describe
119
+ // switching/continuing the conversation, not the contents of an OTP or a quoted earlier message.
120
+ const TEXT_CHANNELS = ['text', 'text message', 'texto', 'sms', 'message', 'mensaje', 'mensaje de texto', 'whatsapp'];
121
+ const TEXT_REQUEST_PREFIXES = ['i want to', 'i need to', 'i would like to', 'id like to', 'i would rather', 'id rather',
122
+ 'i want', 'i need', 'i prefer', 'i would like', 'id like', 'can i', 'could i', 'can we', 'could we', 'can you', 'could you', 'would you', 'lets',
123
+ 'quiero', 'quisiera', 'me gustaria', 'prefiero', 'necesito', 'podemos', 'podriamos', 'puedes', 'podrias', 'puede', 'podria', 'mejor']
124
+ .map(w => w.split(' ')).sort((a, b) => b.length - a.length);
125
+ const TEXT_WRAPPERS = [...COURTESY, ...ACKNOWLEDGEMENTS, ...CONFIRM_FILLER].sort((a, b) => b.length - a.length);
126
+ function trimAnswerWrappers(tokens) {
127
+ while (tokens.length) {
128
+ const first = TEXT_WRAPPERS.find(phrase => phraseAt(tokens, 0, phrase));
129
+ const last = first ? null : TEXT_WRAPPERS.find(phrase => phrase.length <= tokens.length && phraseAt(tokens, tokens.length - phrase.length, phrase));
130
+ if (first)
131
+ tokens = tokens.slice(first.length);
132
+ else if (last)
133
+ tokens = tokens.slice(0, -last.length);
134
+ else
135
+ break;
136
+ }
137
+ return tokens;
138
+ }
139
+ function textRequest(input, words, extra) {
140
+ const raw = String(input ?? '').replace(/\\(['"\\])/g, '$1');
141
+ // Quotation, code, blockquotes and strikethrough mark non-command text before normalization
142
+ // removes their delimiters. Ordinary emphasis and apostrophes remain valid command text.
143
+ const quoted = /["“”«»]|(?:^|\s)'[^']+'(?=$|\s|[.,!?;:])|(?:^|\s)‘[^’]+’(?=$|\s|[.,!?;:])/u.test(raw);
144
+ const markdown = /`|~~|(?:^|\n)[ \t]*>/u.test(raw);
145
+ if (quoted || markdown)
146
+ return false;
147
+ const command = raw.replace(/(\*{1,2}|_{1,2})(?=\S)([\s\S]*?\S)\1/g, '$2');
148
+ let tokens = trimAnswerWrappers(normalize(command.replace(/[,;!?¿¡]/g, ' ')).replace(/\./g, ' ').split(' ').filter(Boolean));
149
+ if (['instead', 'mejor'].includes(tokens.at(-1)))
150
+ tokens.pop();
151
+ const prefix = TEXT_REQUEST_PREFIXES.find(phrase => phraseAt(tokens, 0, phrase));
152
+ if (prefix)
153
+ tokens = trimAnswerWrappers(tokens.slice(prefix.length));
154
+ const body = tokens.join(' ');
155
+ if (!body)
156
+ return false;
157
+ if (onlyAffirmative(body, words))
158
+ return true;
159
+ const channel = value => onlyAffirmative(value, [...TEXT_CHANNELS, ...extra]);
160
+ if (channel(body) || /^(?:text|message) me$|^escrib(?:eme|ame)$/.test(body))
161
+ return true;
162
+ const delivery = /^(?:by|via|over|por|en|a|to) (.+)$/.exec(body);
163
+ if (delivery && channel(delivery[1]))
164
+ return true;
165
+ const continuation = /^(?:continue|communicate|chat|talk|carry on|go on|continuar|continua|continuemos|seguir|sigue|sigamos)(?: with me)? (?:by|via|over|por|en) (.+)$/.exec(body);
166
+ if (continuation && channel(continuation[1]))
167
+ return true;
168
+ const switching = /^(?:switch(?: me)? (?:over )?to|cambiar(?:me)? a|cambia(?:me)? a|pasame a) (.+)$/.exec(body);
169
+ if (switching && channel(switching[1]))
170
+ return true;
171
+ const sending = /^(?:send me (?:a )?|mandame (?:un )?|enviame (?:un )?)(.+)$/.exec(body);
172
+ return !!sending && channel(sending[1]);
173
+ }
121
174
  /**
122
175
  * Whether the answer is the keypad key `key` with nothing around it but courtesy ("1 please", "um 2", "2 gracias") and,
123
176
  * when `yesOk`, a YES word ("yes 1", "sí, 1"). Owner decision 2026-10-15: "Yes 1" at "tell me the product number" was
@@ -157,7 +210,7 @@ export function isAnswer(input, kind, extra = []) {
157
210
  return onlyAffirmative(b, words);
158
211
  }
159
212
  else if (kind === 'text') {
160
- return TEXT_ONLY.test(b) || matchesChoice(b, words.filter((w) => !TEXT_AMBIGUOUS.has(w)));
213
+ return textRequest(input, words, Array.isArray(extra) ? extra : []);
161
214
  }
162
215
  else {
163
216
  return matchesChoice(b, words);
@@ -1 +1 @@
1
- {"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AA2EA;;;GAGG;AACH,sFAmGC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;mHACmH;AACnH;;;;;EAeC;AACD;;;;;;EA6EC"}
1
+ {"version":3,"file":"match-inputs.d.ts","sourceRoot":"","sources":["../../src/helpers/match-inputs.js"],"names":[],"mappings":"AA2EA;;;GAGG;AACH,sFAmGC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;mHACmH;AACnH;;;;;EAeC;AACD;;;;;;EA8FC"}
@@ -274,18 +274,37 @@ export function matchInputs(answer, candidates, current, choiceKey) {
274
274
  }
275
275
  if (r) {
276
276
  for (const option of r.alternatives || [r]) {
277
- readings.push({ form: c.form, name: c.name, value: option.value, ...(option.refused === true ? { refused: true } : {}), known: c.value !== undefined && c.value !== null && String(c.value) === String(option.value), spans: option.spans, keypad: option.keypad === true, fallback: option.fallback === true,
277
+ const known = c.value !== undefined && c.value !== null && String(c.value) === String(option.value);
278
+ // A repeated choice may be the whole answer or only context in the requested field's answer.
279
+ // Use the same whole-answer vocabulary as explicit choices, including courtesy and articles.
280
+ const repeatedChoice = known && !isCur(c) && c.profile.kind === 'choice';
281
+ const wholeOptions = repeatedChoice ? (c.profile.choices || []).filter(choice => choice.key === option.value).map(choice => ({ ...choice, exact: true })) : [];
282
+ const wholeChoice = repeatedChoice && [raw, raw.replace(/\d(?:[\s.-]?\d)*/g, run => run.replace(/\D/g, ''))].some(text => pickChoice(text, wholeOptions, false) === option.value);
283
+ readings.push({ form: c.form, name: c.name, value: option.value, ...(option.refused === true ? { refused: true } : {}), known, repeatedChoice, wholeChoice, spans: option.spans, keypad: option.keypad === true, fallback: option.fallback === true,
278
284
  ...(r.alternatives ? { option_label: option.option_label, option_label_es: option.option_label_es } : {}), group: c.group, exclusive: c.exclusive === true, level: forms.indexOf(c.scope || c.form), current: isCur(c), confirm: Array.isArray(c.confirm_against) ? c.confirm_against : [] });
279
285
  }
280
286
  }
281
287
  }
282
- // Readings that spent the same evidence form a group (connected components).
283
- const conflicts = (a, b) => a.form === b.form && (a.name === b.name && a.value !== b.value || a.exclusive && b.exclusive && a.group && a.group === b.group && a.name !== b.name) || (a.spans || []).some(([s, e]) => (b.spans || []).some(([t, u]) => s < u && t < e));
284
- const parent = readings.map((_, i) => i);
288
+ const paired = (a, b) => a.confirm.indexOf(b.name) > -1 || b.confirm.indexOf(a.name) > -1;
289
+ const fieldConflict = (a, b) => a.form === b.form && (a.name === b.name && a.value !== b.value || a.exclusive && b.exclusive && a.group && a.group === b.group && a.name !== b.name);
290
+ const overlap = (a, b) => (a.spans || []).some(([s, e]) => (b.spans || []).some(([t, u]) => s < u && t < e));
291
+ const competes = (a, b) => fieldConflict(a, b) || overlap(a, b);
292
+ // Resolve fallback ownership before grouping: a losing whole-answer text span cannot join
293
+ // independent structured evidence into an ambiguity. Known contextual choice mentions do
294
+ // not displace current text; whole-answer repetitions and explicit pairs still compete.
295
+ const fallbacks = readings.filter(reading => reading.fallback);
296
+ const stronger = new Map(fallbacks.map(fallback => [fallback, readings.filter(reading => !reading.fallback && competes(fallback, reading) && !(reading.repeatedChoice && !reading.wholeChoice && !paired(fallback, reading)))]));
297
+ const keptFallbacks = fallbacks.filter(fallback => !stronger.get(fallback).length || stronger.get(fallback).some(reading => paired(fallback, reading)));
298
+ const pairedFallbacks = new Set(keptFallbacks.filter(fallback => stronger.get(fallback).length));
299
+ const effective = readings.filter(reading => reading.fallback ? keptFallbacks.includes(reading) : !(reading.repeatedChoice && !reading.wholeChoice && keptFallbacks.some(fallback => competes(fallback, reading) && !paired(fallback, reading))));
300
+ // A fallback retained for a declared pair must not bridge unrelated source spans either.
301
+ const conflicts = (a, b) => fieldConflict(a, b) || overlap(a, b) && !(pairedFallbacks.has(a) && !b.fallback && !paired(a, b) || pairedFallbacks.has(b) && !a.fallback && !paired(a, b));
302
+ // Readings that spent the same effective evidence form a group (connected components).
303
+ const parent = effective.map((_, i) => i);
285
304
  const find = (i) => (parent[i] === i ? i : (parent[i] = find(parent[i])));
286
- for (let i = 0; i < readings.length; i++) {
287
- for (let j = i + 1; j < readings.length; j++) {
288
- if (conflicts(readings[i], readings[j])) {
305
+ for (let i = 0; i < effective.length; i++) {
306
+ for (let j = i + 1; j < effective.length; j++) {
307
+ if (conflicts(effective[i], effective[j])) {
289
308
  parent[find(i)] = find(j);
290
309
  }
291
310
  else {
@@ -294,16 +313,13 @@ export function matchInputs(answer, candidates, current, choiceKey) {
294
313
  }
295
314
  }
296
315
  const groups = {};
297
- readings.forEach((r, i) => { (groups[find(i)] = groups[find(i)] || []).push(r); });
298
- const strip = ({ evidence, spans, keypad, fallback, level, group, exclusive, current: c, confirm, ...r }) => r;
299
- const paired = (a, b) => a.confirm.indexOf(b.name) > -1 || b.confirm.indexOf(a.name) > -1;
316
+ effective.forEach((r, i) => { (groups[find(i)] = groups[find(i)] || []).push(r); });
317
+ const strip = ({ evidence, spans, keypad, fallback, repeatedChoice, wholeChoice, level, group, exclusive, current: c, confirm, ...r }) => r;
300
318
  const hits = [];
301
319
  let ambiguous = [];
302
320
  const remaining = [];
303
321
  for (const group of Object.values(groups)) {
304
- // Free text is a fallback; a specific claim to the same source evidence is stronger.
305
- const specific = group.filter(m => !m.fallback);
306
- const members = specific.length ? specific.concat(group.filter(m => m.fallback && specific.some(s => paired(m, s)))) : group;
322
+ const members = group;
307
323
  let winners;
308
324
  if (members.length === 1) {
309
325
  winners = members;
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:665b33c4b0ecad0f66b71c07956e793bee8983f92b047dfb4a0f2db13f3fc1a8";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:80dad4930b16f70b08ade26e77712eea29dfed68a582f5b6b69906a3a8becb76";
@@ -35,3 +35,11 @@ Acceptance must include real engine-produced states through the actual host outc
35
35
  The shared proposal contract is opt-in through input declarations or validator descriptors. It retains candidates before canonical acceptance, uses an owned exact-confirmation context and revalidates proof before commit. No host or website changes are part of this implementation. The contract is included in JSFE 1.7.3. Publishing and pinning the package do not activate regenerated flow definitions or deploy a host.
36
36
 
37
37
  `contract.requires:['jsfe:input-proposals:v1']` describes intrinsic runtime support, not host configuration. Current JSFE admits that version directly; unknown `jsfe:*` contracts fail closed. Static and linked child declarations derive the requirement and strict entry guard; dynamic proposal workers declare it explicitly. Older runtimes must reject the matched definitions before tenant behavior. Release/pin the accepted runtime before activating regenerated shared and tenant sets. Both consumers must pin the same exact published runtime before the matched shared and tenant flow definitions are activated.
38
+
39
+ ## 1.7.5 input ownership and intent corrections
40
+
41
+ The local candidate corrects input ownership for incidental known-parent choices, keeps independent structured spans independent, and recognizes text-switch intent only as a complete command. English/Spanish courtesy and explicit continuation commands work; OTP delivery questions, quoted/code/struck-through commands, negation and extra-content sentences do not switch channels. Exact action consent, subject gates, money parsing, durable journal behavior and storage formats are unchanged. Provider terminal phrases retain priority when courtesy also makes them fit a shorter neutral action.
42
+
43
+ Tenant integration resolves a valid canonical case before compatibility routing, builds CRM verification text from the same contact snapshot as payload flags, and handles account-menu bare NO through the existing provider action contract. Intent probes fail execution errors independently of expected intent, reject malformed/empty runs, and retain a bilingual synthetic corpus. The new corpus is not a reconstruction of the historical uncommitted production replay.
44
+
45
+ Accept the same immutable tarball in isolated matched host/tenant installs. Run every engine suite and `npm run test:accept`, including the original journeys on both flow sets; `npm test` alone runs the curacao suites in legacy mode. Add host preprocessing end-reason checks to distinguish a closing question from a farewell, and exercise actual tool-call counts, payloads, reentry and fresh consent. Live model probes are separate from hermetic acceptance and retain execution failures as failures. Release authorization was granted after the local review. Publish the accepted runtime as 1.7.5, pin both consumers, deploy the dev host, then activate the matched shared and tenant definitions in the three dev configs. Production deployment remains a separate action.
package/docs/forms.md CHANGED
@@ -39,7 +39,7 @@ A batch retains independent valid fields if another field fails. Dependent early
39
39
 
40
40
  ## Resolution and reentry
41
41
 
42
- Resolve overlapping evidence in this order: current field, one matching field at the nearest owning scope, then ancestors. Multiple competing claims at the same applicable scope are clarified. Independent spans fill independent fields. Typed evidence beats an unconstrained text fallback. `confirm_against` deliberately overrides ordinary priority.
42
+ Resolve overlapping evidence in this order: current field, one matching field at the nearest owning scope, then ancestors. Multiple competing claims at the same applicable scope are clarified. Independent spans fill independent fields. Typed evidence beats an unconstrained text fallback. A noncurrent, already-filled choice mentioned incidentally in the current text answer does not displace that answer; a whole-answer repetition (including courtesy) remains a claim to that choice. Explicit new choices and structured data remain eligible out of order. Resolve losing fallback evidence before computing overlapping groups, so one whole-answer text span cannot make independent email/phone clauses ambiguous. `confirm_against` deliberately retains paired interpretations and overrides ordinary priority.
43
43
 
44
44
  The common loop asks the first ready missing required input, skips accepted data, unwinds inapplicable children and blocks unresolved prerequisites. A context service may use `stop` and `close_on_stop:true` to close itself without handing a value to its parent. With `resume_on_parent_change:true`, an accepted owner correction closes the stale context service and resumes the same owned form with its retained progress, requiring a fresh confirmation. `RETURN` ends the entire engine transaction; ordinary worker completion uses `END`.
45
45
 
@@ -169,3 +169,7 @@ Generation failures, stale artifacts, empty suite selections, crashed suites and
169
169
  ### Host capability admission
170
170
 
171
171
  `definePerformer` declares `guardedActions` in its contract requirements. A host must call `assertFlowHostCapabilities(flows, capabilities)` from `jsfe/host` before activation. Durable remains the default: supply `durableActions: true` and attach the journal. An explicit `actionPersistence: 'session-only'` is the alternative; a bare `guardedActions: true` cannot enable it. An additional `contract.requires: ['durableActions']` insists on durable storage even when the host selects session-only. Existing serialized 1.7.0 declarations with that durable-only requirement remain strict; rebuild a flow set with 1.7.1 to use the host-selectable policy. The check does not enable a journal or choose a conversation encoding. Missing requirements reject activation before customer input or effects. Other flow builders may declare additional boolean host requirements through `contract.requires`.
172
+
173
+ ## Provider menu terminal intent
174
+
175
+ Provider menus keep terminal phrases distinct from neutral menu answers. If an answer selects an action only because courtesy normalization also matches a shorter phrase, an explicitly declared whole-answer `menu.done.words` phrase takes its terminal meaning. For example, a neutral action keyed by “no” can ask what else the caller needs while “no thanks” remains terminal. Fact requests retain their existing priority and the existing done/deferral fallback is preserved. Reuse provider-menu actions and shared phrase renderers instead of adding tenant-specific parsing to the engine.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
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",