jsfe 1.13.1 → 1.14.1

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 CHANGED
@@ -374,6 +374,15 @@ outcome `user_aborted`, no recovery stamp;
374
374
  `answers` a later ordinary DISPATCH in the same turn hands the host the turn without detection. A host that does not know the task answers the `llm`
375
375
  instructions with its text model.
376
376
 
377
+ **Declared choices (`responseChoices`, jsfe 1.14):** a step may name a flow variable of type array holding
378
+ `[{ key, label }]`; the ranker is then also offered `choice:<key>` for each (before the fixed three), and `answers`
379
+ means a reply that picks none of them. A picked choice sets `responseVariable` to `{ key }` with no extraction;
380
+ `answers` sets `{ key: '' }` unless `responseParameters` are declared too. The request carries the options it offers
381
+ (`request.options`); a host validates a reply against those, never a fixed list. The form readers use it: an unread
382
+ answer with any words goes to the ranker with the question's choices (never an exact choice or the YES of a firm
383
+ confirmation; a NO always) and two escapes every question supports, `__agent` (a person) and `__text` (on a call with
384
+ a textable number); a confirmation's exhausted attempts go to the `give-up` worker.
385
+
377
386
  **Host start (`ContextEntry.start`):** `{ role: 'user', content, start: { flow, arguments } }` starts that
378
387
  flow (any flow, by id or name) with those arguments on this turn, without asking the AI. Only the host sets it;
379
388
  it is never derived from what the user typed.
@@ -452,7 +452,7 @@ export const FLOWS = [
452
452
  "id": "ac_switch_to_text_key",
453
453
  "type": "SET",
454
454
  "variable": "ac_key",
455
- "value": "ac_key === '' && !ac_other && !ac_amount && cargo.voice && String(ac_answer || '').trim() === '9' && !!callerTextNumber(cargo) ? '__text' : ac_key"
455
+ "value": "ac_key === '' && !ac_other && !ac_amount && cargo.voice && String(ac_answer || '').trim().replace(/[.,!?;:]+$/, '') === '9' && !!callerTextNumber(cargo) ? '__text' : ac_key"
456
456
  },
457
457
  {
458
458
  "id": "ac_keypad_again",
@@ -629,7 +629,7 @@ export const FLOWS = [
629
629
  "id": "ac_switch_to_text_key_again",
630
630
  "type": "SET",
631
631
  "variable": "ac_key",
632
- "value": "ac_key === '' && !ac_other && !ac_amount && cargo.voice && String(ac_answer || '').trim() === '9' && !!callerTextNumber(cargo) ? '__text' : ac_key"
632
+ "value": "ac_key === '' && !ac_other && !ac_amount && cargo.voice && String(ac_answer || '').trim().replace(/[.,!?;:]+$/, '') === '9' && !!callerTextNumber(cargo) ? '__text' : ac_key"
633
633
  },
634
634
  {
635
635
  "id": "ac_keypad_done",
@@ -1 +1 @@
1
- {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA6HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DC;AACD;;;GAGG;AACH;;;;;;EAGC;AAocD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AAhoBM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyzB9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA6HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DC;AACD;;;GAGG;AACH;;;;;;EAGC;AAqdD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AAjpBM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA00B9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
@@ -309,7 +309,7 @@ const collectInput = {
309
309
  'condition: ci_m.hits.length > 0': FLOW('ci_accept', 'collect-input-accept', 'call', { hits: '{{ci_m.hits}}' }),
310
310
  "condition: ci_m.questions.length > 0": END('ci_question_handled'),
311
311
  "condition: ci_qkey && ci_qkey.indexOf('__') !== 0": FLOW('ci_question_asked', 'provide-data', 'call', { form: '{{form}}', provides: '{{provides}}', asked: '{{ci_qkey}}', no_menu: 'true', no_gate: '{{ci_skip_gate}}' }),
312
- "condition: !ci_must && (ci_words >= 3 || ci_spec.profile.kind === 'amount' && ci_words > 0)": FLOW('ci_elsewhere', '{{ci_reply_reader}}', 'call', { form: '{{form}}', input: '{{current}}', question: '{{ci_q}}', question_es: '{{ci_q_es}}', choices: '{{ci_choices}}' }),
312
+ "condition: !ci_must && ci_words > 0": FLOW('ci_elsewhere', '{{ci_reply_reader}}', 'call', { form: '{{form}}', input: '{{current}}', question: '{{ci_q}}', question_es: '{{ci_q_es}}', choices: '{{ci_choices}}', firm: '{{ci_spec.confirmation}}' }),
313
313
  default: SIDE('ci_miss', "(missFormInput(cargo,form,current),true)")
314
314
  } },
315
315
  ],
@@ -382,26 +382,37 @@ const readFormResponse = {
382
382
  WHEN('response_missing', "!reply || typeof reply.answer !== 'string' || !reply.answer.trim()", SIDE('response_rejected', '(cargo.inputCheck={ok:false,quiet:true},true)'))]
383
383
  };
384
384
  // An answer the field's reader could not read goes to the reply ranker, never straight to the host (owner 2026-10-26: a form
385
- // gives up only for a real new intent). `answers`: a choice field takes the offered key the reply picks, else the
386
- // question is asked again ("Sorry, I didn't catch that."), counted as an attempt so max_attempts still bounds it;
387
- // `abort` ends every flow; `new_request` goes to intent detection.
385
+ // gives up only for a real new intent). The ranker is offered the question's declared choices and the two escapes every
386
+ // question supports (owner 2026-10-28): a person, and on a call with a textable number, text. Every declared choice is
387
+ // offered, `exact` ones too (exact is how WORDS match a choice, not a confirmation); only the YES of a firm (hard)
388
+ // confirmation never is. A choice without a label is described by its key and its worded phrases (keys are digits).
389
+ // `answers` (picks none): asked again ("Sorry, I didn't catch that."), counted as an attempt so max_attempts still bounds
390
+ // it; `abort` ends every flow; `new_request` goes to intent detection.
388
391
  const rankedMiss = (id) => SIDE(id, "(cargo.forms[form].attempts=cargo.forms[form].attempts || {},cargo.forms[form].attempts[input]=Number(cargo.forms[form].attempts[input] || 0)+1,cargo.forms[form].feedback=cargo.forms[form].feedback || {},cargo.forms[form].feedback[input]='miss',true)");
