@toothfairyai/cli 1.0.7 β†’ 1.0.8

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 +59 -23
  2. package/package.json +1 -1
package/bin/toothfairy.js CHANGED
@@ -244,18 +244,51 @@ program
244
244
  let finalResponse = null;
245
245
  let processingStatus = null;
246
246
 
247
- const formatStatusMessage = (status) => {
248
- const statusMessages = {
249
- connected: 'πŸ”— Connected to streaming server',
250
- init: 'πŸš€ Initializing agent...',
251
- initial_setup_completed: 'βœ… Agent setup completed',
252
- tools_processing_completed: 'πŸ› οΈ Tools processing finished',
253
- replying: 'πŸ’­ Agent is thinking and responding...',
254
- updating_memory: 'πŸ’Ύ Updating conversation memory...',
255
- memory_updated: 'βœ… Memory updated successfully',
256
- complete: 'πŸŽ‰ Response complete!',
257
- };
258
- return statusMessages[status] || `πŸ“Š Status: ${status}`;
247
+ const mapStateWithLabel = (state) => {
248
+ switch (state) {
249
+ case 'data_processing_completed':
250
+ return 'πŸ“Š **Retrieving data**';
251
+ case 'tools_processing_completed':
252
+ return 'πŸ› οΈ **Choosing tools**';
253
+ case 'replying':
254
+ return '🧚 **Responding**';
255
+ case 'main_generation_completed':
256
+ return '✨ **Generation completed**';
257
+ case 'memory_updated':
258
+ return 'πŸ’Ύ Memory updated';
259
+ case 'updating_memory':
260
+ return 'πŸ’Ύ Updating memory...';
261
+ case 'init':
262
+ return 'πŸš€ Initializing...';
263
+ case 'initial_setup_completed':
264
+ return 'βœ… Setup completed';
265
+ case 'image_analysis_in_progress':
266
+ return 'πŸ–ΌοΈ Analyzing image...';
267
+ case 'video_analysis_in_progress':
268
+ return 'πŸŽ₯ Analyzing video...';
269
+ case 'audio_analysis_in_progress':
270
+ return '🎡 Analyzing audio...';
271
+ case 'image_generation_in_progress':
272
+ return '🎨 Generating image...';
273
+ case 'video_generation_in_progress':
274
+ return '🎬 Generating video...';
275
+ case '3D_model_generation_in_progress':
276
+ return 'πŸ—οΈ Creating 3D model...';
277
+ case 'code_generation_in_progress':
278
+ return 'πŸ’» Generating code...';
279
+ case 'code_execution_in_progress':
280
+ return '⚑ Executing code...';
281
+ case 'internet_search_in_progress':
282
+ return 'πŸ” Searching internet...';
283
+ case 'planning_in_progress':
284
+ return 'πŸ—ΊοΈ Planning response...';
285
+ case 'handed_off_to_human':
286
+ return 'πŸ‘€ Handed off to human';
287
+ case 'completed':
288
+ return 'πŸŽ‰ Completed';
289
+ default:
290
+ return `πŸ“Š ${state}`;
291
+ }
259
292
  };
260
293
 
261
294
  if (options.output === 'json') {
@@ -287,18 +320,22 @@ program
287
320
  // Text mode: show live streaming
288
321
  let currentSpinner = null;
289
322
 
290
- // Function to update display
291
- const updateDisplay = (text, type = 'response') => {
323
+ // Function to update display with status filtering
324
+ const updateDisplay = (text, agentStatus, type = 'response') => {
292
325
  if (currentSpinner) {
293
326
  currentSpinner.stop();
294
327
  currentSpinner = null;
295
328
  }
296
329
 
297
- // Clear previous lines if we're updating the same response
298
- if (text && type === 'response') {
299
- // For real-time streaming, we overwrite the current line
300
- process.stdout.write('\r\x1b[K'); // Clear current line
301
- process.stdout.write(chalk.green('🧚 Response: ') + text);
330
+ // Only show text when agent is actually replying
331
+ if (text && type === 'response' && agentStatus === 'replying') {
332
+ // Check if text is actually new/different
333
+ if (text !== currentText) {
334
+ // For real-time streaming, we overwrite the current line
335
+ process.stdout.write('\r\x1b[K'); // Clear current line
336
+ process.stdout.write(chalk.green('🧚 Response: ') + text);
337
+ currentText = text;
338
+ }
302
339
  }
303
340
  };
304
341
 
@@ -344,7 +381,7 @@ program
344
381
  if (newStatus && newStatus !== processingStatus) {
345
382
  processingStatus = newStatus;
346
383
  if (options.showProgress) {
347
- const statusMsg = formatStatusMessage(processingStatus);
384
+ const statusMsg = mapStateWithLabel(processingStatus);
348
385
  if (currentSpinner) {
349
386
  currentSpinner.stop();
350
387
  }
@@ -352,10 +389,9 @@ program
352
389
  }
353
390
  }
354
391
  } else if (eventType === 'data') {
355
- // Streaming text data
392
+ // Streaming text data - pass current agent status for filtering
356
393
  if (eventData.text) {
357
- currentText = eventData.text;
358
- updateDisplay(currentText.trim());
394
+ updateDisplay(eventData.text.trim(), processingStatus);
359
395
  }
360
396
  } else if (eventType === 'complete') {
361
397
  // Final response with all metadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toothfairyai/cli",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Command-line interface for ToothFairy AI API",
5
5
  "main": "index.js",
6
6
  "bin": {