jsfe 0.9.6 → 0.9.8

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
@@ -30,6 +30,7 @@ const engine = new WorkflowEngine(
30
30
  globalVariables, // Optional: Session-wide variables
31
31
  validateOnInit, // Optional: Enable pre-flight validation (default: true)
32
32
  language, // Optional: User's preferred language
33
+ aiTimeOut, // Optional: AI timeout in milliseconds (default: 2000ms)
33
34
  messageRegistry, // Optional: Custom message templates
34
35
  guidanceConfig // Optional: User assistance configuration
35
36
  );
@@ -178,13 +179,37 @@ sessionContext.cargo.temporaryData = 'Any dynamic content';
178
179
  - **Default**: 'en' if not specified
179
180
  - **Usage**: Engine selects appropriate prompt_xx properties from flow definitions
180
181
 
181
- **9. messageRegistry** (MessageRegistry, optional)
182
+ **9. aiTimeOut** (number, optional)
183
+ - **Purpose**: Timeout in milliseconds for AI callback function calls
184
+ - **Default**: 2000ms (2 second) if not specified
185
+ - **Usage**: Prevents AI calls from hanging indefinitely, providing better reliability
186
+ - **Range**: Recommended range 1000-30000ms depending on AI service response times
187
+ - **Special Value**: Set to `0` to disable timeout (no time limit on AI calls)
188
+ - **Error Handling**: Throws timeout error if AI call exceeds specified duration
189
+
190
+ ```javascript
191
+ // Examples of different timeout configurations:
192
+
193
+ // Fast local AI (short timeout)
194
+ const fastEngine = new WorkflowEngine(logger, aiCallback, flows, tools, functions,
195
+ {}, true, 'en', 500); // 500ms timeout
196
+
197
+ // Fast cloud AI
198
+ const standardEngine = new WorkflowEngine(logger, aiCallback, flows, tools, functions,
199
+ {}, true, 'en', 1000); // 1 second timeout
200
+
201
+ // No timeout limit (not recommended for production)
202
+ const noTimeoutEngine = new WorkflowEngine(logger, aiCallback, flows, tools, functions,
203
+ {}, true, 'en', 0); // 0 = no timeout
204
+ ```
205
+
206
+ **10. messageRegistry** (MessageRegistry, optional)
182
207
  - **Purpose**: Custom message templates for engine-generated user messages
183
208
  - **Format**: Multi-language message registry with customizable system messages
184
209
  - **Override**: Allows customization of built-in engine messages
185
210
  - **Localization**: Supports multiple languages with fallback to default messages
186
211
 
187
- **10. guidanceConfig** (GuidanceConfig, optional)
212
+ **11. guidanceConfig** (GuidanceConfig, optional)
188
213
  - **Purpose**: Configuration for user guidance and help messages
189
214
  - **Features**: Controls how and when the engine provides user assistance
190
215
  - **Modes**: Append, prepend, template, or none for guidance integration
@@ -853,6 +878,7 @@ const engine = new WorkflowEngine(
853
878
  globalVariables,
854
879
  true, // validateOnInit
855
880
  'es', // language - Spanish
881
+ 1000, // aiTimeOut - 1 second for faster service
856
882
  messageRegistry,
857
883
  guidanceConfig
858
884
  );
package/dist/index.d.ts CHANGED
@@ -91,6 +91,14 @@ export declare const GUIDANCE_CONFIG_EXAMPLES: {
91
91
  template: string;
92
92
  contextSelector: "auto";
93
93
  };
