MCPcopy
hub / github.com/coder/mux / stripEncryptedContent

Function stripEncryptedContent

src/node/services/streamManager.ts:302–323  ·  view source on GitHub ↗
(output: unknown)

Source from the content-addressed store, hash-verified

300}
301
302export function stripEncryptedContent(output: unknown): unknown {
303 if (Array.isArray(output)) {
304 return stripEncryptedContentFromArray(output);
305 }
306
307 // Handle SDK json output shape: { type: "json", value: unknown[] }
308 if (
309 typeof output === "object" &&
310 output !== null &&
311 "type" in output &&
312 output.type === "json" &&
313 "value" in output &&
314 Array.isArray(output.value)
315 ) {
316 return {
317 ...output,
318 value: stripEncryptedContentFromArray(output.value),
319 };
320 }
321
322 return output;
323}
324
325const MAX_ORPHAN_TOOL_RESULT_WARNINGS_PER_STREAM = 3;
326const ORPHAN_TOOL_RESULT_PREVIEW_CHARS = 160;

Callers 2

Calls 1

Tested by

no test coverage detected