jsfe 1.7.10 → 1.7.12

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.
@@ -201,7 +201,7 @@ const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a
201
201
  set('otp_reset_no_code', 'no_code_given', 'false'), set('otp_reset_invite', 'whatsapp_invite_sent', 'false'), set('otp_reset_callback', 'answer_key', "''"),
202
202
  when('otp_tenant_code', 'cargo.authOptions && cargo.authOptions.code_validator && normalized_otp_code.length !== 6 && /[0-9]/.test(user_choice)', call('otp_tenant_code_call', '{{cargo.authOptions.code_validator}}', { answer: '{{user_choice}}' })),
203
203
  set('otp_other_given', 'other_account_given', "answer_key === 'another_account' ? (cargo.authOtherAccount=String(answer_value || ''),true) : false"),
204
- set('otp_other_requested', 'wants_other_account', 'other_account_given || !!(cargo.callerPreselected && normalized_otp_code.length !== 6 && matchesChoice(user_choice,otp_words.other))'),
204
+ set('otp_other_requested', 'wants_other_account', 'other_account_given || !!(cargo.callerPreselected && normalized_otp_code.length !== 6 && matchesChoice(user_choice,otp_phrases.other))'),
205
205
  when('otp_tenant_answer', 'cargo.authOptions && cargo.authOptions.answer_handler && normalized_otp_code.length !== 6 && !wants_other_account', call('otp_tenant_answer_call', '{{cargo.authOptions.answer_handler}}', { answer: '{{user_choice}}' })),
206
206
  cases('otp_response', {
207
207
  'condition: normalized_otp_code.length === 6': { id: 'otp_check_tool', type: 'CALL-TOOL', tool: 'validate-otp', variable: 'otp_validation_result', args: { otp: '{{normalized_otp_code}}', container: '{{cargo}}' }, onFail: call('otp_check_failed', 'get-and-validate-otp-code', undefined, 'replace') },
@@ -209,11 +209,11 @@ const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a
209
209
  "condition: isAnswer(user_choice,'exit')": call('otp_exit', '{{otp_cancel}}', undefined, 'reboot'),
210
210
  "condition: isAnswer(user_choice,'agent')": call('otp_agent', 'live-agent-requested', undefined, 'reboot'),
211
211
  "condition: isAnswer(user_choice,'text')": call('otp_text', 'switch-to-text', undefined, 'reboot'),
212
- 'condition: matchesChoice(user_choice,otp_words.resend)': call('otp_resend', 'resend-otp-code', { resend_reason: 'requested' }),
213
- 'condition: matchesChoice(user_choice,otp_words.later)': say('otp_later', "No problem. Say TEXT and I'll continue with you by message so you can do this when you are free, or {{cargo.verb}} the code whenever you are ready.", 'No hay problema. Diga TEXTO y sigo con usted por mensaje para que lo haga cuando esté libre, o {{cargo.verb_es}} el código cuando pueda.'),
212
+ 'condition: matchesChoice(user_choice,otp_phrases.resend)': call('otp_resend', 'resend-otp-code', { resend_reason: 'requested' }),
213
+ 'condition: matchesChoice(user_choice,otp_phrases.later)': say('otp_later', "No problem. Say TEXT and I'll continue with you by message so you can do this when you are free, or {{cargo.verb}} the code whenever you are ready.", 'No hay problema. Diga TEXTO y sigo con usted por mensaje para que lo haga cuando esté libre, o {{cargo.verb_es}} el código cuando pueda.'),
214
214
  'condition: normalized_otp_code.length > 0 && Number(cargo.otpFormatMisses || 0)<2': say('otp_bad_format', "I was expecting a 6-digit code. Let's try again. You can also {{cargo.voice ? 'press * or ' : ''}}{{cargo.verb}} EXIT to cancel.", "Esperaba un código de 6 dígitos. Intentemos de nuevo. También puede {{cargo.voice ? 'presionar * o decir' : 'escribir'}} SALIR para cancelar."),
215
215
  'condition: normalized_otp_code.length > 0': effect('otp_format_cap_next', 'true'),
216
- ['condition: matchesChoice(user_choice,otp_words.noPhone) || ' + expression(otpPhoneUnavailable, 'user_choice')]: otpMenu('otp_no_phone', "No problem. Then the code can't reach you there. You can use the email on your account instead, or {{cargo.verb}} AGENT to reach a person.", 'No hay problema. Entonces el código no le puede llegar ahí. Puede usar el correo electrónico de su cuenta, o {{cargo.verb_es}} AGENTE para hablar con una persona.', false),
216
+ ['condition: matchesChoice(user_choice,otp_phrases.noPhone) || ' + expression(otpPhoneUnavailable, 'user_choice')]: otpMenu('otp_no_phone', "No problem. Then the code can't reach you there. You can use the email on your account instead, or {{cargo.verb}} AGENT to reach a person.", 'No hay problema. Entonces el código no le puede llegar ahí. Puede usar el correo electrónico de su cuenta, o {{cargo.verb_es}} AGENTE para hablar con una persona.', false),
217
217
  default: set('otp_words_missing', 'no_code_given', 'true')
218
218
  }),
219
219
  effect('otp_word_count', '(cargo.otpWordMisses=Number(cargo.otpWordMisses || 0)+(no_code_given?1:0),true)'),
@@ -77,8 +77,8 @@ function compose(registries, kind) {
77
77
  // Composition preserves authored JSON; the engine compiles only after
78
78
  // all selected sets are available. Mirror the builder's conventional alias.
79
79
  const name = identity(authored && entry.name === undefined ? id.split(/[-:]/).map(part => part.charAt(0).toUpperCase() + part.slice(1)).join('') : entry.name, kind + ' name');
80
- if (kind === 'flows' && !Array.isArray(entry.steps) && !(authored && (entry.form || entry.provides || entry.performs)))
81
- fail('flow ' + id + ' needs steps or a declarative form/provider/performer');
80
+ if (kind === 'flows' && !Array.isArray(entry.steps) && !(authored && (entry.form || entry.provides || entry.performs || entry.call || Array.isArray(entry.before) && entry.before.length)))
81
+ fail('flow ' + id + ' needs steps or a declarative form/provider/performer/worker');
82
82
  const bytes = JSON.stringify(canonical(entry));
83
83
  if (definitions.has(id)) {
84
84
  if (definitions.get(id) !== bytes)
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:2e03bdc05fb1c013135fc03411f3ba77e58b0316d8cb49e9f9b49e86b9b0de17";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:517e0e4ba634f4afc918ca1b37c03fabe3265ab246cbfe6e75b0069821425ece";
@@ -85,8 +85,16 @@ Reviewed acceptance: 89 SDK test files; 142 legacy and 142 native flow suites; 6
85
85
  Owner authorized publication, exact pins in both consumers, dev host deployment and matching shared/ai-ar-ql activation in all three dev configs with session-only actions. Production deployment and activation are excluded. Shopify Policy remains unchanged with its later review recorded as a tenant TODO. Match runtime, host and regenerated definitions before activation; existing uncertain work must retain its hold.
86
86
 
87
87
 
88
- ## 1.7.10 — self-contained JSON authoring
88
+ ## 1.7.11 — self-contained JSON authoring
89
89
 
90
90
  Version-1 JSON flow declarations compile inside JSFE. Tenant JSON contains its forms, providers, performers, workers and ordinary named JavaScript functions; source snapshots remain detached from executable state. Named functions use explicit session arguments and normal JavaScript loops/callbacks. `phrases` and provider `description` are the authoring names; existing executable `words`/`gloss` inputs retain compatibility. Continuation safety revisions are generated internally from source declarations and preserve unknown action holds. The single authoring specification is `docs/copilot-reference.md`, also consumed by the Lambda CoPilot.
91
91
 
92
92
  Owner authorized publication, exact pins in both consumers, dev host deployment and matching shared/ai-ar-ql activation on all three dev configurations with session-only actions. Native Shopify remains composed and Shopify Policy remains unchanged. Production is outside this authorization. Full execution/model replay follows the matched dev activation; local focused results are not relabelled as full published-runtime acceptance.
93
+
94
+ The 1.7.10 publication workflow was stopped before publication after the host-composition preflight rejected call-only declarative workers. Its tag is retained unchanged. The corrected 1.7.11 candidate includes actual registry-composition-to-engine execution coverage.
95
+
96
+ ## 1.7.12 — OTP recovery catalog correction
97
+
98
+ Correct four OTP decision expressions to reference the renamed `otp_phrases` catalog. The incomplete rename in 1.7.11 prevented resend, lost-phone, later and some invalid-code recovery branches from executing correctly. Consent, authentication, action persistence and tool permissions are unchanged. A focused runtime regression executes the actual shared validator for English/Spanish lost-phone answers, resend, later and a short code, requiring no expression failures and no authentication. Tenant execution checks cover the affected account, identity, statement-delivery and proposal paths.
99
+
100
+ This corrective release follows the same authorized dev-only rollout: exact consumer pins, matched shared and ai-ar-ql definitions in all three session-only dev configurations, and production unchanged. Broader execution and model results are retained separately and must be reported as observed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.7.10",
3
+ "version": "1.7.12",
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",