11package cc.unitmesh.agent.render
22
3- /* *
4- * Core renderer interface for CodingAgent
5- * Defines the contract for all renderer implementations
6- */
73interface CodingAgentRenderer {
8- // Lifecycle methods
94 fun renderIterationHeader (current : Int , max : Int )
105 fun renderLLMResponseStart ()
116 fun renderLLMResponseChunk (chunk : String )
127 fun renderLLMResponseEnd ()
138
14- // Tool execution methods
159 fun renderToolCall (toolName : String , paramsStr : String )
16- fun renderToolResult (toolName : String , success : Boolean , output : String? , fullOutput : String? , metadata : Map <String , String > = emptyMap())
10+ fun renderToolResult (
11+ toolName : String ,
12+ success : Boolean ,
13+ output : String? ,
14+ fullOutput : String? ,
15+ metadata : Map <String , String > = emptyMap()
16+ )
1717
18- // Status and completion methods
1918 fun renderTaskComplete ()
2019 fun renderFinalResult (success : Boolean , message : String , iterations : Int )
2120 fun renderError (message : String )
2221 fun renderRepeatWarning (toolName : String , count : Int )
2322
24- // Error recovery methods
2523 fun renderRecoveryAdvice (recoveryAdvice : String )
2624
27- // Policy and permission methods
2825 fun renderUserConfirmationRequest (toolName : String , params : Map <String , Any >)
29-
30- /* *
31- * Add live terminal session (optional, for PTY-enabled platforms)
32- * Default implementation does nothing - override in renderers that support live terminals
33- */
26+
3427 fun addLiveTerminal (
3528 sessionId : String ,
3629 command : String ,
@@ -40,13 +33,3 @@ interface CodingAgentRenderer {
4033 // Default: no-op for renderers that don't support live terminals
4134 }
4235}
43-
44- /* *
45- * Renderer type enumeration for different UI implementations
46- */
47- enum class RendererType {
48- CONSOLE , // Default console output
49- CLI , // Enhanced CLI with colors and formatting
50- TUI , // Terminal UI with interactive elements
51- WEB // Web-based UI
52- }
0 commit comments