392
+ const ESCAPES_JS = "[{key:'__agent',label:'speak with a person (a live agent)'}].concat(cargo.voice && callerTextNumber(cargo) ? [{key:'__text',label:'continue by text message'}] : [])";
393
+ const rankedChoices = (id, from) => SET(id, 'ranked', `(${from}).concat(${ESCAPES_JS})`);
394
+ const escapeRoutes = (id) => [WHEN(`${id}_agent`, "reply && reply.key === '__agent'", FLOW(`${id}_agent_flow`, 'live-agent-requested', 'reboot')),
395
+ WHEN(`${id}_text`, "reply && reply.key === '__text'", FLOW(`${id}_text_flow`, 'switch-to-text', 'reboot'))];
396
+ const rankedDispatch = (id, reason) => ({ ...yieldDispatch(id, 'form', `'${reason}'`), onResponse: 'continue', responseContext: 'Current question: {{asked}}', responseChoices: 'ranked', responseVariable: 'reply' });
389
397
  const readFormReply = {
390
- id: 'read-form-reply', name: 'ReadFormReply', version: '1.0.0', scope: 'isolated', description: 'Rank an unreadable answer against its question: an answer is asked again, a withdrawal or a new request leaves with saved form progress.',
398
+ id: 'read-form-reply', name: 'ReadFormReply', version: '1.1.0', scope: 'isolated', description: 'Rank an unreadable answer against its question: a request for a person or for text is taken; an answer is asked again; a withdrawal or a new request leaves with saved form progress.',
391
399
  parameters: [{ name: 'form', type: 'string' }, { name: 'input', type: 'string' }, { name: 'question', type: 'string' }, { name: 'question_es', type: 'string' }],
392
- variables: vars({ question: '', question_es: '', asked: '' }),
400
+ variables: vars({ question: '', question_es: '', asked: '', ranked: [], reply: null }),
393
401
  steps: [SET('reply_asked', 'asked', "language === 'es' && question_es ? question_es : question"),
394
- { ...yieldDispatch('reply_dispatch', 'form', "'input_not_matched'"), onResponse: 'continue', responseContext: 'Current question: {{asked}}' },
402
+ rankedChoices('reply_ranked', '[]'),
403
+ rankedDispatch('reply_dispatch', 'input_not_matched'),
404
+ ...escapeRoutes('reply_escape'),
395
405
  rankedMiss('reply_miss')]
396
406
  };
397
407
  const readFormChoice = {
398
- id: 'read-form-choice', name: 'ReadFormChoice', version: '1.0.0', scope: 'isolated', description: 'Rank an unreadable answer to a choice question and take the offered option it picks; otherwise ask again. A withdrawal or a new request leaves with saved form progress.',
399
- parameters: [{ name: 'form', type: 'string' }, { name: 'input', type: 'string' }, { name: 'question', type: 'string' }, { name: 'question_es', type: 'string' }, { name: 'choices', type: 'array' }],
400
- variables: vars({ question: '', question_es: '', choices: [], asked: '', options: '', reply: null, picked: '', chain: null, reading: null }),
408
+ id: 'read-form-choice', name: 'ReadFormChoice', version: '1.2.0', scope: 'isolated', description: 'Rank an unreadable answer to a choice question and take the offered option it picks, or a request for a person or for text; otherwise ask again. A withdrawal or a new request leaves with saved form progress.',
409
+ parameters: [{ name: 'form', type: 'string' }, { name: 'input', type: 'string' }, { name: 'question', type: 'string' }, { name: 'question_es', type: 'string' }, { name: 'choices', type: 'array' }, { name: 'firm', type: 'string' }],
410
+ variables: vars({ question: '', question_es: '', choices: [], firm: '', asked: '', ranked: [], reply: null, picked: '', chain: null, reading: null }),
401
411
  steps: [SET('choice_asked', 'asked', "language === 'es' && question_es ? question_es : question"),
402
- SET('choice_options', 'options', "(choices || []).map(function(c){return String(c.key)+' ('+String(c.label || (Array.isArray(c.phrases) && c.phrases.filter(function(p){return String(p)!==String(c.key);})[0]) || c.key)+')';}).join(', ')"),
403
- { ...yieldDispatch('choice_dispatch', 'form', "'input_not_matched'"), onResponse: 'continue', responseContext: 'Current question: {{asked}}', responseParameters: [{ name: 'key', type: 'string', description: 'The key of the offered option the reply picks or says it already chose, one of: {{options}}. Leave it empty when the reply picks none of them.' }], responseVariable: 'reply' },
404
- SET('choice_picked', 'picked', "(function(){var k=String(reply && reply.key || '').trim().toLowerCase();var c=(choices || []).filter(function(c){return String(c.key).toLowerCase()===k;})[0];return c ? String(c.key) : '';})()"),
412
+ rankedChoices('choice_ranked', "(choices || []).filter(function(c){return !(firm==='firm' && String(c.key)==='yes');}).map(function(c){var said=(Array.isArray(c.phrases) ? c.phrases : []).map(String).filter(function(p){return /[a-zà-ÿ]/i.test(p) && p!==String(c.key);}).slice(0,6);return {key:String(c.key),label:String(c.label || (said.length ? c.key+' ('+said.join(', ')+')' : c.key))};})"),
413
+ rankedDispatch('choice_dispatch', 'input_not_matched'),
414
+ ...escapeRoutes('choice_escape'),
415
+ SET('choice_picked', 'picked', "(function(){var k=String(reply && reply.key || '');var c=(choices || []).filter(function(c){return String(c.key)===k;})[0];return c ? String(c.key) : '';})()"),
405
416
  WHEN('choice_none', '!picked', rankedMiss('choice_miss')),
406
417
  WHEN('choice_none_end', '!picked', END('choice_none_done')),
407
418
  SIDE('choice_take', "(cargo.choice=picked,cargo.choiceText=picked,true)"),
@@ -413,15 +424,18 @@ const readFormChoice = {
413
424
  FLOW('choice_accept', 'collect-input-accept', 'call', { hits: '{{reading.hits}}' })]
414
425
  };
415
426
  // A confirmation's unread answer goes to the reply ranker with the confirmation question (owner 2026-10-27), never
416
- // straight to the host. The ranker is offered NO only: a confirmation is accepted only by its exact YES. Result:
417
- // cargo.confirmRanked = 'no' | 'none' (ConfirmForm reads it); `abort` ends every flow; `new_request` goes to intent detection.
427
+ // straight to the host. A form's confirmation is exact (it authorizes the form's action), so the ranker is offered NO
428
+ // and the escapes, never YES. Result: cargo.confirmRanked = 'no' | 'none' (ConfirmForm reads it); `abort` ends every
429
+ // flow; `new_request` goes to intent detection.
418
430
  const readConfirmReply = {
419
- id: 'read-confirm-reply', name: 'ReadConfirmReply', version: '1.0.0', scope: 'isolated', description: 'Rank an unreadable answer to a confirmation: it declines (NO) or is asked again; a withdrawal or a new request leaves with saved form progress. Never confirms.',
431
+ id: 'read-confirm-reply', name: 'ReadConfirmReply', version: '1.1.0', scope: 'isolated', description: 'Rank an unreadable answer to a confirmation: it declines (NO), asks for a person or for text, or is asked again; a withdrawal or a new request leaves with saved form progress. Never confirms.',
420
432
  parameters: [{ name: 'form', type: 'string' }, { name: 'question', type: 'string' }, { name: 'question_es', type: 'string' }],
421
- variables: vars({ question: '', question_es: '', asked: '', reply: null }),
433
+ variables: vars({ question: '', question_es: '', asked: '', ranked: [], reply: null }),
422
434
  steps: [SET('confirm_asked', 'asked', "language === 'es' && question_es ? question_es : question"),
423
- { ...yieldDispatch('confirm_dispatch', 'form', "'confirmation_not_matched'"), onResponse: 'continue', responseContext: 'Current question: {{asked}}', responseParameters: [{ name: 'key', type: 'string', description: "'no' when the reply declines or refuses what the question asks to confirm. Leave it empty otherwise, including when it agrees." }], responseVariable: 'reply' },
424
- SIDE('confirm_ranked', "(cargo.confirmRanked=String(reply && reply.key || '').trim().toLowerCase()==='no' ? 'no' : 'none',true)")]
435
+ rankedChoices('confirm_ranked_choices', "[{key:'no',label:'no: declines or refuses what the question asks to confirm'}]"),
436
+ rankedDispatch('confirm_dispatch', 'confirmation_not_matched'),
437
+ ...escapeRoutes('confirm_escape'),
438
+ SIDE('confirm_ranked', "(cargo.confirmRanked=reply && reply.key==='no' ? 'no' : 'none',true)")]
425
439
  };
