sapper-iq 1.0.16 → 1.0.17
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 +9 -7
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -212,27 +212,29 @@ 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
|
+
// Warn if too many tools
|
|
216
216
|
if (toolMatches.length > 10) {
|
|
217
|
-
console.log(chalk.yellow('\n⚠️ Too many tool calls
|
|
218
|
-
active = false;
|
|
217
|
+
console.log(chalk.yellow('\n⚠️ Too many tool calls! Read 2-3 files, then analyze.'));
|
|
219
218
|
}
|
|
220
219
|
} else {
|
|
221
|
-
// No tools
|
|
220
|
+
// No tools - check for malformed commands
|
|
222
221
|
if (msg.includes('[TOOL:') && msg.includes('[/]')) {
|
|
223
|
-
console.log(chalk.red('\n❌ Malformed tool
|
|
222
|
+
console.log(chalk.red('\n❌ Malformed tool: Use [TOOL:TYPE]path[/TOOL]'));
|
|
224
223
|
messages.push({
|
|
225
224
|
role: 'user',
|
|
226
|
-
content: 'ERROR:
|
|
225
|
+
content: 'ERROR: Tool format wrong! Use [TOOL:TYPE]path[/TOOL]'
|
|
227
226
|
});
|
|
228
227
|
} else {
|
|
229
|
-
// Normal response
|
|
228
|
+
// Normal response - save and continue
|
|
230
229
|
fs.writeFileSync(CONTEXT_FILE, JSON.stringify(messages));
|
|
231
230
|
active = false;
|
|
232
231
|
}
|
|
233
232
|
}
|
|
234
233
|
}
|
|
235
234
|
ask();
|
|
235
|
+
}).catch((error) => {
|
|
236
|
+
console.error(chalk.red('\n❌ Error in conversation loop:'), error);
|
|
237
|
+
ask(); // Continue despite error
|
|
236
238
|
});
|
|
237
239
|
};
|
|
238
240
|
ask();
|