@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.
- package/bin/toothfairy.js +59 -23
- 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
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
//
|
|
298
|
-
if (text && type === 'response') {
|
|
299
|
-
//
|
|
300
|
-
|
|
301
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|