jsfe 1.10.4 → 1.10.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":"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;;;EAmCC;AAUD;;;;;;;;;GASG;AACH,6EAyGC;;;;;;;;AA1ZD,qCAKiD"}
1
+ {"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../src/helpers/answer.js"],"names":[],"mappings":"AA4LA;;;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;;;EAmCC;AAUD;;;;;;;;;GASG;AACH,6EAyGC;;;;;;;;AA/ZD,qCAKiD"}
@@ -176,6 +176,9 @@ function textRequest(input, words, extra) {
176
176
  * when `yesOk`, a YES word ("yes 1", "sí, 1"). Owner decision 2026-10-15: "Yes 1" at "tell me the product number" was
177
177
  * missed. Anything else around the key ("no 1", "1 or 2", "I paid 1 already") is not that key.
178
178
  */
179
+ // Words that name the key itself when said right before it: "el número 4", "opción 2", "number 4", "the 4" (prod
180
+ // 2026-10-25 18:25: "Número 4" and "El número 4" at a numbered product list were not understood, twice).
181
+ const KEY_NAMES = new Set(['number', 'numero', 'option', 'opcion', 'item', 'choice', 'the', 'el', 'la'].map(normalize));
179
182
  function keyWithOnlyCourtesy(b, key, yesOk) {
180
183
  const tk = String(b).replace(/\./g, ' ').split(' ').filter(Boolean);
181
184
  const at = tk.reduce((acc, t, i) => (t === key ? [...acc, i] : acc), []);
@@ -183,7 +186,10 @@ function keyWithOnlyCourtesy(b, key, yesOk) {
183
186
  return false;
184
187
  }
185
188
  else {
186
- const rest = tk.filter((t, i) => i !== at[0]).join(' ');
189
+ let from = at[0];
190
+ while (from > 0 && at[0] - from < 2 && KEY_NAMES.has(tk[from - 1]))
191
+ from--;
192
+ const rest = tk.filter((t, i) => i < from || i > at[0]).join(' ');
187
193
  return onlyAffirmative(rest, yesOk ? ANSWER_WORDS.yes : [], false);
188
194
  }
189
195
  }
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:32e5bd91d0c35d60c3126334ae4d931bd988af19be6acd7fcdb9023794e61840";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:5dcc5703f78eb0d76716ae4ec5d702abefd508aac9a44b3cb67b62efc93e244d";
@@ -1,3 +1,9 @@
1
+ ## 1.10.5: a key named before it
2
+
3
+ At a numbered choice, a word naming the key said right before it picks the key: "el número 4", "opción 2", "number 4", "the
4
+ 4" (`keyWithOnlyCourtesy`; prod 2026-10-25 18:25, "Número 4" and "El número 4" at a numbered product list were not
5
+ understood, twice, and the caller lost the flow). A number anywhere else in a sentence is still not a key.
6
+
1
7
  ## 1.10.4: forms that must complete
2
8
 
3
9
  `must_complete:true` on a form or a field (a field inherits it from any enclosing form; `false` on a field opts out): an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.10.4",
3
+ "version": "1.10.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",