MCPcopy Create free account
hub / github.com/freecodexyz/free-code / createCacheEditsBlock

Function createCacheEditsBlock

src/services/compact/cachedMicrocompact.ts:73–95  ·  view source on GitHub ↗
(
  state: CachedMCState,
  toolUseIds: string[],
)

Source from the content-addressed store, hash-verified

71}
72
73export function createCacheEditsBlock(
74 state: CachedMCState,
75 toolUseIds: string[],
76): CacheEditsBlock | null {
77 const edits = toolUseIds
78 .filter(id => !state.deletedRefs.has(id))
79 .map(id => {
80 state.deletedRefs.add(id)
81 return {
82 type: 'delete' as const,
83 cache_reference: id,
84 }
85 })
86
87 if (edits.length === 0) {
88 return null
89 }
90
91 return {
92 type: 'cache_edits',
93 edits,
94 }
95}
96
97export function markToolsSentToAPI(_state: CachedMCState): void {}
98

Callers

nothing calls this directly

Calls 2

hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected