mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat(cli): add agent_message type for precise --final output filtering
Introduce dedicated agent_message IR type to distinguish final AI responses from generic stdout. This enables --final flag to show only agent messages, filtering out all intermediate content (JSONL events, reasoning, tool calls). Changes: - Add agent_message type to CliOutputUnitType - Update JsonLinesParser to map final responses from all tools (codex, gemini, claude, opencode) to agent_message type - Add final_output field to database schema with migration - Update getCachedOutput and getConversation to return finalOutput - Prefer finalOutput in outputAction for --final flag Fixes issue where --final showed raw JSONL instead of filtered content.
This commit is contained in:
@@ -85,6 +85,7 @@ export interface ExecutionRecord {
|
||||
truncated: boolean;
|
||||
};
|
||||
parsedOutput?: string; // Extracted clean text from structured output units
|
||||
finalOutput?: string; // Agent message only (for --final flag)
|
||||
}
|
||||
|
||||
interface HistoryIndex {
|
||||
@@ -109,6 +110,7 @@ export interface ExecutionOutput {
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
parsedOutput?: string; // Extracted text from stream JSON response
|
||||
finalOutput?: string; // Agent message only (for --final flag)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user