Skip to content

@nogoo9/mcp-server-cloud-fs / cache/filesystem / FilesystemStore

Class: FilesystemStore

Defined in: cache/filesystem.ts:25

Disk-backed cache store using SHA-256 hashed filenames.

Stores cached objects and metadata as pairs of .bin / .meta.json files in the configured directory. Supports TTL-based expiry and debounced flushing.

Implements

Constructors

Constructor

new FilesystemStore(provider, cacheDir, opts): FilesystemStore

Defined in: cache/filesystem.ts:29

Parameters

provider

StorageProvider

cacheDir

string

opts
syncDebounceMs

number

ttlMs

number

Returns

FilesystemStore

Methods

clear()

clear(): Promise<void>

Defined in: cache/filesystem.ts:92

Returns

Promise<void>

Implementation of

CacheStore.clear


delete()

delete(cacheKey): Promise<void>

Defined in: cache/filesystem.ts:84

Parameters

cacheKey

string

Returns

Promise<void>

Implementation of

CacheStore.delete


dirtyEntries()

dirtyEntries(): string[]

Defined in: cache/filesystem.ts:80

Returns

string[]

Implementation of

CacheStore.dirtyEntries


flush()

flush(): Promise<void>

Defined in: cache/filesystem.ts:100

Cancels debounce timer; flushes all dirty entries to provider synchronously.

Returns

Promise<void>

Implementation of

CacheStore.flush


get()

get(cacheKey): Promise<Buffer<ArrayBufferLike> | null>

Defined in: cache/filesystem.ts:45

Returns null on cache miss or TTL expiry. Does NOT call the provider.

Parameters

cacheKey

string

Returns

Promise<Buffer<ArrayBufferLike> | null>

Implementation of

CacheStore.get


isDirty()

isDirty(cacheKey): boolean

Defined in: cache/filesystem.ts:76

Parameters

cacheKey

string

Returns

boolean

Implementation of

CacheStore.isDirty


markDirty()

markDirty(cacheKey, root, key): void

Defined in: cache/filesystem.ts:71

Marks cacheKey dirty and records routing info for flush. Starts debounce timer.

Parameters

cacheKey

string

root

ParsedRoot

key

string

Returns

void

Implementation of

CacheStore.markDirty


set()

set(cacheKey, value): Promise<void>

Defined in: cache/filesystem.ts:62

Stores value with TTL; does NOT mark dirty.

Parameters

cacheKey

string

value

Buffer

Returns

Promise<void>

Implementation of

CacheStore.set

Released under the PolyForm Shield 1.0.0 License.