* Output a ClineMessage based on its type. * This is the main entry point for message output. * * @param msg - The message to output * @param skipFirstUserMessage - If true, skip the first "text" message (user prompt echo)
(msg: ClineMessage, skipFirstUserMessage = true)
| 123 | * @param skipFirstUserMessage - If true, skip the first "text" message (user prompt echo) |
| 124 | */ |
| 125 | outputMessage(msg: ClineMessage, skipFirstUserMessage = true): void { |
| 126 | const ts = msg.ts |
| 127 | const text = msg.text || "" |
| 128 | const isPartial = msg.partial === true |
| 129 | const previousDisplay = this.displayedMessages.get(ts) |
| 130 | const alreadyDisplayedComplete = previousDisplay && !previousDisplay.partial |
| 131 | |
| 132 | if (msg.type === "say" && msg.say) { |
| 133 | this.outputSayMessage(ts, msg.say, text, isPartial, alreadyDisplayedComplete, skipFirstUserMessage) |
| 134 | } else if (msg.type === "ask" && msg.ask) { |
| 135 | // For ask messages, we only output command_output here |
| 136 | // Other asks are handled by AskDispatcher |
| 137 | if (msg.ask === "command_output") { |
| 138 | this.outputCommandOutput(ts, text, isPartial, alreadyDisplayedComplete) |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Output a simple text line with a label. |
no test coverage detected