jsfe 1.94.0 → 1.95.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":"AAwMA,0BAAgC"}
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
* - The web chat link (WEB_LINK_KEY, owner 2026-11-26: "can I continue this on my computer?") is made at send time by the
|
|
16
16
|
* host's get-web-chat-link tool. With no medium or destination named it is texted to the caller's number, else emailed to
|
|
17
17
|
* the email on file, else the medium is asked; any number or email the caller names is used, as for any item.
|
|
18
|
+
* - Any item to a target that is not the caller's own (their phone, the verified cell, the email on file) is read back and
|
|
19
|
+
* sent only on YES, with a warning for the web link, the whole conversation, or a registered document that declares a
|
|
20
|
+
* disclaimer (owner 2026-11-26: anything in the chat may be sensitive). A sender item's own flow gates its destination.
|
|
18
21
|
* No authentication gate here (owner rule: an authenticated caller's chat and documents are theirs to send anywhere;
|
|
19
22
|
* before authentication no reply holds account data). A sender flow gates its own document.
|
|
20
23
|
*/
|
|
@@ -50,7 +53,7 @@ const sendCopy = defineWorker({
|
|
|
50
53
|
],
|
|
51
54
|
variables: vars({
|
|
52
55
|
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: '',
|
|
53
|
-
sc_medium: '', sc_medium_q: '', sc_medium_q_es: '', sc_given: '', sc_other: false, sc_too_long: false, sc_media: [], sc_forced: '', sc_to: '', sc_subject: '', sc_content: '', sc_sent: false, sc_link: '',
|
|
56
|
+
sc_medium: '', sc_medium_q: '', sc_medium_q_es: '', sc_given: '', sc_other: false, sc_too_long: false, sc_media: [], sc_forced: '', sc_to: '', sc_subject: '', sc_content: '', sc_sent: false, sc_link: '', sc_trusted: true, sc_warning: '', sc_warning_es: '', sc_target: '', sc_confirm_q: '', sc_confirm_q_es: '',
|
|
54
57
|
}),
|
|
55
58
|
steps: [
|
|
56
59
|
set('sc_items', 'sc_items', 'sendables(cargo)'),
|
|
@@ -156,6 +159,22 @@ const sendCopy = defineWorker({
|
|
|
156
159
|
})),
|
|
157
160
|
when('sc_email_read', "sc_medium === 'email' && !sc_to", set('sc_email_pick', 'sc_to', "cargo.email && validateEmail(String(cargo.email)) ? String(cargo.email) : ''")),
|
|
158
161
|
when('sc_email_none_end', "sc_medium === 'email' && !sc_to", end('sc_email_none_done')),
|
|
162
|
+
// a target that is not the caller's own (their phone, the verified cell, the email on file): read back, with the item's
|
|
163
|
+
// warning when it has one (the web link, the whole conversation, a registered document's disclaimer), sent only on YES
|
|
164
|
+
set('sc_trusted', 'sc_trusted', "(sc_medium === 'email' ? sc_to.toLowerCase() === String(cargo.otp_email || '').trim().toLowerCase() : [cargo.callerId, cargo.otp_cell_number].map(function (n) { return String(n || '').replace(/\\D/g, '').slice(-10); }).filter(function (n) { return n.length === 10; }).indexOf(String(cargo.textTo || '').replace(/\\D/g, '').slice(-10)) >= 0)"),
|
|
165
|
+
when('sc_warning', '!sc_trusted', set('sc_warning_set', 'sc_warning', "sc_item.kind === 'web_link' ? 'This link opens our conversation, including any account details, for whoever has it. ' : sc_item.kind === 'conversation' ? 'This is our whole conversation, including any account details. ' : sc_item.disclaimer ? String(sc_item.disclaimer) + ' ' : ''")),
|
|
166
|
+
when('sc_warning_es', '!sc_trusted', set('sc_warning_es_set', 'sc_warning_es', "sc_item.kind === 'web_link' ? 'Este enlace abre nuestra conversación, incluidos los datos de su cuenta, para quien lo tenga. ' : sc_item.kind === 'conversation' ? 'Es toda nuestra conversación, incluidos los datos de su cuenta. ' : sc_item.disclaimer ? String(sc_item.disclaimer_es || sc_item.disclaimer) + ' ' : ''")),
|
|
167
|
+
when('sc_target', '!sc_trusted', set('sc_target_set', 'sc_target', "sc_medium === 'email' ? sc_to : String(cargo.textTo || '').replace(/\\D/g, '').slice(-10).replace(/^(\\d{3})(\\d{3})(\\d{4})$/, '($1) $2-$3')")),
|
|
168
|
+
when('sc_confirm_q', '!sc_trusted', set('sc_confirm_q_set', 'sc_confirm_q', "sc_warning + 'Should I send it to ' + sc_target + '? ' + yesNoKeys('en', cargo)")),
|
|
169
|
+
when('sc_confirm_q_es', '!sc_trusted', set('sc_confirm_q_es_set', 'sc_confirm_q_es', "sc_warning_es + '¿Se lo envío a ' + sc_target + '? ' + yesNoKeys('es', cargo)")),
|
|
170
|
+
when('sc_confirm', '!sc_trusted', call('sc_confirm_ask', 'ask-choice', {
|
|
171
|
+
question: '{{sc_confirm_q}}',
|
|
172
|
+
question_es: '{{sc_confirm_q_es}}',
|
|
173
|
+
choices: [{ key: 'yes', phrases: ['1'] }, { key: 'no', phrases: ['2'] }],
|
|
174
|
+
digits: { min: 1, max: 1 },
|
|
175
|
+
})),
|
|
176
|
+
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)),
|
|
177
|
+
when('sc_confirm_no_end', "!sc_trusted && cargo.choice !== 'yes'", end('sc_confirm_no_done', { outcome: 'unresolved', reason: 'declined' })),
|
|
159
178
|
// send: a sender item runs its flow (it tells the caller); content goes as is
|
|
160
179
|
set('sc_subject', 'sc_subject', "sc_item.kind === 'web_link' ? (language === 'es' ? 'Continúe nuestra conversación en la web' : 'Continue our conversation on the web') : language === 'es' ? 'Su copia de nuestra conversación' : sc_item.kind === 'conversation' ? 'Your copy of our conversation' : 'Your copy from our conversation'"),
|
|
161
180
|
when('sc_send_text', "sc_medium === 'text'", call('sc_send_text_call', 'send-text', { message: '{{sc_content}}' })),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Register (or replace, by key) a document the caller may ask to be sent. Throws on a malformed entry: a flow that
|
|
3
3
|
* registers something unsendable is a flow bug and must fail where it is written, not when a caller asks for it.
|
|
4
|
+
* disclaimer / disclaimer_es (a content entry only): said before the document is sent to a number or email that is not the
|
|
5
|
+
* caller's own, with the read-back SendCopy asks then (owner 2026-11-26).
|
|
4
6
|
* → true, so it can stand in a SET expression.
|
|
5
7
|
*/
|
|
6
8
|
export function registerSendable(cargo: any, entry: any): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendables.d.ts","sourceRoot":"","sources":["../../src/helpers/sendables.js"],"names":[],"mappings":"AAiCA
|
|
1
|
+
{"version":3,"file":"sendables.d.ts","sourceRoot":"","sources":["../../src/helpers/sendables.js"],"names":[],"mappings":"AAiCA;;;;;;GAMG;AACH,kEAgDC;AAED;;;;;;;;GAQG;AACH,6CAeC;AAED;;;GAGG;AACH,wEAOC;AAGD;;;;;;GAMG;AACH,mEAwBC;AAED;;;GAGG;AACH,gEAeC;AAED;;;;GAIG;AACH,oEAsBC;AAlMD,8GAA8G;AAC9G,+BAAgC,cAAc,CAAC;AAC/C,mFAAmF;AACnF,2BAA4B,UAAU,CAAC"}
|
|
@@ -31,6 +31,8 @@ const mediaError = (media) => (media === undefined || (Array.isArray(media) && m
|
|
|
31
31
|
/**
|
|
32
32
|
* Register (or replace, by key) a document the caller may ask to be sent. Throws on a malformed entry: a flow that
|
|
33
33
|
* registers something unsendable is a flow bug and must fail where it is written, not when a caller asks for it.
|
|
34
|
+
* disclaimer / disclaimer_es (a content entry only): said before the document is sent to a number or email that is not the
|
|
35
|
+
* caller's own, with the read-back SendCopy asks then (owner 2026-11-26).
|
|
34
36
|
* → true, so it can stand in a SET expression.
|
|
35
37
|
*/
|
|
36
38
|
export function registerSendable(cargo, entry) {
|
|
@@ -58,6 +60,12 @@ export function registerSendable(cargo, entry) {
|
|
|
58
60
|
else if (entry.args !== undefined && !isText(entry.sender)) {
|
|
59
61
|
throw new Error(`registerSendable(${entry.key}): args belong to a sender entry`);
|
|
60
62
|
}
|
|
63
|
+
else if ((entry.disclaimer !== undefined && !isText(entry.disclaimer)) || (entry.disclaimer_es !== undefined && !isText(entry.disclaimer_es))) {
|
|
64
|
+
throw new Error(`registerSendable(${entry.key}): disclaimer and disclaimer_es, when given, must be nonempty strings`);
|
|
65
|
+
}
|
|
66
|
+
else if (entry.disclaimer !== undefined && isText(entry.sender)) {
|
|
67
|
+
throw new Error(`registerSendable(${entry.key}): a disclaimer belongs to a content entry (a sender flow gates its own destination)`);
|
|
68
|
+
}
|
|
61
69
|
else if (mediaError(entry.media)) {
|
|
62
70
|
throw new Error(`registerSendable(${entry.key}): ${mediaError(entry.media)}`);
|
|
63
71
|
}
|
|
@@ -69,6 +77,14 @@ export function registerSendable(cargo, entry) {
|
|
|
69
77
|
else {
|
|
70
78
|
// English label only: the ranker reads the label in either language.
|
|
71
79
|
}
|
|
80
|
+
for (const field of ['disclaimer', 'disclaimer_es']) {
|
|
81
|
+
if (isText(entry[field])) {
|
|
82
|
+
stored[field] = entry[field];
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// not declared: no warning before a send to someone else
|
|
86
|
+
}
|
|
87
|
+
}
|
|
72
88
|
if (isText(entry.content)) {
|
|
73
89
|
stored.content = entry.content;
|
|
74
90
|
}
|
package/dist/runtime-identity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const JSFE_RUNTIME_FINGERPRINT = "sha256:
|
|
1
|
+
export const JSFE_RUNTIME_FINGERPRINT = "sha256:c2192fd56d17411eb395ea0ccfe97d7ba796bdd1373c3d3d6fc373572a119d0a";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsfe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.95.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",
|