MCPcopy Create free account
hub / github.com/apache/maka / pushDigestFile

Function pushDigestFile

packages/core/src/foreign-session.ts:545–555  ·  view source on GitHub ↗
(acc: DigestAccumulator, path: string)

Source from the content-addressed store, hash-verified

543}
544
545export function pushDigestFile(acc: DigestAccumulator, path: string): void {
546 if (path.length === 0) return;
547 // Re-insert to move an existing path to newest, then evict the oldest —
548 // the most recently touched files are the ones the handoff cares about.
549 acc.filesTouched.delete(path);
550 acc.filesTouched.add(path);
551 if (acc.filesTouched.size > FOREIGN_SESSION_DIGEST_MAX_FILES) {
552 const oldest = acc.filesTouched.values().next().value;
553 if (oldest !== undefined) acc.filesTouched.delete(oldest);
554 }
555}
556
557export function finishDigest(
558 acc: DigestAccumulator,

Callers 2

readDigestMethod · 0.90

Calls 4

valuesMethod · 0.80
deleteMethod · 0.65
addMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected