jsfe 1.15.9 → 1.16.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.
package/README.md CHANGED
@@ -12,6 +12,7 @@ npm i jsfe
12
12
  - **[JavaScript Flow Engine User Guide](user-guide.md)**
13
13
  - Comprehensive tutorials, examples, and best practices
14
14
  - **[README.md](README.md)** - Technical API reference (this document)
15
+ - **[Flows architecture guide](docs/architecture-guide.md)** - start here: the concepts, the building blocks, what the caller experiences, and how conversational AI and exact transactional flows work together (the reply ranker and DISPATCH)
15
16
  - **[Flow author reference](docs/copilot-reference.md)** - the authoritative engine and JSON authoring specification for flow authors and AI flow generators (shipped in the package; the Flow Designer's CoPilot reads it from the published version, so change it with the engine)
16
17
  - **[Development candidate acceptance](docs/development-release.md)** - reproducible package and cross-repository verification
17
18
  - **[System Flows](docs/flows/system/README.md)** and **[Shopify Flows](docs/flows/shopify/README.md)** - the bundled flow and tool libraries in `flows/`: a page and a chart per flow, generated from the JSON (`node scripts/flow-docs.mjs`), plus the conventions the system flows share
@@ -1 +1 @@
1
- {"version":3,"file":"flow-docs.d.ts","sourceRoot":"","sources":["../../src/docs/flow-docs.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;;EAqRC"}
1
+ {"version":3,"file":"flow-docs.d.ts","sourceRoot":"","sources":["../../src/docs/flow-docs.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;EAsRC"}
@@ -14,8 +14,10 @@
14
14
  */
15
15
  import fs from 'fs';
16
16
  import path from 'path';
17
+ import { resolveSetDataReferences } from '../forms/declarations.js';
17
18
  export function generateFlowDocs({ sets, root, check = false, hostRun = {}, log = console.log }) {
18
- const SETS = sets;
19
+ // A catalog or value written as {"$data": path} is documented as compilation resolves it.
20
+ const SETS = sets.map((s) => ({ ...s, flows: resolveSetDataReferences(s.flows) }));
19
21
  // Which set holds a flow id; a page links to a flow in its own set, or in another set's folder.
20
22
  const setOf = new Map(), flowOf = new Map();
21
23
  for (const s of SETS) {
@@ -422,7 +424,7 @@ export function generateFlowDocs({ sets, root, check = false, hostRun = {}, log
422
424
  }
423
425
  else { /* not a compiled form */ }
424
426
  if (flow.performs) {
425
- out.push('', '### Performs', '', ...flow.performs.map((a) => `- \`${a.action}\` (${a.effect}): ${a.reconcile && a.reconcile.policy ? cut(a.reconcile.policy, 300) : ''}`), '', performsChart(flow));
427
+ out.push('', '### Performs', '', ...flow.performs.map((a) => `- \`${a.action}\` (${a.effect})`), '', performsChart(flow));
426
428
  }
427
429
  else { /* not a performer */ }
428
430
  if (flow.call) {
@@ -28,7 +28,7 @@ const street = C('address-street-validate', 'Validate a proposed street against
28
28
  W('address_street_malformed', "!/^\\d{1,6}\\s+[A-Za-z\\xC0-\\xFF]/.test(String(value))", S('address_street_invalid', 'noop', "(cargo.inputCheck={ok:false,message:'Please give the street number and street name.',message_es:'Indique el número y nombre de la calle.'},true)")), W('address_street_stop', "!/^\\d{1,6}\\s+[A-Za-z\\xC0-\\xFF]/.test(String(value))", { id: 'address_street_invalid_end', type: 'END' }),
29
29
  S('address_street_components', 'components', "'postal_code:'+values.zip+'|country:US'"), { id: 'address_street_tool', type: 'CALL-TOOL', tool: 'geocode-street', variable: 'result', args: { address: '{{value}}', components: '{{components}}' }, onFail: S('address_street_failed', 'result', 'null') },
30
30
  S('address_street_projection', 'location', E(streetLocation, 'result', 'value', 'values.zip')),
31
- S('address_street_result', 'noop', "(cargo.forms[form].data.street=location, cargo.inputCheck={ok:true,value:String(value)}, true)")
31
+ S('address_street_result', 'noop', "(cargo.forms[form].data.street=location, location.city&&cargo.forms[form].accepted&&cargo.forms[form].accepted.city&&cargo.forms[form].accepted.city.origin==='derived'&&cargo.forms[form].values.city!==location.city?(cargo.forms[form].values.city=location.city):null, cargo.inputCheck={ok:true,value:String(value)}, true)")
32
32
  ], { parameters: [P('form'), P('value'), P('values', 'object')], variables: V({ components: '', result: null, location: null }), contract: { tools: ['geocode-street'], result: { path: 'cargo.inputCheck', type: 'object' } } });
33
33
  const zipPrompt = C('address-zip-prompt', 'Render the ZIP retry wording from the owned address instance.', [S('address_zip_prompt', 'noop', "(cargo.forms[form].data.zip_question=(cargo.forms[form].data.retry ? \"Let's try again. \" : '')+'What is the 5-digit zip code of your new address?',cargo.forms[form].data.zip_question_es=(cargo.forms[form].data.retry?'Intentémoslo otra vez. ':'')+'¿Cuál es el código postal de 5 dígitos de su nueva dirección?',true)")], { parameters: [P('form')], contract: { result: { path: 'cargo.forms[form].data', type: 'object' } } });
34
34
  const streetPrompt = C('address-street-prompt', 'Include the ZIP-derived location when asking for the street.', [S('address_street_prompt', 'noop', "(cargo.forms[form].data.street_question=(cargo.forms[form].data.location?'Got it, '+(cargo.forms[form].values.city?cargo.forms[form].values.city+', '+cargo.forms[form].data.location.state:cargo.forms[form].data.location.line)+'. ':'')+'What is the street address?',cargo.forms[form].data.street_question_es=(cargo.forms[form].data.location?'Entendido, '+(cargo.forms[form].values.city?cargo.forms[form].values.city+', '+cargo.forms[form].data.location.state:cargo.forms[form].data.location.line)+'. ':'')+'¿Cuál es la dirección?',true)")], { parameters: [P('form')], contract: { result: { path: 'cargo.forms[form].data', type: 'object' } } });
@@ -0,0 +1,5 @@
1
+ export function continuationBreaks(previousFlows: any, nextFlows: any): {
2
+ id: any;
3
+ removed: {};
4
+ }[];
5
+ //# sourceMappingURL=continuation-compat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continuation-compat.d.ts","sourceRoot":"","sources":["../../src/forms/continuation-compat.js"],"names":[],"mappings":"AAgBA;;;IAgBC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A deploy check: a change that can break a saved session must bump its declaration's major version. A saved session
3
+ * continues across a minor or patch change, so an entry argument or a form input it may still hold must not disappear
4
+ * without a major bump; neither may a shared data or function name without its entry's major bump. Removing a flow needs
5
+ * no bump: a session standing in a flow that no longer exists is retired anyway.
6
+ *
7
+ * continuationBreaks(previousFlows, nextFlows) → [{ id, removed: { parameters?, inputs?, data?, functions? } }]
8
+ * both arrays are the authored declarations (a set's .flows file); ordinary executable flows are not compared.
9
+ * It reads names only: a change of meaning under the same name is still the author's to declare with a major bump.
10
+ */
11
+ import { majorOf } from './declarations.js';
12
+ const parameterNames = parameters => Array.isArray(parameters) ? parameters.map(p => p?.name).filter(Boolean) : Object.keys(parameters || {});
13
+ const inputNames = inputs => (inputs || []).flatMap(input => [input?.name, ...inputNames(input?.any_of)]).filter(Boolean);
14
+ const missing = (before, after) => { const keep = new Set(after); return [...new Set(before)].filter(name => !keep.has(name)); };
15
+ export function continuationBreaks(previousFlows, nextFlows) {
16
+ const next = new Map((nextFlows || []).filter(flow => flow && flow.id).map(flow => [flow.id, flow]));
17
+ const breaks = [];
18
+ for (const before of previousFlows || []) {
19
+ const after = before && next.get(before.id);
20
+ if (!after || before.declarationVersion === undefined || majorOf(before.version) !== majorOf(after.version))
21
+ continue;
22
+ const removed = {};
23
+ if (before.library === 'data') {
24
+ const names = missing(Object.keys(before.data || {}), Object.keys(after.data || {}));
25
+ if (names.length)
26
+ removed.data = names;
27
+ }
28
+ else if (before.library === 'functions') {
29
+ const names = missing(Object.keys(before.functions || {}), Object.keys(after.functions || {}));
30
+ if (names.length)
31
+ removed.functions = names;
32
+ }
33
+ else {
34
+ const parameters = missing(parameterNames(before.parameters), parameterNames(after.parameters));
35
+ if (parameters.length)
36
+ removed.parameters = parameters;
37
+ const inputs = missing(inputNames(before.form?.inputs), inputNames(after.form?.inputs));
38
+ if (inputs.length)
39
+ removed.inputs = inputs;
40
+ }
41
+ if (Object.keys(removed).length)
42
+ breaks.push({ id: before.id, removed });
43
+ }
44
+ return breaks;
45
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/forms/contracts.js"],"names":[],"mappings":"AAgBA;;;IAGC;AACD;;;;;EAGC;AACD,qGAAqG;AACrG;;QAwCC;AAqBD;;;QAEC;AAgBD;;;;;;;;;QASC;AACD;;;;QAGC;AACD;;;;;;;;QA8BC;AAED,mHAAmH;AACnH,kDAgBC;AAED,+GAA+G;AAC/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EC"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/forms/contracts.js"],"names":[],"mappings":"AAgBA;;;IAGC;AACD;;;;;EAGC;AACD,qGAAqG;AACrG;;QAwCC;AAqBD;;;QAEC;AAgBD;;;;;;;;;QASC;AACD;;;;QAGC;AACD;;;;;;;;QA8BC;AAED,mHAAmH;AACnH,kDAgBC;AAED,+GAA+G;AAC/G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4EC"}
@@ -138,7 +138,7 @@ export function defineProvider({ provides, contract, parameters = [], variables
138
138
  }
139
139
  export function defineForm({ contract, provides, ...spec }) {
140
140
  const flow = formFlow({ ...spec, ...(provides ? { extraVars: { ...spec.extraVars, provides, questions: providerQuestions(provides) } } : {}) });
141
- return declared(flow, { role: 'collector', ...contract, form: { inputs: 'inputs' } });
141
+ return declared(flow, { role: 'collector', ...contract, form: { inputs: 'inputs' }, ...(provides ? { catalog: 'provides' } : {}) });
142
142
  }
143
143
  export function definePerformer({ performs, contract, prepare, present, project = [], provides, ...spec }) {
144
144
  validateActionProjection(project, spec.id);
@@ -170,7 +170,7 @@ export function definePerformer({ performs, contract, prepare, present, project
170
170
  { ...set('receipt_applied', 'noop', 'pf_receipt ? consumeActionReceipt(cargo,pf_receipt) : true'), requireTrue: true },
171
171
  call('present', present, { form: '{{form_instance}}', request: '{{pf_request}}', result: '{{pf_result}}' }),
172
172
  ...(spec.after || [])] });
173
- return declared(flow, { role: 'performer', ...contract, requires: ['guardedActions', ...normalizeHostRequirements(contract?.requires, spec.id)], actions: 'performs', form: { inputs: 'inputs' }, prepares: prepare, presents: present, projects: 'projection' });
173
+ return declared(flow, { role: 'performer', ...contract, requires: ['guardedActions', ...normalizeHostRequirements(contract?.requires, spec.id)], actions: 'performs', form: { inputs: 'inputs' }, prepares: prepare, presents: present, projects: 'projection', ...(provides ? { catalog: 'provides' } : {}) });
174
174
  }
175
175
  /** A registered tool gets one generated adapter with explicit args; no dynamic tool-name interpreter is needed. */
176
176
  export function operationWorkers(tools) {
@@ -278,6 +278,10 @@ export function validateFlowContracts(flows, tools = [], { externalFlows = [], r
278
278
  for (const reference of [provides.gate?.flow, provides.source?.flow])
279
279
  if (reference && !ids.has(reference))
280
280
  fail(flow.id, `unknown provider worker ${reference}`);
281
+ // a FLOW to a name that does not exist is skipped silently at run time, so a menu choice's target is checked here
282
+ for (const choice of provides.menu?.choices || [])
283
+ if (choice?.flow && !ids.has(choice.flow))
284
+ fail(flow.id, `unknown menu worker ${choice.flow}`);
281
285
  }
282
286
  for (const action of contract.performs || flow.variables?.[contract.actions]?.value || []) {
283
287
  if (action.retry?.unknown && !(action.effect === 'send' && action.retry.unknown === 'explicit'))
@@ -292,8 +296,6 @@ export function validateFlowContracts(flows, tools = [], { externalFlows = [], r
292
296
  fail(flow.id, `unknown action worker ${action.flow}`);
293
297
  if (!action.outcomes || !Object.keys(action.outcomes).length)
294
298
  fail(flow.id, `action ${action.action} needs outcomes`);
295
- if (['charge', 'write', 'send', 'cancel'].includes(action.effect) && !action.idempotency && !action.reconcile)
296
- fail(flow.id, `action ${action.action} needs idempotency or reconciliation`);
297
299
  if ((action.effect === 'charge' || action.effect === 'cancel' || action.reversible === false) && action.confirm?.exact !== true)
298
300
  fail(flow.id, `action ${action.action} needs exact confirmation`);
299
301
  }
@@ -1,6 +1,7 @@
1
1
  /** The set's shared data for expressions, read as $data.<name>: references resolved, deep-frozen (one engine serves many
2
2
  * sessions), never copied into session variables. Every $data.<name> an expression reads must exist, checked at load. */
3
3
  export function flowSetData(flows: any, compiledFlows?: any[]): any;
4
+ export function resolveSetDataReferences(flows: any): any;
4
5
  /** Compile only explicitly versioned declarations. Ordinary executable JSON is unchanged.
5
6
  * @param {any[]} flows
6
7
  * @param {{tools?: any[], externalFlows?: any[], validate?: boolean}} options
@@ -20,4 +21,6 @@ export function captureOriginalDeclaration(flow: any): {
20
21
  export function serializeFlowDeclaration(flow: any, { resolvedFlow }?: {
21
22
  resolvedFlow?: any;
22
23
  }): any;
24
+ /** The major of a declared version ("2.4.1" → "2"; absent or unreadable → "0"). */
25
+ export function majorOf(version: any): string;
23
26
  //# sourceMappingURL=declarations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../../src/forms/declarations.js"],"names":[],"mappings":"AAgDA;yHACyH;AACzH,oEAaC;AAmFD;;;;GAIG;AACH,+CAJW,GAAG,EAAE,uCACL;IAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAC,GACxD,GAAG,EAAE,CAmEjB;AAED,sGAAsG;AACtG;;;SAAqK;AAuBrK,6FAA6F;AAC7F;;QAuCC"}
1
+ {"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../../src/forms/declarations.js"],"names":[],"mappings":"AAyDA;yHACyH;AACzH,oEAaC;AAID,0DAIC;AAmFD;;;;GAIG;AACH,+CAJW,GAAG,EAAE,uCACL;IAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAC,GACxD,GAAG,EAAE,CAuEjB;AAED,sGAAsG;AACtG;;;SAAqK;AAuBrK,6FAA6F;AAC7F;;QAuCC;AAnSD,mFAAmF;AACnF,8CAA4G"}
@@ -12,6 +12,15 @@ const fail = message => { throw new Error('Flow declaration: ' + message); };
12
12
  function sourceRevision(source) { const text = JSON.stringify(source); const hashes = [2166136261, 2246822507, 3266489909, 668265263]; for (let i = 0; i < text.length; i++)
13
13
  for (let lane = 0; lane < hashes.length; lane++)
14
14
  hashes[lane] = Math.imul(hashes[lane] ^ text.charCodeAt(i), 16777619 + lane * 2) >>> 0; return hashes.map(n => n.toString(16).padStart(8, '0')).join(''); }
15
+ /** The major of a declared version ("2.4.1" → "2"; absent or unreadable → "0"). */
16
+ const majorOf = version => { const m = /^\s*v?(\d+)/i.exec(String(version ?? '')); return m ? String(Number(m[1])) : '0'; };
17
+ /** A declaration's continuation revision: its major version, plus the major of each shared entry it uses ($data, fn.).
18
+ * A minor or patch change keeps the revision, so a saved session continues; a breaking change bumps the major. */
19
+ function majorRevision(declarationVersion, source, libraries) {
20
+ const text = JSON.stringify(source), uses = { data: /\$data\b/.test(text), functions: /(?<![\w$])fn\./.test(text) };
21
+ const shared = libraries.filter(library => uses[library.library]).map(library => library.library + '@' + library.id + ':' + majorOf(library.version)).sort();
22
+ return 'declaration-v' + declarationVersion + ':major:' + majorOf(source.version) + (shared.length ? '/' + shared.join('/') : '');
23
+ }
15
24
  const variableDeclaration = value => value && typeof value === 'object' && !Array.isArray(value) && ['string', 'number', 'integer', 'boolean', 'object', 'array'].includes(value.type) ? value : { type: Array.isArray(value) ? 'array' : value === null || typeof value === 'object' ? 'object' : typeof value, value };
16
25
  const DECLARATION_VERSIONS = new Set([1, 2]);
17
26
  /** A flow set's shared entries: {id, library:'functions', declarationVersion:2, functions} and
@@ -29,7 +38,7 @@ function sharedFunctions(libraries) {
29
38
  fail('a shared functions entry needs an id');
30
39
  if (library.declarationVersion !== 2)
31
40
  fail('shared functions ' + library.id + ' require declarationVersion 2');
32
- const extra = Object.keys(library).filter(key => !['id', 'name', 'library', 'declarationVersion', 'description', 'functions'].includes(key));
41
+ const extra = Object.keys(library).filter(key => !['id', 'name', 'library', 'declarationVersion', 'description', 'version', 'functions'].includes(key));
33
42
  if (extra.length)
34
43
  fail('shared functions ' + library.id + ' cannot declare ' + extra.join(', '));
35
44
  if (!library.functions || typeof library.functions !== 'object' || Array.isArray(library.functions) || !Object.keys(library.functions).length)
@@ -51,7 +60,7 @@ function sharedData(libraries) {
51
60
  fail('a shared data entry needs an id');
52
61
  if (library.declarationVersion !== 2)
53
62
  fail('shared data ' + library.id + ' requires declarationVersion 2');
54
- const extra = Object.keys(library).filter(key => !['id', 'name', 'library', 'declarationVersion', 'description', 'data'].includes(key));
63
+ const extra = Object.keys(library).filter(key => !['id', 'name', 'library', 'declarationVersion', 'description', 'version', 'data'].includes(key));
55
64
  if (extra.length)
56
65
  fail('shared data ' + library.id + ' cannot declare ' + extra.join(', '));
57
66
  if (!library.data || typeof library.data !== 'object' || Array.isArray(library.data) || !Object.keys(library.data).length)
@@ -88,6 +97,15 @@ export function flowSetData(flows, compiledFlows = []) {
88
97
  }
89
98
  return Object.keys(resolved).length ? resolved : undefined;
90
99
  }
100
+ /** A set's version 2 declarations with every {"$data":"path"} replaced by its value, as compilation sees them; the shared
101
+ * data entries are kept. For readers of the declarations (the flow docs); compilation resolves them itself. */
102
+ export { majorOf };
103
+ export function resolveSetDataReferences(flows) {
104
+ const data = sharedData((flows || []).filter(isLibrary));
105
+ if (!Object.keys(data).length)
106
+ return flows;
107
+ return flows.map(flow => flow?.declarationVersion === 2 && !isLibrary(flow) ? resolveDataReferences(flow, data, flow.id) : flow);
108
+ }
91
109
  const isDataReference = value => !!value && typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length === 1 && typeof value.$data === 'string';
92
110
  /** Replace every {"$data":"path"} with a copy of the shared value at that path; an unknown path fails compilation. */
93
111
  function resolveDataReferences(value, data, where, active = new Set()) {
@@ -266,7 +284,11 @@ export function compileFlowDeclarations(flows, { tools, externalFlows = [], vali
266
284
  return false; parameterNames.add(parameter.name); return true; }), ...(rest.parameterInstructions !== undefined ? { parameterInstructions: rest.parameterInstructions } : {}), ...(functions ? { functions } : {}), metadata: { ...flow.metadata, declaration: { version: declarationVersion, source: source.id } } };
267
285
  // Revisions are engine bookkeeping; a stale authored token cannot override source change detection.
268
286
  const { safetyRevision: ignoredRevision, ...revisionSource } = source;
269
- return withSafetyRevision(flow, 'declaration-v' + declarationVersion + ':' + sourceRevision(declarationVersion === 2 && Object.keys(shared).length ? { ...revisionSource, sharedFunctions: shared } : revisionSource));
287
+ const revised = withSafetyRevision(flow, majorRevision(declarationVersion, original, libraries));
288
+ // The earlier revision, a fingerprint of the whole declaration: a session saved under it continues while the declaration
289
+ // is unchanged (and takes the major revision), so moving to major revisions retires no session.
290
+ revised.safetyRevisionCompat = 'declaration-v' + declarationVersion + ':' + sourceRevision(declarationVersion === 2 && Object.keys(shared).length ? { ...revisionSource, sharedFunctions: shared } : revisionSource);
291
+ return revised;
270
292
  });
271
293
  const externalObjects = externalFlows.filter(flow => flow && typeof flow === 'object');
272
294
  const formIds = new Set(flows.filter(flow => flow.declarationVersion !== undefined && flow.form).map(flow => flow.id));
@@ -472,7 +494,7 @@ export function serializeFlowDeclaration(flow, { resolvedFlow = flow } = {}) {
472
494
  else if (spec.variables)
473
495
  result.variables = spec.variables;
474
496
  for (const [key, value] of Object.entries(spec))
475
- if (!sharedKeys.includes(key) && !['extraVars', 'variables', 'helpers', 'safetyRevision'].includes(key) && !(isForm && formKeys.has(key)))
497
+ if (!sharedKeys.includes(key) && !['extraVars', 'variables', 'helpers', 'safetyRevision', 'safetyRevisionCompat'].includes(key) && !(isForm && formKeys.has(key)))
476
498
  result[key] = value;
477
499
  const out = rewrite(result);
478
500
  // Helpers and bodies can reference other explicitly authored expressions as well.
@@ -1 +1 @@
1
- {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AAqIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DC;AACD;;;GAGG;AACH;;;;;;EAGC;AAgfD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AArrBM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA82B9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
1
+ {"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/forms/flows.js"],"names":[],"mappings":"AAqIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DC;AACD;;;GAGG;AACH;;;;;;EAGC;AAsfD,wHAAwH;AACxH,wEAaC;AACD,4FAA4F;AAC5F;;;EAYC;AACD,sGAAsG;AACtG;;;EAOC;AA3rBM,6CAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAo3B9G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOG"}
@@ -459,20 +459,26 @@ const readFormChoice = {
459
459
  // form's other choices (a correction) and a person, never YES. Result: cargo.confirmRanked = 'no' | 'changed' | 'none'
460
460
  // (ConfirmForm reads it); `abort` ends every flow; `new_request` goes to intent detection.
461
461
  const readConfirmReply = {
462
- id: 'read-confirm-reply', name: 'ReadConfirmReply', version: '1.2.0', scope: 'isolated', description: 'Rank an unreadable answer to a confirmation: it declines (NO), picks another of the form\'s choices (a correction, read as that input\'s answer), asks for a person, or is asked again; a withdrawal or a new request leaves with saved form progress. Never confirms.',
463
- parameters: [{ name: 'form', type: 'string' }, { name: 'question', type: 'string' }, { name: 'question_es', type: 'string' }],
464
- variables: vars({ question: '', question_es: '', asked: '', ranked: [], reply: null, chain: null, others: [], picked: null, reading: null }),
462
+ id: 'read-confirm-reply', name: 'ReadConfirmReply', version: '1.3.0', scope: 'isolated', description: 'Rank an unreadable answer to a confirmation: it declines (NO), picks another of the form\'s choices (a correction, read as that input\'s answer), says a named field read back is wrong (confirm.named_fields: that input is asked again), asks for a person, or is asked again; a withdrawal or a new request leaves with saved form progress. Never confirms.',
463
+ parameters: [{ name: 'form', type: 'string' }, { name: 'question', type: 'string' }, { name: 'question_es', type: 'string' }, { name: 'named_fields', type: 'boolean' }],
464
+ variables: vars({ question: '', question_es: '', asked: '', ranked: [], reply: null, chain: null, others: [], fields: [], field: null, picked: null, reading: null, named_fields: false }),
465
465
  steps: [SET('confirm_asked', 'asked', "language === 'es' && question_es ? question_es : question"),
466
466
  SET('confirm_chain', 'chain', 'formInputChain(cargo.forms, form, cargo)'),
467
467
  SET('confirm_others', 'others', otherChoicesJS("''", '[]')),
468
- rankedChoices('confirm_ranked_choices', "[{key:'no',label:'no: declines or refuses what the question asks to confirm'}].concat(others.map(function(c){return {key:c.key,label:c.label};}))"),
468
+ // confirm.named_fields: a field read back may be corrected in the caller's own words ('es Long Beach' at an address
469
+ // read back with the ZIP code's city): each named input of this form that holds a value is offered, and a pick asks
470
+ // that input again, so the caller's value replaces the one read back
471
+ SET('confirm_fields', 'fields', "named_fields === true || named_fields === 'true' ? (chain || []).filter(function(i){var v=cargo.forms[form] && cargo.forms[form].values;return i.form===form && !i.confirmation && Array.isArray(i.names) && i.names.length && v && v[i.name]!==undefined && v[i.name]!==null && v[i.name]!=='';}).map(function(i){var l=String(i.label || i.names[0]);return {key:'field:'+i.name,label:'says the '+l+' read back is wrong, or gives a different '+l,owner:{form:i.form,name:i.name}};}) : []"),
472
+ rankedChoices('confirm_ranked_choices', "[{key:'no',label:'no: declines or refuses what the question asks to confirm'}].concat(others.map(function(c){return {key:c.key,label:c.label};})).concat(fields.map(function(c){return {key:c.key,label:c.label};}))"),
469
473
  rankedDispatch('confirm_dispatch', 'confirmation_not_matched'),
470
474
  ...escapeRoutes('confirm_escape'),
471
475
  // a correction picked by the ranker is read as its input's answer: the form changes and is confirmed again, never confirmed
472
476
  SET('confirm_picked', 'picked', "others.filter(function(c){return reply && c.key===reply.key;})[0] || null"),
473
477
  SET('confirm_read', 'reading', "picked ? enrichFormMatches(readFormAnswer(picked.key, chain, picked.owner, picked.key, []), chain, form, [picked.owner.name], picked.owner.name) : null"),
474
478
  WHEN('confirm_change', 'reading && reading.hits.length', FLOW('confirm_change_accept', 'collect-input-accept', 'call', { hits: '{{reading.hits}}' })),
475
- SIDE('confirm_ranked', "(cargo.confirmRanked=reading && reading.hits.length ? 'changed' : reply && reply.key==='no' ? 'no' : 'none',true)")]
479
+ SET('confirm_field', 'field', "fields.filter(function(c){return reply && c.key===reply.key;})[0] || null"),
480
+ WHEN('confirm_field_reset', 'field', SIDE('confirm_field_ask', '(resetFormInputs(cargo, field.owner.form, [field.owner.name]), true)')),
481
+ SIDE('confirm_ranked', "(cargo.confirmRanked=reading && reading.hits.length || field ? 'changed' : reply && reply.key==='no' ? 'no' : 'none',true)")]
476
482
  };
477
483
  const collectContextualAnswer = formFlow({ id: 'collect-contextual-answer', name: 'CollectContextualAnswer', description: 'Collect one open-ended answer using contextual DISPATCH and preserve the caller wording.',
478
484
  parameters: [...['question', 'question_es', 'description', 'context', 'context_es'].map(name => ({ name, type: 'string' })), { name: 'choices', type: 'array' }, { name: 'digits', type: 'object' }],
@@ -597,7 +603,7 @@ const confirmForm = {
597
603
  'condition: cf_named': SET('cf_named_reset', 'cf_result', "(resetFormInputs(cargo, cf_named.form, [cf_named.name]), 'changed')"),
598
604
  "condition: cargo.choice === 'no'": SET('cf_declined', 'cf_result', "'no'"),
599
605
  "condition: Array.isArray(clarifications) && pickChoice(String(cargo.choiceText || '').replace(/[?¿]/g,''),[{key:'clarify',phrases:clarifications,exact:true}],false)==='clarify'": SET('cf_clarification', 'cf_result', "'clarification'"),
600
- 'condition: !cf_must && cf_words > 0': FLOW('cf_elsewhere', 'read-confirm-reply', 'call', { form: '{{form}}', question: '{{cf_prompt}}', question_es: '{{cf_prompt_es}}' }),
606
+ 'condition: !cf_must && cf_words > 0': FLOW('cf_elsewhere', 'read-confirm-reply', 'call', { form: '{{form}}', question: '{{cf_prompt}}', question_es: '{{cf_prompt_es}}', named_fields: '{{named_fields}}' }),
601
607
  default: SET('cf_unclear', 'cf_result', "'unclear'")
602
608
  } },
603
609
  // the ranker's reading of an unread answer: a decline is the NO; an answer that declines nothing is asked again
@@ -5,6 +5,7 @@ export function serviceDigits(text: any): string;
5
5
  export function otpDigits(text: any): string;
6
6
  export function contactPrompt(cargo: any, options: any, callerAllowed: any, partial?: boolean, es?: boolean): string;
7
7
  export function contactError(kind: any, options: any, es?: boolean): string;
8
+ export function otpWhere(cargo: any, es?: boolean): string;
8
9
  export function otpPrompt(cargo: any, es?: boolean): string;
9
10
  export function emailReadback(address: any, voice: any, es?: boolean): string;
10
11
  /** Reenter the existing owning FORM or its gate without making the owner its own parent. */
@@ -1 +1 @@
1
- {"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AA2BA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,6CAMC;AACD,qHAQC;AAMD,4EAKC;AAoFD,4DAKC;AAmHD,8EAGC;AA4BD,4FAA4F;AAC5F;;;;EAOC;AAQD,0BAAmI"}
1
+ {"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AA2BA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,6CAMC;AACD,qHAQC;AAMD,4EAKC;AAwFD,2DAKC;AACD,4DAMC;AAuHD,8EAGC;AA4BD,4FAA4F;AAC5F;;;;EAOC;AAQD,0BAAmI"}
@@ -95,6 +95,9 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
95
95
  when('identity_contact_partial_reset', '!contact_partial', effect('identity_contact_partial_forget', "(cargo.gcePartial='',true)")),
96
96
  set('identity_contact_allowed', 'contact_allowed', "!!cargo.callerId && !callerIsInternational(cargo) && !cargo.callerDeclined && contact_options.caller_on_file !== 'no'"),
97
97
  set('identity_contact_prefill', 'contact_prefill', "String(acct_number || cell_number || email || (!contact_partial && contact_allowed && contact_options.caller_on_file === 'yes' ? cargo.callerId : ''))"),
98
+ // a question answered from what is already known (the caller ID, a contact given) is never spoken: its intro (why the
99
+ // account is needed) leads the verification code question instead (otpPrompt). A spoken question said it (or had none).
100
+ effect('identity_contact_intro_unsaid', "(!contact_prefill ? (cargo.otpIntro='',cargo.otpIntro_es='') : contact_options.intro && !cargo.contactIntroSkip && !contact_options.fromMenu ? (cargo.otpIntro=String(contact_options.intro),cargo.otpIntro_es=String(contact_options.intro_es || contact_options.intro)) : true,true)"),
98
101
  effect('identity_contact_preselected', "(acct_number || cell_number || email ? true : (cargo.callerPreselected=!!(contact_prefill && contact_options.caller_on_file === 'yes')),true)"),
99
102
  set('identity_contact_profiles', 'contact_profiles', "contact_profiles_base.map(function (field) {return field.name === 'account' ? Object.assign({},field,{profile:{kind:'identifier',pattern:contact_options.account_pattern || '(?!)'}}) : field;}).concat(contact_allowed ? [{name:'caller_decision',label:'caller ID choice',label_es:'opción del identificador de llamadas',profile:{kind:'choice',choices:[{key:'yes',phrases:['1','yes','si','sí'],exact:true},{key:'no',phrases:['no','nope','nah'],exact:true}]}}] : [])"),
100
103
  set('identity_contact_keypad', 'contact_keypad', "(function () {var shapes=[{first:'23456789',lengths:[10]},{first:'1',lengths:[11]}].concat(contact_options.account_shape || []);if(contact_partial){var left=[];(contact_options.account_shape || []).forEach(function(s){(s.lengths || []).forEach(function(n){var rest=n-String(cargo.gcePartial).length;if(rest>0 && left.indexOf(rest)<0)left.push(rest);});});return {min:1,max:12,autoSubmitMs:3000,complete:[{first:'0123456789',lengths:left.sort(function(a,b){return a-b;})}]};}return {min:7,max:12,autoSubmitMs:3000,autoSubmitChars:contact_allowed?['1']:[],complete:shapes};})()"),
@@ -171,16 +174,28 @@ const auth = worker('authenticate-user', 'AuthenticateUser', 'Authenticate a con
171
174
  cases('auth_complete', { 'condition: cargo.otpVerified === true': set('auth_ok', 'auth_result', 'true'), 'condition: cargo.authRetry': end('auth_return_retry'), default: otpMenu('auth_retry_code', "I couldn't verify your account. You can try again or use another contact.", 'No pude verificar su cuenta. Puede intentarlo de nuevo o usar otro contacto.', true) }),
172
175
  call('auth_gate_end', 'task-gate', { form: '{{parent_form}}', gate: 'authenticate-user', active: false })
173
176
  ] });
177
+ // Where the code went, for a caller who asks ('¿dónde está?'): the channel and the masked destination, never the code.
178
+ export function otpWhere(cargo, es = false) {
179
+ const number = String(cargo.otp_cell_number || '').replace(/\D/g, '').slice(-4), tail = cargo.voice ? number.split('').join(', ') : number;
180
+ if (cargo.otpSentOn === 'whatsapp')
181
+ return es ? 'Se lo acabo de enviar aquí en este chat.' : 'I just sent it to you here in this chat.';
182
+ if (cargo.otp_cell_number)
183
+ return es ? 'Se lo envié por mensaje de texto al celular que termina con ' + tail + '. Revise sus mensajes de texto.' : 'I sent it by text message to the cell ending with ' + tail + '. Check your text messages.';
184
+ return es ? 'Se lo envié por correo electrónico a ' + String(cargo.otp_email || '') + '. Revise su correo.' : 'I sent it by email to ' + String(cargo.otp_email || '') + '. Check your email.';
185
+ }
174
186
  export function otpPrompt(cargo, es = false) {
175
187
  const verb = es ? cargo.verb_es : cargo.verb, number = String(cargo.otp_cell_number || '').replace(/\D/g, '').slice(-4), tail = cargo.voice ? number.split('').join(', ') : number;
176
188
  const where = cargo.otpSentOn === 'whatsapp' ? (es ? 'que le acabo de enviar aquí en este chat' : 'I just sent you here in this chat') : (es ? 'que recibió en ' : 'you received at ') + (cargo.otp_cell_number ? (es ? 'celular que termina con ' : 'cell ending with ') + tail : (es ? 'correo electrónico: ' : 'email: ') + String(cargo.otp_email || ''));
177
189
  const name = cargo.callerPreselected && cargo.callerNamed && cargo.displayName ? cargo.displayName : '';
178
- return (name ? name + (es ? ', por favor' : ', please') : es ? 'Por favor' : 'Please') + ' ' + verb + ' ' + (cargo.voice ? es ? 'o ingrese ' : 'or enter ' : '') + (es ? 'el código de verificación de 6 dígitos ' : 'the 6-digit verification code ') + where + '. ' + (es ? `También puede ${cargo.voice ? 'presionar * o decir' : 'escribir'} SALIR para cancelar.` : `You can also ${cargo.voice ? 'press * or ' : ''}${verb} EXIT to cancel.`) + (cargo.callerPreselected ? (es ? ` Para usar otra cuenta, ${verb} OTRA CUENTA.` : ` To use another account, ${verb} ANOTHER ACCOUNT.`) : '');
190
+ const lead = String((es ? cargo.otpIntro_es : cargo.otpIntro) || '');
191
+ return (lead ? lead + ' ' : '') + (name ? name + (es ? ', por favor' : ', please') : es ? 'Por favor' : 'Please') + ' ' + verb + ' ' + (cargo.voice ? es ? 'o ingrese ' : 'or enter ' : '') + (es ? 'el código de verificación de 6 dígitos ' : 'the 6-digit verification code ') + where + '. ' + (es ? `También puede ${cargo.voice ? 'presionar * o decir' : 'escribir'} SALIR para cancelar.` : `You can also ${cargo.voice ? 'press * or ' : ''}${verb} EXIT to cancel.`) + (cargo.callerPreselected ? (es ? ` Para usar otra cuenta, ${verb} OTRA CUENTA.` : ` To use another account, ${verb} ANOTHER ACCOUNT.`) : '');
179
192
  }
180
193
  const OTP_PROFILES = [{ name: 'code', label: 'verification code', label_es: 'código de verificación', profile: { kind: 'digits', min: 6, max: 6 } }, raw];
181
194
  const code = worker('get-and-validate-otp-code', 'GetAndValidateOtpCode', 'Collect a one-time-code answer through the owning FORM ancestry, preserving protocol commands for validation.', { variables: vars({ otp_code: '', user_choice: '', normalized_otp_code: '', otp_question: '', otp_question_es: '', otp_profiles: OTP_PROFILES }), contract: { role: 'collector', summary: 'One-time-code answer collector using shared FORM matching' }, steps: [
182
195
  when('otp_already_verified', 'cargo.otpVerified === true', end('otp_existing_verification')),
183
196
  set('otp_question', 'otp_question', expression(otpPrompt, 'cargo')), set('otp_question_es', 'otp_question_es', expression(otpPrompt, 'cargo', 'true')),
197
+ // a contact question's unsaid intro (identity_contact_intro_unsaid) leads the first code question only
198
+ effect('otp_intro_said', "(cargo.otpIntro='',cargo.otpIntro_es='',true)"),
184
199
  call('otp_collect', 'collect-service-answer', { profiles: '{{otp_profiles}}', question: '{{otp_question}}', question_es: '{{otp_question_es}}', keypad: { min: 6, max: 6 }, parent_form: '{{cargo.authOptions.parent_form}}', stop_path: 'cargo.otpVerified', context: 'account verification', context_es: 'verificación de cuenta' }),
185
200
  when('otp_verified_by_join', 'cargo.otpVerified === true', end('otp_join_finished')),
186
201
  set('otp_answer', 'otp_code', "String(cargo.serviceAnswer.values.code || cargo.serviceAnswer.raw || '')"), set('otp_choice', 'user_choice', 'otp_code.trim().toLowerCase()'), set('otp_digits', 'normalized_otp_code', expression(otpDigits, 'otp_code')),
@@ -206,8 +221,8 @@ function otpPhoneUnavailable(value) {
206
221
  // What the reply ranker may take at the code question beside the code: the step's offers. Email and another account are
207
222
  // offered only where the step offers them (a code sent by text; a caller-ID preselection).
208
223
  const OTP_REPLY_CHOICES = [{ key: 'email', label: 'use the email on the account instead of the phone' }, { key: 'another_account', label: 'use another account' },
209
- { key: 'resend', label: 'the code did not arrive; send it again' }, { key: 'no_phone', label: 'no longer has that phone or number' }, { key: '__agent', label: 'speak with a person (a live agent)' }];
210
- const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a challenge response with explicit bounded retries, alternate-contact handling and tenant callbacks.', { variables: vars({ otp_phrases: OTP_WORDS, no_code_given: false, wants_other_account: false, other_account_given: false, otp_validation_result: false, whatsapp_invite_sent: false, invite_text: '', otp_cancel: 'contact-support', answer_key: '', answer_value: '', otp_reply_choices: OTP_REPLY_CHOICES, otp_offers: [], otp_reply: {} }), contract: { role: 'gate', summary: 'Validate the active one-time challenge', tools: ['validate-otp', 'send-whatsapp-invite'], result: { path: 'cargo.otpVerified', type: 'boolean' } }, steps: [
224
+ { key: 'where', label: 'asks where the code is or where it was sent, or cannot find it' }, { key: 'resend', label: 'the code did not arrive; send it again' }, { key: 'no_phone', label: 'no longer has that phone or number' }, { key: '__agent', label: 'speak with a person (a live agent)' }];
225
+ const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a challenge response with explicit bounded retries, alternate-contact handling and tenant callbacks.', { variables: vars({ otp_phrases: OTP_WORDS, no_code_given: false, wants_other_account: false, other_account_given: false, otp_validation_result: false, whatsapp_invite_sent: false, invite_text: '', otp_cancel: 'contact-support', answer_key: '', answer_value: '', otp_reply_choices: OTP_REPLY_CHOICES, otp_offers: [], otp_reply: {}, otp_where: '', otp_where_es: '' }), contract: { role: 'gate', summary: 'Validate the active one-time challenge', tools: ['validate-otp', 'send-whatsapp-invite'], result: { path: 'cargo.otpVerified', type: 'boolean' } }, steps: [
211
226
  set('otp_cancel', 'otp_cancel', "cargo.authCancelFlow || 'contact-support'"),
212
227
  set('otp_reset_no_code', 'no_code_given', 'false'), set('otp_reset_invite', 'whatsapp_invite_sent', 'false'), set('otp_reset_callback', 'answer_key', "''"),
213
228
  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}}' })),
@@ -243,10 +258,12 @@ const validateCode = worker('validate-otp-code', 'ValidateOtpCode', 'Validate a
243
258
  + ".concat(((typeof $callers !== 'undefined' && $callers && $callers['authenticate-user']) || []).map(function(c){return {key:'usecase:'+c.id,label:'states the reason for the call: '+c.label};}))"
244
259
  + ".concat(((typeof $gateExits !== 'undefined' && $gateExits && $gateExits['authenticate-user']) || []).map(function(a){return {key:'exit:'+a.key,label:a.label,route:'new_request'};}))"),
245
260
  when('otp_off_topic', 'no_code_given', { id: 'otp_reply_rank', type: 'DISPATCH', onResponse: 'continue', responseContext: 'Please say the 6-digit verification code I sent you. (Por favor diga el código de verificación de 6 dígitos que le envié.)', responseChoices: 'otp_offers', responseVariable: 'otp_reply', onNoIntent: 'stay' }),
261
+ set('otp_where', 'otp_where', expression(otpWhere, 'cargo')), set('otp_where_es', 'otp_where_es', expression(otpWhere, 'cargo', 'true')),
246
262
  set('otp_reply_picked', 'no_code_given', "no_code_given && !(otp_reply && otp_reply.key && String(otp_reply.key).indexOf('usecase:') !== 0)"),
247
263
  cases('otp_reply_route', {
248
264
  "condition: !no_code_given && otp_reply && otp_reply.key === 'email'": call('otp_ranked_email', 'authenticate-user', { cell_number: '', email: '', retrying: true, declined_caller: true }, 'replace'),
249
265
  "condition: !no_code_given && otp_reply && otp_reply.key === 'another_account'": call('otp_ranked_account', 'authenticate-user', { cell_number: '', email: '', retrying: true, declined_caller: true }, 'replace'),
266
+ "condition: !no_code_given && otp_reply && otp_reply.key === 'where'": say('otp_ranked_where', '{{otp_where}}', '{{otp_where_es}}'),
250
267
  "condition: !no_code_given && otp_reply && otp_reply.key === 'resend'": call('otp_ranked_resend', 'resend-otp-code', { resend_reason: 'requested' }),
251
268
  "condition: !no_code_given && otp_reply && otp_reply.key === 'no_phone'": otpMenu('otp_ranked_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),
252
269
  "condition: !no_code_given && otp_reply && otp_reply.key === '__agent'": call('otp_ranked_agent', 'live-agent-requested', undefined, 'reboot'),
@@ -2,6 +2,7 @@ export const FLOWS: any[];
2
2
  export { FLOWS as IDENTITY_FLOWS } from "./identity-flows.js";
3
3
  export { compileFormPrompts } from "./prompt-compiler.js";
4
4
  export { explainSession } from "./inspection.js";
5
+ export { continuationBreaks } from "./continuation-compat.js";
5
6
  export { inheritFlowDeclaration } from "./declaration-capture.js";
6
7
  export { withSafetyRevision, CONTINUATION_SAFETY_REQUIREMENT } from "./continuation-safety.js";
7
8
  export { FIELD_PRESETS, formFlow, declinedFlow, textValue } from "./flows.js";
@@ -13,4 +13,5 @@ export { addressDraft, zipLocation, streetLocation, resolvedAddress } from '../h
13
13
  export { explainSession } from './inspection.js';
14
14
  export { Form, Provider, Performer, Worker, compileExpression } from './authoring.js';
15
15
  export { compileFlowDeclarations, serializeFlowDeclaration, captureOriginalDeclaration } from './declarations.js';
16
+ export { continuationBreaks } from './continuation-compat.js';
16
17
  export { inheritFlowDeclaration } from './declaration-capture.js';
@@ -16,6 +16,7 @@ export function streetLocation(result: any, said: any, zip: any): {
16
16
  street: string;
17
17
  said: string;
18
18
  verified: boolean;
19
+ city: any;
19
20
  };
20
21
  export function resolvedAddress(values: any, data: any): {
21
22
  street: any;
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/helpers/address.js"],"names":[],"mappings":"AAAA,uFAAuF;AACvF;;;;;EAQC;AACD;;;;;SASC;AACD,gDAEC;AACD;;;;EAMC;AACD;;;;;;;;EAIC"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/helpers/address.js"],"names":[],"mappings":"AAAA,uFAAuF;AACvF;;;;;EAQC;AACD;;;;;SASC;AACD,gDAEC;AACD;;;;;EASC;AACD;;;;;;;;EAIC"}
@@ -27,7 +27,10 @@ export function streetLocation(result, said, zip) {
27
27
  const part = kind => components.find(c => (c.types || []).includes(kind))?.long_name || '';
28
28
  const types = row.types || [], locationType = row.location_type || row.geometry?.location_type || '';
29
29
  const exact = result?.status === 'OK' && row.partial_match !== true && types.includes('street_address') && locationType === 'ROOFTOP' && part('street_number') && part('route') && (!part('postal_code') || part('postal_code') === zip);
30
- return { street: exact ? part('street_number') + ' ' + part('route') : String(said).trim(), said: String(said).trim(), verified: !!exact };
30
+ // An exact street match names the place its mail carries; it corrects a city read from the ZIP code alone (90805 is
31
+ // Lakewood to the ZIP lookup, while its streets are Long Beach and Lakewood)
32
+ const city = exact ? part('locality') || part('postal_town') || part('sublocality') : '';
33
+ return { street: exact ? part('street_number') + ' ' + part('route') : String(said).trim(), said: String(said).trim(), verified: !!exact, city };
31
34
  }
32
35
  export function resolvedAddress(values, data) {
33
36
  const unit = /^(none|no|ninguno|ninguna|sin|no hay)$/i.test(String(values.unit || '')) ? '' : String(values.unit || '').replace(/^(apt\.?|unit|#)\s*/i, '');
@@ -1,4 +1,4 @@
1
- /** Session-owned action state. Backend idempotency and reconciliation remain explicit parts of the action contract. */
1
+ /** Session-owned action state. */
2
2
  import { nextFormInput, formPath, formInputApplies } from './form-state.js';
3
3
  export function formSignature(value) {
4
4
  return JSON.stringify(value, (_key, v) => v && typeof v === 'object' && !Array.isArray(v)
package/dist/index.d.ts CHANGED
@@ -393,6 +393,7 @@ export interface FlowDefinition {
393
393
  description: string;
394
394
  version: string;
395
395
  safetyRevision?: string;
396
+ safetyRevisionCompat?: string;
396
397
  primary?: boolean;
397
398
  wraps?: string;
398
399
  interruptable?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAyB1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAA4B,MAAM,sBAAsB,CAAC;AAyBvF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CASxD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CASxD;AAGD;;;;;;;;;;;;GAYG;AAIH,qBAAa,kBAAmB,SAAQ,KAAK;aACE,KAAK,CAAC,EAAE,KAAK;gBAA9C,OAAO,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,KAAK,YAAA;CAI3D;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAA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wB;IAMhC,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,2BAA2B;CAKpC"}
package/dist/index.js CHANGED
@@ -2246,10 +2246,16 @@ function retireUnsafeContinuation(engine, extraStacks = []) {
2246
2246
  const staleForm = Object.values(engine.cargo?.forms || {}).find(state => {
2247
2247
  const definition = engine.flowsMenu?.find(flow => flow.id === state.definition);
2248
2248
  const previous = previousRevisions[state.definition], current = definition?.safetyRevision;
2249
- return (previous !== undefined || current !== undefined) && previous !== current;
2249
+ return (previous !== undefined || current !== undefined) && previous !== current
2250
+ && !(definition?.safetyRevisionCompat !== undefined && previous === definition.safetyRevisionCompat);
2250
2251
  });
2251
2252
  const mismatch = frames.find(frame => {
2252
2253
  const current = engine.flowsMenu?.find(flow => flow.id === frame.flowId);
2254
+ // A frame saved under the earlier fingerprint revision continues while its declaration is unchanged, under the new revision.
2255
+ if (current?.safetyRevisionCompat !== undefined && frame.safetyRevision === current.safetyRevisionCompat) {
2256
+ frame.safetyRevision = current.safetyRevision;
2257
+ return false;
2258
+ }
2253
2259
  return current?.safetyRevision !== undefined
2254
2260
  ? current.safetyRevision !== frame.safetyRevision
2255
2261
  : frame.safetyRevision !== undefined;
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:fd2a9a936f409b3e5eaf40eb2c60a9f081caa099852cbd8fabdb5135a862d5f2";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:729d045d9d202f88024c65d732fa64fdcccd24bd0b4f85dd204698e3b3ccc91a";
@@ -0,0 +1,366 @@
1
+ # JSFE flows architecture guide
2
+
3
+ This guide is for developers new to JSFE. It explains the ideas behind the engine, the building blocks a flow set is
4
+ made of, what the caller sees and hears, and how a conversation can feel free and natural while the transactions in it
5
+ stay exact and safe. It introduces concepts; the [flow author reference](copilot-reference.md) is the precise
6
+ specification, and the [README](../README.md) is the API reference.
7
+
8
+ The examples use a fictional utility company. Every name and number in them is invented.
9
+
10
+ ## 1. The problem: two kinds of software in one conversation
11
+
12
+ A caller who phones a utility might say any of these in one call:
13
+
14
+ - "How much do I owe?"
15
+ - "I want to pay 80 dollars with my card ending in 4242."
16
+ - "Wait, make it 60."
17
+ - "When is it due, by the way?"
18
+ - "Actually, can I talk to a person?"
19
+
20
+ Two very different kinds of software have to serve that call.
21
+
22
+ **A conversational AI** understands people. It copes with any wording, any language, answers out of order, changes of
23
+ mind and questions in the middle of a task. But it guesses, and a guess is never acceptable when money moves.
24
+
25
+ **A transactional script** is exact. It verifies the caller, collects every required field, reads the amount back,
26
+ asks for a clear YES and charges the card once. But a classic script is rigid: one question at a time, one expected
27
+ answer, and anything else is "Sorry, I didn't understand."
28
+
29
+ JSFE joins the two. **The flow owns the transaction; the AI helps only with understanding language, and every AI
30
+ decision is a choice from a short closed list that the flow then checks.** The AI never writes a value into a
31
+ payment, never confirms a charge and never decides what the business does.
32
+
33
+ ## 2. The big picture
34
+
35
+ ```mermaid
36
+ flowchart LR
37
+ U([Caller: voice, SMS, chat]) --> H[Host application]
38
+ H -->|updateActivity| E[JSFE engine]
39
+ E -->|aiCallback: closed questions| AI[(Models: classifier and LLM)]
40
+ E -->|CALL-TOOL| T[(Business APIs)]
41
+ E -->|reply text, session| H
42
+ H -->|no flow serves the turn| G[Host AI answer: RAG, guru]
43
+ ```
44
+
45
+ - **The host** is your application: it owns the channels (phone, text, web), credentials, storage, model
46
+ configuration and turn order. It calls `engine.updateActivity(...)` once per caller message and saves the session the
47
+ engine returns.
48
+ - **The engine** runs flows. It decides whether the message belongs to a flow in progress, starts a new flow, or hands
49
+ the turn back to the host.
50
+ - **Models** are reached only through the host's `aiCallback`. The engine builds every question it asks a model, and
51
+ decodes every answer, so a host never interprets a model's output itself.
52
+ - **Tools** are the only way a flow touches the outside world (charge a card, send a text, open a ticket).
53
+ - **The host's own AI** answers whatever no flow serves: a general question, small talk, a product question answered
54
+ from documents.
55
+
56
+ ## 3. Building blocks
57
+
58
+ ### Flow sets and tools
59
+
60
+ A flow set is a JSON array of flow definitions (`tenant.flows`) with a matching JSON array of tool definitions
61
+ (`tenant.tools`). A host usually composes several sets: the **system** set every tenant shares (identity checks, field
62
+ collectors, retries, handoffs), optional product sets (for example a store integration), and the **tenant** set with
63
+ that business's own flows. Flows reference each other by id, so a tenant set reuses shared workers instead of copying
64
+ them.
65
+
66
+ ### Steps
67
+
68
+ A flow is made of steps. Most authors need only a handful:
69
+
70
+ | Step | What it does |
71
+ | --- | --- |
72
+ | `SAY` | Queue text for the caller. |
73
+ | `SAY-GET` | Say the queued text and wait for the caller's answer. |
74
+ | `SET` | Compute a value (a JavaScript expression) into a variable. |
75
+ | `CASE` / `SWITCH` | Branch on a condition or a value. |
76
+ | `FLOW` | Run another flow: `call` (and come back), `replace` or `reboot`. |
77
+ | `CALL-TOOL` | Call a registered tool, with an `onFail` route. |
78
+ | `END` | Finish this flow and return to the one that called it. |
79
+ | `RETURN` | Finish every flow and hand a reply (or the turn) to the host. |
80
+ | `DISPATCH` | Finish every flow and send this message to intent detection, as if it were the first message. |
81
+
82
+ ### The four authoring concepts
83
+
84
+ Steps are the machine code. Authors mostly write **declarations**, and JSFE generates the steps.
85
+
86
+ | Concept | You declare | JSFE gives you |
87
+ | --- | --- | --- |
88
+ | **Form** | the inputs a task needs | collection in any order, validation, corrections, resume after a detour |
89
+ | **Provider** | the facts a flow can answer and where they come from | answers to exactly the fact asked, behind an identity gate |
90
+ | **Performer** | an action: its effect, gate, tool, confirmation and outcomes | a guarded, confirmed, single execution |
91
+ | **Worker** | a few explicit steps | a small reusable task (a calculation, a lookup, a handoff) |
92
+
93
+ **Forms: any order, one question at a time.** A form lists its inputs once. The engine loops: find the first missing
94
+ input, ask it, store whatever the answer actually contained, repeat. Because of that loop, a caller who says
95
+ everything at once, answers a later question early, corrects an earlier answer, or comes back after a detour needs no
96
+ special code:
97
+
98
+ ```json
99
+ {
100
+ "declarationVersion": 2, "id": "pay-bill", "primary": true,
101
+ "description": "The caller wants to pay their bill now. Not: a question about a past payment.",
102
+ "form": {
103
+ "inputs": [
104
+ { "name": "account", "field": "account_number" },
105
+ { "name": "amount", "profile": { "kind": "amount", "min": 1, "money": { "currency": "USD", "cardinals": true, "intent": "payment" } },
106
+ "question": "How much would you like to pay?", "question_es": "¿Cuánto desea pagar?" },
107
+ { "name": "card", "form": "collect-credit-card" }
108
+ ]
109
+ }
110
+ }
111
+ ```
112
+
113
+ Forms nest: a payment form contains a card form, which contains card-number, expiration and security-code fields. An
114
+ answer may fill an input of any active form in the chain, so "use the card ending in 4242" is understood while the
115
+ payment is still asking for the amount.
116
+
117
+ **Providers: answer what was asked.** A provider declares a catalog of facts (balance, due date, last payment), each
118
+ with its source path, its wording and the identity gate that protects it. JSFE derives the rest from that one catalog:
119
+ the `asked` parameter intent detection fills, the words that recognize each fact in the middle of another task, and the
120
+ menu offered after an answer. "When is it due?" gets the due date, not a summary of the whole account.
121
+
122
+ **Performers: actions with guard rails.** A performer is a form plus a declared action:
123
+
124
+ ```json
125
+ "performs": [{
126
+ "action": "bill_payment", "effect": "charge", "subject": "form.data.account",
127
+ "gate": { "flow": "verify-caller", "verified": ["cargo.verified"] },
128
+ "flow": "payment-execute", "confirm": { "exact": true },
129
+ "outcomes": { "ok": "resolved", "failed": "unresolved", "unknown": "unresolved" }
130
+ }]
131
+ ```
132
+
133
+ From that, JSFE refuses to run the action without the gate, binds the confirmation to the exact request the caller
134
+ heard, invalidates it when any input changes, and never treats a timeout as success.
135
+
136
+ **An unknown result.** A timeout after the card may have been charged leaves the result unknown. The engine handles it
137
+ for every action: the action is claimed once, a result that is not one of the declared `outcomes` counts as unknown,
138
+ and an unknown charge or cancellation is held, never repeated (only a `send` may declare an explicit retry). Where the
139
+ payment API accepts an idempotency key, the flow passes one as a tool argument as well.
140
+
141
+ ### Shared data and shared functions
142
+
143
+ A value several flows use (a catalog, a list of services, a set of phrases) is written once in the set's data entry and
144
+ referenced as `{"$data": "path.to.value"}`; expressions read it as `$data.name`. A function several flows use is
145
+ written once in the set's functions entry and called as `fn.name(...)`. One source means two flows can never drift
146
+ apart.
147
+
148
+ ### Session state
149
+
150
+ The engine's session holds the flow stacks and `cargo`, the conversation's shared state. Form progress lives in
151
+ `cargo.forms`, so a task interrupted by a question, a detour or a different request resumes from where it was when the
152
+ caller comes back to it. The host stores the session between turns; the engine never stores anything itself.
153
+
154
+ ### Deploying while conversations are in progress
155
+
156
+ A new flow set can go live while callers are in the middle of a flow. A flow's `version` decides what happens to them:
157
+
158
+ - **A minor or patch change** (`1.4.0` to `1.5.0`: new wording, a new fact, a fix) keeps the conversation going on the
159
+ steps already saved in it.
160
+ - **A breaking change bumps the major** (`1.5.0` to `2.0.0`): an input, entry argument or shared name removed or
161
+ renamed, or a value whose meaning changed. A conversation saved under the old major ends that task safely on its next
162
+ turn, without running any action or reading the caller's message as an answer, and the caller is asked to state the
163
+ request again.
164
+
165
+ `continuationBreaks(previousFlows, nextFlows)` compares a set with the deployed one and lists every removed name that
166
+ needs a major bump, so a forgotten bump fails the deploy instead of reaching a caller.
167
+
168
+ ## 4. One turn, step by step
169
+
170
+ Every caller message travels the same path. The order is the design: **deterministic readers first, AI only where
171
+ language is genuinely ambiguous, and the host last.**
172
+
173
+ ```mermaid
174
+ flowchart TD
175
+ M[Caller message] --> A{Flow waiting for an answer?}
176
+ A -->|yes| R[Deterministic readers: keys, numbers, typed fields, exact phrases]
177
+ R -->|read| V[Validate, store, ask next question]
178
+ R -->|not read| K[Reply ranker: a closed choice]
179
+ K -->|answers / a choice| V
180
+ K -->|abort| X[End flows: request cancelled]
181
+ K -->|new_request| D[DISPATCH]
182
+ A -->|no| D
183
+ D --> S1[Intent detection, stage 1: which primary flow, or None]
184
+ S1 -->|a flow| S2[Stage 2: that flow's parameters]
185
+ S2 --> F[Start the flow; its form validates every value]
186
+ S1 -->|None| HA[Host answers with its own AI]
187
+ ```
188
+
189
+ ### Deterministic readers
190
+
191
+ When a flow is waiting for an answer, the engine first tries to read it without any model: a keypad key, a phone number,
192
+ an email, an amount, a card number, a whole-answer phrase of a choice. The rules are strict on purpose:
193
+
194
+ - **The current question first.** An answer is read against the question being asked, and the inputs that question
195
+ explicitly invites ("type NEW CARD, LINK, or a different amount" invites an amount).
196
+ - **Out of order needs the whole signature.** A number fills another field only when the whole number fits it: a
197
+ fragment of a longer number fills nothing.
198
+ - **A confirmation is answered only when it is asked.** A stray "yes" never confirms anything that is not the current
199
+ question.
200
+ - **One part of an answer never fills two fields.** Two fields of the same form that fit the same words are asked
201
+ about, never ranked.
202
+
203
+ The engine records every out-of-order fill and every refused reading, so a host can log why a value was taken.
204
+
205
+ ### The reply ranker
206
+
207
+ When the readers cannot read an answer that has words in it, the engine asks the **reply ranker** one question: what
208
+ does this reply do with the question the flow asked? The model picks from a closed list:
209
+
210
+ | Option | Meaning | What happens |
211
+ | --- | --- | --- |
212
+ | `answers` | the reply responds to the question | the flow continues; any value still goes through deterministic validation |
213
+ | `choice:<key>` | the reply picks one of the question's offered choices | that choice is the answer |
214
+ | `abort` | the caller withdraws the request | every flow ends; the caller hears that the request was cancelled |
215
+ | `new_request` | the caller asks for something else | DISPATCH: the message goes to intent detection |
216
+
217
+ Some options are **never offered**, so the ranker cannot pick them: a choice marked `exact` (anything that charges or
218
+ cancels) and the YES of a firm confirmation. A ranker can understand "no thanks, maybe later" as NO; it can never
219
+ produce a YES to a payment. Options that cost more when wrong need a higher score (a NO that would cancel what the
220
+ caller was confirming, or a new request that leaves the question unanswered). A reply that clears no option is
221
+ `answers`, and the question is asked again if nothing usable was in it.
222
+
223
+ ### DISPATCH
224
+
225
+ `DISPATCH` is the bridge back to free conversation. It ends the flows in progress and re-reads the message through
226
+ intent detection, in the same turn. If the message starts another flow, that flow starts; if not, the host answers it
227
+ with its own AI and the conversation context. Form progress is kept in `cargo.forms`, so when the caller returns to
228
+ the task ("OK, let's pay now"), the primary flow starts again and resumes from its saved draft instead of asking
229
+ everything again.
230
+
231
+ A flow can also ask a question whose answer is open ("Describe the problem") with a **contextual DISPATCH**
232
+ (`onResponse: "continue"`): the ranker decides whether the reply answers, withdraws or changes the subject, and an
233
+ answer's fields are extracted by the same parameter extraction intent detection uses.
234
+
235
+ **DISPATCH is not giving up.** Sending a caller to a person (the `give-up` worker) happens only after real attempts at
236
+ the answer ran out, or a service the flow needs failed. A caller who changed the subject is dispatched, never
237
+ transferred.
238
+
239
+ ### Intent detection: two stages
240
+
241
+ 1. **Which flow.** Only primary flows can start this way, and stage 1 reads only their `description`: what should
242
+ start the flow and, in a `Not:` list, what belongs elsewhere. The answer is one flow or `None`.
243
+ 2. **Which arguments.** For the chosen flow only, stage 2 extracts its parameters: closed values (an enum such as
244
+ `asked: "balance"`, a boolean) and free text. A parameter the model cannot fill is left out, and the flow asks for
245
+ it.
246
+
247
+ Each stage is one `aiCallback` call that carries instructions for both a classifier and an LLM, so a host can run
248
+ either, or race both. JSFE builds both sets of instructions and decodes both answers (`jsfe/host`), which keeps a
249
+ production host and a test harness on one implementation.
250
+
251
+ ## 5. Why the transactions stay safe
252
+
253
+ The conversational freedom above never reaches the transaction directly. These are the guarantees, and where each one
254
+ lives:
255
+
256
+ | Guarantee | How |
257
+ | --- | --- |
258
+ | No private fact before identity is verified | a provider's `gate` and a performer's `gate` run the verification worker and check the verified paths |
259
+ | No value accepted unchecked | every value, whether read, extracted at activation or understood by the ranker, passes the same field validator |
260
+ | No charge without a clear YES | `confirm: { exact: true }`: only confirmation words or the option's exact phrases; never offered to the ranker |
261
+ | The YES confirms what the caller heard | consent is bound to the request and the input revision; changing any input invalidates it |
262
+ | "Yes, but make it 60" is not consent | an answer with YES plus a correction or another request is not approval of the old request |
263
+ | No guessed success | an executor reports success, failure or unknown; unknown holds the action, it is never retried as if it failed |
264
+ | One effect, once | effects run only through `CALL-TOOL`; the session records the attempt (`lastTurnToolCalls`) and the host never rolls such a turn back |
265
+ | No escape from a half-finished effect | `must_complete` keeps a payment's card questions in place instead of dispatching an unreadable answer |
266
+
267
+ The host keeps its side of the contract: one `updateActivity` at a time per conversation; a cancelled turn is awaited,
268
+ not abandoned; a turn that attempted a tool is never restored to its earlier session; and external effects carry an
269
+ idempotency key where the backend supports one. The [README](../README.md) section "Host Responsibilities: Tool Calls,
270
+ Cancellation and Concurrency" explains each rule and the production incident behind it.
271
+
272
+ ## 6. What the caller sees and hears
273
+
274
+ ### Messages
275
+
276
+ - **`SAY` and `SAY-GET`** carry `value` and a per-language variant (`value_es`); the session's language picks one.
277
+ - **Voice and text differ.** A question may have written wording for text (`question_text`) and spoken wording for a
278
+ call. On a call, offer keys ("press 1 or say YES"); in text, never say "press".
279
+ - **Spoken values.** Helpers read amounts, dates and last-four digits naturally on a call (`amountToSpeech`,
280
+ `dateToWords`, `last4`).
281
+
282
+ ### Questions and answers
283
+
284
+ - **Choices.** A choice has a key, phrases in each language and, on a call, keypad keys. A key matches only as the
285
+ whole answer. Sensitive choices are `exact`.
286
+ - **Confirmations.** `confirmation: "firm"` for consent (a charge, a cancellation, storing a card, filing a request):
287
+ only confirmation words. `"soft"` for an offer ("Would you like a link?"): the wider YES vocabulary.
288
+ - **Proposals.** When the flow infers a value ("Is this the card ending in 4242?"), a proposal asks the caller to
289
+ approve that one value. It never authorizes the final action.
290
+ - **Questions in the middle of a task.** "When is it due?" asked while paying is answered from the provider's catalog,
291
+ and the payment asks its question again.
292
+ - **Menus after an answer.** A provider may offer a short menu ("To make a payment, say PAY. For a payment link, say
293
+ LINK."). Menu choices start their flows; "no thanks" ends politely.
294
+ - **Misses.** The first unreadable answer is acknowledged and the question is asked again; validator rejections have
295
+ their own budget (`max_attempts`) with a declared recovery (`on_exhausted`). Every question also accepts a request
296
+ for a person.
297
+
298
+ ### Endings
299
+
300
+ A flow ends with an outcome (`resolved`, `unresolved`, `deflected`, or `pending` for a task that was paused), and may
301
+ give the host recovery guidance (`resume`, `restart`, `hold`, `none`). Hosts use these for reporting and for what to
302
+ say when the conversation returns.
303
+
304
+ ## 7. A conversation, annotated
305
+
306
+ ```text
307
+ Caller: Hi, I want to pay my bill.
308
+ ```
309
+ Intent detection, stage 1, picks `PayBill`; stage 2 finds no amount. The form's first missing input is the account.
310
+
311
+ ```text
312
+ Agent: To make a payment, I first need to verify your account. Please say or enter your account number.
313
+ Caller: 4417 2209
314
+ Agent: I found the account. Please enter the 6-digit code I just sent to your phone ending in 12.
315
+ Caller: 381 552
316
+ ```
317
+ Deterministic readers: the account number and the code are typed fields. The identity gate is now satisfied.
318
+
319
+ ```text
320
+ Agent: Your amount due is $84.20. How much would you like to pay?
321
+ Caller: When is it due, actually?
322
+ Agent: Your payment is due on November 5. How much would you like to pay?
323
+ ```
324
+ The question is a provider fact asked mid-form: answered, and the form asks its question again.
325
+
326
+ ```text
327
+ Caller: Let's do 60 with the card ending in 4242.
328
+ ```
329
+ One answer fills two fields: the amount (the current question) and the card (an input of the nested card form).
330
+
331
+ ```text
332
+ Agent: I'll charge $60.00 to the card ending in 4242. Say YES to pay, or NO.
333
+ Caller: Yeah, but make it 70.
334
+ ```
335
+ Not consent: YES plus a correction. The amount changes, the confirmation is invalidated, and the read-back is asked
336
+ again for $70.00.
337
+
338
+ ```text
339
+ Agent: I'll charge $70.00 to the card ending in 4242. Say YES to pay, or NO.
340
+ Caller: Yes.
341
+ Agent: Your payment of $70.00 was successful. Is there anything else I can help you with?
342
+ Caller: Do you have energy-saving rebates?
343
+ ```
344
+ An exact YES to the current confirmation runs the charge once. The last question is not something this flow reads:
345
+ the ranker says `new_request`, DISPATCH sends it to intent detection, no flow serves it, and the host's own AI answers
346
+ it from the company's documents.
347
+
348
+ ## 8. Design rules worth keeping
349
+
350
+ 1. **Declare, don't script.** Write the manifest (inputs, facts, actions) first; let JSFE generate the steps.
351
+ 2. **Support what the question invites, DISPATCH the rest.** Never build a natural-language interpreter for one field.
352
+ 3. **One source for everything.** Shared workers, shared data, shared functions: copies drift.
353
+ 4. **Flow behavior lives in flows.** Offers, prompts and wording belong to flow steps, not to the host. If a flow cannot
354
+ express something, it is a feature request for the engine.
355
+ 5. **Side effects only through `CALL-TOOL`,** with an `onFail` route and a declared answer for an unknown result.
356
+ 6. **Sensitive decisions are exact.** Any choice that charges or cancels is `exact`, and asked as a firm confirmation.
357
+ 7. **Descriptions are for detection only.** A primary's description says what starts it and what does not; caller
358
+ wording belongs in questions and fact renderers.
359
+ 8. **Test journeys, not just units.** Run the real engine on the real set: in order, out of order, all at once,
360
+ corrected, a mid-form question, a change of subject, a decline, voice and text, every language.
361
+
362
+ ## Where to read next
363
+
364
+ - [Flow author reference](copilot-reference.md): every field, step, profile and rule, precisely.
365
+ - [README](../README.md): engine API, `aiCallback`, intent detection, the reply ranker and host responsibilities.
366
+ - [System flows](flows/system/README.md): the shared workers, a page and a chart per flow.
@@ -328,7 +328,6 @@ A Performer requires `form`, nonempty `performs`, `prepare` worker and `present`
328
328
  | `subject` | Ownership path such as `form.data.account` or `form.data.subject`; bind account/service identity, not an unrelated session flag. |
329
329
  | `gate:{flow?,verified:[paths]}` | Execution-time verification; rerun the declared flow before each fresh effect. |
330
330
  | `flow`, `tool` | Installed executor worker and/or registered tool identity. |
331
- | `idempotency`, `reconcile` | Explicit backend policy. Charge/write/send/cancel require at least one; declaring prose alone does not implement backend idempotency. |
332
331
  | `confirm:{exact:true}` | Required for charge, cancel or `reversible:false`. This requires a real form confirmation question. |
333
332
  | `outcomes` | Map declared executor statuses to business outcomes, including unknown results. |
334
333
  | `retry` | Explicit policies: `after:[knownStatuses]`; unknown retry only for SEND with `unknown:"explicit"` and a new accepted recovery choice. |
@@ -359,7 +358,6 @@ This reduced **composed-registry fragment** illustrates action authoring, not a
359
358
  "action":"curacao_payment", "effect":"charge", "subject":"form.data.account",
360
359
  "gate":{"flow":"get-account","verified":["cargo.otpVerified","cargo.authenticatedAccount"]},
361
360
  "flow":"payment-execute", "confirm":{"exact":true},
362
- "reconcile":{"policy":"Hold unknown results for reconciliation; never automatically repeat a charge."},
363
361
  "outcomes":{"ok":"resolved","failed":"unresolved","unknown":"unresolved"}
364
362
  }],
365
363
  "prepare":"payment-prepare", "present":"payment-present",
@@ -378,7 +376,7 @@ This reduced **composed-registry fragment** illustrates action authoring, not a
378
376
  }
379
377
  ```
380
378
 
381
- The action key makes this session projection idempotent; it does not make the payment API idempotent. Declare backend `idempotency` only when the actual API supports the stated key/policy. Otherwise implement and test the declared reconciliation/unknown-result hold. Neither policy wording nor a recorded ledger entry proves a charge succeeded.
379
+ The action key makes this session projection idempotent; it does not make the payment API idempotent. Where the API accepts an idempotency key, pass one as a tool argument. Either way an unknown result is held, never repeated: the engine claims each confirmed action once, treats a status outside `outcomes` as unknown, and never retries an unknown charge or cancellation. A recorded ledger entry does not prove a charge succeeded.
382
380
 
383
381
  ## 9. Outcomes, recovery and persistence
384
382
 
@@ -394,7 +392,7 @@ Session-only protects persisted, serialized session progress from reentry/repeti
394
392
 
395
393
  With a durable journal, the host saves the returned full session before acknowledging exact versioned action receipts with `checkpointActionSession`. Failed saves do not release scopes. Compatible late results project into current state without replaying presenters or restoring an old workflow merely because their storage sequence is larger. Recovery identity binds verified runtime bytes and actual flow/tool contracts; a version string alone is insufficient. Identity mismatch, unresolved effects or failed projections preserve holds. Do not change persistence mode for a live conversation or clear holds to manufacture compatibility.
396
394
 
397
- For versioned JSON, JSFE generates internal continuation revisions from the entire ordered declaration and named function bodies. Do not author `safetyRevision`. A source change retires obsolete unexecuted continuations before new input; uncertain effects remain preserved/quarantined. This is change detection, not authentication or automatic hot reload. Ordinary executable flows can explicitly use the SDK's revision helper when their host owns that policy.
395
+ For versioned JSON, JSFE generates each declaration's continuation revision from its `version` major, plus the `version` major of each shared data or functions entry it uses (`$data`, `fn.`). Do not author `safetyRevision`. A minor or patch change keeps the revision: a saved session continues on its saved steps. **A change that can break a saved session bumps the major** (a removed or renamed input, entry argument, shared data or function name, or a changed meaning under the same name); the next turn of a session saved under the old major retires its unexecuted continuation before new input, and uncertain effects remain preserved/quarantined. `continuationBreaks(previousFlows, nextFlows)` (`jsfe/forms`) lists the removed names that need a major bump; run it against the deployed set before every deploy. A session saved under the earlier fingerprint revision (the whole declaration) continues while its declaration is unchanged. This is change detection, not authentication or automatic hot reload. Ordinary executable flows can explicitly use the SDK's revision helper when their host owns that policy.
398
396
 
399
397
  ## 10. Matching tools JSON
400
398
 
@@ -87,7 +87,13 @@ group being read as another field (an account number, an amount).
87
87
 
88
88
  ## 1.9.2: address city list and part corrections
89
89
 
90
- The shared address form (`collect-geocoded-address`) asks the city when the ZIP code carries several place names (`geocode-zip` returns `localities`, Google's `postcode_localities`; at most 7): "Which city is it: Commerce, East Los Angeles, Los Angeles or Vernon?", by name or key. With one name it is not asked, and a caller who says the city is wrong is asked it plainly and any city is taken. At the read-back, naming one part without a value ("the city is wrong", "la ciudad no") asks only that part again, and a plain NO asks which part is wrong (zip code, city, street, apartment, or ALL to start over) instead of starting over. The part naming is an opt-in form confirmation setting, `confirm.named_fields: true`, read from each input's `names`; other forms keep their behavior. A host whose `geocode-zip` returns no `localities` keeps the one city it returns.
90
+ The shared address form (`collect-geocoded-address`) asks the city when the ZIP code carries several place names (`geocode-zip` returns `localities`, Google's `postcode_localities`; at most 7): "Which city is it: Commerce, East Los Angeles, Los Angeles or Vernon?", by name or key. With one name it is not asked, and a caller who says the city is wrong is asked it plainly and any city is taken. At the read-back, naming one part without a value ("the city is wrong", "la ciudad no") asks only that part again, and a plain NO asks which part is wrong (zip code, city, street, apartment, or ALL to start over) instead of starting over. The part naming is an opt-in form confirmation setting, `confirm.named_fields: true`, read from each input's `names`; other forms keep their behavior. A host whose `geocode-zip` returns no `localities` keeps the one city it returns. A city read from the ZIP code alone is replaced by the city of an exact (rooftop) street match (90805: the ZIP lookup names Lakewood, its streets are Long Beach and Lakewood); a city the caller chose or gave is never replaced. With `named_fields`, a correction the word reader cannot read ("es Long Beach") goes to the reply ranker, which is offered each named part read back (`field:<input>`); a pick asks that part again, so the caller's value replaces the one read back.
91
+
92
+ At the verification code question the reply ranker is offered `where`: a caller who asks where the code is ("¿dónde está?") hears where it went (by text to the cell ending with the last four digits, by email, or in this chat) and the code question again; nothing is sent again.
93
+
94
+ The contact question's `intro` (why the account is needed) is not lost when the question is answered without being asked (the caller ID on file, a contact the caller gave): the first verification code question begins with it instead, once. A contact question that is asked says it, as before, and the code question does not repeat it.
95
+
96
+ A form's or performer's `provides` catalog is validated like a provider's (`validateFlowContracts`: facts present, unique keys, a source path or worker for each fact, a gate for private facts, known gate and source workers), and every catalog's menu choices must name existing flows (a FLOW to an unknown name is skipped silently at run time). The check runs where flow sets are built and validated, never when an engine loads a set.
91
97
 
92
98
  ## 1.9.1: stored sessions without definition copies
93
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.15.9",
3
+ "version": "1.16.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",
@@ -43,6 +43,7 @@
43
43
  "dist",
44
44
  "README.md",
45
45
  "LICENSE",
46
+ "docs/architecture-guide.md",
46
47
  "docs/copilot-reference.md",
47
48
  "docs/development-release.md"
48
49
  ],