jsfe 1.97.0 → 1.98.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":"send-copy-flow.d.ts","sourceRoot":"","sources":["../../src/forms/send-copy-flow.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"send-copy-flow.d.ts","sourceRoot":"","sources":["../../src/forms/send-copy-flow.js"],"names":[],"mappings":"AAwOA,0BAAmD"}
|
|
@@ -30,8 +30,9 @@ const when = (id, condition, step) => ({ id, type: 'CASE', branches: { [`conditi
|
|
|
30
30
|
const say = (id, value, value_es) => ({ id, type: 'SAY', value, value_es });
|
|
31
31
|
const end = (id, extra = {}) => ({ id, type: 'END', ...extra });
|
|
32
32
|
const call = (id, value, parameters) => ({ id, type: 'FLOW', value, callType: 'call', ...(parameters ? { parameters } : {}) });
|
|
33
|
-
|
|
34
|
-
const
|
|
33
|
+
// The closing question, unless the calling flow continues the conversation itself (no_closing; owner 2026-11-28).
|
|
34
|
+
const ANYTHING_ELSE = "{{typeof no_closing !== 'undefined' && (no_closing === true || no_closing === 'true') ? '' : ' Is there anything else I can help you with?'}}";
|
|
35
|
+
const ANYTHING_ELSE_ES = "{{typeof no_closing !== 'undefined' && (no_closing === true || no_closing === 'true') ? '' : ' ¿Hay algo más en lo que le pueda ayudar?'}}";
|
|
35
36
|
const TEXT_WORDS = ['1', 'text', 'texto', 'sms', 'message', 'text message', 'mensaje', 'mensaje de texto'];
|
|
36
37
|
// A text message is one message: Twilio rejects a body over 1,600 characters (error 21617), so longer content goes by email.
|
|
37
38
|
const TEXT_MAX = 1600;
|
|
@@ -51,6 +52,7 @@ const sendCopy = defineWorker({
|
|
|
51
52
|
{ name: 'item', type: 'string', enum_from: 'sendables', description: "What the user asks to have sent: the reply or document they name or point to. 'That', 'it', 'this', 'eso' or 'lo que me dijo' is the latest reply; the whole chat, conversation or transcript ('toda la conversación') is the whole conversation; continuing on the web, a computer or another device is the link to continue on the web." },
|
|
52
53
|
{ name: 'medium', type: 'string', enum: ['text', 'email'], description: "How the user asks to have it sent: text for a text message or SMS ('mensaje', 'texto'), email for an email ('correo')." },
|
|
53
54
|
{ name: 'destination', type: 'string', description: 'The phone number or email address the user gave to send it to, as given.' },
|
|
55
|
+
{ name: 'no_closing', type: 'boolean', internal: true, description: 'Internal: true when the calling flow continues the conversation itself, so no closing question is asked.' },
|
|
54
56
|
{ name: 'other_destination', type: 'boolean', description: "true when the user asks to send it to a different, new or other phone number or email than their own, without saying what it is ('another number', 'a different email', 'otro número', 'a mi otro correo'); false when they give the number or email, or name none." },
|
|
55
57
|
],
|
|
56
58
|
variables: vars({
|
|
@@ -188,7 +190,7 @@ const sendCopy = defineWorker({
|
|
|
188
190
|
// another email address or phone number: SendCopy again with it, so it is read back in its turn
|
|
189
191
|
when('sc_corrected', "!sc_trusted && (cargo.choice === 'email' || cargo.choice === 'text')", set('sc_corrected_set', 'sc_given', `cargo.choice === 'email' ? ${EMAIL_IN_JS}(cargo.choiceText) : readPhone(String(cargo.choiceText || ''))`)),
|
|
190
192
|
when('sc_corrected_medium', "!sc_trusted && (cargo.choice === 'email' || cargo.choice === 'text')", set('sc_corrected_medium_set', 'sc_medium', 'cargo.choice')),
|
|
191
|
-
when('sc_corrected_again', "!sc_trusted && !!sc_given && (sc_medium === 'email' || sc_medium === 'text') && (cargo.choice === 'email' || cargo.choice === 'text')", { id: 'sc_corrected_again_flow', type: 'FLOW', value: 'send-copy', callType: 'replace', parameters: { item: '{{sc_item.key}}', medium: '{{sc_medium}}', destination: '{{sc_given}}' } }),
|
|
193
|
+
when('sc_corrected_again', "!sc_trusted && !!sc_given && (sc_medium === 'email' || sc_medium === 'text') && (cargo.choice === 'email' || cargo.choice === 'text')", { id: 'sc_corrected_again_flow', type: 'FLOW', value: 'send-copy', callType: 'replace', parameters: { item: '{{sc_item.key}}', medium: '{{sc_medium}}', destination: '{{sc_given}}', no_closing: '{{no_closing}}' } }),
|
|
192
194
|
when('sc_confirm_no', "!sc_trusted && cargo.choice !== 'yes'", say('sc_confirm_no_say', "Okay, I didn't send it." + ANYTHING_ELSE, 'De acuerdo, no lo envié.' + ANYTHING_ELSE_ES)),
|
|
193
195
|
when('sc_confirm_no_end', "!sc_trusted && cargo.choice !== 'yes'", end('sc_confirm_no_done', { outcome: 'unresolved', reason: 'declined' })),
|
|
194
196
|
// send: a sender item runs its flow (it tells the caller); content goes as is
|
package/dist/runtime-identity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const JSFE_RUNTIME_FINGERPRINT = "sha256:
|
|
1
|
+
export const JSFE_RUNTIME_FINGERPRINT = "sha256:d1f8989aad34c35e6f702f20a3147e925822d08b66e210250d47a929bacca55e";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsfe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.98.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",
|