jsfe 1.100.0 → 1.101.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.
@@ -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
@@ -119,8 +119,9 @@ export declare function decodeFlowLlm(text: string, stage: FlowStageRequest): {
119
119
  * chose; below it, "None". A weak start (`any` below WEAK_START) is "None" too when the route is split, its top flow
120
120
  * under SPLIT_ROUTE_SHARE: unsure a flow is wanted and unsure which, the Guru answers (prod 2026-10-29: 'Esta
121
121
  * cancelación afecta mi crédito?' after a cancellation, any 0.51, restarted CancelService). `scores` are the top three flows by the chance that each is the one started,
122
- * any × its route probability (for logs and the host's near-miss hedge); `any` is logged with them. Throws when
123
- * either answer is missing or names no offered flow.
122
+ * any × its route probability (for logs and the host's near-miss hedge); `any` is logged with them. An unanswered
123
+ * `route` with `any` below the threshold is "None" (no scores). Throws when `any` is missing, when `route` is missing
124
+ * and `any` is at or above the threshold, or when `route` names no offered flow.
124
125
  */
125
126
  export declare function decodeFlowSystemOne(answers: StageSystemOneAnswers, stage: FlowStageRequest, { threshold }?: {
126
127
  threshold?: number | undefined;
@@ -1 +1 @@
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_START) is "None" too when the route is split, its top flow
120
120
  * under SPLIT_ROUTE_SHARE: unsure a flow is wanted and unsure which, the Guru answers (prod 2026-10-29: 'Esta
121
121
  * cancelación afecta mi crédito?' after a cancellation, any 0.51, restarted CancelService). `scores` are the top three flows by the chance that each is the one started,
122
- * any × its route probability (for logs and the host's near-miss hedge); `any` is logged with them. Throws when
123
- * either answer is missing or names no offered flow.
122
+ * any × its route probability (for logs and the host's near-miss hedge); `any` is logged with them. An unanswered
123
+ * `route` with `any` below the threshold is "None" (no scores). Throws when `any` is missing, when `route` is missing
124
+ * and `any` is at or above the threshold, or when `route` names no offered flow.
124
125
  */
125
126
  export function decodeFlowSystemOne(answers, stage, { threshold = STAGE_YES_THRESHOLD } = {}) {
126
127
  const any = Number(answers?.any?.noul);
@@ -129,8 +130,13 @@ export function decodeFlowSystemOne(answers, stage, { threshold = STAGE_YES_THRE
129
130
  const names = stage.flows.map(f => f.name);
130
131
  const route = answers?.route;
131
132
  const raw = route?.probabilities;
132
- if (!raw || typeof raw !== 'object')
133
- throw new Error('System One: question route unanswered');
133
+ if (!raw || typeof raw !== 'object') {
134
+ // System One refuses a choice none of whose options fit; with `any` below the cut that is "None" already (owner 2026-11-30).
135
+ if (any < threshold)
136
+ return { flowName: 'None', scores: [], any };
137
+ else
138
+ throw new Error('System One: question route unanswered');
139
+ }
134
140
  if (!names.includes(String(route?.choice)))
135
141
  throw new Error(`System One: route chose "${String(route?.choice).slice(0, 60)}", not an offered workflow`);
136
142
  const probabilities = Object.fromEntries(names.map(n => [n, Number(raw[n]) || 0]));
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:c7d31f85c684478382c574b64d935a17e301c7a33a06004df303372f68f6e975";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:a41d7acc2f6dcb39e1d36a83716195bc110d551fd72789a7e1d25169cd049ab4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.100.0",
3
+ "version": "1.101.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",