jsfe 1.66.0 → 1.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -503,7 +503,10 @@ const engine = new WorkflowEngine(logger, aiCallback, flows, tools,
503
503
  `readInternationalPhone`, `readIdentifier`, `normalizeAndFindCapture`, and `matchInputs` (which of a
504
504
  form's inputs an answer fills; ties between inputs of the same form are returned for the flow to ask).
505
505
  - Saying values: `amountToSpeech`, `dateToWords`, `last4`, `maskEmail`, `urlToSpeech`,
506
- `textWithUrlToSpeech`, `anythingElse`, `goodbye`.
506
+ `textWithUrlToSpeech`, `anythingElse`, `goodbye`, `channelVerb(lang, cargo, capital)` ("say" on a call, "type"
507
+ elsewhere, or the host's `cargo.verb`), and `yesNoKeys(lang, cargo, yes, no)` ("Press 1 or say YES, or press 2 or say
508
+ NO." on a call): every yes/no question names 1 for YES and 2 for NO on a call. A FLOW call's parameters interpolate
509
+ values, not expressions, so build such a question in a SET step and pass the variable.
507
510
  - Checks: `validateDigits`, `validatePhone`, `validateEmail`, `validateCardNumber`,
508
511
  `validateExpiration`, and `validateOTP(code, container)`, which accepts a code whose SHA-256 matches
509
512
  `container.otpHash` within 10 minutes of `container.otpTimestamp`, or a second code emailed beside it
@@ -1 +1 @@
1
- {"version":3,"file":"address-flows.d.ts","sourceRoot":"","sources":["../../src/forms/address-flows.js"],"names":[],"mappings":"AAgDA,0BAAmF"}
1
+ {"version":3,"file":"address-flows.d.ts","sourceRoot":"","sources":["../../src/forms/address-flows.js"],"names":[],"mappings":"AAiDA,0BAAmF"}
@@ -13,14 +13,14 @@ const address = defineForm({ id: 'collect-geocoded-address', name: 'CollectGeoco
13
13
  before: [S('address_given', 'given', "given || (cargo.forms[cargo.forms[form_instance].parent] || {}).context && (cargo.forms[cargo.forms[form_instance].parent].context.given || '') || ''"), S('address_draft', 'draft', E(addressDraft, "given || (cargo.forms[form_instance].seeds && cargo.forms[form_instance].seeds.given) || ''")), S('address_seed_zip', 'zip', "zip || draft.zip"), S('address_seed_street', 'street', "street || draft.street"), S('address_seed_unit', 'unit', "unit || draft.unit"), S('address_data', 'noop', "(cargo.forms[form_instance].data=Object.assign({need_city:false},cargo.forms[form_instance].data || {}), draft.street ? (cargo.addressDraft={said:draft.street}) : null, true)"),
14
14
  // The calling form's own label for this input names what is being changed ("new delivery address") in every question and the read-back;
15
15
  // without one, today's wording.
16
- S('address_spec', 'address_spec', "(function(f){var p=f&&f.parent?cargo.forms[f.parent]:null,s=p&&p.specs,n=f&&f.result_input,x=null;if(n&&Array.isArray(s)){for(var i=0;i<s.length;i++){if(s[i]&&s[i].name===n){x=s[i];break;}}}else if(n&&s&&typeof s==='object'){x=s[n]||null;}return x||{};})(cargo.forms[form_instance])"), S('address_label', 'address_label', "typeof address_spec.label==='string'&&address_spec.label.trim()?address_spec.label.trim():'new address'"), S('address_label_es', 'address_label_es', "typeof address_spec.label_es==='string'&&address_spec.label_es.trim()?address_spec.label_es.trim():'nueva dirección'"), S('address_label_data', 'noop', "(function(d,labelled){d.label=address_label;d.label_es=address_label_es;d.labelled=labelled;d.city_state_question=labelled?'What city and state is your '+address_label+' in?':'What city and state is that in?';d.city_state_question_es=labelled?'¿En qué ciudad y estado está su '+address_label_es+'?':'¿En qué ciudad y estado está?';d.unit_question=labelled?'Is there an apartment or unit number in your '+address_label+'? Type the number, or NONE.':'Is there an apartment or unit number? Type the number, or NONE.';d.unit_question_es=labelled?'¿Hay un número de apartamento o unidad en su '+address_label_es+'? Escriba el número, o NINGUNO.':'¿Hay un número de apartamento o unidad? Escriba el número, o NINGUNO.';return true;})(cargo.forms[form_instance].data,typeof address_spec.label==='string'&&!!address_spec.label.trim())")],
16
+ S('address_spec', 'address_spec', "(function(f){var p=f&&f.parent?cargo.forms[f.parent]:null,s=p&&p.specs,n=f&&f.result_input,x=null;if(n&&Array.isArray(s)){for(var i=0;i<s.length;i++){if(s[i]&&s[i].name===n){x=s[i];break;}}}else if(n&&s&&typeof s==='object'){x=s[n]||null;}return x||{};})(cargo.forms[form_instance])"), S('address_label', 'address_label', "typeof address_spec.label==='string'&&address_spec.label.trim()?address_spec.label.trim():'new address'"), S('address_label_es', 'address_label_es', "typeof address_spec.label_es==='string'&&address_spec.label_es.trim()?address_spec.label_es.trim():'nueva dirección'"), S('address_label_data', 'noop', "(function(d,labelled){d.label=address_label;d.label_es=address_label_es;d.labelled=labelled;d.city_state_question=labelled?'What city and state is your '+address_label+' in?':'What city and state is that in?';d.city_state_question_es=labelled?'¿En qué ciudad y estado está su '+address_label_es+'?':'¿En qué ciudad y estado está?';d.unit_question=labelled?'Is there an apartment or unit number in your '+address_label+'? '+channelVerb('en',cargo,true)+' the number, or NONE.':'Is there an apartment or unit number? '+channelVerb('en',cargo,true)+' the number, or NONE.';d.unit_question_es=labelled?'¿Hay un número de apartamento o unidad en su '+address_label_es+'? '+channelVerb('es',cargo,true)+' el número, o NINGUNO.':'¿Hay un número de apartamento o unidad? '+channelVerb('es',cargo,true)+' el número, o NINGUNO.';return true;})(cargo.forms[form_instance].data,typeof address_spec.label==='string'&&!!address_spec.label.trim())")],
17
17
  inputs: [{ name: 'zip', field: 'zip', argument_description: '5-digit ZIP code', names: ['zip', 'zip code', 'postal code', 'código postal', 'codigo postal'], validator: 'address-zip-validate', prepare: 'address-zip-prompt', question_from: 'zip_question', question: 'What is the 5-digit zip code of your new address?', question_es: '¿Cuál es el código postal de 5 dígitos de su nueva dirección?', form_client: { control: 'postal', regions: ['us'], fills: { city: 'locality' }, autofill: 'postal-code' } },
18
18
  { name: 'city', argument_description: 'city name alone', label: 'city', label_es: 'ciudad', names: ['city', 'ciudad'], profile: { kind: 'choice', choices: [], accept_other: true, other_needs_letter: true }, choices_from: 'city_choices', when: { 'form.data.city_known': true }, depends_on: ['zip'], reset_on: ['zip'], prepare: 'address-city-prompt', question_from: 'city_question', question: 'Which city is it?', question_es: '¿Qué ciudad es?', form_client: { control: 'combobox', autofill: 'address-level2' } },
19
19
  { name: 'city_state', argument_description: 'city and state', label: 'city and state', label_es: 'ciudad y estado', names: ['city', 'ciudad'], profile: { kind: 'text' }, when: { 'form.data.need_city': true }, depends_on: ['zip'], question_from: 'city_state_question', question: 'What city and state is that in?', question_es: '¿En qué ciudad y estado está?' },
20
20
  { name: 'street', argument_description: 'street number and street name, without the apartment', label: 'street address', label_es: 'dirección', names: ['street', 'calle'], profile: { kind: 'pattern', regex: streetPattern, spoken_digits: 'house_number', accept_other: true }, depends_on: ['zip'], validator: 'address-street-validate', prepare: 'address-street-prompt', question_from: 'street_question', question: 'What is the street address?', question_es: '¿Cuál es la dirección?', form_client: { control: 'place', types: 'address', regions: ['us'], fills: { zip: 'postal_code', city: 'locality' }, autofill: 'address-line1' } },
21
- { name: 'unit', declinable: true, argument_description: 'apartment or unit number alone, such as 4 or 12B', reset_on: ['street'], label: 'apartment or unit', label_es: 'apartamento o unidad', names: ['apartment', 'apt', 'unit', 'apartamento', 'unidad', 'departamento'], profile: { kind: 'pattern', regex: '(?:\\bapartment|\\bapartamento|\\bdepartamento|\\bapt\\.?|\\bunit|\\bunidad|#)\\s*([\\w-]+)', group: 1, spoken_digits: true, accept_other: true }, question_from: 'unit_question', question: 'Is there an apartment or unit number? Type the number, or NONE.', question_es: '¿Hay un número de apartamento o unidad? Escriba el número, o NINGUNO.', form_client: { autofill: 'address-line2' } }],
21
+ { name: 'unit', declinable: true, argument_description: 'apartment or unit number alone, such as 4 or 12B', reset_on: ['street'], label: 'apartment or unit', label_es: 'apartamento o unidad', names: ['apartment', 'apt', 'unit', 'apartamento', 'unidad', 'departamento'], profile: { kind: 'pattern', regex: '(?:\\bapartment|\\bapartamento|\\bdepartamento|\\bapt\\.?|\\bunit|\\bunidad|#)\\s*([\\w-]+)', group: 1, spoken_digits: true, accept_other: true }, question_from: 'unit_question', question: 'Is there an apartment or unit number? {{channelVerb(\'en\', cargo, true)}} the number, or NONE.', question_es: '¿Hay un número de apartamento o unidad? {{channelVerb(\'es\', cargo, true)}} el número, o NINGUNO.', form_client: { autofill: 'address-line2' } }],
22
22
  before_confirm: [S('address_resolved', 'address_result', E(resolvedAddress, 'cargo.forms[form_instance].values', 'cargo.forms[form_instance].data'))],
23
- confirm: { named_fields: true, reply_context: 'This is a mailing address read back for confirmation. A reply may correct one part or several at once: the street number, street name or street type, the apartment or unit, the city, or the ZIP code.', no_keys: ['2', 'not right', 'not correct', 'incorrect', 'wrong', 'no es correcto', 'no es correcta', 'incorrecta'], question: 'Your {{address_label}} is {{address_result.line}}. Is that correct?', question_es: 'Su {{address_label_es}} es {{address_result.line}}. ¿Es correcta?' },
23
+ confirm: { named_fields: true, reply_context: 'This is a mailing address read back for confirmation. A reply may correct one part or several at once: the street number, street name or street type, the apartment or unit, the city, or the ZIP code.', no_keys: ['2', 'not right', 'not correct', 'incorrect', 'wrong', 'no es correcto', 'no es correcta', 'incorrecta'], question: "Your {{address_label}} is {{address_result.line}}. Is that correct? {{yesNoKeys('en', cargo)}}", question_es: "Su {{address_label_es}} es {{address_result.line}}. ¿Es correcta? {{yesNoKeys('es', cargo)}}" },
24
24
  after: [S('address_result_store', 'noop', '(cargo.forms[form_instance].values.resolved = address_result, cargo.address = address_result, cargo.addressDraft = null, true)')], declined: [S('address_retry_noop', 'noop', 'true')] });
25
25
  const zip = C('address-zip-validate', 'Read city and state from geocoder evidence for the proposed ZIP; missing geocoder data requires an explicit city.', [
26
26
  S('address_zip_components', 'components', "'postal_code:'+value+'|country:US'"), { id: 'address_zip_tool', type: 'CALL-TOOL', tool: 'geocode-zip', variable: 'result', args: { components: '{{components}}', address: '' }, onFail: S('address_zip_failed', 'result', 'null') },
@@ -41,9 +41,10 @@ const cityPrompt = C('address-city-prompt', 'Ask which of the ZIP code\'s place
41
41
  const PARTS = [{ key: 'zip', label: 'ZIP code', label_es: 'Código postal', phrases: ['1', 'zip', 'zip code', 'postal code', 'código postal', 'codigo postal'] }, { key: 'city', label: 'City', label_es: 'Ciudad', phrases: ['2', 'city', 'ciudad'] }, { key: 'street', label: 'Street', label_es: 'Calle', phrases: ['3', 'street', 'calle'] }, { key: 'unit', label: 'Apartment', label_es: 'Apartamento', phrases: ['4', 'apartment', 'apt', 'unit', 'apartamento', 'unidad', 'departamento'] }, { key: 'all', label: 'Everything', label_es: 'Todo', phrases: ['5', 'all', 'everything', 'all of it', 'todo', 'toda'] }];
42
42
  const declined = C('collect-geocoded-address-declined', 'Ask which part of the declined address is wrong, re-ask only that part, or start a fresh pass.', [
43
43
  S('address_retry_owner', 'parent_form', 'cargo.forms[form_instance].parent'), S('address_retry_input', 'result_input', 'cargo.forms[form_instance].result_input'),
44
+ S('address_retry_part_q', 'part_question', "'Which part is wrong: 1 the zip code, 2 the city, 3 the street, or 4 the apartment? Or '+channelVerb('en',cargo)+' ALL to start over.'"), S('address_retry_part_q_es', 'part_question_es', "'¿Qué parte está mal: 1 el código postal, 2 la ciudad, 3 la calle, o 4 el apartamento? O '+channelVerb('es',cargo)+' TODO para empezar de nuevo.'"),
44
45
  F('address_retry_part_ask', 'ask-choice', { question: '{{part_question}}', question_es: '{{part_question_es}}', choices: '{{parts}}' }),
45
46
  S('address_retry_part', 'part', "['zip','city','street','unit','all'].indexOf(cargo.choice)>=0 ? cargo.choice : 'all'"),
46
47
  S('address_retry_clear', 'noop', "(part==='all' ? (resetFormInputs(cargo,form_instance,['zip','city','city_state','street','unit']),cargo.forms[form_instance].data={retry:true,need_city:false}) : resetFormInputs(cargo,form_instance,[part==='city' ? (cargo.forms[form_instance].data.city_choice ? 'city' : 'city_state') : part]),true)"),
47
48
  F('address_retry', 'collect-geocoded-address', { form_instance: '{{form_instance}}', parent_form: '{{parent_form}}', result_input: '{{result_input}}' }, 'replace')
48
- ], { parameters: [P('form_instance')], variables: V({ parent_form: '', result_input: '', part: '', parts: PARTS, part_question: "Which part is wrong: 1 the zip code, 2 the city, 3 the street, or 4 the apartment? Or say ALL to start over.", part_question_es: "¿Qué parte está mal: 1 el código postal, 2 la ciudad, 3 la calle, o 4 el apartamento? O diga TODO para empezar de nuevo." }) });
49
+ ], { parameters: [P('form_instance')], variables: V({ parent_form: '', result_input: '', part: '', parts: PARTS, part_question: '', part_question_es: '' }) });
49
50
  export const FLOWS = [address, zip, street, zipPrompt, cityPrompt, streetPrompt, declined];
@@ -74,6 +74,8 @@ export function validateFlowContracts(flows: any, tools?: any[], { externalFlows
74
74
  question_es: string;
75
75
  retry: string;
76
76
  retry_es: string;
77
+ retry_text: string;
78
+ retry_text_es: string;
77
79
  };
78
80
  zip: {
79
81
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/forms/contracts.js"],"names":[],"mappings":"AAgBA;;;IAGC;AACD;;;;;EAGC;AACD,qGAAqG;AACrG;;QAwCC;AAqBD;;;QAEC;AAgBD;;;;;;;;;QASC;AACD;;;;QAGC;AACD;;;;;;;;QA8BC;AAED,mHAAmH;AACnH,kDAgBC;AAED,+GAA+G;AAC/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EC"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/forms/contracts.js"],"names":[],"mappings":"AAgBA;;;IAGC;AACD;;;;;EAGC;AACD,qGAAqG;AACrG;;QAwCC;AAqBD;;;QAEC;AAgBD;;;;;;;;;QASC;AACD;;;;QAGC;AACD;;;;;;;;QA8BC;AAED,mHAAmH;AACnH,kDAgBC;AAED,+GAA+G;AAC/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EC"}
@@ -131,6 +131,10 @@ export namespace FIELD_PRESETS {
131
131
  export { retry_1 as retry };
132
132
  let retry_es_1: string;
133
133
  export { retry_es_1 as retry_es };
134
+ let retry_text_1: string;
135
+ export { retry_text_1 as retry_text };
136
+ let retry_text_es_1: string;
137
+ export { retry_text_es_1 as retry_text_es };
134
138
  }
135
139
  namespace zip {
136
140
  let label_2: string;
@@ -162,10 +166,10 @@ export namespace FIELD_PRESETS {
162
166
  export { retry_2 as retry };
163
167
  let retry_es_2: string;
164
168
  export { retry_es_2 as retry_es };
165
- let retry_text_1: string;
166
- export { retry_text_1 as retry_text };
167
- let retry_text_es_1: string;
168
- export { retry_text_es_1 as retry_text_es };
169
+ let retry_text_2: string;
170
+ export { retry_text_2 as retry_text };
171
+ let retry_text_es_2: string;
172
+ export { retry_text_es_2 as retry_text_es };
169
173
  }
170
174
  namespace account_number {
171
175
  let label_3: string;
@@ -193,10 +197,10 @@ export namespace FIELD_PRESETS {
193
197
  export { retry_3 as retry };
194
198
  let retry_es_3: string;
195
199
  export { retry_es_3 as retry_es };
196
- let retry_text_2: string;
197
- export { retry_text_2 as retry_text };
198
- let retry_text_es_2: string;
199
- export { retry_text_es_2 as retry_text_es };
200
+ let retry_text_3: string;
201
+ export { retry_text_3 as retry_text };
202
+ let retry_text_es_3: string;
203
+ export { retry_text_es_3 as retry_text_es };
200
204
  }
201
205
  namespace ssn_last4 {
202
206
  let label_4: string;
@@ -330,10 +334,10 @@ export namespace FIELD_PRESETS {
330
334
  export { retry_4 as retry };
331
335
  let retry_es_4: string;
332
336
  export { retry_es_4 as retry_es };
333
- let retry_text_3: string;
334
- export { retry_text_3 as retry_text };
335
- let retry_text_es_3: string;
336
- export { retry_text_es_3 as retry_text_es };
337
+ let retry_text_4: string;
338
+ export { retry_text_4 as retry_text };
339
+ let retry_text_es_4: string;
340
+ export { retry_text_es_4 as retry_text_es };
337
341
  }
338
342
  namespace card_expiration {
339
343
  let label_10: string;
@@ -364,10 +368,10 @@ export namespace FIELD_PRESETS {
364
368
  export { retry_5 as retry };
365
369
  let retry_es_5: string;
366
370
  export { retry_es_5 as retry_es };
367
- let retry_text_4: string;
368
- export { retry_text_4 as retry_text };
369
- let retry_text_es_4: string;
370
- export { retry_text_es_4 as retry_text_es };
371
+ let retry_text_5: string;
372
+ export { retry_text_5 as retry_text };
373
+ let retry_text_es_5: string;
374
+ export { retry_text_es_5 as retry_text_es };
371
375
  }
372
376
  namespace card_cvv {
373
377
  let label_11: string;
@@ -1 +1 @@
1
- {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA4GA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;AAslBD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AA94BM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkI9G,4CAEqI;AAi+BrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AA6GA;;;;;;;GAOG;AACH;;;;GAIG;AACH,8HAA8H;AAC9H,uFAIC;AAsGD;;2EAE2E;AAC3E,qEAEC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC;AACD;;;GAGG;AACH;;;;;;EAGC;AAslBD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AA/4BM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmI9G,4CAEqI;AAq+BrI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
@@ -56,7 +56,8 @@ export const FIELD_PRESETS = {
56
56
  retry_text: 'Please type your 10-digit phone number.', retry_text_es: 'Por favor escriba su número de teléfono de 10 dígitos.' },
57
57
  email: { label: 'email address', label_es: 'correo electrónico', profile: { kind: 'email' },
58
58
  question: 'What is your email address?', question_es: '¿Cuál es su correo electrónico?',
59
- retry: 'Please say your email address, for example juan at gmail dot com.', retry_es: 'Por favor diga su correo electrónico, por ejemplo juan arroba gmail punto com.' },
59
+ retry: 'Please say your email address, for example juan at gmail dot com.', retry_es: 'Por favor diga su correo electrónico, por ejemplo juan arroba gmail punto com.',
60
+ retry_text: 'Please type your email address, for example juan@gmail.com.', retry_text_es: 'Por favor escriba su correo electrónico, por ejemplo juan@gmail.com.' },
60
61
  zip: { label: 'ZIP code', label_es: 'código postal', profile: { kind: 'digits', min: 5, max: 5, refuse_amount_shape: true }, digits: { min: 5, max: 5 },
61
62
  question: 'What is your ZIP code?', question_es: '¿Cuál es su código postal?',
62
63
  retry: 'Please say or enter your 5-digit ZIP code.', retry_es: 'Por favor diga o ingrese su código postal de 5 dígitos.',
@@ -1061,12 +1062,16 @@ provideData.steps.splice(provideData.steps.findIndex((s) => s.id === 'pd_menu_q'
1061
1062
  // which re-read the summary): say so, offer the action the catalog names (provides.menu.unanswered), and otherwise return to the menu.
1062
1063
  const providerUnanswered = {
1063
1064
  id: 'provider-unanswered', name: 'ProviderUnanswered', version: '1.0.0', scope: 'isolated',
1064
- description: "Worker: a question the provider has no fact for, sent back to it from its own menu: says provides.menu.unanswered.question(_es) and offers that menu's choice unanswered.choice. YES runs it, NO returns to the menu, anything else is DISPATCHed. Param: provides.",
1065
+ description: "Worker: a question the provider has no fact for, sent back to it from its own menu: says provides.menu.unanswered.question(_es), followed by yesNoKeys (1 YES, 2 NO on a call; do not word the keys in the question), and offers that menu's choice unanswered.choice. YES runs it, NO returns to the menu, anything else is DISPATCHed. Param: provides.",
1065
1066
  parameters: [{ name: 'provides', type: 'object', description: 'The provider catalog' }],
1066
- variables: vars({ pu_choice: null, pu_yes: false, pu_no: false, pu_flow: '' }),
1067
+ variables: vars({ pu_choice: null, pu_yes: false, pu_no: false, pu_flow: '', pu_q: '', pu_q_es: '' }),
1067
1068
  steps: [
1068
1069
  SET('pu_find', 'pu_choice', "(provides.menu.choices || []).filter(function (c) { return c.key === provides.menu.unanswered.choice; })[0] || null"),
1069
- FLOW('pu_ask', 'ask-choice', 'call', { question: '{{provides.menu.unanswered.question}}', question_es: '{{provides.menu.unanswered.question_es}}', choices: [{ key: 'yes', phrases: ['1'] }, { key: 'no', phrases: ['2', 'no', 'no thanks', 'no thank you', 'not now', 'no gracias', 'ahora no'] }], accept_other: true, digits: { min: 1, max: 1 } }),
1070
+ // the offer is a yes/no question: it names 1 for YES and 2 for NO on a call (owner 2026-11-14), built here because a FLOW
1071
+ // call's parameters interpolate values, not expressions
1072
+ SET('pu_question', 'pu_q', "String(provides.menu.unanswered.question || '') + ' ' + yesNoKeys('en', cargo)"),
1073
+ SET('pu_question_es', 'pu_q_es', "String(provides.menu.unanswered.question_es || provides.menu.unanswered.question || '') + ' ' + yesNoKeys('es', cargo)"),
1074
+ FLOW('pu_ask', 'ask-choice', 'call', { question: '{{pu_q}}', question_es: '{{pu_q_es}}', choices: [{ key: 'yes', phrases: ['1'] }, { key: 'no', phrases: ['2', 'no', 'no thanks', 'no thank you', 'not now', 'no gracias', 'ahora no'] }], accept_other: true, digits: { min: 1, max: 1 } }),
1070
1075
  SET('pu_read_yes', 'pu_yes', "String(cargo.choice) === 'yes' || isAnswer(cargo.choiceText, 'yes')"),
1071
1076
  SET('pu_read_no', 'pu_no', "!pu_yes && String(cargo.choice) === 'no'"),
1072
1077
  SET('pu_take', 'pu_flow', "pu_yes && pu_choice ? (function (c) { if (c.set) { Object.keys(c.set).forEach(function (k) { cargo[k] = c.set[k]; }); } else { /* nothing to set */ } return c.flow; })(pu_choice) : ''"),
@@ -1 +1 @@
1
- {"version":3,"file":"send-copy-flow.d.ts","sourceRoot":"","sources":["../../src/forms/send-copy-flow.js"],"names":[],"mappings":"AA+IA,0BAAgC"}
1
+ {"version":3,"file":"send-copy-flow.d.ts","sourceRoot":"","sources":["../../src/forms/send-copy-flow.js"],"names":[],"mappings":"AAkJA,0BAAgC"}
@@ -42,7 +42,7 @@ const sendCopy = defineWorker({
42
42
  { name: 'destination', type: 'string', description: 'The phone number or email address the user gave to send it to, as given.' },
43
43
  ],
44
44
  variables: vars({
45
- noop: false, sc_items: [], sc_key: '', sc_item: null, sc_last: null, sc_last_head: '', sc_doc_list: '', sc_email: '', sc_phone: '',
45
+ noop: false, sc_items: [], sc_key: '', sc_item: null, sc_last: null, sc_last_head: '', sc_offer_q: '', sc_offer_q_es: '', sc_doc_list: '', sc_email: '', sc_phone: '',
46
46
  sc_medium: '', sc_medium_q: '', sc_medium_q_es: '', sc_given: '', sc_media: [], sc_forced: '', sc_to: '', sc_subject: '', sc_content: '', sc_sent: false,
47
47
  }),
48
48
  steps: [
@@ -58,9 +58,12 @@ const sendCopy = defineWorker({
58
58
  set('sc_doc_list', 'sc_doc_list', "sc_items.map(function (i) { return (language === 'es' && i.label_es) || i.label; }).join(language === 'es' ? '; ' : '; ')"),
59
59
  when('sc_documents', '!sc_item && !sc_last', say('sc_documents_say', 'I can send you: {{sc_doc_list}}. Tell me which one, and whether by text or email.', 'Puedo enviarle: {{sc_doc_list}}. Dígame cuál, y si por mensaje de texto o por correo.')),
60
60
  when('sc_documents_end', '!sc_item && !sc_last', end('sc_documents_done')),
61
+ // the question is built here: a FLOW call's parameters interpolate values, never expressions
62
+ when('sc_offer_q', '!sc_item', set('sc_offer_q_set', 'sc_offer_q', "'Should I send you my last answer: \"' + sc_last_head + '\"? ' + yesNoKeys('en', cargo)")),
63
+ when('sc_offer_q_es', '!sc_item', set('sc_offer_q_es_set', 'sc_offer_q_es', "'¿Le envío mi última respuesta: \"' + sc_last_head + '\"? ' + yesNoKeys('es', cargo)")),
61
64
  when('sc_offer', '!sc_item', call('sc_offer_ask', 'ask-choice', {
62
- question: 'Should I send you my last answer: "{{sc_last_head}}"? Please say yes or no.',
63
- question_es: '¿Le envío mi última respuesta: "{{sc_last_head}}"? Por favor diga sí o no.',
65
+ question: '{{sc_offer_q}}',
66
+ question_es: '{{sc_offer_q_es}}',
64
67
  choices: [{ key: 'yes', phrases: ['1'] }, { key: 'no', phrases: ['2'] }],
65
68
  digits: { min: 1, max: 1 },
66
69
  })),
@@ -64,6 +64,8 @@ export namespace STANDARD_FUNCTIONS {
64
64
  export { goodbye };
65
65
  export { sayName };
66
66
  export { sorryNotCaught };
67
+ export { yesNoKeys };
68
+ export { channelVerb };
67
69
  export { dateToWords };
68
70
  export { amountToSpeech };
69
71
  export { validateCardNumber };
@@ -203,6 +205,8 @@ import { anythingElse } from './phrases.js';
203
205
  import { goodbye } from './phrases.js';
204
206
  import { sayName } from './phrases.js';
205
207
  import { sorryNotCaught } from './phrases.js';
208
+ import { yesNoKeys } from './phrases.js';
209
+ import { channelVerb } from './phrases.js';
206
210
  import { dateToWords } from './date-words.js';
207
211
  import { amountToSpeech } from './amount-to-speech.js';
208
212
  import { validateCardNumber } from './card-checks.js';
@@ -280,5 +284,5 @@ import { sendables } from './sendables.js';
280
284
  import { chatTranscript } from './sendables.js';
281
285
  import { conversationCopy } from './sendables.js';
282
286
  import { CONVERSATION_KEY } from './sendables.js';
283
- export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho, readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY };
287
+ export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho, readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY };
284
288
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.js"],"names":[],"mappings":";;;;;;;;;;;;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,oBAAoB;iCA9BM,gBAAgB;0BAAhB,gBAAgB;+BAAhB,gBAAgB;iCAAhB,gBAAgB;iCAAhB,gBAAgB"}
@@ -27,7 +27,7 @@ import { readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStateme
27
27
  import { ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho } from './answer.js';
28
28
  import { readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational } from './contact.js';
29
29
  import { normalizeAndFindCapture } from './capture.js';
30
- import { anythingElse, goodbye, sayName, sorryNotCaught } from './phrases.js';
30
+ import { anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb } from './phrases.js';
31
31
  import { dateToWords } from './date-words.js';
32
32
  import { amountToSpeech } from './amount-to-speech.js';
33
33
  import { validateCardNumber, validateExpiration } from './card-checks.js';
@@ -37,7 +37,7 @@ import { checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS } from
37
37
  import { validateDigits, validatePhone, validateEmail } from './validators.js';
38
38
  import { joinSpokenDigits, spokenDigitsText, wholeSpokenNumber } from './spoken-digits.js';
39
39
  import { urlToSpeech, textWithUrlToSpeech } from './url-speech.js';
40
- export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho, readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY, };
40
+ export { continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse, formProposalPolicy, stageFormProposal, nextFormProposal, formProposalReadings, bindFormProposal, retireStaleFormProposal, decideFormProposal, commitFormProposals, settleFormProposalValidation, formProposalProtocol, validateFormProposalPolicy, validateFormProposalDescriptor, formProposalDescriptor, clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome, readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, saysNoValue, confirmOutOfOrderLine, matchesChoice, ANSWER_WORDS, CONFIRM_WORDS, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho, readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational, normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance, checkOtp, clearOtp, maskDestination, validateOTP, OTP_EXPIRY_MS, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, spokenDigitsText, wholeSpokenNumber, registerSendable, sendables, chatTranscript, conversationCopy, CONVERSATION_KEY, };
41
41
  /** The functions flows call by name, ready to spread into a host's approved functions. */
42
42
  export const STANDARD_FUNCTIONS = {
43
43
  continuationSafetyProtocol, cancelFormTask, contextualResponseProtocol, validateFormResponse, hasFormResponse,
@@ -45,7 +45,7 @@ export const STANDARD_FUNCTIONS = {
45
45
  clearFormMisses, formNoOwner, missFormInput, formMustComplete, formInputPrompt, formUserDescriptionSource, formConcernLine, formAcknowledges, consumeFormFeedback, keepFormLine, clearFormLines, formConversationOutcome,
46
46
  readMoneyAmount, isMoneyAmount, moneyIntentAllows, isPastPaymentStatement, isPartialMoneyAnswer, validateMoneyOptions, takeChoiceOffer, saysConfirmWord, confirmOutOfOrderLine, matchesChoice, isAnswer, isAgentRequest, isExitRequest, isGlobalExit, isOtherRequest, isSpelledFragment, isAmountAnswer, amountInAnswer, pickChoice, withoutPromptEcho,
47
47
  readEmail, readPhone, readInternationalPhone, readIdentifier, last4, maskEmail, callerTextNumber, textDestination, callerIsInternational,
48
- normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance,
48
+ normalizeAndFindCapture, anythingElse, goodbye, sayName, sorryNotCaught, yesNoKeys, channelVerb, dateToWords, amountToSpeech, validateCardNumber, validateExpiration, consumeActionReceipt, authorizeFormActionRetry, formSignature, selectFormAction, confirmFormRevision, prepareFormAction, actionConfirmationValid, beginFormAction, finishFormAction, actionGateVerified, sourceNeedsLoad, beginSourceRefresh, completeSourceRefresh, pickProviderQuestion, matchInputs, readFormAnswer, readInputProfile, formAcceptanceTrace, resolveFormInputs, formInputApplies, formInputFilled, nextFormInput, formInputChain, openFormInstance, validateFormIncompleteOutcome, formIncompleteOutcome, validateFormExhaustion, exhaustFormInput, formInitialReadings, orderFormReadings, proposedFormValues, applyFormValidation, formReadingDependencies, exclusiveFormReadings, enrichFormMatches, expandFormActivations, settleFormActivations, rememberFormArguments, resetFormInputs, hasFormValue, formPath, formValuesEqual, formReadingReady, formReadingRelevant, formPreparation, queueFormReadings, pendingFormReadings, formWorkLimit, answerResetsFormReplays, rejectFormReadings, invalidateFormInputs, acceptFormReadings, formInstanceApplies, formParentResume, closeFormInstance,
49
49
  validateOTP, validateDigits, validatePhone, validateEmail, urlToSpeech, textWithUrlToSpeech, joinSpokenDigits, wholeSpokenNumber,
50
50
  registerSendable, sendables, chatTranscript, conversationCopy,
51
51
  };
@@ -15,4 +15,17 @@ export function sorryNotCaught(lang: any, cargo: any): string;
15
15
  export function anythingElse(lang: any, name: any): any;
16
16
  /** The parting wish when a conversation ends, in the turn's language, with the name if known. */
17
17
  export function goodbye(lang: any, name: any): any;
18
+ /**
19
+ * The verb that asks for an answer on this channel: the host's (`cargo.verb` / `cargo.verb_es`), else "say" / "diga" on a
20
+ * call and "type" / "escriba" elsewhere. `capital` capitalizes it for the start of a sentence.
21
+ */
22
+ export function channelVerb(lang: any, cargo: any, capital?: boolean): string;
23
+ /**
24
+ * The keys and words of a yes/no question, worded for the channel (owner 2026-11-14): every yes/no question names
25
+ * 1 for YES and 2 for NO on a call. The verb is the host's (`cargo.verb` / `cargo.verb_es`: "say" / "type"), else
26
+ * "say" on a call and "type" elsewhere. `yes` and `no` are optional tails ("to submit it", "para enviarla").
27
+ * voice: "Press 1 or say YES to submit it, or press 2 or say NO."
28
+ * text: "Type YES to submit it, or type NO."
29
+ */
30
+ export function yesNoKeys(lang: any, cargo: any, yes?: string, no?: string): string;
18
31
  //# sourceMappingURL=phrases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phrases.d.ts","sourceRoot":"","sources":["../../src/helpers/phrases.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iHAAiH;AACjH,2CAOC;AAED;;;;GAIG;AACH,8DAOC;AAWD,2HAA2H;AAC3H,wDAEC;AAED,iGAAiG;AACjG,mDAEC"}
1
+ {"version":3,"file":"phrases.d.ts","sourceRoot":"","sources":["../../src/helpers/phrases.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iHAAiH;AACjH,2CAOC;AAED;;;;GAIG;AACH,8DAOC;AAWD,2HAA2H;AAC3H,wDAEC;AAED,iGAAiG;AACjG,mDAEC;AAED;;;GAGG;AACH,8EAIC;AAED;;;;;;GAMG;AACH,oFAQC"}
@@ -43,3 +43,28 @@ export function anythingElse(lang, name) {
43
43
  export function goodbye(lang, name) {
44
44
  return (GOODBYE[lang] || GOODBYE.en)(sayName(name));
45
45
  }
46
+ /**
47
+ * The verb that asks for an answer on this channel: the host's (`cargo.verb` / `cargo.verb_es`), else "say" / "diga" on a
48
+ * call and "type" / "escriba" elsewhere. `capital` capitalizes it for the start of a sentence.
49
+ */
50
+ export function channelVerb(lang, cargo, capital = false) {
51
+ const es = lang === 'es', voice = !!(cargo && cargo.voice === true);
52
+ const verb = String((cargo && (es ? cargo.verb_es : cargo.verb)) || (es ? (voice ? 'diga' : 'escriba') : (voice ? 'say' : 'type')));
53
+ return capital ? verb.charAt(0).toUpperCase() + verb.slice(1) : verb;
54
+ }
55
+ /**
56
+ * The keys and words of a yes/no question, worded for the channel (owner 2026-11-14): every yes/no question names
57
+ * 1 for YES and 2 for NO on a call. The verb is the host's (`cargo.verb` / `cargo.verb_es`: "say" / "type"), else
58
+ * "say" on a call and "type" elsewhere. `yes` and `no` are optional tails ("to submit it", "para enviarla").
59
+ * voice: "Press 1 or say YES to submit it, or press 2 or say NO."
60
+ * text: "Type YES to submit it, or type NO."
61
+ */
62
+ export function yesNoKeys(lang, cargo, yes = '', no = '') {
63
+ const es = lang === 'es', voice = !!(cargo && cargo.voice === true);
64
+ const verb = channelVerb(lang, cargo);
65
+ const tail = (t) => (t ? ' ' + String(t).trim() : '');
66
+ const yesWord = es ? 'SÍ' : 'YES';
67
+ const lead = voice ? (es ? 'Presione 1 o ' : 'Press 1 or ') + verb : verb.charAt(0).toUpperCase() + verb.slice(1);
68
+ const second = voice ? (es ? 'presione 2 o ' : 'press 2 or ') + verb : verb;
69
+ return `${lead} ${yesWord}${tail(yes)}, ${es ? 'o' : 'or'} ${second} NO${tail(no)}.`;
70
+ }
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:b1afd306e1642e130fd912e974947379a120980d23c3665cb9b665c52d4e766d";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:6a6a323da263b0e7dbb8eb9bf8b51b8a19160003946be01e38e9a11ba34128ef";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.66.0",
3
+ "version": "1.68.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",