MCPcopy
hub / github.com/Doorman11991/smallcode / get

Function get

src/compiled/cognition/cache.ts:141–145  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

139/** Public cache. Counters are emitted on every get/put for hit-rate observability. */
140export const cache: PromptCache = {
141 async get(key: string): Promise<CacheEntry | null> {
142 const e = await __backend.get(key);
143 counter(e ? "cognition.cache_hit" : "cognition.cache_miss");
144 return e;
145 },
146 async put(key, prompt_name, model_id, value, ttl_ms, usage): Promise<void> {
147 await __backend.put(key, prompt_name, model_id, value, ttl_ms, usage);
148 counter("cognition.cache_put", { prompt: prompt_name });

Callers

nothing calls this directly

Calls 2

counterFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected