sapper-iq 1.0.20 → 1.0.21
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/package.json +1 -1
- package/sapper.mjs +3 -1
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -202,7 +202,9 @@ WORKFLOW:
|
|
|
202
202
|
console.log();
|
|
203
203
|
messages.push({ role: 'assistant', content: msg });
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
// Fixed regex: .+? (non-greedy) stops correctly before [/TOOL]
|
|
206
|
+
// Old regex [^\]\n]+ was broken - it stopped at ] which is at END of [/TOOL]
|
|
207
|
+
const toolMatches = [...msg.matchAll(/\[TOOL:(\w+)\](.+?)(?:\]([\s\S]*?))?\[\/TOOL\]/g)];
|
|
206
208
|
|
|
207
209
|
if (toolMatches.length > 0) {
|
|
208
210
|
for (const match of toolMatches) {
|