Files
oh-my-pi/packages/coding-agent/src/tools/fs-cache-invalidation.ts
T
can1357 c267f04c00 feat(coding-agent): added cache-based hashline stale-anchor recovery fallback
- Implemented hashline stale-anchor recovery using cached reads and a 3-way merge fallback.
- Updated hashline execution and preflight checks to retry mismatched anchors through cache recovery.
- Added file-read cache support with per-session LRU snapshots and contiguous/sparse record APIs.
- Integrated read and search tools with the shared cache to record candidate lines for recovery.
- Added tests for stale-anchor recovery flows and FileReadCache session, null, overlap, and eviction behavior.
2026-05-09 05:50:09 +02:00

29 lines
823 B
TypeScript

import { invalidateFsScanCache } from "@oh-my-pi/pi-natives";
/**
* Invalidate shared filesystem scan caches after a content write/update.
*/
export function invalidateFsScanAfterWrite(path: string): void {
invalidateFsScanCache(path);
}
/**
* Invalidate shared filesystem scan caches after deleting a file.
*/
export function invalidateFsScanAfterDelete(path: string): void {
invalidateFsScanCache(path);
}
/**
* Invalidate shared filesystem scan caches after a rename/move.
*
* Some watchers care about the disappearance at the old path; others about the
* appearance at the new one. Bust both to keep callers honest.
*/
export function invalidateFsScanAfterRename(oldPath: string, newPath: string): void {
invalidateFsScanCache(oldPath);
if (newPath !== oldPath) {
invalidateFsScanCache(newPath);
}
}