jsfe 1.100.0 → 1.101.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.
@@ -1 +1 @@
1
- {"version":3,"file":"transfer-line-flow.d.ts","sourceRoot":"","sources":["../../src/forms/transfer-line-flow.js"],"names":[],"mappings":"AA0FA,0BAAsC"}
1
+ {"version":3,"file":"transfer-line-flow.d.ts","sourceRoot":"","sources":["../../src/forms/transfer-line-flow.js"],"names":[],"mappings":"AA6FA,0BAAsC"}
@@ -9,7 +9,7 @@
9
9
  * - Available: the caller is asked (unless `confirmed`: they already asked to be connected); YES sets cargo.transferTo = key
10
10
  * and ends every flow with the connecting line, and the host ends the call's session and dials the department. NO gives
11
11
  * the number.
12
- * - Not available (closed, or not a call): the department's number and hours are given.
12
+ * - Not available: on a call (closed) it can help but cannot be connected now, its hours and number; not a call, its number and hours.
13
13
  * - An unknown key says the team cannot be reached here.
14
14
  */
15
15
  import { defineWorker } from './contracts.js';
@@ -29,7 +29,7 @@ const transferToLine = defineWorker({
29
29
  contract: { role: 'router', summary: "Offers a warm transfer to one of the tenant's departments by key; gives its number and hours when it cannot transfer" },
30
30
  id: 'transfer-to-line',
31
31
  name: 'TransferToLine',
32
- version: '1.1.0',
32
+ version: '1.2.0',
33
33
  scope: 'isolated',
34
34
  description: "Worker: offer to connect the caller with the tenant's department `line` (a key of cargo.transferLines). On a call inside its hours YES sets cargo.transferTo and ends the flows with the connecting line; otherwise, or on NO, its number and hours are given.",
35
35
  parameters: [
@@ -39,7 +39,7 @@ const transferToLine = defineWorker({
39
39
  { name: 'confirmed', type: 'boolean', description: 'true when the caller already asked to be connected: no question, the transfer starts' },
40
40
  { name: 'no_closing', type: 'boolean', internal: true, description: 'Internal: true when the calling flow continues the conversation itself, so no closing question is asked.' },
41
41
  ],
42
- variables: vars({ noop: false, tl: null, tl_name: '', tl_name_es: '', tl_reach: '', tl_reach_es: '', tl_q: '', tl_q_es: '' }),
42
+ variables: vars({ noop: false, tl: null, tl_name: '', tl_name_es: '', tl_reach: '', tl_reach_es: '', tl_closed: '', tl_closed_es: '', tl_q: '', tl_q_es: '' }),
43
43
  steps: [
44
44
  set('tl_line', 'tl', "(cargo.transferLines && typeof line === 'string' && cargo.transferLines[line]) || null"),
45
45
  when('tl_unknown', '!tl', say('tl_unknown_say', "{{" + LEAD + "}}Sorry, I can't connect you with that team from here." + ANYTHING_ELSE, "{{" + LEAD_ES + "}}Lo siento, no puedo comunicarle con ese equipo desde aquí." + ANYTHING_ELSE_ES)),
@@ -51,7 +51,10 @@ const transferToLine = defineWorker({
51
51
  set('tl_reach', 'tl_reach', "'You can reach ' + tl_name + (tl.phone ? ' at ' + phoneToSpeech(tl.phone, 'en', !!cargo.voice) : '') + (tl.hours ? ', ' + tl.hours : '') + '.'"),
52
52
  set('tl_reach_es', 'tl_reach_es', "'Puede comunicarse con ' + tl_name_es + (tl.phone ? ' al ' + phoneToSpeech(tl.phone, 'es', !!cargo.voice) : '') + (tl.hours_es ? ', ' + tl.hours_es : '') + '.'"),
53
53
  // not available now (closed, or not a call): the number and hours
54
- when('tl_closed_call', "tl.available !== true && cargo.voice", say('tl_closed_call_say', "{{" + LEAD + " + tl_name.charAt(0).toUpperCase() + tl_name.slice(1)}} isn't available right now. {{tl_reach}}" + ANYTHING_ELSE, "{{" + LEAD_ES + " + tl_name_es.charAt(0).toUpperCase() + tl_name_es.slice(1)}} no está disponible en este momento. {{tl_reach_es}}" + ANYTHING_ELSE_ES)),
54
+ // a call outside its hours (owner wording 2026-11-29): it can help, it cannot be connected now, its hours, its number
55
+ set('tl_closed_line', 'tl_closed', "tl_name.charAt(0).toUpperCase() + tl_name.slice(1) + ' can help, but I am not able to connect you at this time.' + (tl.hours ? ' Their working hours are ' + tl.hours + (tl.phone ? ', and their direct phone number is ' + phoneToSpeech(tl.phone, 'en', true) : '') + '.' : (tl.phone ? ' Their direct phone number is ' + phoneToSpeech(tl.phone, 'en', true) + '.' : ''))"),
56
+ set('tl_closed_line_es', 'tl_closed_es', "tl_name_es.charAt(0).toUpperCase() + tl_name_es.slice(1) + ' le puede ayudar, pero no puedo comunicarle en este momento.' + (tl.hours_es ? ' Su horario de atención es ' + tl.hours_es + (tl.phone ? ', y su número directo es ' + phoneToSpeech(tl.phone, 'es', true) : '') + '.' : (tl.phone ? ' Su número directo es ' + phoneToSpeech(tl.phone, 'es', true) + '.' : ''))"),
57
+ when('tl_closed_call', "tl.available !== true && cargo.voice", say('tl_closed_call_say', "{{" + LEAD + " + tl_closed}}" + ANYTHING_ELSE, "{{" + LEAD_ES + " + tl_closed_es}}" + ANYTHING_ELSE_ES)),
55
58
  when('tl_closed_text', "tl.available !== true && !cargo.voice", say('tl_closed_text_say', "{{" + LEAD + " + tl_reach}}" + ANYTHING_ELSE, "{{" + LEAD_ES + " + tl_reach_es}}" + ANYTHING_ELSE_ES)),
56
59
  when('tl_closed_end', 'tl.available !== true', end('tl_closed_done', { outcome: 'resolved', reason: 'transfer_line_number' })),
57
60
  // already asked for by the caller: connected without a question
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:c7d31f85c684478382c574b64d935a17e301c7a33a06004df303372f68f6e975";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:e63269d2d8c3d4fd9f89f8fd037579f19eae751aca01d1c182dc172a847cf815";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.100.0",
3
+ "version": "1.101.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",