94
+ silent: {
95
+ enabled: boolean;
96
+ mode: "none";
97
+ };
98
+ automation: {
99
+ enabled: boolean;
100
+ mode: "none";
101
+ };
94
102
  disabled: {
95
103
  enabled: boolean;
96
104
  mode: "none";
@@ -448,6 +456,9 @@ export declare class WorkflowEngine implements Engine {
448
456
  guidanceConfig?: GuidanceConfig;
449
457
  globalVariables?: Record<string, unknown>;
450
458
  aiCallback: AiCallbackFunction;
459
+ aiTimeOut: number;
460
+ private enabledCommands;
461
+ private commandsEnabled;
451
462
  private sessionContext;
452
463
  set logger(value: Logger);
453
464
  get logger(): Logger;
@@ -468,13 +479,17 @@ export declare class WorkflowEngine implements Engine {
468
479
  * @param globalVariables - Optional global variables shared across all new flows
469
480
  * @param validateOnInit - Whether to perform validation on initialization (default: true)
470
481
  * @param language - Optional language code for localization
482
+ * @param aiTimeOut - Optional timeout in milliseconds for AI calls (default: 1000ms)
471
483
  * @param messageRegistry - Optional message registry for custom messages
472
484
  * @param guidanceConfig - Optional guidance configuration for AI interactions
473
485
  * @example
474
486
  * const engine = new WorkflowEngine(logger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS);
487
+ * // With custom timeout:
488
+ * const engine = new WorkflowEngine(logger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS, [], true, 'en', 1000);
475
489
  */
476
490
  constructor(hostLogger: Logger | null, aiCallback: AiCallbackFunction, flowsMenu: FlowDefinition[], toolsRegistry: ToolDefinition[], APPROVED_FUNCTIONS: ApprovedFunctions, globalVariables?: Record<string, unknown>, // Optional global variables shared across all new flows
477
- validateOnInit?: boolean, language?: string, messageRegistry?: MessageRegistry, guidanceConfig?: GuidanceConfig);
491
+ validateOnInit?: boolean, language?: string, aiTimeOut?: number, // Optional AI timeout in milliseconds (default 2000ms)
492
+ messageRegistry?: MessageRegistry, guidanceConfig?: GuidanceConfig);
478
493
  /**
479
494
  * Initialize a new session context for a user session.
480
495
  *
@@ -489,6 +504,64 @@ export declare class WorkflowEngine implements Engine {
489
504
  */
490
505
  initSession(userId: string, sessionId: string): EngineSessionContext;
491
506
  updateActivity(contextEntry: ContextEntry, engineSessionContext: EngineSessionContext): Promise<EngineSessionContext>;
507
+ /**
508
+ * Enable specific system commands or all commands if none specified.
509
+ * Useful for voice applications that want to limit command availability.
510
+ *
511
+ * @param commands - Array of command names to enable, or empty/null to enable all
512
+ *
513
+ * @example
514
+ * ```typescript
515
+ * // Enable only help and status commands (disable cancel for voice apps)
516
+ * engine.enableCommands(['help', 'status']);
517
+ *
518
+ * // Enable all commands
519
+ * engine.enableCommands();
520
+ * ```
521
+ */
522
+ enableCommands(commands?: string[]): void;
523
+ /**
524
+ * Disable specific system commands or all commands if none specified.
525
+ * Useful for automation flows that should not be interruptible.
526
+ *
527
+ * @param commands - Array of command names to disable, or empty/null to disable all
528
+ *
529
+ * @example
530
+ * ```typescript
531
+ * // Disable only cancel command (allow help/status for voice apps)
532
+ * engine.disableCommands(['cancel']);
533
+ *
534
+ * // Disable all commands for automation flows
535
+ * engine.disableCommands();
536
+ * ```
537
+ */
538
+ disableCommands(commands?: string[]): void;
539
+ /**
540
+ * Check if a specific system command is currently enabled.
541
+ *
542
+ * @param command - The command to check
543
+ * @returns true if the command is enabled, false otherwise
544
+ *
545
+ * @example
546
+ * ```typescript
547
+ * if (engine.isCommandEnabled('cancel')) {
548
+ * // Show cancel option in UI
549
+ * }
550
+ * ```
551
+ */
552
+ isCommandEnabled(command: string): boolean;
553
+ /**
554
+ * Get list of currently enabled commands.
555
+ *
556
+ * @returns Array of enabled command names
557
+ *
558
+ * @example
559
+ * ```typescript
560
+ * const enabledCommands = engine.getEnabledCommands();
561
+ * console.log('Available commands:', enabledCommands);
562
+ * ```
563
+ */
564
+ getEnabledCommands(): string[];
492
565
  /**
493
566
  * Reconstruct variable references after JSON deserialization.
494
567
  * This fixes the issue where JSON.stringify/parse breaks shared object references
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;;;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;AACH,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;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IACH,OAAO,CAAC,qBAAqB;IAuB7B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA+B9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAoDzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAmCxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAmBxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAwC3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA4CzB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAmC7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAkC5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAmChC;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,GAAE,GAAQ,GAAG,GAAG;IAkHxC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6D5B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAe7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2BhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAiC9B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA0FnC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA6BhC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,2BAA2B;CAKrC"}
package/dist/index.js CHANGED
@@ -61,12 +61,12 @@ const DEFAULT_MESSAGE_REGISTRY = {
61
61
  flow_init: "🤖 Processing {{flowPrompt}}",
62
62
  flow_interrupted: "🔄 Switched to {{flowPrompt}}\n\n(Your previous \"{{previousFlowPrompt}}\" progress has been saved)",
63
63
  flow_resumed: "🔄 Resuming where you left off with {{flowPrompt}}.",
64
- flow_resumed_with_guidance: "🔄 Resuming {{flowPrompt}} - Type 'cancel' or 'help' for options.",
64
+ flow_resumed_with_guidance: "🔄 Resuming {{flowPrompt}} - Type 'cancel flow' or 'help' for options.",
65
65
  flow_completed: "✅ {{flowPrompt}} completed successfully.",
66
66
  flow_completed_generic: "✅ Flow completed.",
67
67
  flow_cancelled: "❌ Cancelled {{flowPrompt}}.",
68
- flow_help_general: "Processing {{flowPrompt}} - You can also 'cancel' or request 'help'.",
69
- flow_help_payment: "Processing {{flowPrompt}} - You can also 'cancel' or request 'help'.",
68
+ flow_help_general: "Processing {{flowPrompt}} - You can also 'cancel flow' or request 'help'.",
69
+ flow_help_payment: "Processing {{flowPrompt}} - You can also 'cancel flow' or request 'help'.",
70
70
  critical_error: "❌ I encountered a critical error. Let me restart our session to ensure everything works properly.",
71
71
  invalid_input: "❌ I'm sorry, I didn't understand that. Please try again.",
72
72
  system_ready: "🤖 System ready. How can I help you today?",
@@ -82,7 +82,7 @@ const DEFAULT_MESSAGE_REGISTRY = {
82
82
  cmd_flow_exited: "✅ Successfully exited {{flowName}}. How can I help you with something else?",
83
83
  cmd_help_title: "📋 Flow Help - {{flowName}}",
84
84
  cmd_help_available_commands: "Available commands while in this flow:",
85
- cmd_help_cancel: "• \"cancel\" - Exit this flow completely",
85
+ cmd_help_cancel: "• \"cancel flow\" - Exit this flow completely",
86
86
  cmd_help_status: "• \"status\" - Show current flow information",
87
87
  cmd_help_help: "• \"help\" - Show this help message",
88
88
  cmd_help_financial_warning: "⚠️ This is a financial transaction flow. Please complete or cancel to maintain security.",
@@ -104,12 +104,12 @@ const DEFAULT_MESSAGE_REGISTRY = {
104
104
  flow_init: "🤖 Procesando {{flowPrompt}}",
105
105
  flow_interrupted: "🔄 Cambiado a {{flowPrompt}}\n\n(Su progreso anterior de \"{{previousFlowPrompt}}\" ha sido guardado)",
106
106
  flow_resumed: "🔄 Continuando donde lo dejó con {{flowPrompt}}.",
107
- flow_resumed_with_guidance: "🔄 Continuando {{flowPrompt}} - Escriba 'cancelar' o 'ayuda' para opciones.",
107
+ flow_resumed_with_guidance: "🔄 Continuando {{flowPrompt}} - Escriba 'cancelar flujo' o 'ayuda' para opciones.",
108
108
  flow_completed: "✅ {{flowPrompt}} completado exitosamente.",
109
109
  flow_completed_generic: "✅ Flujo completado.",
110
110
  flow_cancelled: "❌ {{flowPrompt}} cancelado.",
111
- flow_help_general: "Procesando {{flowPrompt}} - También puede 'cancelar' o solicitar 'ayuda'.",
112
- flow_help_payment: "Procesando {{flowPrompt}} - También puede 'cancelar' o solicitar 'ayuda'.",
111
+ flow_help_general: "Procesando {{flowPrompt}} - También puede 'cancelar flujo' o solicitar 'ayuda'.",
112
+ flow_help_payment: "Procesando {{flowPrompt}} - También puede 'cancelar flujo' o solicitar 'ayuda'.",
113
113
  critical_error: "❌ Encontré un error crítico. Permítame reiniciar nuestra sesión para asegurar que todo funcione correctamente.",
114
114
  invalid_input: "❌ Lo siento, no entendí eso. Por favor, inténtelo de nuevo.",
115
115
  system_ready: "🤖 Sistema listo. ¿Cómo puedo ayudarle hoy?",
@@ -125,7 +125,7 @@ const DEFAULT_MESSAGE_REGISTRY = {
125
125
  cmd_flow_exited: "✅ Salió exitosamente de {{flowName}}. ¿Cómo puedo ayudarle con algo más?",
126
126
  cmd_help_title: "📋 Ayuda del Flujo - {{flowName}}",
127
127
  cmd_help_available_commands: "Comandos disponibles en este flujo:",
128
- cmd_help_cancel: "• \"cancelar\" - Salir completamente de este flujo",
128
+ cmd_help_cancel: "• \"cancelar flujo\" - Salir completamente de este flujo",
129
129
  cmd_help_status: "• \"estado\" - Mostrar información del flujo actual",
130
130
  cmd_help_help: "• \"ayuda\" - Mostrar este mensaje de ayuda",
131
131
  cmd_help_financial_warning: "⚠️ Este es un flujo de transacción financiera. Por favor complete o cancele para mantener la seguridad.",
@@ -148,14 +148,14 @@ const DEFAULT_MESSAGE_REGISTRY = {
148
148
  // Multi-language command support for system commands
149
149
  const COMMAND_SYNONYMS = {
150
150
  en: {
151
- cancel: ['cancel', 'abort', 'stop', 'exit', 'quit', 'end'],
151
+ cancel: ['cancel', 'cancel flow', 'cancel workflow', 'abort flow', 'stop flow', 'exit flow', 'quit flow', 'end flow'],
152
152
  help: ['help', '?', 'options', 'commands'],
153
153
  status: ['status', 'where am i', 'what flow', 'current flow', 'info'],
154
154
  switch: ['switch', 'change', 'go to'],
155
155
  continue: ['continue', 'proceed', 'keep going', 'go on']
156
156
  },
157
157
  es: {
158
- cancel: ['cancelar', 'abortar', 'parar', 'salir', 'terminar', 'fin'],
158
+ cancel: ['cancelar', 'cancelar flujo', 'cancelar workflow', 'abortar flujo', 'parar flujo', 'salir flujo', 'terminar flujo', 'fin flujo'],
159
159
  help: ['ayuda', '?', 'opciones', 'comandos'],
160
160
  status: ['estado', 'donde estoy', 'que flujo', 'flujo actual', 'info'],
161
161
  switch: ['cambiar', 'ir a', 'cambio'],
@@ -203,7 +203,8 @@ function isCommand(engine, input, command) {
203
203
  function detectSystemCommand(engine, input) {
204
204
  const commands = ['cancel', 'help', 'status', 'switch', 'continue'];
205
205
  for (const command of commands) {
206
- if (isCommand(engine, input, command)) {
206
+ // Only check commands that are enabled
207
+ if (engine.isCommandEnabled(command) && isCommand(engine, input, command)) {
207
208
  return command;
208
209
  }
209
210
  }
@@ -234,17 +235,28 @@ export const GUIDANCE_CONFIG_EXAMPLES = {
234
235
  separator: ' ',
235
236
  contextSelector: 'auto',
236
237
  guidanceMessages: {
237
- general: "You can type cancel or help - To complete {{flowPrompt}}",
238
- payment: "You can type cancel or help - Payment in progress"
238
+ general: "You can type 'cancel flow' or 'help' - To complete {{flowPrompt}}",
239
+ payment: "You can type 'cancel flow' or 'help' - Payment in progress"
239
240
  }
240
241
  },
241
242
  // Compact inline style
242
243
  compact: {
243
244
  enabled: true,
244
245
  mode: 'template',
245
- template: "{{message}} (Type 'cancel' or 'help' for {{flowPrompt}})",
246
+ template: "{{message}} (Type 'cancel flow' or 'help' for {{flowPrompt}})",
246
247
  contextSelector: 'auto'
247
248
  },
249
+ // ZERO ADDITIONAL PROMPTS - For voice, automation, or clean conversational flows
250
+ silent: {
251
+ enabled: false, // Disables ALL guidance generation
252
+ mode: 'none'
253
+ },
254
+ // COMMANDS DISABLED - For automation flows that should not be interruptible
255
+ automation: {
256
+ enabled: false,
257
+ mode: 'none'
258
+ // Pair with: engine.disableCommands() to disable all system commands
259
+ },
248
260
  // Disabled guidance
249
261
  disabled: {
250
262
  enabled: false,
@@ -258,12 +270,12 @@ export const GUIDANCE_CONFIG_EXAMPLES = {
258
270
  contextSelector: 'auto',
259
271
  guidanceMessages: {
260
272
  en: {
261
- general: "You can type cancel or help - To complete {{flowPrompt}}",
262
- payment: "You can type cancel or help - Payment in progress"
273
+ general: "You can type 'cancel flow' or 'help' - To complete {{flowPrompt}}",
274
+ payment: "You can type 'cancel flow' or 'help' - Payment in progress"
263
275
  },
264
276
  es: {
265
- general: "Puede escribir cancelar o ayuda - Para completar {{flowPrompt}}",
266
- payment: "Puede escribir cancelar o ayuda - Pago en progreso"
277
+ general: "Puede escribir 'cancelar flujo' o 'ayuda' - Para completar {{flowPrompt}}",
278
+ payment: "Puede escribir 'cancelar flujo' o 'ayuda' - Pago en progreso"
267
279
  }
268
280
  }
269
281
  }
@@ -1824,24 +1836,21 @@ async function playFlowFrame(engine) {
1824
1836
  logger.info(`[${currentFlowFrame.transaction.id.slice(0, 8)}] Playing flow: ${currentFlowFrame.flowName}, steps left: ${currentFlowFrame.flowStepsStack.length}, stack depth: ${stackDepth}`);
1825
1837
  // Handle pending variable storage when resuming flow execution
1826
1838
  if (currentFlowFrame.pendingVariable && currentFlowFrame.inputStack && currentFlowFrame.inputStack.length > 0) {
1827
- const userInput = currentFlowFrame.inputStack[currentFlowFrame.inputStack.length - 1];
1839
+ let userInput = currentFlowFrame.inputStack[currentFlowFrame.inputStack.length - 1];
1828
1840
  // Safety check: ensure userInput is defined before processing
1829
1841
  if (!userInput) {
1830
- logger.warn(`Skipping variable processing - userInput is undefined for pendingVariable: ${currentFlowFrame.pendingVariable}`);
1831
- // Clear the pending variable to avoid infinite loops
1832
- delete currentFlowFrame.pendingVariable;
1833
- }
1834
- else {
1835
- // Store user input as variable value with proper sanitization
1836
- // (System commands like 'cancel' are already handled before this point)
1837
- setUserInputVariable(currentFlowFrame.variables, currentFlowFrame.pendingVariable, userInput, true // Sanitize user input
1838
- );
1839
- logger.info(`Stored sanitized user input in variable '${currentFlowFrame.pendingVariable}': "${userInput}"`);
1840
- delete currentFlowFrame.pendingVariable;
1841
- // Pop the SAY-GET step now that variable assignment is complete
1842
- currentFlowFrame.flowStepsStack.pop();
1843
- logger.info(`Popped SAY-GET step after variable assignment completed`);
1844
- }
1842
+ logger.info(`Skipping variable processing - userInput is undefined for pendingVariable: ${currentFlowFrame.pendingVariable}`);
1843
+ userInput = '';
1844
+ }
1845
+ // Store user input as variable value with proper sanitization
1846
+ // (System commands like 'cancel' are already handled before this point)
1847
+ setUserInputVariable(currentFlowFrame.variables, currentFlowFrame.pendingVariable, userInput, true // Sanitize user input
1848
+ );
1849
+ logger.info(`Stored sanitized user input in variable '${currentFlowFrame.pendingVariable}': "${userInput}"`);
1850
+ delete currentFlowFrame.pendingVariable;
1851
+ // Pop the SAY-GET step now that variable assignment is complete
1852
+ currentFlowFrame.flowStepsStack.pop();
1853
+ logger.info(`Popped SAY-GET step after variable assignment completed`);
1845
1854
  }
1846
1855
  // Flow completion handling
1847
1856
  if (currentFlowFrame.flowStepsStack.length === 0) {
@@ -1990,22 +1999,49 @@ async function playStep(currentFlowFrame, engine) {
1990
1999
  }
1991
2000
  }
1992
2001
  // === AI COMMUNICATION LAYER ===
2002
+ /**
2003
+ * Create a timeout wrapper for AI calls
2004
+ * @param promise - The promise to wrap with timeout
2005
+ * @param timeoutMs - Timeout in milliseconds (0 = no timeout)
2006
+ * @returns Promise that rejects if timeout is reached
2007
+ */
2008
+ function withTimeout(promise, timeoutMs) {
2009
+ // If timeout is 0 or negative, return the promise directly (no timeout)
2010
+ if (timeoutMs <= 0) {
2011
+ return promise;
2012
+ }
2013
+ return new Promise((resolve, reject) => {
2014
+ const timeoutId = setTimeout(() => {
2015
+ reject(new Error(`AI call timed out after ${timeoutMs}ms`));
2016
+ }, timeoutMs);
2017
+ promise
2018
+ .then((result) => {
2019
+ clearTimeout(timeoutId);
2020
+ resolve(result);
2021
+ })
2022
+ .catch((error) => {
2023
+ clearTimeout(timeoutId);
2024
+ reject(error);
2025
+ });
2026
+ });
2027
+ }
1993
2028
  /**
1994
2029
  * Base AI worker: Plain interface to AI services
1995
2030
  * Uses the user-provided AI callback function instead of hardcoded implementation
1996
2031
  * @param systemInstruction - The system message/prompt for the AI
1997
2032
  * @param userMessage - The user's input message
1998
2033
  * @param aiCallback - User-provided AI communication function
2034
+ * @param timeoutMs - Timeout in milliseconds for the AI call
1999
2035
  * @returns AI response as string
2000
2036
  */
2001
- async function fetchAiResponse(systemInstruction, userMessage, aiCallback) {
2037
+ async function fetchAiResponse(systemInstruction, userMessage, aiCallback, timeoutMs = 1000) {
2002
2038
  try {
2003
- logger.debug(`fetchAiResponse called with system instruction length: ${systemInstruction.length}, user message: "${userMessage}"`);
2039
+ logger.debug(`fetchAiResponse called with system instruction length: ${systemInstruction.length}, user message: "${userMessage}", timeout: ${timeoutMs}ms`);
2004
2040
  if (!aiCallback) {
2005
2041
  throw new Error('aiCallback is null. AI-powered features are not available.');
2006
2042
  }
2007
- // Use the user-provided AI callback function
2008
- const aiResponse = await aiCallback(systemInstruction, userMessage);
2043
+ // Use the user-provided AI callback function with timeout
2044
+ const aiResponse = await withTimeout(aiCallback(systemInstruction, userMessage), timeoutMs);
2009
2045
  if (typeof aiResponse !== 'string') {
2010
2046
  throw new Error('AI callback must return a string response');
2011
2047
  }
@@ -2027,9 +2063,10 @@ async function fetchAiResponse(systemInstruction, userMessage, aiCallback) {
2027
2063
  * @param flows - Available flows (optional)
2028
2064
  * @param jsonSchema - Optional JSON schema for structured responses
2029
2065
  * @param aiCallback - User-provided AI communication function
2066
+ * @param timeoutMs - Timeout in milliseconds for the AI call
2030
2067
  * @returns AI response as string or parsed JSON object
2031
2068
  */
2032
- async function fetchAiTask(task, rules, context, userInput, flows, jsonSchema, aiCallback) {
2069
+ async function fetchAiTask(task, rules, context, userInput, flows, jsonSchema, aiCallback, timeoutMs = 1000) {
2033
2070
  try {
2034
2071
  if (!aiCallback) {
2035
2072
  throw new Error('AI callback function is required');
@@ -2050,7 +2087,7 @@ async function fetchAiTask(task, rules, context, userInput, flows, jsonSchema, a
2050
2087
  const flowDescriptions = flows.map(flow => `${flow.name}: ${flow.description} (Risk: ${flow.metadata?.riskLevel || 'unknown'})`).join('\n');
2051
2088
  userMessage += `\n\n<available-flows>\n${flowDescriptions}\n</available-flows>`;
2052
2089
  }
2053
- const aiResponse = await fetchAiResponse(systemMessage, userMessage, aiCallback);
2090
+ const aiResponse = await fetchAiResponse(systemMessage, userMessage, aiCallback, timeoutMs);
2054
2091
  // If JSON schema was provided, parse and return JSON
2055
2092
  if (jsonSchema) {
2056
2093
  // Clean up common AI response formatting issues
@@ -2126,7 +2163,7 @@ async function getFlowForInput(input, engine) {
2126
2163
  </chat-history>\n\n`;
2127
2164
  }
2128
2165
  try {
2129
- const aiResponse = await fetchAiTask(task, rules, context, input, flowsForIntentDetection, undefined, engine.aiCallback);
2166
+ const aiResponse = await fetchAiTask(task, rules, context, input, flowsForIntentDetection, undefined, engine.aiCallback, engine.aiTimeOut);
2130
2167
  if (aiResponse && aiResponse !== 'None' && aiResponse !== 'null') {
2131
2168
  const flow = flowsMenu.find(flow => flow.name.toLowerCase() === aiResponse.toLowerCase() || flow.id === aiResponse);
2132
2169
  if (flow) {
@@ -2743,8 +2780,8 @@ function handleSayGetStep(currentFlowFrame, engine) {
2743
2780
  }
2744
2781
  // Add contextual guidance to SAY messages when user input is expected
2745
2782
  function addFlowContextGuidance(message, flowFrame, engine) {
2746
- // Check if guidance is disabled
2747
- if (!engine.guidanceConfig?.enabled) {
2783
+ // Check if guidance is disabled OR commands are disabled
2784
+ if (!engine.guidanceConfig?.enabled || engine.getEnabledCommands().length === 0) {
2748
2785
  return message;
2749
2786
  }
2750
2787
  // Check if this flow frame was just resumed - if so, skip regular guidance since
@@ -2790,25 +2827,35 @@ function addFlowContextGuidance(message, flowFrame, engine) {
2790
2827
  }
2791
2828
  }
2792
2829
  // Fallback to centralized messaging system if no custom guidance found
2793
- if (!guidance && engine) {
2794
- // Use centralized messaging system
2830
+ if (!guidance) {
2831
+ // Try centralized messaging system first
2795
2832
  const messageId = contextType === 'payment' ? 'flow_help_payment' : 'flow_help_general';
2796
2833
  guidance = getSystemMessage(engine, messageId, {
2797
2834
  flowName,
2798
2835
  flowPrompt: getFlowPrompt(engine, flowName)
2799
2836
  });
2800
- }
2801
- else if (!guidance) {
2802
- // Fallback to hardcoded messages if engine not available
2803
- if (contextType === 'payment') {
2804
- guidance = "Type 'cancel' or 'help' for options.";
2805
- }
2806
- else {
2807
- guidance = "Type 'cancel' or 'help' for options.";
2837
+ // If still no guidance from system messages, try command-based fallback
2838
+ if (!guidance) {
2839
+ // Generate dynamic guidance messages based on enabled commands
2840
+ let availableOptions = [];
2841
+ if (engine.isCommandEnabled('cancel')) {
2842
+ availableOptions.push("'cancel flow'");
2843
+ }
2844
+ if (engine.isCommandEnabled('help')) {
2845
+ availableOptions.push("'help'");
2846
+ }
2847
+ if (engine.isCommandEnabled('status')) {
2848
+ availableOptions.push("'status'");
2849
+ }
2850
+ if (availableOptions.length > 0) {
2851
+ guidance = `Type ${availableOptions.join(' or ')} for options.`;
2852
+ }
2808
2853
  }
2854
+ // If no guidance found, leave guidance empty - respect implementer's intent!
2855
+ // DO NOT force "Continue with your response" - that's unwanted prompt injection!
2809
2856
  }
2810
2857
  // Apply template interpolation to guidance if needed
2811
- if (guidance.includes('{{')) {
2858
+ if (guidance && guidance.includes('{{')) {
2812
2859
  guidance = guidance.replace(/\{\{([^}]+)\}\}/g, (match, key) => {
2813
2860
  const context = {
2814
2861
  flowName,
@@ -2818,6 +2865,10 @@ function addFlowContextGuidance(message, flowFrame, engine) {
2818
2865
  return context[key] || match;
2819
2866
  });
2820
2867
  }
2868
+ // If no guidance content, return original message (respect implementer's intent for no prompts)
2869
+ if (!guidance || guidance.trim() === '') {
2870
+ return message;
2871
+ }
2821
2872
  // Apply integration mode
2822
2873
  switch (config.mode) {
2823
2874
  case 'none':
@@ -3202,7 +3253,7 @@ Context Extraction Examples:
3202
3253
  '</chat-context>';
3203
3254
  const context = variablesContext || 'No variables available';
3204
3255
  try {
3205
- const aiResponse = await fetchAiTask(task, rules, context, String(input), [], schemaDescription, engine.aiCallback);
3256
+ const aiResponse = await fetchAiTask(task, rules, context, String(input), [], schemaDescription, engine.aiCallback, engine.aiTimeOut);
3206
3257
  // When we expect JSON args, the response should be parsed as an object
3207
3258
  const args = typeof aiResponse === 'string' ? JSON.parse(aiResponse) : aiResponse;
3208
3259
  // Type coercion and validation
@@ -4269,7 +4320,8 @@ async function handleFlowControlCommands(input, engine, userId) {
4269
4320
  }
4270
4321
  // Help commands
4271
4322
  if (detectedCommand === 'help') {
4272
- return handleFlowHelp(currentFlowFrame, engine);
4323
+ const helpResponse = handleFlowHelp(currentFlowFrame, engine);
4324
+ return helpResponse; // May be null if help is disabled or no guidance wanted
4273
4325
  }
4274
4326
  // Status/Where am I commands
4275
4327
  if (detectedCommand === 'status') {
@@ -4279,20 +4331,41 @@ async function handleFlowControlCommands(input, engine, userId) {
4279
4331
  }
4280
4332
  // Help handler for active flows
4281
4333
  function handleFlowHelp(currentFlowFrame, engine) {
4334
+ // If help command is disabled, return null (no response)
4335
+ if (!engine.isCommandEnabled('help')) {
4336
+ return null;
4337
+ }
4282
4338
  const flowName = currentFlowFrame.flowName;
4283
4339
  const isFinancialFlow = flowName.toLowerCase().includes('payment') ||
4284
4340
  flowName.toLowerCase().includes('transfer') ||
4285
4341
  flowName.toLowerCase().includes('financial');
4286
4342
  const helpTitle = getSystemMessage(engine, 'cmd_help_title', { flowName });
4287
4343
  const availableCommands = getSystemMessage(engine, 'cmd_help_available_commands');
4288
- const cancelHelp = getSystemMessage(engine, 'cmd_help_cancel');
4289
- const statusHelp = getSystemMessage(engine, 'cmd_help_status');
4290
- const helpHelp = getSystemMessage(engine, 'cmd_help_help');
4291
4344
  let helpMessage = `${helpTitle}\n\n`;
4345
+ // Check if we have any enabled commands to show
4346
+ const enabledCommands = engine.getEnabledCommands();
4347
+ if (enabledCommands.length === 0) {
4348
+ // No commands available - return minimal response or null based on guidance config
4349
+ if (engine.guidanceConfig?.enabled === false) {
4350
+ return null; // Implementer wants no additional prompts at all
4351
+ }
4352
+ return `${helpTitle}\n\nNo commands are currently available.`;
4353
+ }
4292
4354
  helpMessage += `${availableCommands}\n`;
4293
- helpMessage += `${cancelHelp}\n`;
4294
- helpMessage += `${statusHelp}\n`;
4295
- helpMessage += `${helpHelp}\n\n`;
4355
+ // Only show commands that are enabled
4356
+ if (engine.isCommandEnabled('cancel')) {
4357
+ const cancelHelp = getSystemMessage(engine, 'cmd_help_cancel');
4358
+ helpMessage += `${cancelHelp}\n`;
4359
+ }
4360
+ if (engine.isCommandEnabled('status')) {
4361
+ const statusHelp = getSystemMessage(engine, 'cmd_help_status');
4362
+ helpMessage += `${statusHelp}\n`;
4363
+ }
4364
+ if (engine.isCommandEnabled('help')) {
4365
+ const helpHelp = getSystemMessage(engine, 'cmd_help_help');
4366
+ helpMessage += `${helpHelp}\n`;
4367
+ }
4368
+ helpMessage += `\n`;
4296
4369
  if (isFinancialFlow) {
4297
4370
  const financialWarning = getSystemMessage(engine, 'cmd_help_financial_warning');
4298
4371
  helpMessage += `${financialWarning}\n\n`;
@@ -4421,7 +4494,7 @@ ${context}`;
4421
4494
  "reasoning": "brief explanation"
4422
4495
  }`;
4423
4496
  try {
4424
- const analysis = await fetchAiTask(task, rules, context, input, flowsMenu, jsonSchema, engine.aiCallback);
4497
+ const analysis = await fetchAiTask(task, rules, context, input, flowsMenu, jsonSchema, engine.aiCallback, engine.aiTimeOut);
4425
4498
  // Ensure analysis is an object and add originalInput
4426
4499
  if (typeof analysis === 'object' && analysis !== null) {
4427
4500
  analysis.originalInput = input; // Preserve the original input
@@ -4712,13 +4785,17 @@ export class WorkflowEngine {
4712
4785
  * @param globalVariables - Optional global variables shared across all new flows
4713
4786
  * @param validateOnInit - Whether to perform validation on initialization (default: true)
4714
4787
  * @param language - Optional language code for localization
4788
+ * @param aiTimeOut - Optional timeout in milliseconds for AI calls (default: 1000ms)
4715
4789
  * @param messageRegistry - Optional message registry for custom messages
4716
4790
  * @param guidanceConfig - Optional guidance configuration for AI interactions
4717
4791
  * @example
4718
4792
  * const engine = new WorkflowEngine(logger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS);
4793
+ * // With custom timeout:
4794
+ * const engine = new WorkflowEngine(logger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS, [], true, 'en', 1000);
4719
4795
  */
4720
4796
  constructor(hostLogger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS, globalVariables, // Optional global variables shared across all new flows
4721
- validateOnInit, language, messageRegistry, guidanceConfig) {
4797
+ validateOnInit, language, aiTimeOut, // Optional AI timeout in milliseconds (default 2000ms)
4798
+ messageRegistry, guidanceConfig) {
4722
4799
  // Private session context - engine works directly with session data (no copying!)
4723
4800
  this.sessionContext = null;
4724
4801
  // Validate logger compatibility
@@ -4738,6 +4815,7 @@ export class WorkflowEngine {
4738
4815
  this.toolsRegistry = toolsRegistry;
4739
4816
  this.APPROVED_FUNCTIONS = APPROVED_FUNCTIONS;
4740
4817
  this.globalVariables = globalVariables ? { ...globalVariables } : {}; // Copy global variables to prevent external mutations
4818
+ this.aiTimeOut = aiTimeOut ?? 2000; // Default to 2000ms (2 seconds)
4741
4819
  // if validateOnInit is not provided, default to true
4742
4820
  validateOnInit = validateOnInit !== undefined ? validateOnInit : true;
4743
4821
  this.language = language;
@@ -4748,6 +4826,9 @@ export class WorkflowEngine {
4748
4826
  separator: '\n\n',
4749
4827
  contextSelector: 'auto'
4750
4828
  };
4829
+ // Initialize command management (all commands enabled by default)
4830
+ this.commandsEnabled = true;
4831
+ this.enabledCommands = new Set(['cancel', 'help', 'status', 'switch', 'continue']);
4751
4832
  // No longer initialize session-specific data in constructor - it's now in sessionContext
4752
4833
  this.sessionId = crypto.randomUUID();
4753
4834
  this.createdAt = new Date();
@@ -4910,6 +4991,101 @@ export class WorkflowEngine {
4910
4991
  throw error;
4911
4992
  }
4912
4993
  }
4994
+ /**
4995
+ * Enable specific system commands or all commands if none specified.
4996
+ * Useful for voice applications that want to limit command availability.
4997
+ *
4998
+ * @param commands - Array of command names to enable, or empty/null to enable all
4999
+ *
5000
+ * @example
5001
+ * ```typescript
5002
+ * // Enable only help and status commands (disable cancel for voice apps)
5003
+ * engine.enableCommands(['help', 'status']);
5004
+ *
5005
+ * // Enable all commands
5006
+ * engine.enableCommands();
5007
+ * ```
5008
+ */
5009
+ enableCommands(commands) {
5010
+ this.commandsEnabled = true;
5011
+ if (!commands || commands.length === 0) {
5012
+ // Enable all commands
5013
+ this.enabledCommands = new Set(['cancel', 'help', 'status', 'switch', 'continue']);
5014
+ logger.debug('All system commands enabled');
5015
+ }
5016
+ else {
5017
+ // Enable only specified commands
5018
+ this.enabledCommands = new Set(commands);
5019
+ logger.debug(`System commands enabled: ${commands.join(', ')}`);
5020
+ }
5021
+ }
5022
+ /**
5023
+ * Disable specific system commands or all commands if none specified.
5024
+ * Useful for automation flows that should not be interruptible.
5025
+ *
5026
+ * @param commands - Array of command names to disable, or empty/null to disable all
5027
+ *
5028
+ * @example
5029
+ * ```typescript
5030
+ * // Disable only cancel command (allow help/status for voice apps)
5031
+ * engine.disableCommands(['cancel']);
5032
+ *
5033
+ * // Disable all commands for automation flows
5034
+ * engine.disableCommands();
5035
+ * ```
5036
+ */
5037
+ disableCommands(commands) {
5038
+ if (!commands || commands.length === 0) {
5039
+ // Disable all commands
5040
+ this.commandsEnabled = false;
5041
+ this.enabledCommands.clear();
5042
+ logger.debug('All system commands disabled');
5043
+ }
5044
+ else {
5045
+ // Disable only specified commands
5046
+ for (const command of commands) {
5047
+ this.enabledCommands.delete(command);
5048
+ }
5049
+ logger.debug(`System commands disabled: ${commands.join(', ')}`);
5050
+ // If no commands are left enabled, set commandsEnabled to false
5051
+ if (this.enabledCommands.size === 0) {
5052
+ this.commandsEnabled = false;
5053
+ }
5054
+ }
5055
+ }
5056
+ /**
5057
+ * Check if a specific system command is currently enabled.
5058
+ *
5059
+ * @param command - The command to check
5060
+ * @returns true if the command is enabled, false otherwise
5061
+ *
5062
+ * @example
5063
+ * ```typescript
5064
+ * if (engine.isCommandEnabled('cancel')) {
5065
+ * // Show cancel option in UI
5066
+ * }
5067
+ * ```
5068
+ */
5069
+ isCommandEnabled(command) {
5070
+ return this.commandsEnabled && this.enabledCommands.has(command);
5071
+ }
5072
+ /**
5073
+ * Get list of currently enabled commands.
5074
+ *
5075
+ * @returns Array of enabled command names
5076
+ *
5077
+ * @example
5078
+ * ```typescript
5079
+ * const enabledCommands = engine.getEnabledCommands();
5080
+ * console.log('Available commands:', enabledCommands);
5081
+ * ```
5082
+ */
5083
+ getEnabledCommands() {
5084
+ if (!this.commandsEnabled) {
5085
+ return [];
5086
+ }
5087
+ return Array.from(this.enabledCommands);
5088
+ }
4913
5089
  /**
4914
5090
  * Reconstruct variable references after JSON deserialization.
4915
5091
  * This fixes the issue where JSON.stringify/parse breaks shared object references
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
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",