jsfe 0.9.1 β†’ 0.9.3

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
@@ -9,7 +9,8 @@ npm i jsfe
9
9
 
10
10
  ## πŸ“– Documentation
11
11
 
12
- - **[JavaScript Flow Engine User Guide](JavaScript%20Flow%20Engine.md)** - Comprehensive tutorials, examples, and best practices
12
+ - **[JavaScript Flow Engine User Guide](JavaScript%20Flow%20Engine.md)**
13
+ - Comprehensive tutorials, examples, and best practices
13
14
  - **[README.md](README.md)** - Technical API reference (this document)
14
15
 
15
16
  *For detailed tutorials, step-by-step examples, and comprehensive workflow patterns, see the **[User Guide](JavaScript%20Flow%20Engine.md)**.*
@@ -87,6 +88,7 @@ The WorkflowEngine constructor accepts the following parameters in order, each s
87
88
  - **Content**: All workflows that the engine can detect and execute
88
89
  - **Validation**: Engine validates flow structure during initialization
89
90
  - **Requirements**: Each flow must have valid id, name, description, and steps
91
+ - **Primary Property**: Use `primary: true` to mark user-facing entry point flows vs. helper sub-flows
90
92
 
91
93
  **4. toolsRegistry** (ToolDefinition[])
92
94
  - **Purpose**: Array of external tool definitions for CALL-TOOL steps
@@ -136,6 +138,10 @@ sessionContext.cargo.temporaryData = 'Any dynamic content';
136
138
  - **Default**: `true` - recommended for development and production
137
139
  - **Performance**: Set to `false` only in high-performance scenarios with pre-validated flows
138
140
  - **Output**: Detailed validation reports with errors, warnings, and success metrics
141
+ - **Primary Flow Validation**: Only flows marked with `primary: true` are validated as top-level workflows
142
+ - Sub-flows are validated in context when called from primary flows
143
+ - Prevents validation errors for helper flows that depend on parent flow variables
144
+ - Ensures complete validation coverage through deep traversal of flow call graphs
139
145
 
140
146
  **8. language** (string, optional)
141
147
  - **Purpose**: User's preferred language for localized messages and prompts
@@ -219,6 +225,7 @@ You can integrate any AI service (Claude, Gemini, local LLMs, etc.) by implement
219
225
  The engine operates through four primary registries that define its capabilities:
220
226
 
221
227
  #### 1. **Flows Registry** - Workflow Definitions
228
+
222
229
  ```javascript
223
230
  const flowsMenu = [
224
231
  {
@@ -226,6 +233,7 @@ const flowsMenu = [
226
233
  name: "ProcessPayment",
227
234
  prompt: "Process a payment",
228
235
  description: "Handle payment processing with validation",
236
+ primary: true, // Optional: Marks this as a primary (user-facing) flow
229
237
  steps: [
230
238
  { type: "SAY", value: "Let's process your payment." },
231
239
  { type: "SAY-GET", variable: "amount", value: "Enter amount:" },
@@ -234,8 +242,42 @@ const flowsMenu = [
234
242
  }
235
243
  ];
236
244
  ```
245
+
246
+ ##### Flow Definition Properties
247
+
248
+ - **`id`** (required): Unique identifier for the flow
249
+ - **`name`** (required): Human-readable flow name used in execution context
250
+ - **`prompt`** (required): User-facing description for AI intent detection
251
+ - **`description`** (required): Detailed description of the flow's purpose
252
+ - **`primary`** (optional): Boolean flag marking user-facing entry point flows
253
+ - `true`: Primary flows are standalone workflows that users can directly trigger
254
+ - `false` or omitted: Helper/sub-flows called by other flows, not directly accessible
255
+ - **Validation Impact**: Only primary flows are validated as top-level workflows during initialization
256
+ - **AI Detection**: Only primary flows are considered for intent detection and user interaction
257
+ - **`steps`** (required): Array of workflow steps to execute
258
+ - **`variables`** (optional): Flow-specific variable definitions with types and descriptions
259
+ - **`version`** (optional): Flow version for compatibility tracking (defaults to "1.0")
260
+
261
+ ##### Primary vs. Sub-Flow Architecture
262
+
263
+ The `primary` property enables a clean separation between:
264
+
265
+ **Primary Flows** (`primary: true`):
266
+ - User-facing workflows that can be directly triggered by user input
267
+ - Entry points for specific business processes (e.g., "StartPayment", "CreateTicket")
268
+ - Included in AI intent detection and flow selection
269
+ - Validated as standalone workflows during engine initialization
270
+
271
+ **Sub-Flows** (no `primary` property or `primary: false`):
272
+ - Helper workflows called by other flows (e.g., "RetryPayment", "ValidateInput")
273
+ - Internal logic flows for error handling, validation, or shared functionality
274
+ - Not directly accessible to users through intent detection
275
+ - Validated only when called from primary flows, ensuring proper variable context
276
+
277
+ This architecture prevents validation errors for sub-flows that depend on variables from their calling flows, while ensuring complete validation coverage during the engine's deep validation process.
237
278
  #### Referencing Tool Results in Later Steps
