MCPcopy Create free account
hub / github.com/coder/mux / recordAccess

Method recordAccess

src/node/services/memoryMeta.ts:201–212  ·  view source on GitHub ↗

Record a use (read or write) of a memory file at the MemoryService chokepoint.

(logicalKey: string, options: { write: boolean })

Source from the content-addressed store, hash-verified

199
200 /** Record a use (read or write) of a memory file at the MemoryService chokepoint. */
201 async recordAccess(logicalKey: string, options: { write: boolean }): Promise<void> {
202 await this.mutate((entries) => {
203 const current = entries[logicalKey] ?? EMPTY_ENTRY;
204 const now = Date.now();
205 entries[logicalKey] = {
206 ...current,
207 accessCount: current.accessCount + 1,
208 lastAccessedAt: now,
209 lastWriteAt: options.write ? now : current.lastWriteAt,
210 };
211 });
212 }
213
214 /**
215 * Move all entries for a renamed file or directory subtree so pins and

Callers 5

memoryMeta.test.tsFile · 0.80
recordUsageMethod · 0.80
recordRenameMethod · 0.80
writeForFunction · 0.80

Calls 1

mutateMethod · 0.95

Tested by 1

writeForFunction · 0.64