jsfe 1.51.0 → 1.52.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
@@ -387,10 +387,11 @@ instructions with its text model.
387
387
  favor / now / ahora; CANCEL is not one) ends every flow at any question, before any reader, command or the reply ranker
388
388
  (`isGlobalExit`), outcome `user_aborted`, reason `exit_requested`, unless the question declares a choice of its own for that
389
389
  word (its key or a phrase is `*`, EXIT, QUIT or SALIR): that choice takes the answer. The engine then starts
390
- the worker `global-exit` (default: a reboot to the set's `contact-support` with `exit_outcome`, the outcome in force before the
391
- flows ended, and the waiting question's `exit_context` as `support_context`), or the tenant flow that `wraps: "global-exit"`. A waiting stack
390
+ the worker `global-exit` with `exit_outcome`, the outcome in force before the flows ended (default since 1.52.0: "The process has
391
+ been cancelled at your request. Is there anything else I can help you with?", or thanks with the same offer when that outcome is
392
+ `resolved`; no contact list), or the tenant flow that `wraps: "global-exit"`. A waiting stack
392
393
  that declares its own exit destination (`cancel_flow` other than `contact-support`, e.g. the retry menu's) starts that flow instead,
393
- as its local exit did. A set with neither a wrapper nor `contact-support` keeps the generic reply.
394
+ as its local exit did. A set with neither a wrapper nor `global-exit` keeps the generic reply.
394
395
 
395
396
  **Keypad 9 (jsfe 1.42.0, owner 2026-10-31):** on a call, a whole answer of `9` at any question ends every flow and starts
396
397
  `switch-to-text`, when the caller's number can take texts (`callerTextNumber`) and the set has that flow. A question that declares a
@@ -1 +1 @@
1
- {"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AA8CA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,6CAMC;AACD,qHAQC;AASD,4EAKC;AAiGD,2DAOC;AACD,4DAOC;AACD,gHAAgH;AAChH,8DAGC;AAyJD,8EAGC;AA4BD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AApQD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AAqRzC,0BAAsK"}
1
+ {"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AA8CA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,6CAMC;AACD,qHAQC;AASD,4EAKC;AAiGD,2DAOC;AACD,4DAOC;AACD,gHAAgH;AAChH,8DAGC;AAyJD,8EAGC;AA4BD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AApQD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AAuRzC,0BAAsK"}
@@ -468,9 +468,11 @@ const failed = worker('verification-failed', 'VerificationFailed', 'End a verifi
468
468
  end('vf_end')]
469
469
  });
470
470
  // The global exit (owner 2026-11-11): the engine starts this flow when the whole answer is *, EXIT, QUIT or SALIR (and the
471
- // question declares no choice of its own for it), after every flow has ended. Default: the tenant's support closing with the outcome in force. A tenant
471
+ // question declares no choice of its own for it), after every flow has ended. Default (1.52.0, owner 2026-11-11): the process cancelled at the
472
+ // caller's request, or thanks when the outcome in force is resolved, each ending with an offer of more help; no contact list (the caller chose
473
+ // to leave, they are not stuck). A tenant
472
474
  // gives the global exit its own path with a flow that `wraps` this one; the engine then starts that wrapper.
