Skip to content

Class: FilesystemCache

WHERE — store/retrieve installed deps.

v1.0: fully async. All four methods may do filesystem / network IO (FilesystemCache uses fs/promises; Redis/HTTP caches are inherently async). Hot path concerns about prompt-building are addressed by caching results in-memory at higher layers, not by sync IO.

Implements

Constructors

Constructor

new FilesystemCache(baseDir): FilesystemCache;

Parameters

Parameter Type
baseDir string

Returns

FilesystemCache

Properties

baseDir

readonly baseDir: string;

Methods

has()

has(scope, key): Promise<boolean>;

Parameters

Parameter Type
scope string
key string

Returns

Promise\<boolean>

Implementation of

CachePort.has


loadAll()

loadAll(scope, readers?): Promise<Record<string, unknown>[]>;

Parameters

Parameter Type
scope string
readers? ReaderPort[]

Returns

Promise\<Record\<string, unknown>[]>

Implementation of

CachePort.loadAll


loadKey()

loadKey(
   scope, 
   key, 
readers?): Promise<Record<string, unknown>[]>;

Parameters

Parameter Type
scope string
key string
readers? ReaderPort[]

Returns

Promise\<Record\<string, unknown>[]>

Implementation of

CachePort.loadKey


store()

store(
   scope, 
   key, 
items): Promise<void>;

Parameters

Parameter Type
scope string
key string
items CacheItem[]

Returns

Promise\<void>

Implementation of

CachePort.store