MCPcopy Create free account
hub / github.com/cloudflare/agents / compressFile

Method compressFile

packages/shell/src/memory.ts:356–364  ·  view source on GitHub ↗
(
    path: string,
    destination?: string
  )

Source from the content-addressed store, hash-verified

354 }
355
356 async compressFile(
357 path: string,
358 destination?: string
359 ): Promise<StateCompressionResult> {
360 const dest = destination ?? `${path}.gz`;
361 const bytes = await gzipBytes(await this.readFileBytes(path));
362 await this.writeFileBytes(dest, bytes);
363 return { path, destination: dest, bytesWritten: bytes.byteLength };
364 }
365
366 async decompressFile(
367 path: string,

Callers

nothing calls this directly

Calls 3

readFileBytesMethod · 0.95
writeFileBytesMethod · 0.95
gzipBytesFunction · 0.90

Tested by

no test coverage detected