|
@@ -84,11 +84,21 @@
|
|
|
let prompt = selectedAction?.prompt ?? '';
|
|
|
let toolIds = [];
|
|
|
|
|
|
+ // Handle: {{variableId|tool:id="toolId"}} pattern
|
|
|
+ // This regex captures variableId and toolId from {{variableId|tool:id="toolId"}}
|
|
|
+ const varToolPattern = /\{\{(.*?)\|tool:id="([^"]+)"\}\}/g;
|
|
|
+ prompt = prompt.replace(varToolPattern, (match, variableId, toolId) => {
|
|
|
+ toolIds.push(toolId);
|
|
|
+ return variableId; // Replace with just variableId
|
|
|
+ });
|
|
|
+
|
|
|
+ // legacy {{TOOL:toolId}} pattern (for backward compatibility)
|
|
|
let toolIdPattern = /\{\{TOOL:([^\}]+)\}\}/g;
|
|
|
let match;
|
|
|
while ((match = toolIdPattern.exec(prompt)) !== null) {
|
|
|
toolIds.push(match[1]);
|
|
|
}
|
|
|
+
|
|
|
// Remove all TOOL placeholders from the prompt
|
|
|
prompt = prompt.replace(toolIdPattern, '');
|
|
|
|