|
@@ -120,6 +120,8 @@
|
|
|
|
|
|
const extractInputVariables = (text: string): Record<string, any> => {
|
|
|
const regex = /{{\s*([^|}\s]+)\s*\|\s*([^}]+)\s*}}/g;
|
|
|
+ const regularRegex = /{{\s*([^|}\s]+)\s*}}/g;
|
|
|
+
|
|
|
const variables: Record<string, any> = {};
|
|
|
let match;
|
|
|
|
|
@@ -130,6 +132,16 @@
|
|
|
variables[varName] = parseVariableDefinition(definition);
|
|
|
}
|
|
|
|
|
|
+ // Then, extract regular variables (without pipe) - only if not already processed
|
|
|
+ while ((match = regularRegex.exec(text)) !== null) {
|
|
|
+ const varName = match[1].trim();
|
|
|
+
|
|
|
+ // Only add if not already processed as custom variable
|
|
|
+ if (!variables.hasOwnProperty(varName)) {
|
|
|
+ variables[varName] = { type: 'text' }; // Default type for regular variables
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return variables;
|
|
|
};
|
|
|
|