MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / replace

Method replace

projects/runtime-client/src/cache.ts:48–63  ·  view source on GitHub ↗
(records: Iterable<unknown>, filter: RuntimeRecordCacheFilter = {})

Source from the content-addressed store, hash-verified

46 }
47
48 replace(records: Iterable<unknown>, filter: RuntimeRecordCacheFilter = {}): RuntimeRecord[] {
49 if (Object.keys(filter).length > 0) {
50 for (const runtime of this.list(filter)) {
51 this.records.delete(runtime.runtimeId)
52 }
53 } else {
54 this.records.clear()
55 }
56
57 const accepted: RuntimeRecord[] = []
58 for (const record of records) {
59 const runtime = this.upsert(record)
60 if (runtime) accepted.push(runtime)
61 }
62 return accepted.sort(sortByUpdatedAtDesc)
63 }
64
65 applyNotification(notification: RuntimeNotification): RuntimeRecord | null {
66 if (!RUNTIME_RECORD_NOTIFICATION_METHODS.has(notification.method)) return null

Callers 15

cache.test.tsFile · 0.80
sanitizeIdFunction · 0.80
unsanitizeIdFunction · 0.80
fallbackTitleFunction · 0.80
fallbackTitleFunction · 0.80
fallbackSlugFunction · 0.80
writeClaudeSessionFunction · 0.80
openRuntimeSocketFunction · 0.80
safeIdFunction · 0.80
resolveGitInfoFunction · 0.80
handleIsGitDirectoryFunction · 0.80

Calls 5

listMethod · 0.95
upsertMethod · 0.95
pushMethod · 0.80
deleteMethod · 0.65
clearMethod · 0.65

Tested by 3

writeClaudeSessionFunction · 0.64
openRuntimeSocketFunction · 0.64
safeIdFunction · 0.64