@toothfairyai/cli 1.0.12 → 1.0.13

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.
Files changed (2) hide show
  1. package/bin/toothfairy.js +11 -17
  2. package/package.json +1 -1
package/bin/toothfairy.js CHANGED
@@ -244,6 +244,7 @@ program
244
244
  let finalResponse = null;
245
245
  let processingStatus = null;
246
246
  let lastUpdateTime = 0;
247
+ let hasStartedResponse = false;
247
248
 
248
249
  const mapStateWithLabel = (state) => {
249
250
  switch (state) {
@@ -322,11 +323,7 @@ program
322
323
  let currentSpinner = null;
323
324
 
324
325
  // Function to update display with status filtering
325
- const updateDisplay = (
326
- text,
327
- agentStatus,
328
- type = 'response'
329
- ) => {
326
+ const updateDisplay = (text, agentStatus, type = 'response') => {
330
327
  if (currentSpinner) {
331
328
  currentSpinner.stop();
332
329
  currentSpinner = null;
@@ -344,9 +341,13 @@ program
344
341
  trimmedText?.length > currentText?.length &&
345
342
  now - lastUpdateTime > 50
346
343
  ) {
347
- // For real-time streaming, we overwrite the current line
348
- process.stdout.write('\r\x1b[K'); // Clear current line
349
- process.stdout.write(chalk.green('🧚 Response: ') + trimmedText);
344
+ if (!hasStartedResponse) {
345
+ // First time showing response - print header on new line
346
+ console.log(chalk.green('🧚 Responding'));
347
+ hasStartedResponse = true;
348
+ }
349
+ // Stream new text content on new line
350
+ console.log(trimmedText);
350
351
  currentText = trimmedText;
351
352
  lastUpdateTime = now;
352
353
  }
@@ -421,11 +422,7 @@ program
421
422
 
422
423
  // Handle progressive text streaming
423
424
  if (eventData.text && agentStatus === 'replying') {
424
- updateDisplay(
425
- eventData.text,
426
- agentStatus,
427
- 'response'
428
- );
425
+ updateDisplay(eventData.text, agentStatus, 'response');
429
426
  }
430
427
 
431
428
  // Handle fulfilled status (final response)
@@ -437,10 +434,7 @@ program
437
434
  currentSpinner.stop();
438
435
  currentSpinner = null;
439
436
  }
440
- process.stdout.write('\r\x1b[K'); // Clear current line
441
- process.stdout.write(
442
- chalk.blue('🪄 ') + currentText.trim()
443
- );
437
+ console.log(chalk.blue('🪄 Response complete'));
444
438
  }
445
439
  }
446
440
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toothfairyai/cli",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Command-line interface for ToothFairy AI API",
5
5
  "main": "index.js",
6
6
  "bin": {