sapper-iq 1.0.17 → 1.0.19
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 +7 -9
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -212,29 +212,27 @@ Don't keep executing tools endlessly - provide insights after reading!`
|
|
|
212
212
|
}
|
|
213
213
|
fs.writeFileSync(CONTEXT_FILE, JSON.stringify(messages));
|
|
214
214
|
|
|
215
|
-
//
|
|
215
|
+
// Limit tool executions - if too many, warn and exit
|
|
216
216
|
if (toolMatches.length > 10) {
|
|
217
|
-
console.log(chalk.yellow('\n⚠️ Too many tool calls!
|
|
217
|
+
console.log(chalk.yellow('\n⚠️ Too many tool calls in one response! AI should analyze, not just read endlessly.'));
|
|
218
|
+
active = false;
|
|
218
219
|
}
|
|
219
220
|
} else {
|
|
220
|
-
// No tools - check
|
|
221
|
+
// No tools found - check if malformed command
|
|
221
222
|
if (msg.includes('[TOOL:') && msg.includes('[/]')) {
|
|
222
|
-
console.log(chalk.red('\n❌ Malformed tool:
|
|
223
|
+
console.log(chalk.red('\n❌ Malformed tool command detected! Expected format: [TOOL:TYPE]path[/TOOL]'));
|
|
223
224
|
messages.push({
|
|
224
225
|
role: 'user',
|
|
225
|
-
content: 'ERROR:
|
|
226
|
+
content: 'ERROR: Your tool command is malformed. Use [TOOL:TYPE]path]content[/TOOL] or [TOOL:TYPE]path[/TOOL]'
|
|
226
227
|
});
|
|
227
228
|
} else {
|
|
228
|
-
// Normal response - save and
|
|
229
|
+
// Normal response without tools - save context and wait for next input
|
|
229
230
|
fs.writeFileSync(CONTEXT_FILE, JSON.stringify(messages));
|
|
230
231
|
active = false;
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
ask();
|
|
235
|
-
}).catch((error) => {
|
|
236
|
-
console.error(chalk.red('\n❌ Error in conversation loop:'), error);
|
|
237
|
-
ask(); // Continue despite error
|
|
238
236
|
});
|
|
239
237
|
};
|
|
240
238
|
ask();
|