473
- const globalExit = worker('global-exit', 'GlobalExit', 'Worker (started by the engine): the caller exited; give the support closing with the outcome in force.', { scope: 'isolated', parameters: [param('exit_outcome', 'The declared outcome in force when the caller exited (resolved: thanks)'), param('support_context', 'What the caller needed help with (the question\'s exit_context), English'), param('support_context_es', 'The same in Spanish')], steps: [
474
- call('global_exit_support', 'contact-support', { exit_outcome: '{{exit_outcome}}', support_context: '{{support_context}}', support_context_es: '{{support_context_es}}' }, 'reboot')
475
+ const globalExit = worker('global-exit', 'GlobalExit', 'Worker (started by the engine): the caller exited; say the process was cancelled at their request (thanks when the outcome in force is resolved) and offer more help.', { scope: 'isolated', version: '1.1.0', parameters: [param('exit_outcome', 'The declared outcome in force when the caller exited (resolved: thanks)'), param('support_context', 'What the caller needed help with (the question\'s exit_context), English; not spoken since 1.52.0'), param('support_context_es', 'The same in Spanish')], steps: [
476
+ { id: 'global_exit_say', type: 'SAY', value: "{{exit_outcome === 'resolved' ? 'Thank you for contacting us! Is there anything else I can help you with?' : 'The process has been cancelled at your request. Is there anything else I can help you with?'}}", value_es: "{{exit_outcome === 'resolved' ? '¡Gracias por comunicarse con nosotros! ¿Hay algo más en lo que pueda ayudarle?' : 'El proceso fue cancelado a petición suya. ¿Hay algo más en lo que pueda ayudarle?'}}", outcome: "{{exit_outcome === 'resolved' ? 'resolved' : 'user_aborted'}}", reason: "{{exit_outcome === 'resolved' ? 'left_after_resolved' : 'exit_requested'}}" }
475
477
  ] });
476
478
  export const FLOWS = [taskGate, resume, service, rawTransport, contact, misread, declined, splitFailed, rejected, auth, code, validateCode, emailToo, retry, email, failed, globalExit];
package/dist/index.d.ts CHANGED
@@ -604,7 +604,7 @@ export declare function detectFlowWithParameters(input: string, engine: Engine):
604
604
  /**
605
605
  * The global exit (owner 2026-11-11). The flow that answers a caller who exits, after every flow has ended: the
606
606
  * system set's `global-exit`, or the tenant flow that `wraps` it. It receives the outcome in force before the flows ended, so
607
- * a caller who leaves after being served is thanked. Null when the set has neither a wrapper nor `contact-support`: the generic reply answers.
607
+ * a caller who leaves after being served is thanked. Null when the set has neither a wrapper nor `global-exit`: the generic reply answers.
608
608
  */
609
609
  export declare const GLOBAL_EXIT_FLOW = "global-exit";
610
610
  /**
package/dist/index.js CHANGED
@@ -4230,7 +4230,7 @@ async function handleDispatchStep(currentFlowFrame, engine) {
4230
4230
  /**
4231
4231
  * The global exit (owner 2026-11-11). The flow that answers a caller who exits, after every flow has ended: the
4232
4232
  * system set's `global-exit`, or the tenant flow that `wraps` it. It receives the outcome in force before the flows ended, so
4233
- * a caller who leaves after being served is thanked. Null when the set has neither a wrapper nor `contact-support`: the generic reply answers.
4233
+ * a caller who leaves after being served is thanked. Null when the set has neither a wrapper nor `global-exit`: the generic reply answers.
4234
4234
  */
4235
4235
  export const GLOBAL_EXIT_FLOW = 'global-exit';
4236
4236
  function globalExitStart(engine) {
@@ -4249,8 +4249,8 @@ function globalExitStart(engine) {
4249
4249
  }
4250
4250
  const base = menu.find(f => f.id === GLOBAL_EXIT_FLOW);
4251
4251
  const wrapper = base ? menu.find(f => f.wraps === base.id || f.wraps === base.name) : undefined;
4252
- // The default reboots to the set's `contact-support`; a set without one keeps the generic reply (a FLOW to a missing flow is skipped).
4253
- const flow = wrapper || (base && menu.some(f => f.id === 'contact-support') ? base : undefined);
4252
+ // The default answers on its own (1.52.0); a set without `global-exit` keeps the generic reply.
4253
+ const flow = wrapper || base;
4254
4254
  const context = declared('exit_context'), contextEs = declared('exit_context_es');
4255
4255
  return flow ? { flow: flow.id, arguments: { exit_outcome: outcomeInForce(engine)?.outcome || '', ...(context ? { support_context: context, support_context_es: contextEs || context } : {}) } } : null;
4256
4256
  }
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:20a0b00343fbccb8342d26b3a560a7217075daef050aef2edc7b1a765742ec12";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:76ce5ae5d3bb7215c635ed6e0a92a8a91ab1701e451c37ecdf8d1a1a73c21a7e";
@@ -254,10 +254,10 @@ flowchart TD
254
254
  Before any reader, a waiting question checks two whole answers that work everywhere (jsfe 1.42.0):
255
255
 
256
256
  - **The global exit.** `*`, EXIT, QUIT or SALIR (repeated, or with please / por favor / now / ahora; CANCEL is not one) ends
257
- every flow, outcome `user_aborted`, reason `exit_requested`. The engine then starts `global-exit`: by default a reboot to the
258
- set's `contact-support` with the question's `exit_context`, which thanks a caller whose request was already resolved. A tenant
257
+ every flow, outcome `user_aborted`, reason `exit_requested`. The engine then starts `global-exit`: by default (1.52.0) it says the
258
+ process was cancelled at the caller's request, or thanks a caller whose request was already resolved, and offers more help. A tenant
259
259
  gives the exit its own path with a flow that `wraps: "global-exit"`; a flow that declares its own exit destination (`cancel_flow`)
260
- keeps it. A set with neither a wrapper nor `contact-support` keeps the generic cancel reply.
260
+ keeps it. A set with neither a wrapper nor `global-exit` keeps the generic cancel reply.
261
261
  - **Keypad 9 switches a call to text,** when the caller's number can take texts and the set has `switch-to-text`. Keypad 8
262
262
  (language) and 0 (a person) are the host's, before the engine.
263
263
  - **A declared choice wins.** A question that offers its own choice for the word (its key or a phrase is `*`, EXIT, QUIT,
@@ -271,7 +271,7 @@ An unreadable answer with any words goes to the reply ranker, offered the questi
271
271
 
272
272
  `user_description` / `user_description_es` on a form (jsfe 1.42.0): one sentence saying what the process does, written with the engine's own `{{...}}` expressions, every input of the form in scope ('' until answered) and its data ("This process allows you to change the delivery address or delivery date for your order.{{change === 'address' ? ' You chose to change the delivery address.' : change === 'date' ? ' You chose to change the delivery date.' : ''}}"). The nearest form in the chain declaring one is used. The form's readers then offer the reply ranker `concern`; a caller who expresses doubt that the process is what they need hears the sentence, "To cancel, press the asterisk key or say EXIT." (text: "To cancel, type EXIT."; Spanish SALIR) and the question again, with no attempt counted. Declare it where a caller may mistake what the flow is doing; it applies to every question of the form and its sub-forms, so word it for all of them.
273
273
 
274
- **Global keys (jsfe 1.42.0).** A whole answer `*`, EXIT, QUIT or SALIR ends every flow at any question and starts `global-exit` (default: `contact-support`; a tenant overrides it with a flow that `wraps: "global-exit"`). On a call a whole answer `9` starts `switch-to-text` when the caller can be texted. Never write a local handler for these; to give a question its own meaning for one, declare it as a choice (key or phrase): a declared choice takes the answer. CANCEL is not an exit word.
274
+ **Global keys (jsfe 1.42.0).** A whole answer `*`, EXIT, QUIT or SALIR ends every flow at any question and starts `global-exit` (default: "cancelled at your request" and an offer of more help, thanks when resolved; a tenant overrides it with a flow that `wraps: "global-exit"`). On a call a whole answer `9` starts `switch-to-text` when the caller can be texted. Never write a local handler for these; to give a question its own meaning for one, declare it as a choice (key or phrase): a declared choice takes the answer. CANCEL is not an exit word.
275
275
 
276
276
  `must_complete:true` on a form (inherited by every field of it and of the forms nested in it) or on one field (`false` on a field opts out): an unreadable answer is never yielded to DISPATCH, however long, and neither is a confirmation miss or an unresolved ambiguity — the question is asked again, acknowledged. A worded reply always reaches the reply ranker, offered every choice the chain's reader accepts: a pick is taken, a clear withdrawal ends the flows, and any other verdict (a new request included) stays and says `first_task` / `first_task_es` from the nearest form declaring it, "I understand, first let's record your new card." / "Entiendo, primero vamos a registrar su tarjeta nueva.", then the field's `retry` or its question. It uses no attempt. Use it where leaving would strand an effect in progress (a payment's card, its billing-ZIP correction). Other exits stay explicit: the form's stop words, `max_attempts` with `on_exhausted`, and whatever the host intercepts before the engine. The form runaway guard counts passes without a caller answer only.
277
277
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.51.0",
3
+ "version": "1.52.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",