MCPcopy Create free account
hub / github.com/ColeMurray/background-agents / createKvCacheStore

Function createKvCacheStore

packages/shared/src/cache-store.ts:19–26  ·  view source on GitHub ↗
(kv: KvCacheNamespace)

Source from the content-addressed store, hash-verified

17}
18
19export function createKvCacheStore(kv: KvCacheNamespace): CacheStore {
20 function get(key: string): Promise<string | null>;
21 function get(key: string, type: "json"): Promise<unknown | null>;
22 function get(key: string, type?: "json"): Promise<string | unknown | null> {
23 return type === "json" ? kv.get(key, "json") : kv.get(key);
24 }
25
26 return {
27 get,
28 put: (key, value, opts) => (opts ? kv.put(key, value, opts) : kv.put(key, value)),
29 delete: (key) => kv.delete(key),

Callers 15

refreshReposCacheFunction · 0.90
handleListReposFunction · 0.90
handleUpdateRepoMetadataFunction · 0.90
lookupThreadSessionFunction · 0.90
storeThreadSessionFunction · 0.90
clearThreadSessionFunction · 0.90
index.tsFile · 0.90
handleIncomingMessageFunction · 0.90
handleRepoSelectionFunction · 0.90
getBotUserIdFunction · 0.90
getUserPreferencesFunction · 0.90

Calls 3

getMethod · 0.65
putMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected