Function
createCacheEditsBlock
(
state: CachedMCState,
toolUseIds: string[],
)
Source from the content-addressed store, hash-verified
| 71 | } |
| 72 | |
| 73 | export 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 | |
| 97 | export function markToolsSentToAPI(_state: CachedMCState): void {} |
| 98 | |
Callers
nothing calls this directly
Tested by
no test coverage detected