@toothfairyai/cli 1.0.10 → 1.0.11
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/bin/toothfairy.js +7 -2
- package/package.json +1 -1
package/bin/toothfairy.js
CHANGED
|
@@ -243,6 +243,7 @@ program
|
|
|
243
243
|
let currentText = '';
|
|
244
244
|
let finalResponse = null;
|
|
245
245
|
let processingStatus = null;
|
|
246
|
+
let lastUpdateTime = 0;
|
|
246
247
|
|
|
247
248
|
const mapStateWithLabel = (state) => {
|
|
248
249
|
switch (state) {
|
|
@@ -330,12 +331,16 @@ program
|
|
|
330
331
|
// Only show text when agent is actually replying
|
|
331
332
|
if (text && type === 'response' && agentStatus === 'replying') {
|
|
332
333
|
const trimmedText = text.trim();
|
|
333
|
-
|
|
334
|
-
|
|
334
|
+
const now = Date.now();
|
|
335
|
+
|
|
336
|
+
// Only update if the text is actually different and enough time has passed
|
|
337
|
+
// This prevents rapid duplicate updates
|
|
338
|
+
if (trimmedText !== currentText && (now - lastUpdateTime > 50)) {
|
|
335
339
|
// For real-time streaming, we overwrite the current line
|
|
336
340
|
process.stdout.write('\r\x1b[K'); // Clear current line
|
|
337
341
|
process.stdout.write(chalk.green('🧚 Response: ') + trimmedText);
|
|
338
342
|
currentText = trimmedText;
|
|
343
|
+
lastUpdateTime = now;
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
346
|
};
|