jsfe 1.53.0 → 1.55.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.
@@ -806,7 +806,7 @@ const disambiguate = {
806
806
  // ── confirm-form: the exact confirmation of a finished form; a correction is matched against the form chain ───────
807
807
  const confirmForm = {
808
808
  id: 'confirm-form', name: 'ConfirmForm', version: '1.0.0', scope: 'isolated',
809
- description: "Worker: ask a form's confirmation (YES / NO, keys 1 and 2; firm only when an action it authorizes is a payment; otherwise soft: YES is read as a soft confirmation's and offered to the reply ranker). A correction instead ('no, make it $40') is read against the form chain and stored, and the result is 'changed' so the form runs again; an answer with words it cannot read goes to the reply ranker (read-confirm-reply); an unclear one is asked again, and after two the give-up worker takes over. Result: cargo.formConfirm[form] = 'yes' | 'no' | 'changed'. Params: form, question(_es), exit_context(_es).",
809
+ description: "Worker: ask a form's confirmation (YES / NO, keys 1 and 2; firm only when an action it authorizes is a payment; otherwise soft: YES is read as a soft confirmation's and offered to the reply ranker). A correction instead ('no, make it $40') is read against the form chain and stored, and the result is 'changed' so the form runs again; an answer with words it cannot read goes to the reply ranker (read-confirm-reply); an unclear one is asked again, and after four the give-up worker takes over. Result: cargo.formConfirm[form] = 'yes' | 'no' | 'changed'. Params: form, question(_es), exit_context(_es).",
810
810
  parameters: ['form', 'confirmation', 'question', 'question_es', 'exit_context', 'exit_context_es', 'phrases', 'words', 'interrupts', 'no_keys', 'clarifications', 'invites', 'rank_parameters'].map((n) => ({ name: n, type: ['phrases', 'words', 'interrupts', 'no_keys', 'clarifications', 'invites', 'rank_parameters'].includes(n) ? 'array' : 'string', description: n })).concat([{ name: 'named_fields', type: 'boolean', description: "true: an answer that names one of the form's inputs (its names) without a value re-asks only that input" }]),
811
811
  variables: vars({ confirmation: '', cf_clarify: null, named_fields: false, reply_context: '', rank_parameters: [], cf_must: false, cf_presets: FIELD_PRESETS, cf_chain: [], cf_m: null, cf_current: null, cf_result: '', cf_prompt: '', cf_prompt_es: '', cf_words: 0, cf_tries: 0, phrases: null, words: [], clarifications: [], no_keys: ['2'], interrupts: [], invites: [], cf_choices: [], cf_event: '', cf_amount: false, cf_questions: [], cf_provides: null, cf_skip_gate: '' }),
812
812
  steps: [
@@ -853,14 +853,14 @@ const confirmForm = {
853
853
  // the ranker's reading of an unread answer: a decline is the NO; an answer that declines nothing is asked again
854
854
  SET('cf_ranked', 'cf_result', "cf_result ? cf_result : cargo.confirmRanked === 'yes' ? 'yes' : cargo.confirmRanked === 'no' ? 'no' : cargo.confirmRanked === 'none' ? 'unclear' : cargo.confirmRanked === 'concern' ? 'concern' : ''"),
855
855
  SET('cf_changed', 'cf_result', "cf_result ? cf_result : 'changed'"),
856
- // an unclear answer is asked again (the form runs again and reaches this question), at most twice
856
+ // an unclear answer is asked again (the form runs again and reaches this question); the fourth miss gives up (owner 2026-11-12: two lost a payment)
857
857
  // a concern is answered and asked again: no attempt, and the misses so far stand
858
858
  SET('cf_tries_count', 'cf_tries', "cf_result === 'unclear' ? missFormInput(cargo,form,'__confirm') : cf_result === 'concern' ? 0 : (clearFormMisses(cargo,form,'__confirm'),0)"),
859
859
  WHEN('cf_first', 'cf_must && cf_result === \'unclear\' && cf_words > 0', SIDE('cf_first_line', "(cargo.forms[form].feedback['__confirm']='first',true)")),
860
860
  // out of attempts: the give-up worker (a person), never a silent DISPATCH that ends the request unanswered
861
- optionalIncomplete('cf_optional_exhausted', 'cf_tries >= 2 && !cf_must', 'form', "'confirmation_misses_exhausted'"),
862
- WHEN('cf_misses_stamp', 'cf_tries >= 2 && !cf_must', recoveryStamp('cf_failure_stamp', 'form', "'confirmation_misses_exhausted'")),
863
- WHEN('cf_misses_exhausted', 'cf_tries >= 2 && !cf_must', FLOW('cf_give_up', 'give-up', 'reboot', { context: '{{exit_context}}', context_es: '{{exit_context_es}}' })),
861
+ optionalIncomplete('cf_optional_exhausted', 'cf_tries >= 4 && !cf_must', 'form', "'confirmation_misses_exhausted'"),
862
+ WHEN('cf_misses_stamp', 'cf_tries >= 4 && !cf_must', recoveryStamp('cf_failure_stamp', 'form', "'confirmation_misses_exhausted'")),
863
+ WHEN('cf_misses_exhausted', 'cf_tries >= 4 && !cf_must', FLOW('cf_give_up', 'give-up', 'reboot', { context: '{{exit_context}}', context_es: '{{exit_context_es}}' })),
864
864
  WHEN('cf_clarified_no_sorry', 'cf_clarify', SIDE('cf_clarified_feedback', "consumeFormFeedback(cargo,form,'__confirm')")),
865
865
  WHEN('cf_bind_revision', "cf_result === 'yes'", SIDE('cf_bind', 'confirmFormRevision(cargo, form)')),
866
866
  SIDE('cf_store', "(cargo.formConfirm[form] = cf_result === 'unclear' || cf_result === 'clarification' || cf_result === 'concern' ? 'changed' : cf_result, true)"),
@@ -921,7 +921,7 @@ const subForms = [
921
921
  description: "Sub-form: street address, city, state, ZIP, in any order. Result: the parent's result input (or cargo.formResults['collect-address']).",
922
922
  inputs: [{ name: 'street_address', field: 'street_address' }, { name: 'city', field: 'city', confirm_against: ['state'] }, { name: 'state', field: 'state' }, { name: 'zip', field: 'zip' }],
923
923
  extraVars: { exit_context: 'your address', exit_context_es: 'su dirección' } }),
924
- formFlow({ id: 'collect-credit-card', name: 'CollectCreditCard', version: '1.0.0', first_task: 'record your new card', first_task_es: 'registrar su tarjeta nueva',
924
+ formFlow({ id: 'collect-credit-card', name: 'CollectCreditCard', version: '1.0.0', first_task: 'enter your new card details', first_task_es: 'ingresar los datos de su tarjeta nueva',
925
925
  description: "Sub-form: card number, expiration, security code, billing ZIP, in any order. Result (with keep_pii for the charge step): the parent's result input.",
926
926
  inputs: [{ name: 'card_number', field: 'card_number' }, { name: 'card_expiration', field: 'card_expiration' }, { name: 'card_cvv', field: 'card_cvv' }, { name: 'card_zip', field: 'card_zip' }],
927
927
  extraVars: { exit_context: 'your payment', exit_context_es: 'su pago' } }),
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/helpers/address.js"],"names":[],"mappings":"AAEA;;;;;EAQC;AACD;;;;;SASC;AACD,gDAEC;AACD;;;;;EASC;AACD;;;;;;;;EAIC"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/helpers/address.js"],"names":[],"mappings":"AAEA;;;;;EAQC;AACD;;;;;SAWC;AACD,gDAEC;AACD;;;;;EASC;AACD;;;;;;;;EAIC"}
@@ -13,7 +13,9 @@ export function addressDraft(raw) {
13
13
  export function zipLocation(result) {
14
14
  const components = result?.components || result?.results?.[0]?.address_components || [];
15
15
  const part = (kind, short = false) => { const row = components.find(c => (c.types || []).includes(kind)); return row ? String(short ? row.short_name || row.long_name : row.long_name || row.short_name) : ''; };
16
- const city = part('locality') || part('postal_town') || part('sublocality'), state = part('administrative_area_level_1', true);
16
+ // The place name its mail carries: the locality, else (inside a city Google splits into named areas, such as Los Angeles's
17
+ // Canoga Park and West Hills, where it returns no locality) the sublocality or neighborhood.
18
+ const city = part('locality') || part('postal_town') || part('sublocality') || part('sublocality_level_1') || part('neighborhood'), state = part('administrative_area_level_1', true);
17
19
  // A ZIP code can belong to several places (90023: Commerce, East Los Angeles, Los Angeles, Vernon); each is a name its
18
20
  // mail may carry, so the caller picks one. Google lists them as postcode_localities; at most 7 (8 is a reserved key).
19
21
  const listed = [].concat(result?.localities || result?.results?.[0]?.postcode_localities || []).map(String).filter(Boolean);
@@ -30,7 +32,7 @@ export function streetLocation(result, said, zip) {
30
32
  const exact = result?.status === 'OK' && row.partial_match !== true && types.includes('street_address') && locationType === 'ROOFTOP' && part('street_number') && part('route') && (!part('postal_code') || part('postal_code') === zip);
31
33
  // An exact street match names the place its mail carries; it corrects a city read from the ZIP code alone (90805 is
32
34
  // Lakewood to the ZIP lookup, while its streets are Long Beach and Lakewood)
33
- const city = exact ? part('locality') || part('postal_town') || part('sublocality') : '';
35
+ const city = exact ? part('locality') || part('postal_town') || part('sublocality') || part('sublocality_level_1') || part('neighborhood') : '';
34
36
  return { street: exact ? part('street_number') + ' ' + part('route') : String(said).trim(), said: String(said).trim(), verified: !!exact, city };
35
37
  }
36
38
  export function resolvedAddress(values, data) {
@@ -5,7 +5,7 @@ export function missFormInput(cargo: any, id: any, input: any): any;
5
5
  * stop words, max_attempts and on_exhausted, and whatever the host intercepts before the engine). */
6
6
  export function formMustComplete(cargo: any, id: any, input: any): boolean;
7
7
  /** A must_complete question's reply that picks nothing the ranker was offered is acknowledged, then the question again (owner
8
- * 2026-11-02): "I understand, first let's record your new card." The task is the nearest enclosing form's first_task. */
8
+ * 2026-11-02): "I understand, first let's enter your new card details." The task is the nearest enclosing form's first_task. */
9
9
  export function formFirstLine(cargo: any, id: any, input: any, es: any): string;
10
10
  /**
11
11
  * A form's user_description (owner 2026-11-11): what the process does, for a caller who doubts the current process is what they
@@ -1 +1 @@
1
- {"version":3,"file":"form-conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/form-conversation.js"],"names":[],"mappings":"AAMA,0EAGC;AACD,oEAGC;AACD;;qGAEqG;AACrG,2EAWC;AACD;yHACyH;AACzH,gFAIC;AACD;;;;;GAKG;AACH;;;SAQC;AACD;+CAC+C;AAC/C,sEAIC;AACD;;;GAGG;AACH,+GAUC;AAMD,oEAOC;AACD,8EAAwI;AAExI,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,oEAGC;AACD;;qGAEqG;AACrG,2EAWC;AACD;gIACgI;AAChI,gFAIC;AACD;;;;;GAKG;AACH;;;SAQC;AACD;+CAC+C;AAC/C,sEAIC;AACD;;;GAGG;AACH,+GAUC;AAMD,oEAOC;AACD,8EAAwI;AAExI,yGAAyG;AACzG;;;;;;;;;;;;;;;;;;;;EAUC;AAED,sGAAsG;AACtG;;;;;;;;;;;;;;;;;;;;EAeC;AAED;2HAC2H;AAC3H,8EAOC"}
@@ -45,7 +45,7 @@ export function formMustComplete(cargo, id, input) {
45
45
  return false;
46
46
  }
47
47
  /** A must_complete question's reply that picks nothing the ranker was offered is acknowledged, then the question again (owner
48
- * 2026-11-02): "I understand, first let's record your new card." The task is the nearest enclosing form's first_task. */
48
+ * 2026-11-02): "I understand, first let's enter your new card details." The task is the nearest enclosing form's first_task. */
49
49
  export function formFirstLine(cargo, id, input, es) {
50
50
  const seen = new Set();
51
51
  let task = '';
@@ -1 +1 @@
1
- {"version":3,"file":"reply-rank.d.ts","sourceRoot":"","sources":["../../src/host/reply-rank.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,aAAa,4DAA6D,CAAC;AACxF,kEAAkE;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,UAAU,MAAM,EAAE,CAAC;AACxF,wHAAwH;AACxH,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AACjD,0FAA0F;AAG1F,MAAM,WAAW,oBAAoB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;AACzF,MAAM,WAAW,WAAW;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAAC,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAAE;AACvH,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,gGAAgG;AAChG,eAAO,MAAM,aAAa,EAAE,WAAuB,CAAC;AACpD,wCAAwC;AACxC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAY3D,CAAC;AACF;;;GAGG;AACH,eAAO,MAAM,4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@ export function decodeReplyRankSystemOne(answers, request, { threshold = REPLY_Y
208
208
  const cleared = request.systemOne.index.map(q => q.option).filter(o => scores[o] >= (cuts[o] ?? threshold)).sort((a, b) => scores[b] - scores[a]);
209
209
  // A cleared choice is taken over `answers` and `new_request` (owner 2026-10-28: a request that names an offered option
210
210
  // is that option, "Representative." is the agent); only `abort` keeps its rank.
211
- const choice = cleared.find(o => o.startsWith(CHOICE_PREFIX));
211
+ // A refusal that names another offered choice is that choice (owner 2026-11-12; prod CAc00caf: "no era membresía… es
212
+ // monitor" at the Club cancellation scored no .94, mcm .57, and the correction was lost): a cleared choice other than
213
+ // NO, YES and an escape (`__agent`) is taken over the NO.
214
+ const firstChoice = cleared.find(o => o.startsWith(CHOICE_PREFIX));
215
+ const named = firstChoice === `${CHOICE_PREFIX}no` ? cleared.find(o => o.startsWith(CHOICE_PREFIX) && ![`${CHOICE_PREFIX}no`, `${CHOICE_PREFIX}yes`].includes(o) && !o.startsWith(`${CHOICE_PREFIX}__`)) : undefined;
216
+ const choice = named ?? firstChoice;
212
217
  // `irrelevant` takes a choice's place only from its own higher cut (REPLY_IRRELEVANT_OVER_CHOICE).
213
- const yieldsToChoice = cleared[0] === 'answers' || cleared[0] === 'new_request' || (cleared[0] === 'irrelevant' && scores.irrelevant < REPLY_IRRELEVANT_OVER_CHOICE);
218
+ const yieldsToChoice = (named !== undefined && cleared[0] === `${CHOICE_PREFIX}no`) || cleared[0] === 'answers' || cleared[0] === 'new_request' || (cleared[0] === 'irrelevant' && scores.irrelevant < REPLY_IRRELEVANT_OVER_CHOICE);
214
219
  // A clear ask outranks noise (owner 2026-11-02, prod "¿Quién habla?" irrelevant .85, new_request .72): with both cleared the reply is a request.
215
220
  const best = choice && yieldsToChoice ? choice : cleared[0] === 'irrelevant' && !choice && cleared.includes('new_request') ? 'new_request' : cleared[0];
216
221
  if (best) {
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:00e658a3501432cfcba47657486370b3517cb6c1698fbb438b3de360be600b97";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:547956f390bd1b1db2a3f2696105403111ae29689c096c44183ecb6c34808e8b";
@@ -267,13 +267,13 @@ The loop skips accepted data and asks the first ready missing required field. Co
267
267
 
268
268
  ### Retry, yield and recovery
269
269
 
270
- An unreadable answer with any words goes to the reply ranker, offered the question's choices (`exact` ones too, since `exact` is how words match a choice; never the YES of a firm confirmation; a NO always) and a person (`__agent`), never text (the words and keypad key for text are read before it): a picked choice is the answer, a person is taken, a reply that picks none is asked again (counted against `max_attempts`); only `abort` or `new_request` leaves the form. `max_misses` (default two) bounds unreadable answers without words (symbols, an unexpected keypad entry): clarify the first with explicit retry text or a localized “Sorry, I didn't catch that.” prefix; yield the second utterance to DISPATCH while preserving the draft. A form confirmation's unread answers are ranked the same way (offered NO, never YES); after two, the `give-up` worker takes over. Validator failures use a separate `max_attempts` budget. An out-of-order accepted answer is not a miss. On exhaustion the nearest declared `on_exhausted` receives `{form,input,failed_form,failed_input,reason:"attempts_exhausted"}` and must deliberately recover that branch; it does not receive consent.
270
+ An unreadable answer with any words goes to the reply ranker, offered the question's choices (`exact` ones too, since `exact` is how words match a choice; never the YES of a firm confirmation; a NO always) and a person (`__agent`), never text (the words and keypad key for text are read before it): a picked choice is the answer, a person is taken, a reply that picks none is asked again (counted against `max_attempts`); only `abort` or `new_request` leaves the form. `max_misses` (default two) bounds unreadable answers without words (symbols, an unexpected keypad entry): clarify the first with explicit retry text or a localized “Sorry, I didn't catch that.” prefix; yield the second utterance to DISPATCH while preserving the draft. A form confirmation's unread answers are ranked the same way (offered NO, never YES); after four, the `give-up` worker takes over. Validator failures use a separate `max_attempts` budget. An out-of-order accepted answer is not a miss. On exhaustion the nearest declared `on_exhausted` receives `{form,input,failed_form,failed_input,reason:"attempts_exhausted"}` and must deliberately recover that branch; it does not receive consent.
271
271
 
272
272
  `user_description` / `user_description_es` on a form (jsfe 1.42.0): one sentence saying what the process does, written with the engine's own `{{...}}` expressions, every input of the form in scope ('' until answered) and its data ("This process allows you to change the delivery address or delivery date for your order.{{change === 'address' ? ' You chose to change the delivery address.' : change === 'date' ? ' You chose to change the delivery date.' : ''}}"). The nearest form in the chain declaring one is used. The form's readers then offer the reply ranker `concern`; a caller who expresses doubt that the process is what they need hears the sentence, "To cancel, press the asterisk key or say EXIT." (text: "To cancel, type EXIT."; Spanish SALIR) and the question again, with no attempt counted. Declare it where a caller may mistake what the flow is doing; it applies to every question of the form and its sub-forms, so word it for all of them.
273
273
 
274
274
  **Global keys (jsfe 1.42.0).** A whole answer `*`, EXIT, QUIT or SALIR ends every flow at any question and starts `global-exit` (default: "cancelled at your request" and an offer of more help, thanks when resolved; a tenant overrides it with a flow that `wraps: "global-exit"`). On a call a whole answer `9` starts `switch-to-text` when the caller can be texted. Never write a local handler for these; to give a question its own meaning for one, declare it as a choice (key or phrase): a declared choice takes the answer. CANCEL is not an exit word.
275
275
 
276
- `must_complete:true` on a form (inherited by every field of it and of the forms nested in it) or on one field (`false` on a field opts out): an unreadable answer is never yielded to DISPATCH, however long, and neither is a confirmation miss or an unresolved ambiguity — the question is asked again, acknowledged. A worded reply always reaches the reply ranker, offered every choice the chain's reader accepts: a pick is taken, a clear withdrawal ends the flows, and any other verdict (a new request included) stays and says `first_task` / `first_task_es` from the nearest form declaring it, "I understand, first let's record your new card." / "Entiendo, primero vamos a registrar su tarjeta nueva.", then the field's `retry` or its question. It uses no attempt. Use it where leaving would strand an effect in progress (a payment's card, its billing-ZIP correction). Other exits stay explicit: the form's stop words, `max_attempts` with `on_exhausted`, and whatever the host intercepts before the engine. The form runaway guard counts passes without a caller answer only.
276
+ `must_complete:true` on a form (inherited by every field of it and of the forms nested in it) or on one field (`false` on a field opts out): an unreadable answer is never yielded to DISPATCH, however long, and neither is a confirmation miss or an unresolved ambiguity — the question is asked again, acknowledged. A worded reply always reaches the reply ranker, offered every choice the chain's reader accepts: a pick is taken, a clear withdrawal ends the flows, and any other verdict (a new request included) stays and says `first_task` / `first_task_es` from the nearest form declaring it, "I understand, first let's enter your new card details." / "Entiendo, primero vamos a ingresar los datos de su tarjeta nueva.", then the field's `retry` or its question. It uses no attempt. Use it where leaving would strand an effect in progress (a payment's card, its billing-ZIP correction). Other exits stay explicit: the form's stop words, `max_attempts` with `on_exhausted`, and whatever the host intercepts before the engine. The form runaway guard counts passes without a caller answer only.
277
277
 
278
278
  `confirm.named_fields: true` lets a caller correct a read-back in their own words: each input of this form that declares `names` and holds a value is offered to the reply ranker, and a pick extracts the new value of every such input, so one reply can change several. `confirm.reply_context` tells the ranker and the extraction what a reply may contain (never spoken); an input's `argument_description` says what its value looks like ("apartment or unit number alone, such as 4 or 12B"). A reply the word readers only partly account for goes to the ranker, so none of it is lost.
279
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.53.0",
3
+ "version": "1.55.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",