MCPcopy Create free account
hub / github.com/continuedev/continue / processAndOutputResponse

Function processAndOutputResponse

extensions/cli/src/commands/chat.ts:197–219  ·  view source on GitHub ↗
(
  finalResponse: string,
  isHeadless: boolean,
  silent?: boolean,
  format?: "json",
)

Source from the content-addressed store, hash-verified

195
196// Helper function to process and output response in headless mode
197function processAndOutputResponse(
198 finalResponse: string,
199 isHeadless: boolean,
200 silent?: boolean,
201 format?: "json",
202): void {
203 if (isHeadless && finalResponse && finalResponse.trim()) {
204 let processedResponse = finalResponse;
205
206 // Strip think tags if --silent flag is enabled
207 if (silent) {
208 processedResponse = stripThinkTags(processedResponse);
209 }
210
211 // Process output based on format
212 const outputResponse =
213 format === "json"
214 ? processJsonOutput(processedResponse)
215 : processedResponse;
216
217 safeStdout(outputResponse + "\n");
218 }
219}
220
221// Helper function to handle auto-compaction for headless mode
222async function handleAutoCompaction(

Callers 1

processMessageFunction · 0.85

Calls 3

processJsonOutputFunction · 0.85
safeStdoutFunction · 0.85
stripThinkTagsFunction · 0.70

Tested by

no test coverage detected