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

Method decompressFile

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

Source from the content-addressed store, hash-verified

364 }
365
366 async decompressFile(
367 path: string,
368 destination?: string
369 ): Promise<StateCompressionResult> {
370 const dest = destination ?? path.replace(/\.gz$/i, "");
371 const bytes = await gunzipBytes(await this.readFileBytes(path));
372 await this.writeFileBytes(dest, bytes);
373 return { path, destination: dest, bytesWritten: bytes.byteLength };
374 }
375
376 async hashFile(path: string, options?: StateHashOptions): Promise<string> {
377 return hashBytes(await this.readFileBytes(path), options);

Callers

nothing calls this directly

Calls 4

readFileBytesMethod · 0.95
writeFileBytesMethod · 0.95
gunzipBytesFunction · 0.90
replaceMethod · 0.65

Tested by

no test coverage detected