238
279
  When a CALL-TOOL step finishes, it can store the returned data into a variable you name via the variable property. That variable will hold the entire return object from the tool.
280
+
239
281
  ```javascript
240
282
  Using variable
241
283
  {
@@ -259,6 +301,7 @@ Because you get the raw return object, you do not need to use .result in your te
259
301
  If you omit variable, you won’t be able to access the tool’s output later.
260
302
 
261
303
  #### 2. **Tools Registry** - External Integrations
304
+
262
305
  ```javascript
263
306
  const toolsRegistry = [
264
307
  {
@@ -281,6 +324,7 @@ const toolsRegistry = [
281
324
  ```
282
325
 
283
326
  #### 3. **Approved Functions Registry** - Secure Local Functions
327
+
284
328
  ```javascript
285
329
  const APPROVED_FUNCTIONS = {};
286
330
 
@@ -306,7 +350,8 @@ const globalVariables = {
306
350
  ### Session Management
307
351
 
308
352
  - Each user requires a unique session context via `initSession(logger, userId, sessionId)`
309
- - **CRITICAL**: `updateActivity()` returns an updated `EngineSessionContext` - you must always update your session reference
353
+ - **CRITICAL**: `updateActivity()` returns an updated `EngineSessionContext`
354
+ - You must always update your session reference on every call
310
355
  - The `EngineSessionContext` object should be persisted by your application
311
356
  - Pass the same session context to `updateActivity` for conversation continuity
312
357
  - **Session Isolation**: Each user/session must have its own context to prevent state contamination
@@ -442,7 +487,9 @@ return aiResponse;
442
487
 
443
488
  ### Stack-of-Stacks Design
444
489
 
445
- The Flow Engine implements a sophisticated "stack-of-stacks" architecture that allows flows to be suspended and resumed, enabling users to naturally interrupt one workflow to handle another task, then return to their original workflow seamlessly.
490
+ The Flow Engine implements a sophisticated "stack-of-stacks" architecture that allows flows to be suspended
491
+ and resumed, enabling users to naturally interrupt one workflow to handle another task, then return to
492
+ their original workflow seamlessly.
446
493
 
447
494
  #### Core Components
448
495
 
@@ -680,11 +727,14 @@ The Flow Engine implements a sophisticated "stack-of-stacks" architecture that a
680
727
  - βœ… **SET** - Variable assignment with interpolation support
681
728
  - βœ… **CALL-TOOL** - External tool execution with error handling
682
729
  - βœ… **FLOW** - Sub-flow execution with multiple call types
683
- - βœ… **SWITCH** - Enhanced conditional branching with expressions
730
+ - βœ… **CASE** - Conditional branching with expressions
731
+ - βœ… **SWITCH** - Conditional branching based on single value matching
684
732
 
685
733
  ### Expression System
686
734
 
687
- The JSFE engine features a **powerful, unified JavaScript expression evaluator** that provides consistent syntax and behavior across all contexts. This system supports the full range of JavaScript expressions while maintaining security through a trusted developer model.
735
+ The JSFE engine features a **powerful, unified JavaScript expression evaluator** that provides consistent
736
+ syntax and behavior across all contexts. This system supports the full range of JavaScript expressions
737
+ while maintaining security through a trusted developer model and limiting user input usage as values.
688
738
 
689
739
  #### Core Features
690
740
  - βœ… **Full JavaScript Expression Support** - All standard operators, functions, and syntax
@@ -711,13 +761,8 @@ The JSFE engine features a **powerful, unified JavaScript expression evaluator**
711
761
  ```
712
762
 
713
763
  #### Supported JavaScript Features
714
- - **Arithmetic**: `+`, `-`, `*`, `/`, `%`, `**` (exponentiation)
715
- - **Comparison**: `===`, `!==`, `>`, `<`, `>=`, `<=`, `==`, `!=`
716
- - **Logical**: `&&`, `||`, `!`, `??` (nullish coalescing)
717
- - **Ternary**: `condition ? true_value : false_value`
718
- - **Object/Array Access**: `obj.prop`, `obj['key']`, `arr[index]`
719
- - **Method Calls**: `str.toUpperCase()`, `arr.length`, `Math.round(num)`
720
- - **Template Literals**: `` `Hello ${name}` `` (within expressions)
764
+ All JavaScript features are supported within a sandboxed environment with access limited to
765
+ explicitly exported variables and functions.
721
766
 
722
767
  #### Security Model
723
768
  - **Developer Trust**: Workflows authored by developers, not end users
@@ -727,7 +772,9 @@ The JSFE engine features a **powerful, unified JavaScript expression evaluator**
727
772
 
728
773
  ### Internationalization and Localization
729
774
 
730
- The JSFE engine supports multiple languages through localized properties in flow definitions and steps. This allows you to create workflows that automatically display messages in the user's preferred language.
775
+ The JSFE engine supports multiple languages through localized properties in flow definitions
776
+ and steps. This allows you to create workflows that automatically display messages in the user's
777
+ preferred language.
731
778
 
732
779
  #### Flow-Level Localization
733
780
 
@@ -793,7 +840,9 @@ const engine = new WorkflowEngine(
793
840
 
794
841
  #### Language Fallback
795
842
 
796
- If a localized property is not found for the specified language, the engine automatically falls back to the default `prompt` or `value` property. This ensures your flows always work even if some translations are missing.
843
+ If a localized property is not found for the specified language, the engine automatically falls
844
+ back to the default `prompt` or `value` property. This ensures your flows always work even if
845
+ some translations are missing.
797
846
 
798
847
  ```javascript
799
848
  // Example: User has language='es' but only English is available
@@ -825,7 +874,7 @@ The engine supports safe JavaScript expressions within `{{}}` templates:
825
874
  {{user.permissions.includes('admin') && creditScore > 700}}
826
875
  ```
827
876
 
828
- ### Safe Method Calls
877
+ ### JavaScript Method and Function Calls
829
878
 
830
879
  **String Methods:**
831
880
  ```javascript
@@ -857,7 +906,7 @@ The engine supports safe JavaScript expressions within `{{}}` templates:
857
906
  {{Math.max(balance, 0)}}
858
907
  ```
859
908
 
860
- **Safe Functions:**
909
+ **Functions:**
861
910
  ```javascript
862
911
  // Type conversion and validation
863
912
  {{Number(input) > 0 && !isNaN(Number(input))}}
@@ -873,7 +922,8 @@ The engine supports safe JavaScript expressions within `{{}}` templates:
873
922
 
874
923
  ## Demo/Test Mode: Flow Matching Without AI
875
924
 
876
- For demos, tests, or developer convenience, you can set `aiCallback` to `null` when constructing the engine. In this mode, intent detection will:
925
+ For demos, tests, or developer convenience, you can set `aiCallback` to `null` when constructing
926
+ the engine. In this mode, intent detection will:
877
927
 
878
928
  1. **Match by Flow Name or ID (case-insensitive):**
879
929
  - If the user input exactly matches a flow's `name` or `id`, that flow is activated.
@@ -882,7 +932,8 @@ For demos, tests, or developer convenience, you can set `aiCallback` to `null` w
882
932
  3. **No Match:**
883
933
  - If no match is found, no flow is activated.
884
934
 
885
- This makes it easy to run demos and tests without requiring a real AI intent detection function. In production, always provide a real `aiCallback` for robust intent detection.
935
+ This makes it easy to run demos and tests without requiring a real AI intent detection function.
936
+ In production, always provide a real `aiCallback` for robust intent detection.
886
937
 
887
938
  ### Test Suite Patterns
888
939
 
@@ -930,14 +981,14 @@ async function runTest(inputs, sessionContext) {
930
981
  }
931
982
  ```
932
983
 
933
- This pattern ensures that each test runs in complete isolation, preventing the session corruption that can occur when tests share state.
984
+ This pattern ensures that each test runs in complete isolation, preventing the session corruption
985
+ that can occur when tests share state.
934
986
 
935
987
  ## Security & Compliance
936
988
 
937
989
  ### Expression Security
938
990
  - βœ… **Direct JavaScript Evaluation** - Native JavaScript execution with security framework
939
- - βœ… **Controlled Access** - Only exported variables and functions are accessable JavaScript identifiers allowed as parameters
940
- scope
991
+ - βœ… **Controlled Access** - Only exported variables and functions are accessable JavaScript identifiers allowed as parameters scope
941
992
  - βœ… **User Input Safety** - User inputs treated as values, with protection against code injection
942
993
 
943
994
  ### Transaction Management
package/dist/index.d.ts CHANGED
@@ -171,12 +171,6 @@ export interface FlowStep {
171
171
  }>;
172
172
  customValidator?: string;
173
173
  };
174
- retryBehavior?: {
175
- preserveData?: boolean;
176
- askUserBeforeRetry?: boolean;
177
- escalateAfterMaxRetries?: FlowStep;
178
- showProgressiveHelp?: boolean;
179
- };
180
174
  }
181
175
  export interface TransactionStep {
182
176
  stepId: string;
@@ -243,6 +237,7 @@ export interface FlowDefinition {
243
237
  [key: `prompt_${string}`]: string | undefined;
244
238
  description: string;
245
239
  version: string;
240
+ primary?: boolean;
246
241
  interruptable?: boolean;
247
242
  steps: FlowStep[];
248
243
  variables?: Record<string, {
@@ -460,6 +455,8 @@ export declare class WorkflowEngine implements Engine {
460
455
  * @param language - Optional language code for localization
461
456
  * @param messageRegistry - Optional message registry for custom messages
462
457
  * @param guidanceConfig - Optional guidance configuration for AI interactions
458
+ * @example
459
+ * const engine = new WorkflowEngine(logger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS);
463
460
  */
464
461
  constructor(hostLogger: Logger, aiCallback: AiCallbackFunction, flowsMenu: FlowDefinition[], toolsRegistry: ToolDefinition[], APPROVED_FUNCTIONS: ApprovedFunctions, globalVariables?: Record<string, unknown>, // Optional global variables shared across all new flows
465
462
  validateOnInit?: boolean, language?: string, messageRegistry?: MessageRegistry, guidanceConfig?: GuidanceConfig);
@@ -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;CAChC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAG/D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,M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IAM9B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,2BAA2B;CAKrC"}
package/dist/index.js CHANGED
@@ -2095,7 +2095,11 @@ async function getFlowForInput(input, engine) {
2095
2095
  logger.warn("No flows available in the menu");
2096
2096
  return null;
2097
2097
  }
2098
- // First try direct name or id matching (case-insensitive)
2098
+ // Filter to only primary flows for AI intent detection
2099
+ const primaryFlows = flowsMenu.filter(flow => flow.primary === true);
2100
+ const flowsForIntentDetection = primaryFlows.length > 0 ? primaryFlows : flowsMenu;
2101
+ logger.debug(`Using ${flowsForIntentDetection.length} flows for intent detection (${primaryFlows.length} primary flows available)`);
2102
+ // First try direct name or id matching (case-insensitive) - check all flows
2099
2103
  const directMatch = flowsMenu.find(flow => flow.name.toLowerCase() === input.toLowerCase() || (flow.id.toLowerCase() === input.toLowerCase()));
2100
2104
  if (directMatch) {
2101
2105
  logger.info(`Direct flow name/id match found: ${directMatch.name} (${directMatch.id})`);
@@ -2106,7 +2110,7 @@ async function getFlowForInput(input, engine) {
2106
2110
  logger.info(`No flow matched for input: "${input}" (no AI)`);
2107
2111
  return null;
2108
2112
  }
2109
- // If AI callback is present, use AI for intent detection
2113
+ // If AI callback is present, use AI for intent detection with primary flows only
2110
2114
  const task = "Considering the chat history when available and applicable, decide if the user input should trigger any available flow.";
2111
2115
  const rules = `- Return the exact flow name if a match is found
2112
2116
  - Return "None" if no workflow applies
@@ -2122,7 +2126,7 @@ async function getFlowForInput(input, engine) {
2122
2126
  </chat-history>\n\n`;
2123
2127
  }
2124
2128
  try {
2125
- const aiResponse = await fetchAiTask(task, rules, context, input, flowsMenu, undefined, engine.aiCallback);
2129
+ const aiResponse = await fetchAiTask(task, rules, context, input, flowsForIntentDetection, undefined, engine.aiCallback);
2126
2130
  if (aiResponse && aiResponse !== 'None' && aiResponse !== 'null') {
2127
2131
  const flow = flowsMenu.find(flow => flow.name.toLowerCase() === aiResponse.toLowerCase() || flow.id === aiResponse);
2128
2132
  if (flow) {
@@ -2421,9 +2425,9 @@ async function shouldRetryStep(step, error, currentFlowFrame, engine) {
2421
2425
  case 'skip':
2422
2426
  case 'fallback':
2423
2427
  return false;
2424
- case 'ask_user':
2425
- // TODO: Implement user confirmation for retry
2426
- return true;
2428
+ default:
2429
+ logger.warn(`Unknown retry action "${condition.action}" for step ${step.id}`);
2430
+ return false;
2427
2431
  }
2428
2432
  }
2429
2433
  }
@@ -2454,11 +2458,6 @@ async function retryCurrentStep(step, error, currentFlowFrame, engine) {
2454
2458
  const delay = Math.min(1000 * Math.pow(2, currentRetryCount), 30000); // Max 30 seconds
2455
2459
  await new Promise(resolve => setTimeout(resolve, delay));
2456
2460
  }
2457
- // Show progressive help if enabled
2458
- if (step.retryBehavior?.showProgressiveHelp && step.retryCount > 1) {
2459
- const helpMessage = generateProgressiveHelpMessage(step, error, step.retryCount);
2460
- addToContextStack(currentFlowFrame.contextStack, 'system', helpMessage, step.id + '-retry-help');
2461
- }
2462
2461
  // Put the step back on the stack for retry
2463
2462
  currentFlowFrame.flowStepsStack.push(step);
2464
2463
  return `Retrying ${step.tool} (attempt ${step.retryCount})...`;
@@ -4019,21 +4018,27 @@ function evaluateExpression(expression, variables = {}, contextStack = [], optio
4019
4018
  return expression;
4020
4019
  }
4021
4020
  // Simple regex to find {{expression}} patterns
4022
- const expressionRegex = /\{\{([^}]+)\}\}/g;
4021
+ //const expressionRegex = /\{\{([^}]+)\}\}/g;
4022
+ // Above does not allow inner curly braces, so we use a more permissive regex
4023
+ const expressionRegex = /\{\{([\s\S]*?)\}\}/g;
4023
4024
  // Create evaluation context by merging all available variables
4024
4025
  const context = createSimplifiedEvaluationContext(variables, contextStack, engine);
4025
4026
  // Check if the entire expression is a single interpolation
4026
- const singleExpressionMatch = expression.match(/^\{\{([^}]+)\}\}$/);
4027
- if (singleExpressionMatch) {
4027
+ let singleExpressionMatch = expression.startsWith('{{') && expression.endsWith('}}') ? expression.slice(2, -2).trim() : null;
4028
+ if (singleExpressionMatch || !expression.includes('{{')) {
4029
+ // If no brackets (e.g. CASE condition:) then the whole expression is a single expression - as-if it was {{expression}}
4030
+ if (singleExpressionMatch === null) {
4031
+ singleExpressionMatch = expression;
4032
+ }
4028
4033
  // Single expression - return the evaluated result directly to preserve type
4029
4034
  try {
4030
- const evaluationResult = evaluateJavaScriptExpression(singleExpressionMatch[1].trim(), context);
4035
+ const evaluationResult = evaluateJavaScriptExpression(singleExpressionMatch.trim(), context);
4031
4036
  logger.debug(`Simplified evaluation complete (single): ${expression} -> ${evaluationResult}`);
4032
4037
  return convertReturnType(evaluationResult, opts.returnType);
4033
4038
  }
4034
4039
  catch (error) {
4035
4040
  const errorMessage = error instanceof Error ? error.message : 'Unknown error';
4036
- logger.warn(`Single expression evaluation failed: ${singleExpressionMatch[1]} - ${errorMessage}`);
4041
+ logger.warn(`Single expression evaluation failed: ${singleExpressionMatch} - ${errorMessage}`);
4037
4042
  return opts.returnType === 'boolean' ? false : `[error: ${expression}]`;
4038
4043
  }
4039
4044
  }
@@ -4041,7 +4046,9 @@ function evaluateExpression(expression, variables = {}, contextStack = [], optio
4041
4046
  const result = expression.replace(expressionRegex, (match, expr) => {
4042
4047
  try {
4043
4048
  // Direct JavaScript evaluation with injected variables
4049
+ logger.debug(`Evaluating expression: ${expr.trim()}`);
4044
4050
  const evaluationResult = evaluateJavaScriptExpression(expr.trim(), context);
4051
+ logger.debug(`Expression evaluated: ${expr.trim()} -> ${evaluationResult}`);
4045
4052
  return String(evaluationResult);
4046
4053
  }
4047
4054
  catch (error) {
@@ -4196,9 +4203,17 @@ function setUserInputVariable(variables, key, value, sanitize = true) {
4196
4203
  * Maintains backward compatibility with existing code
4197
4204
  */
4198
4205
  function interpolateMessage(template, contextStack, variables = {}, engine) {
4199
- logger.debug(`Interpolating message template: ${template} with variables: ${JSON.stringify(variables)}`);
4200
- if (!template)
4206
+ if (!template) {
4207
+ logger.warn(`Empty template provided for interpolation`);
4201
4208
  return template;
4209
+ }
4210
+ if (template.includes("{{") && template.includes("}}")) {
4211
+ logger.debug(`Interpolating message template: ${template} with variables: ${JSON.stringify(variables)}`);
4212
+ }
4213
+ else {
4214
+ logger.debug(`No template placeholders found in: ${template}`);
4215
+ return template; // No interpolation needed
4216
+ }
4202
4217
  // For template interpolation, we should NOT apply security restrictions
4203
4218
  // Templates are developer-controlled, not user input
4204
4219
  const result = evaluateExpression(template, variables, contextStack, {
@@ -4693,6 +4708,8 @@ export class WorkflowEngine {
4693
4708
  * @param language - Optional language code for localization
4694
4709
  * @param messageRegistry - Optional message registry for custom messages
4695
4710
  * @param guidanceConfig - Optional guidance configuration for AI interactions
4711
+ * @example
4712
+ * const engine = new WorkflowEngine(logger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS);
4696
4713
  */
4697
4714
  constructor(hostLogger, aiCallback, flowsMenu, toolsRegistry, APPROVED_FUNCTIONS, globalVariables, // Optional global variables shared across all new flows
4698
4715
  validateOnInit, language, messageRegistry, guidanceConfig) {
@@ -5089,6 +5106,7 @@ export class WorkflowEngine {
5089
5106
  state.errors.push(`Flow not found: ${flowName}`);
5090
5107
  return;
5091
5108
  }
5109
+ logger.info(`Validating flow: ${flowName} (depth: ${state.currentDepth})`);
5092
5110
  // Mark as visited
5093
5111
  state.visitedFlows.add(flowName);
5094
5112
  state.currentDepth++;
@@ -5118,7 +5136,8 @@ export class WorkflowEngine {
5118
5136
  }
5119
5137
  // Validate recursively if deep validation is enabled
5120
5138
  if (opts.deep) {
5121
- const calledFlows = state.flowCallGraph.get(flowName) || [];
5139
+ const calledFlows = state.flowCallGraph.get(flowDef.id) || [];
5140
+ logger.debug(`πŸ” Processing call graph for "${flowDef.id}": [${calledFlows.join(', ')}]`);
5122
5141
  for (const calledFlow of calledFlows) {
5123
5142
  this._validateFlowRecursive(calledFlow, state, opts);
5124
5143
  }
@@ -5400,11 +5419,15 @@ export class WorkflowEngine {
5400
5419
  state.errors.push(`FLOW step "${step.id}" in flow "${flowDef.name}" missing required "value" field`);
5401
5420
  return;
5402
5421
  }
5403
- // Add to call graph
5404
- const calledFlows = state.flowCallGraph.get(flowDef.name) || [];
5405
- if (!calledFlows.includes(step.value)) {
5406
- calledFlows.push(step.value);
5407
- state.flowCallGraph.set(flowDef.name, calledFlows);
5422
+ // Find the target flow to get its ID for consistent call graph storage
5423
+ const targetFlow = this.flowsMenu.find((f) => f.id === step.value || f.name === step.value);
5424
+ const targetFlowId = targetFlow ? targetFlow.id : step.value; // Fallback to step.value if not found
5425
+ // Add to call graph - use flow IDs for consistency
5426
+ const calledFlows = state.flowCallGraph.get(flowDef.id) || [];
5427
+ if (!calledFlows.includes(targetFlowId)) {
5428
+ calledFlows.push(targetFlowId);
5429
+ state.flowCallGraph.set(flowDef.id, calledFlows);
5430
+ logger.debug(`πŸ“ž Added flow "${targetFlowId}" to call graph for "${flowDef.id}"`);
5408
5431
  }
5409
5432
  // Validate callType if present
5410
5433
  if (step.callType && !['call', 'replace', 'reboot'].includes(step.callType)) {
@@ -5511,12 +5534,16 @@ export class WorkflowEngine {
5511
5534
  }
5512
5535
  }
5513
5536
  logger.info(`πŸ”— Found ${referencedSubFlows.size} flows referenced as sub-flows: [${Array.from(referencedSubFlows).join(', ')}]`);
5514
- // PHASE 2: Validate only top-level flows (not referenced as sub-flows)
5515
- logger.info('πŸ” Phase 2: Validating top-level flows...');
5537
+ // PHASE 2: Validate primary flows and referenced flows
5538
+ logger.info('πŸ” Phase 2: Validating primary flows...');
5516
5539
  for (const flow of this.flowsMenu) {
5517
- if (referencedSubFlows.has(flow.name) || referencedSubFlows.has(flow.id)) {
5518
- // Skip validation of sub-flows - they'll be validated in parent context
5519
- logger.info(`⏭️ Skipping sub-flow "${flow.name}" - will be validated in parent context`);
5540
+ // Only validate flows marked as primary: true, or if no flows are marked as primary, validate all unreferenced flows
5541
+ const hasPrimaryFlows = this.flowsMenu.some(f => f.primary === true);
5542
+ const shouldValidate = hasPrimaryFlows ? flow.primary === true : !(referencedSubFlows.has(flow.name) || referencedSubFlows.has(flow.id));
5543
+ if (!shouldValidate) {
5544
+ // Skip validation of non-primary flows when primary flows exist
5545
+ const reason = hasPrimaryFlows ? 'Non-primary flow - validated in context' : 'Sub-flow - validated in parent context';
5546
+ logger.info(`⏭️ Skipping ${hasPrimaryFlows ? 'non-primary' : 'sub'}-flow "${flow.name}" - ${reason.toLowerCase()}`);
5520
5547
  results.skippedSubFlows.push(flow.name);
5521
5548
  // Add placeholder result for tracking
5522
5549
  results.flowResults.push({
@@ -5525,12 +5552,12 @@ export class WorkflowEngine {
5525
5552
  errors: [],
5526
5553
  warnings: [],
5527
5554
  skipped: true,
5528
- skipReason: 'Sub-flow - validated in parent context'
5555
+ skipReason: reason
5529
5556
  });
5530
5557
  results.validFlows++;
5531
5558
  continue;
5532
5559
  }
5533
- logger.info(`πŸ” Validating top-level flow "${flow.name}"...`);
5560
+ logger.info(`πŸ” Validating ${hasPrimaryFlows ? 'primary' : 'top-level'} flow "${flow.name}"...`);
5534
5561
  // Create isolated validation state for each flow
5535
5562
  const result = this.validateFlow(flow.name, options);
5536
5563
  results.flowResults.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
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",