MCPcopy Index your code
hub / github.com/coder/mux / stripEncryptedContentFromArray

Function stripEncryptedContentFromArray

src/node/services/streamManager.ts:290–300  ·  view source on GitHub ↗

* Strip encryptedContent from web search results to reduce token usage. * The encrypted page content can be massive (4000+ chars per result) and isn't * needed for model context. Keep URL, title, and pageAge for reference.

(output: unknown[])

Source from the content-addressed store, hash-verified

288 * needed for model context. Keep URL, title, and pageAge for reference.
289 */
290function stripEncryptedContentFromArray(output: unknown[]): unknown[] {
291 return output.map((item: unknown) => {
292 if (item && typeof item === "object" && "encryptedContent" in item) {
293 // Remove encryptedContent but keep other fields
294 const { encryptedContent, ...rest } = item as Record<string, unknown>;
295 return rest;
296 }
297
298 return item;
299 });
300}
301
302export function stripEncryptedContent(output: unknown): unknown {
303 if (Array.isArray(output)) {

Callers 1

stripEncryptedContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected