@@ -6,6 +6,7 @@ import { readFileSync, existsSync, readdirSync, unlinkSync, promises as fsPromis
66import { join } from 'path' ;
77import { homedir } from 'os' ;
88import { executeCliTool } from '../../tools/cli-executor.js' ;
9+ import { SmartContentFormatter } from '../../tools/cli-output-converter.js' ;
910import type { RouteContext } from './types.js' ;
1011
1112interface ParsedRuleFrontmatter {
@@ -662,8 +663,8 @@ FILE NAME: ${fileName}`;
662663 // Create onOutput callback for real-time streaming
663664 const onOutput = broadcastToClients
664665 ? ( unit : import ( '../../tools/cli-output-converter.js' ) . CliOutputUnit ) => {
665- // CliOutputUnit handler: convert to string content for broadcast
666- const content = typeof unit . content === 'string' ? unit . content : JSON . stringify ( unit . content ) ;
666+ // CliOutputUnit handler: use SmartContentFormatter for intelligent formatting
667+ const content = SmartContentFormatter . format ( unit . content , unit . type ) || JSON . stringify ( unit . content ) ;
667668 broadcastToClients ( {
668669 type : 'CLI_OUTPUT' ,
669670 payload : {
@@ -749,8 +750,8 @@ FILE NAME: ${fileName}`;
749750 // Create onOutput callback for review step
750751 const reviewOnOutput = broadcastToClients
751752 ? ( unit : import ( '../../tools/cli-output-converter.js' ) . CliOutputUnit ) => {
752- // CliOutputUnit handler: convert to string content for broadcast
753- const content = typeof unit . content === 'string' ? unit . content : JSON . stringify ( unit . content ) ;
753+ // CliOutputUnit handler: use SmartContentFormatter for intelligent formatting
754+ const content = SmartContentFormatter . format ( unit . content , unit . type ) || JSON . stringify ( unit . content ) ;
754755 broadcastToClients ( {
755756 type : 'CLI_OUTPUT' ,
756757 payload : {
0 commit comments