MCPcopy Create free account
hub / github.com/backnotprop/plannotator / semanticDiffCacheKey

Function semanticDiffCacheKey

packages/shared/semantic-diff.ts:404–416  ·  view source on GitHub ↗
(input: {
  rawPatch: string;
  cwd?: string;
  fileExts?: string[];
})

Source from the content-addressed store, hash-verified

402}
403
404export function semanticDiffCacheKey(input: {
405 rawPatch: string;
406 cwd?: string;
407 fileExts?: string[];
408}): string {
409 const hash = createHash("sha256");
410 hash.update(input.rawPatch);
411 hash.update("\0");
412 hash.update(input.cwd ?? "");
413 hash.update("\0");
414 hash.update(normalizeSemanticDiffFileExts(input.fileExts).join("\0"));
415 return hash.digest("hex");
416}
417
418export class SemanticDiffResponseCache {
419 private readonly cache = new Map<string, SemanticDiffResponse>();

Callers 3

getSemanticDiffFunction · 0.90
getSemanticDiffFunction · 0.85

Calls 2

updateMethod · 0.80

Tested by

no test coverage detected