426
440
  const collectContextualAnswer = formFlow({ id: 'collect-contextual-answer', name: 'CollectContextualAnswer', description: 'Collect one open-ended answer using contextual DISPATCH and preserve the caller wording.',
427
441
  parameters: [...['question', 'question_es', 'description', 'context', 'context_es'].map(name => ({ name, type: 'string' })), { name: 'choices', type: 'array' }, { name: 'digits', type: 'object' }],
@@ -507,7 +521,7 @@ const disambiguate = {
507
521
  // ── confirm-form: the exact confirmation of a finished form; a correction is matched against the form chain ───────
508
522
  const confirmForm = {
509
523
  id: 'confirm-form', name: 'ConfirmForm', version: '1.0.0', scope: 'isolated',
510
- description: "Worker: ask a form's confirmation (exact YES / NO; keys 1 and 2). 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 unclear short answer is asked again, a long unread one goes to the reply ranker (read-confirm-reply). Result: cargo.formConfirm[form] = 'yes' | 'no' | 'changed'. Params: form, question(_es), exit_context(_es).",
524
+ description: "Worker: ask a form's confirmation (exact YES / NO; keys 1 and 2). 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).",
511
525
  parameters: ['form', 'question', 'question_es', 'exit_context', 'exit_context_es', 'phrases', 'words', 'interrupts', 'no_keys', 'clarifications', 'invites'].map((n) => ({ name: n, type: ['phrases', 'words', 'interrupts', 'no_keys', 'clarifications', 'invites'].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" }]),
512
526
  variables: vars({ named_fields: false, cf_must: false, cf_named: null, 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: '' }),
513
527
  steps: [
@@ -546,15 +560,18 @@ const confirmForm = {
546
560
  'condition: cf_named': SET('cf_named_reset', 'cf_result', "(resetFormInputs(cargo, cf_named.form, [cf_named.name]), 'changed')"),
547
561
  "condition: cargo.choice === 'no'": SET('cf_declined', 'cf_result', "'no'"),
548
562
  "condition: Array.isArray(clarifications) && pickChoice(String(cargo.choiceText || '').replace(/[?¿]/g,''),[{key:'clarify',phrases:clarifications,exact:true}],false)==='clarify'": SET('cf_clarification', 'cf_result', "'clarification'"),
549
- 'condition: !cf_must && (cf_words >= 3 || cf_amount && cf_words > 0)': FLOW('cf_elsewhere', 'read-confirm-reply', 'call', { form: '{{form}}', question: '{{cf_prompt}}', question_es: '{{cf_prompt_es}}' }),
563
+ 'condition: !cf_must && cf_words > 0': FLOW('cf_elsewhere', 'read-confirm-reply', 'call', { form: '{{form}}', question: '{{cf_prompt}}', question_es: '{{cf_prompt_es}}' }),
550
564
  default: SET('cf_unclear', 'cf_result', "'unclear'")
551
565
  } },
552
566
  // the ranker's reading of an unread answer: a decline is the NO; an answer that declines nothing is asked again
553
567
  SET('cf_ranked', 'cf_result', "cf_result ? cf_result : cargo.confirmRanked === 'no' ? 'no' : cargo.confirmRanked === 'none' ? 'unclear' : ''"),
554
568
  SET('cf_changed', 'cf_result', "cf_result ? cf_result : 'changed'"),
555
- // an unclear short answer is asked again (the form runs again and reaches this question), at most twice
569
+ // an unclear answer is asked again (the form runs again and reaches this question), at most twice
556
570
  SET('cf_tries_count', 'cf_tries', "cf_result === 'unclear' ? missFormInput(cargo,form,'__confirm') : (clearFormMisses(cargo,form,'__confirm'),0)"),
557
- WHEN('cf_misses_exhausted', 'cf_tries >= 2 && !cf_must', yieldDispatch('cf_misses_dispatch', 'form', "'confirmation_misses_exhausted'")),
571
+ // out of attempts: the give-up worker (a person), never a silent DISPATCH that ends the request unanswered
572
+ optionalIncomplete('cf_optional_exhausted', 'cf_tries >= 2 && !cf_must', 'form', "'confirmation_misses_exhausted'"),
573
+ WHEN('cf_misses_stamp', 'cf_tries >= 2 && !cf_must', recoveryStamp('cf_failure_stamp', 'form', "'confirmation_misses_exhausted'")),
574
+ WHEN('cf_misses_exhausted', 'cf_tries >= 2 && !cf_must', FLOW('cf_give_up', 'give-up', 'reboot', { context: '{{exit_context}}', context_es: '{{exit_context_es}}' })),
558
575
  WHEN('cf_bind_revision', "cf_result === 'yes'", SIDE('cf_bind', 'confirmFormRevision(cargo, form)')),
559
576
  SIDE('cf_store', "(cargo.formConfirm[form] = cf_result === 'unclear' || cf_result === 'clarification' ? 'changed' : cf_result, true)"),
560
577
  ],
@@ -257,12 +257,12 @@ const retry = worker('generic-retry-with-options', 'GenericRetryWithOptions', 'C
257
257
  set('retry_question', 'retry_question', "error_message+' '+(question || 'Would you like to try again?')+' To retry '+(cargo.voice?'Press 1 or ':'')+cargo.verb+' YES. '+(callerTextNumber(cargo)?'To switch to text press 9 or '+cargo.verb+' TEXT. ':'')+'To abort '+(cargo.voice?'press the asterisk key or ':'')+cargo.verb+' EXIT.'"),
258
258
  set('retry_question_es', 'retry_question_es', "error_message_es+' '+(question_es || '¿Le gustaría intentar nuevamente?')+' Para reintentar '+(cargo.voice?'Presione 1 o ':'')+cargo.verb_es+' SÍ. '+(callerTextNumber(cargo)?'Para cambiar a texto presione 9 o '+cargo.verb_es+' TEXTO. ':'')+'Para salir '+(cargo.voice?'presione la tecla de asterisco o ':'')+cargo.verb_es+' SALIR.'"),
259
259
  call('retry_collect', 'collect-service-answer', { profiles: '{{retry_profiles}}', question: '{{retry_question}}', question_es: '{{retry_question_es}}', keypad: { min: 1, max: 1 }, parent_form: '{{parent_form}}' }),
260
- set('retry_answer', 'user_choice', 'String(cargo.serviceAnswer.raw || "")'),
260
+ set('retry_answer', 'user_choice', 'String(cargo.serviceAnswer.raw || "").trim().replace(/[.,!?;:]+$/,"")'),
261
261
  set('retry_default_cancel', 'cancel_flow', "cancel_flow || 'contact-support'"),
262
262
  when('retry_unknown_key_question', '/^\\s*[2-8]\\s*$/.test(user_choice)', set('retry_unknown_question', 'retry_question', "'Sorry, that is not an option. To retry '+(cargo.voice?'Press 1 or ':'')+cargo.verb+' YES. '+(callerTextNumber(cargo)?'To switch to text press 9 or '+cargo.verb+' TEXT. ':'')+(cargo.voice?'For an agent press 0. ':'')+'To abort '+(cargo.voice?'press the asterisk key or ':'')+cargo.verb+' EXIT.'")),
263
263
  when('retry_unknown_key_question_es', '/^\\s*[2-8]\\s*$/.test(user_choice)', set('retry_unknown_question_es', 'retry_question_es', "'Lo siento, esa no es una opción. Para reintentar '+(cargo.voice?'Presione 1 o ':'')+cargo.verb_es+' SÍ. '+(callerTextNumber(cargo)?'Para cambiar a texto presione 9 o '+cargo.verb_es+' TEXTO. ':'')+(cargo.voice?'Para un agente presione 0. ':'')+'Para salir '+(cargo.voice?'presione la tecla de asterisco o ':'')+cargo.verb_es+' SALIR.'")),
264
264
  when('retry_unknown_key', '/^\\s*[2-8]\\s*$/.test(user_choice)', call('retry_bad_key_collect', 'collect-service-answer', { profiles: '{{retry_profiles}}', question: '{{retry_question}}', question_es: '{{retry_question_es}}', keypad: { min: 1, max: 1 }, parent_form: '{{parent_form}}' })),
265
- set('retry_latest_answer', 'user_choice', 'String(cargo.serviceAnswer.raw || "")'), set('retry_capture', 'smart_capture_result', 'capture_patterns && capture_patterns.length ? normalizeAndFindCapture(user_choice,capture_patterns) : null'),
265
+ set('retry_latest_answer', 'user_choice', 'String(cargo.serviceAnswer.raw || "").trim().replace(/[.,!?;:]+$/,"")'), set('retry_capture', 'smart_capture_result', 'capture_patterns && capture_patterns.length ? normalizeAndFindCapture(user_choice,capture_patterns) : null'),
266
266
  cases('retry_capture_route', { 'condition: smart_capture_result && retry_call_type === "replace"': call('retry_captured_replace', '{{retry_flow}}', { cell_number: '', email: '', '{{smart_capture_result.variable}}': '{{smart_capture_result.value}}', retry_flow: '{{retry_flow}}', cancel_flow: '{{cancel_flow}}', retrying: true, contact_options: null, parent_form: '{{parent_form}}' }, 'replace'), 'condition: smart_capture_result': call('retry_captured_reboot', '{{retry_flow}}', { '{{smart_capture_result.variable}}': '{{smart_capture_result.value}}', retry_flow: '{{retry_flow}}', cancel_flow: '{{cancel_flow}}', retrying: true, contact_options: null, parent_form: '{{parent_form}}' }, 'reboot'), default: effect('retry_no_capture', 'true') }),
267
267
  set('retry_typed_code', 'normalized_otp_code', "allow_code_entry && user_choice.replace(/\\D/g,'').length === 6 ? user_choice.replace(/\\D/g,'') : ''"), when('retry_validate_code', '!!normalized_otp_code', call('retry_code_validate', 'validate-otp-code')),
268
268
  cases('retry_decision', { 'condition: normalized_otp_code && cargo.otpVerified === true': end('retry_verified'), "condition: (user_choice.trim() === '1' || isAnswer(user_choice,'yes',retry_yes_words)) && retry_call_type === 'replace'": call('retry_yes_replace', '{{retry_flow}}', { retrying: true, cell_number: '', email: '', contact_options: null, parent_form: '{{parent_form}}' }, 'replace'), "condition: user_choice.trim() === '1' || isAnswer(user_choice,'yes',retry_yes_words)": call('retry_yes_reboot', '{{retry_flow}}', { retrying: true, contact_options: null, parent_form: '{{parent_form}}' }, 'reboot'), "condition: user_choice.trim() === '9' || isAnswer(user_choice,'text')": call('retry_text', 'switch-to-text', undefined, 'reboot'), "condition: isAgentRequest(user_choice)": call('retry_agent', 'live-agent-requested', undefined, 'reboot'), "condition: !user_choice.trim() || /^\\d$/.test(user_choice.trim()) || isExitRequest(user_choice)": call('retry_cancel', '{{cancel_flow}}', undefined, 'reboot'), default: { id: 'retry_dispatch', type: 'DISPATCH', outcome: '{{caller_outcome}}', reason: '{{caller_reason}}' } })
@@ -1 +1 @@
1
- {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/helpers/contact.js"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH;;WA8BC;AAID;;;;;GAKG;AACH,0CAWC;AAED;;;;;GAKG;AACH,0DAgBC;AAED,qHAAqH;AACrH,2DAIC;AAED;;;;GAIG;AACH;;;SAmBC;AAED;;;GAGG;AACH,sDAOC;AAED;;;;;GAKG;AACH,yEAUC;AAQD;;;;;GAKG;AACH,qDAIC;AAED,mHAAmH;AACnH,oDAIC"}
1
+ {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/helpers/contact.js"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AACH;;WAiCC;AAID;;;;;GAKG;AACH,0CAWC;AAED;;;;;GAKG;AACH,0DAgBC;AAED,qHAAqH;AACrH,2DAIC;AAED;;;;GAIG;AACH;;;SAmBC;AAED;;;GAGG;AACH,sDAOC;AAED;;;;;GAKG;AACH,yEAUC;AAQD;;;;;GAKG;AACH,qDAIC;AAED,mHAAmH;AACnH,oDAIC"}
@@ -40,7 +40,10 @@ export function readEmail(text, { literal = false } = {}) {
40
40
  return '';
41
41
  }
42
42
  else {
43
- const domain = (spoken.slice(at + 1).trim().match(/^[^\s@]+/) || [''])[0].replace(/[.,;:!?]+$/, '');
43
+ // a spelled domain arrives in pieces ("gm a i l.com", "y a h o o . c o m"): join them up to its top-level domain
44
+ const after = spoken.slice(at + 1).trim();
45
+ const spelled = after.match(/^[a-z0-9-]+(?:\s+[a-z0-9-]+){1,12}?(?:\s*\.\s*(?:[a-z]{2,}|[a-z](?:\s+[a-z]){1,2})\b){1,2}/i);
46
+ const domain = (spelled ? spelled[0].replace(/\s+/g, '') : (after.match(/^[^\s@]+/) || [''])[0]).replace(/[.,;:!?]+$/, '');
44
47
  const pieces = spoken.slice(0, at).replace(/@/g, ' ').normalize('NFD').replace(/[\u0300-\u036f]/g, '').split(/[\s,;:!?]+/).map((w) => w.replace(/^[^a-z0-9]+|[^a-z0-9]+$/gi, '')).filter(Boolean);
45
48
  const local = [];
46
49
  for (let k = pieces.length - 1; k >= 0 && local.join('').length < 64; k--) {
@@ -1,5 +1,6 @@
1
1
  /** Return an isolated declaration copy; unknown response fields cannot silently become legacy dispatch. */
2
2
  export function validateContextualResponseStep(step: any, flow: any): {
3
+ choices?: any;
3
4
  parameters: any;
4
5
  variable: any;
5
6
  } | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"contextual-response.d.ts","sourceRoot":"","sources":["../../src/helpers/contextual-response.js"],"names":[],"mappings":"AAMA,2GAA2G;AAC3G;;;qBAkBC;AACD,+FAIC;AAED,gGAAgG;AAChG,yDAGC;AApCD,4FAA4F;AAC5F,+CAAgD,8BAA8B,CAAC;AACxE,qDAA0C;AAmC1C,kDAA8J"}
1
+ {"version":3,"file":"contextual-response.d.ts","sourceRoot":"","sources":["../../src/helpers/contextual-response.js"],"names":[],"mappings":"AAMA,2GAA2G;AAC3G;;;;qBAqBC;AACD,+FAIC;AAED,gGAAgG;AAChG,yDAGC;AAvCD,4FAA4F;AAC5F,+CAAgD,8BAA8B,CAAC;AACxE,qDAA0C;AAsC1C,kDAA8J"}
@@ -6,17 +6,21 @@ const safeName = value => typeof value === 'string' && /^[A-Za-z_$][\w$]*$/.test
6
6
  const fail = message => { throw new Error('Contextual response: ' + message); };
7
7
  /** Return an isolated declaration copy; unknown response fields cannot silently become legacy dispatch. */
8
8
  export function validateContextualResponseStep(step, flow) {
9
- const typed = own(step, 'responseParameters') || own(step, 'responseVariable');
9
+ const typed = own(step, 'responseParameters') || own(step, 'responseVariable') || own(step, 'responseChoices');
10
10
  if (!typed)
11
11
  return null;
12
12
  if (step.type !== 'DISPATCH' || step.onResponse !== 'continue' || typeof step.responseContext !== 'string' || !step.responseContext.trim())
13
13
  fail('typed responses require DISPATCH onResponse:continue and nonempty responseContext');
14
14
  if (!safeName(step.responseVariable) || ['cargo', 'currentContext', 'userInput', 'language', 'globalVariables'].includes(step.responseVariable) || !own(flow?.variables, step.responseVariable) || flow.variables[step.responseVariable]?.type !== 'object')
15
15
  fail('responseVariable must name a declared object variable in this flow');
16
- if (!Array.isArray(step.responseParameters) || !step.responseParameters.length)
16
+ const choices = own(step, 'responseChoices');
17
+ if (choices && (!safeName(step.responseChoices) || step.responseChoices === step.responseVariable || !own(flow?.variables, step.responseChoices) || flow.variables[step.responseChoices]?.type !== 'array'))
18
+ fail('responseChoices must name a declared array variable in this flow');
19
+ // With choices, extraction is optional: a reply that picks none of them is { key: '' } unless parameters are declared.
20
+ if (!(choices && !own(step, 'responseParameters')) && (!Array.isArray(step.responseParameters) || !step.responseParameters.length))
17
21
  fail('responseParameters must be a nonempty canonical parameter array');
18
22
  const names = new Set();
19
- for (const p of step.responseParameters) {
23
+ for (const p of step.responseParameters || []) {
20
24
  if (!p || typeof p !== 'object' || Array.isArray(p) || !safeName(p.name) || names.has(p.name))
21
25
  fail('response parameter names must be unique safe identifiers');
22
26
  names.add(p.name);
@@ -36,7 +40,7 @@ export function validateContextualResponseStep(step, flow) {
36
40
  fail('responseParameters accepts only canonical parameter descriptors');
37
41
  }
38
42
  try {
39
- return structuredClone({ parameters: step.responseParameters, variable: step.responseVariable });
43
+ return structuredClone({ parameters: step.responseParameters || [], variable: step.responseVariable, ...(choices ? { choices: step.responseChoices } : {}) });
40
44
  }
41
45
  catch {
42
46
  fail('response parameters must be cloneable declaration data');
@@ -7,12 +7,21 @@
7
7
  * answers the reply answers the question (the default: an open question's reply that clears no option is its answer)
8
8
  * abort the caller withdraws the request and asks for nothing else
9
9
  * new_request the caller asks for something else: a different service or an unrelated question
10
+ * choice:<key> the reply picks one of the question's declared choices (only when the step declares them); `answers`
11
+ * is then a reply that picks none of them
10
12
  *
11
13
  * Both executors' instructions come from the same criteria. A host that does not know this task answers the `llm`
12
14
  * instructions with its text model, which is a complete answer.
13
15
  */
14
16
  export declare const REPLY_OPTIONS: readonly ["answers", "abort", "new_request"];
15
- export type ReplyOption = typeof REPLY_OPTIONS[number];
17
+ /** The fixed options, or `choice:<key>` for a declared choice. */
18
+ export type ReplyOption = typeof REPLY_OPTIONS[number] | `choice:${string}`;
19
+ /** A choice the question offers: its key and the words that describe it to the ranker. */
20
+ export interface ReplyChoice {
21
+ key: string;
22
+ label: string;
23
+ }
24
+ export declare const CHOICE_PREFIX = "choice:";
16
25
  /** An open question's reply that clears no option is its answer (owner decision 2026-10-26). */
17
26
  export declare const REPLY_DEFAULT: ReplyOption;
18
27
  /** A noul at or above this is a yes. */
@@ -28,6 +37,8 @@ export interface ReplyRankRequest {
28
37
  /** the flow's question and what answers it (the step's responseContext, interpolated) */
29
38
  question: string;
30
39
  options: ReplyOption[];
40
+ /** the question's declared choices, when it offers any */
41
+ choices?: ReplyChoice[];
31
42
  llm: {
32
43
  system: string;
33
44
  user: string;
@@ -43,14 +54,16 @@ export interface ReplyRankRequest {
43
54
  };
44
55
  }
45
56
  /** The reply ranker's instructions for both executors. */
46
- export declare function buildReplyRank(input: string, conversation: ReplyTurn[], question: string): ReplyRankRequest;
57
+ export declare function buildReplyRank(input: string, conversation: ReplyTurn[], question: string, choices?: ReplyChoice[]): ReplyRankRequest;
47
58
  /** A text model's answer as the canonical reply; throws when it names no offered option. */
48
59
  export declare function decodeReplyRankLlm(text: string, request: ReplyRankRequest): {
49
60
  option: ReplyOption;
50
61
  };
51
62
  /**
52
63
  * System One's answers as the canonical reply: the highest-rated option when it clears the cut, else the default
53
- * (`answers`), with every option's probability (for logs). Throws if any question is unanswered.
64
+ * (`answers`), with every option's probability (for logs). A declared choice that clears the cut is taken over `answers`
65
+ * ("picks none of them") and `new_request`; only `abort` keeps its rank (owner 2026-10-28: a reply rated its menu
66
+ * choice 0.65 and `answers` 0.81, and the menu was asked again). Throws if any question is unanswered.
54
67
  */
55
68
  export declare function decodeReplyRankSystemOne(answers: Record<string, {
56
69
  noul?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"reply-rank.d.ts","sourceRoot":"","sources":["../../src/host/reply-rank.ts"],"names":[],"mappings":"AAAA;;;;;;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}
@@ -7,11 +7,14 @@
7
7
  * answers the reply answers the question (the default: an open question's reply that clears no option is its answer)
8
8
  * abort the caller withdraws the request and asks for nothing else
9
9
  * new_request the caller asks for something else: a different service or an unrelated question
10
+ * choice:<key> the reply picks one of the question's declared choices (only when the step declares them); `answers`
11
+ * is then a reply that picks none of them
10
12
  *
11
13
  * Both executors' instructions come from the same criteria. A host that does not know this task answers the `llm`
12
14
  * instructions with its text model, which is a complete answer.
13
15
  */
14
16
  export const REPLY_OPTIONS = ['answers', 'abort', 'new_request'];
17
+ export const CHOICE_PREFIX = 'choice:';
15
18
  /** An open question's reply that clears no option is its answer (owner decision 2026-10-26). */
16
19
  export const REPLY_DEFAULT = 'answers';
17
20
  /** A noul at or above this is a yes. */
@@ -32,10 +35,30 @@ const CRITERIA = {
32
35
  },
33
36
  };
34
37
  const TASK = 'A workflow asked the caller a question. Decide what the caller\'s latest message does with it.';
38
+ // With declared choices, `answers` is the reply that responds without picking any of them.
39
+ const ANSWERS_WITHOUT_CHOICE = {
40
+ true: 'The latest message responds to the current question but picks none of the offered options.',
41
+ false: 'It picks one of the offered options, withdraws the request, or asks for something else.',
42
+ };
43
+ const choiceCriteria = (c) => ({
44
+ true: `The latest message picks the option "${c.label}", in any words, or says it already chose it.`,
45
+ false: 'It picks another option or none of them, withdraws the request, or asks for something else.',
46
+ });
47
+ const criteriaOf = (option, choices) => {
48
+ if (option.startsWith(CHOICE_PREFIX)) {
49
+ return choiceCriteria(choices.find(c => CHOICE_PREFIX + c.key === option));
50
+ }
51
+ else if (option === 'answers' && choices.length) {
52
+ return ANSWERS_WITHOUT_CHOICE;
53
+ }
54
+ else {
55
+ return CRITERIA[option];
56
+ }
57
+ };
35
58
  const conversationText = (conversation, input) => `${conversation.length ? `<conversation>\n${conversation.map(t => `${t.role}: ${t.content}`).join('\n')}\n</conversation>\n` : ''}<latest-message>\n${input}\n</latest-message>`;
36
59
  /** The reply ranker's instructions for both executors. */
37
- export function buildReplyRank(input, conversation, question) {
38
- const options = [...REPLY_OPTIONS];
60
+ export function buildReplyRank(input, conversation, question, choices = []) {
61
+ const options = [...choices.map(c => `${CHOICE_PREFIX}${c.key}`), ...REPLY_OPTIONS];
39
62
  const schema = {
40
63
  type: 'object', additionalProperties: false, required: ['option'],
41
64
  properties: { option: { type: 'string', enum: options } },
@@ -47,7 +70,7 @@ export function buildReplyRank(input, conversation, question) {
47
70
  question,
48
71
  '</current-question>',
49
72
  '',
50
- ...options.map(o => `- ${o}: ${CRITERIA[o].true}`),
73
+ ...options.map(o => `- ${o}: ${criteriaOf(o, choices).true}`),
51
74
  `When none clearly applies: ${REPLY_DEFAULT}.`,
52
75
  '',
53
76
  '<json-schema>',
@@ -60,11 +83,11 @@ export function buildReplyRank(input, conversation, question) {
60
83
  const index = [];
61
84
  options.forEach((o, i) => {
62
85
  const id = `r${i}`;
63
- questions[id] = { type: 'noul', criteria: CRITERIA[o], instructions: { option: o, question: `Does the latest message do what \`${o}\` describes?` } };
86
+ questions[id] = { type: 'noul', criteria: criteriaOf(o, choices), instructions: { option: o, question: `Does the latest message do what \`${o}\` describes?` } };
64
87
  index.push({ id, option: o });
65
88
  });
66
89
  return {
67
- task: 'rank_reply', input, conversation, question, options,
90
+ task: 'rank_reply', input, conversation, question, options, ...(choices.length ? { choices } : {}),
68
91
  llm: { system, user: conversationText(conversation, input), schema },
69
92
  systemOne: {
70
93
  state: {
@@ -88,7 +111,9 @@ export function decodeReplyRankLlm(text, request) {
88
111
  }
89
112
  /**
90
113
  * System One's answers as the canonical reply: the highest-rated option when it clears the cut, else the default
91
- * (`answers`), with every option's probability (for logs). Throws if any question is unanswered.
114
+ * (`answers`), with every option's probability (for logs). A declared choice that clears the cut is taken over `answers`
115
+ * ("picks none of them") and `new_request`; only `abort` keeps its rank (owner 2026-10-28: a reply rated its menu
116
+ * choice 0.65 and `answers` 0.81, and the menu was asked again). Throws if any question is unanswered.
92
117
  */
93
118
  export function decodeReplyRankSystemOne(answers, request, { threshold = REPLY_YES_THRESHOLD } = {}) {
94
119
  const scores = {};
@@ -98,7 +123,9 @@ export function decodeReplyRankSystemOne(answers, request, { threshold = REPLY_Y
98
123
  throw new Error(`System One: question ${q.id} unanswered`);
99
124
  scores[q.option] = noul;
100
125
  }
101
- const [best] = request.systemOne.index.map(q => q.option).sort((a, b) => scores[b] - scores[a]);
126
+ const ranked = request.systemOne.index.map(q => q.option).sort((a, b) => scores[b] - scores[a]);
127
+ const choice = ranked.find(o => o.startsWith(CHOICE_PREFIX) && scores[o] >= threshold);
128
+ const best = choice && ranked[0] !== 'abort' ? choice : ranked[0];
102
129
  if (best && scores[best] >= threshold) {
103
130
  return { option: best, scores, fallback: false };
104
131
  }
package/dist/index.d.ts CHANGED
@@ -276,6 +276,7 @@ export interface FlowStep {
276
276
  };
277
277
  responseParameters?: FlowParameterDefinition[];
278
278
  responseVariable?: string;
279
+ responseChoices?: string;
279
280
  tool?: string;
280
281
  args?: Record<string, unknown>;
281
282
  variable?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAyB1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAyB1E;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CASxD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CASxD;AAGD;;;;;;;;;;;;GAYG;AAIH,qBAAa,kBAAmB,SAAQ,KAAK;aACE,KAAK,CAAC,EAAE,KAAK;gBAA9C,OAAO,EAAE,MAAM,EAAkB,KAAK,CAA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AAG;IAkHxC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAwE5B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAe7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2BhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAiC9B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA2CnC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA6BhC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,2BAA2B;CAKpC"}
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28
28
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
29
  **/
30
30
  import { buildFlowStage, buildParameterStage, hasStageParameters } from './host/intent-stages.js';
31
- import { buildReplyRank, REPLY_OPTIONS } from './host/reply-rank.js';
31
+ import { buildReplyRank, CHOICE_PREFIX } from './host/reply-rank.js';
32
32
  /*
33
33
  // Deploy new version to NPM:
34
34
  npm version patch -m "chore(release): %s"
@@ -2958,12 +2958,12 @@ async function detectFlowInTwoStages(input, engine, flows) {
2958
2958
  * when the host says `answers` is the default because no option cleared its cut (`fallback: true`); an answer
2959
2959
  * without that flag (a text model's pick, or a host that does not send it) is a confident one.
2960
2960
  */
2961
- async function rankReply(input, engine, question) {
2961
+ async function rankReply(input, engine, question, choices = []) {
2962
2962
  const { input: cleanInput, conversation } = buildDetectFlowRequest(input, engine.lastChatTurn, []);
2963
- const request = buildReplyRank(cleanInput, conversation, question);
2963
+ const request = buildReplyRank(cleanInput, conversation, question, choices);
2964
2964
  const reply = parseStageReply(await fetchAiResponse(request.llm.system, request.llm.user, engine.aiCallback, engine.aiTimeOut, stageSchema('rank_reply', request.llm.schema), request));
2965
2965
  const option = String(reply.option ?? '');
2966
- if (!REPLY_OPTIONS.includes(option))
2966
+ if (!request.options.includes(option))
2967
2967
  throw new Error(`rank_reply: "${option.slice(0, 40)}" is not an offered option`);
2968
2968
  const confident = reply.fallback !== true;
2969
2969
  logger.info(`rank_reply: ${option}${confident ? '' : ' (default: no option cleared the cut)'} for ${JSON.stringify(cleanInput)}`);
@@ -2974,6 +2974,19 @@ async function rankReply(input, engine, question) {
2974
2974
  * declaration that marks it `verbatim: true` (an open answer whose words are the value, such as a reason). Opt-in:
2975
2975
  * a field that names a thing to look up (a product, a city) needs a real extraction, never the whole reply.
2976
2976
  */
2977
+ /** A step's declared choices: an array of { key, label } with unique nonempty keys; a missing label is the key. */
2978
+ function readResponseChoices(value) {
2979
+ if (!Array.isArray(value) || !value.length)
2980
+ throw new Error('Contextual response choices must be a nonempty array');
2981
+ const keys = new Set();
2982
+ return value.map((choice) => {
2983
+ const key = String(choice?.key ?? '').trim();
2984
+ if (!key || keys.has(key))
2985
+ throw new Error('Contextual response choices need unique nonempty keys');
2986
+ keys.add(key);
2987
+ return { key, label: String(choice?.label ?? '').trim() || key };
2988
+ });
2989
+ }
2977
2990
  function verbatimReplyField(parameters) {
2978
2991
  return parameters.length === 1 && parameters[0].verbatim === true ? parameters[0].name : null;
2979
2992
  }
@@ -5919,7 +5932,7 @@ async function processActivity(input, userId, engine) {
5919
5932
  let abortReply = null;
5920
5933
  let guardedRoutingFailed = false;
5921
5934
  engine.dispatchIfMatched = async (frame, step) => {
5922
- if (activatedThisTurn && step.responseParameters === undefined && step.responseVariable === undefined)
5935
+ if (activatedThisTurn && step.responseParameters === undefined && step.responseVariable === undefined && step.responseChoices === undefined)
5923
5936
  return false;
5924
5937
  let declaration;
5925
5938
  try {
@@ -5939,19 +5952,38 @@ async function processActivity(input, userId, engine) {
5939
5952
  throw new Error('Contextual response parameter description resolved empty');
5940
5953
  }
5941
5954
  }
5955
+ // The step's declared choices, as they stand now (a flow builds them for the question it asked).
5956
+ let choices = [];
5957
+ try {
5958
+ choices = declaration?.choices ? readResponseChoices(frame.variables[declaration.choices]) : [];
5959
+ }
5960
+ catch (error) {
5961
+ guardedRoutingFailed = true;
5962
+ throw error;
5963
+ }
5942
5964
  // A model error leaves this live continuation pending for the caller's error policy.
5943
5965
  let option;
5944
5966
  let confident;
5945
5967
  try {
5946
- ({ option, confident } = await rankReply(String(sanitizedInput), engine, question));
5968
+ ({ option, confident } = await rankReply(String(sanitizedInput), engine, question, choices));
5947
5969
  }
5948
5970
  catch (error) {
5949
5971
  guardedRoutingFailed = true;
5950
5972
  throw error;
5951
5973
  }
5952
- ranked = option;
5953
- if (option === 'answers') {
5954
- if (declaration) {
5974
+ ranked = option.startsWith(CHOICE_PREFIX) ? 'answers' : option;
5975
+ if (option.startsWith(CHOICE_PREFIX)) {
5976
+ // A declared choice is the whole answer: no extraction.
5977
+ frame.variables[declaration.variable] = { key: option.slice(CHOICE_PREFIX.length) };
5978
+ logger.info(`Contextual DISPATCH in '${frame.flowName}': the reply picks '${option.slice(CHOICE_PREFIX.length)}'; the flow continues`);
5979
+ return false;
5980
+ }
5981
+ else if (option === 'answers') {
5982
+ if (declaration && !declaration.parameters.length) {
5983
+ // choices only: the reply picks none of them, so the flow asks again
5984
+ frame.variables[declaration.variable] = { key: '' };
5985
+ }
5986
+ else if (declaration) {
5955
5987
  // A confident answer is never lost: when extraction finds nothing (or fails) in a `verbatim` field, the
5956
5988
  // field is the reply as said. A default `answers` keeps extraction as the judge, so an empty field
5957
5989
  // stays empty and the flow asks again.
@@ -7456,9 +7488,9 @@ export class WorkflowEngine {
7456
7488
  }
7457
7489
  // DISPATCH always routes the turn's own input — no value. It may declare the ending of the
7458
7490
  // flows it ends (`outcome` / `reason`, kept only when no flow matches).
7459
- const extra = Object.keys(step).filter(k => !['id', 'type', 'outcome', 'reason', 'recovery', 'onResponse', 'responseContext', 'responseParameters', 'responseVariable'].includes(k));
7491
+ const extra = Object.keys(step).filter(k => !['id', 'type', 'outcome', 'reason', 'recovery', 'onResponse', 'responseContext', 'responseParameters', 'responseVariable', 'responseChoices'].includes(k));
7460
7492
  if (extra.length > 0) {
7461
- state.errors.push(`DISPATCH step "${step.id}" in flow "${flowDef.name}" has invalid attribute(s) ${extra.map(k => `"${k}"`).join(', ')} - DISPATCH takes only "id", "outcome", "reason", "recovery", "onResponse" "responseContext", "responseParameters" and "responseVariable"`);
7493
+ state.errors.push(`DISPATCH step "${step.id}" in flow "${flowDef.name}" has invalid attribute(s) ${extra.map(k => `"${k}"`).join(', ')} - DISPATCH takes only "id", "outcome", "reason", "recovery", "onResponse" "responseContext", "responseParameters", "responseVariable" and "responseChoices"`);
7462
7494
  }
7463
7495
  else if (step.onResponse !== undefined && step.onResponse !== 'continue') {
7464
7496
  state.errors.push(`DISPATCH step "${step.id}" in flow "${flowDef.name}" onResponse must be "continue" when provided`);
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:32c2bede7bd93be3b95aaa402b64aaf747b89e7827f81566e9bba9876f044823";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:9fa908654ad5402560cc1cf51e4cd57d1bff01735b4e31d6fc0bb4f5f519ceb1";
@@ -251,7 +251,7 @@ The loop skips accepted data and asks the first ready missing required field. Co
251
251
 
252
252
  ### Retry, yield and recovery
253
253
 
254
- `max_misses` defaults to two consecutive unreadable answers: 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. An unreadable answer of three or more words (any words at an amount) goes to the reply ranker instead: `answers` takes the offered choice it picks, else asks again (counted against `max_attempts`); only `abort` or `new_request` leaves the form. 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.
254
+ An unreadable answer with any words goes to the reply ranker, offered the question's choices (never an exact choice or the YES of a firm confirmation; a NO always), a person (`__agent`) and, on a call with a textable number, text (`__text`): a picked choice is the answer, a person or text 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.
255
255
 
256
256
  `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. Use it where leaving would strand an effect in progress (a payment's card, its billing-ZIP correction). 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.
257
257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.13.1",
3
+ "version": "1.14.1",
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",