From 7f3033b1c1d1b629557a49498a4ff186057af5f9 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 11 Jan 2026 21:17:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=99=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20CLI=20=E8=BE=93=E5=87=BA=E5=86=85=E5=AE=B9=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ccw/src/commands/cli.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ccw/src/commands/cli.ts b/ccw/src/commands/cli.ts index 25d3bf13..112d1549 100644 --- a/ccw/src/commands/cli.ts +++ b/ccw/src/commands/cli.ts @@ -7,6 +7,7 @@ import chalk from 'chalk'; import http from 'http'; import inquirer from 'inquirer'; import type { CliOutputUnit } from '../tools/cli-output-converter.js'; +import { SmartContentFormatter } from '../tools/cli-output-converter.js'; import { cliExecutorTool, getCliToolsStatus, @@ -793,11 +794,12 @@ async function execAction(positionalPrompt: string | undefined, options: CliExec // Always broadcast to dashboard for real-time viewing // Note: /api/hook wraps extraData into payload, so send fields directly // Maintain backward compatibility with frontend expecting { chunkType, data } - const content = typeof unit.content === 'string' ? unit.content : JSON.stringify(unit.content); + // Use SmartContentFormatter for intelligent content formatting + const content = SmartContentFormatter.format(unit.content, unit.type) || JSON.stringify(unit.content); broadcastStreamEvent('CLI_OUTPUT', { executionId, chunkType: unit.type, // For backward compatibility - data: content, // For backward compatibility + data: content, // For backward compatibility (now formatted) unit // New structured format });