@toothfairyai/cli 1.0.9 → 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 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) {
@@ -329,12 +330,17 @@ program
329
330
 
330
331
  // Only show text when agent is actually replying
331
332
  if (text && type === 'response' && agentStatus === 'replying') {
332
- // Check if text is actually new/different
333
- if (text !== currentText) {
333
+ const trimmedText = text.trim();
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)) {
334
339
  // For real-time streaming, we overwrite the current line
335
340
  process.stdout.write('\r\x1b[K'); // Clear current line
336
- process.stdout.write(chalk.green('🧚 Response: ') + text.trim());
337
- currentText = text;
341
+ process.stdout.write(chalk.green('🧚 Response: ') + trimmedText);
342
+ currentText = trimmedText;
343
+ lastUpdateTime = now;
338
344
  }
339
345
  }
340
346
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toothfairyai/cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Command-line interface for ToothFairy AI API",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/api.js CHANGED
@@ -318,7 +318,9 @@ class ToothFairyAPI {
318
318
  };
319
319
 
320
320
  const createdChat = await this.createChat(chatData);
321
- console.debug(`Chat created: ${createdChat.id}`);
321
+ if (this.verbose) {
322
+ console.debug(`Chat created: ${createdChat.id}`);
323
+ }
322
324
 
323
325
  // Create message
324
326
  const messageData = {
@@ -328,7 +330,9 @@ class ToothFairyAPI {
328
330
  userID: 'CLI',
329
331
  };
330
332
  const createdMessage = await this.createMessage(messageData);
331
- console.debug(`Message created: ${createdMessage.id}`);
333
+ if (this.verbose) {
334
+ console.debug(`Message created: ${createdMessage.id}`);
335
+ }
332
336
 
333
337
  // Prepare agent data for streaming
334
338
  const agentData = {