claude-memory-layer 2.4.4 → 2.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -262,7 +262,7 @@ function emptyLatencyAggregate() {
262
262
  return { count: 0, failedCount: 0, totalMs: 0, maxMs: 0 };
263
263
  }
264
264
  function runtimeVersion() {
265
- const value = "2.4.4"?.trim();
265
+ const value = "2.4.6"?.trim();
266
266
  return sanitizeRuntimeVersion(value || "development");
267
267
  }
268
268
  function sanitizeRuntimeVersion(value) {
@@ -274,7 +274,7 @@ function emptyLatencyAggregate() {
274
274
  return { count: 0, failedCount: 0, totalMs: 0, maxMs: 0 };
275
275
  }
276
276
  function runtimeVersion() {
277
- const value = "2.4.4"?.trim();
277
+ const value = "2.4.6"?.trim();
278
278
  return sanitizeRuntimeVersion(value || "development");
279
279
  }
280
280
  function sanitizeRuntimeVersion(value) {
@@ -35,7 +35,7 @@ function emptyLatencyAggregate() {
35
35
  return { count: 0, failedCount: 0, totalMs: 0, maxMs: 0 };
36
36
  }
37
37
  function runtimeVersion() {
38
- const value = "2.4.4"?.trim();
38
+ const value = "2.4.6"?.trim();
39
39
  return sanitizeRuntimeVersion(value || "development");
40
40
  }
41
41
  function sanitizeRuntimeVersion(value) {
@@ -626,10 +626,12 @@ function isExplicitlyProhibitedLessonQuery(query) {
626
626
  }
627
627
  function lessonScoringQuery(query) {
628
628
  const korean = /^(?:도구\s*호출|파일\s*(?:수정|변경))(?:(?:\s*[/·,]\s*|\s*(?:및|와|과)\s*)(?:도구\s*호출|파일\s*(?:수정|변경)))*(?:은|는|을|를)?\s*(?:하지\s*마(?:세요|십시오|라)|금지)$/u;
629
+ const readOnly = /^(?:읽기\s*전용으로\s*확인하고\s*)?(?:파일(?:\s*(?:수정|변경))?|설치|교훈\s*저장)(?:(?:\s*[/·,]\s*|\s*(?:및|와|과)\s*)(?:파일(?:\s*(?:수정|변경))?|설치|교훈\s*저장))*(?:은|는|을|를)?\s*하지\s*마(?:세요|십시오|라)$/u;
630
+ const privateOutput = /^(?:인증정보|(?:대화\s*)?로그\s*전체)(?:(?:\s*[/·,]\s*|\s*(?:나|이나|및|와|과)\s*)(?:인증정보|(?:대화\s*)?로그\s*전체))*(?:은|는|을|를)?\s*출력하지\s*마(?:세요|십시오|라)$/u;
629
631
  const english = /^(?:please\s+)?(?:do[ -]+not|don't|never)\s+(?:(?:call|use|invoke)\s+tools|(?:edit|modify|change)\s+files)(?:\s+(?:or|and)\s+(?:(?:call|use|invoke)\s+tools|(?:edit|modify|change)\s+files))*$/iu;
630
632
  return query.split(/(?<=[.!?;])(?=\s)|[\r\n]+/u).filter((clause) => {
631
633
  const statement = clause.trim().replace(/[.!?;]$/, "").trim();
632
- return !korean.test(statement) && !english.test(statement);
634
+ return !korean.test(statement) && !english.test(statement) && !readOnly.test(statement) && !privateOutput.test(statement);
633
635
  }).join(" ");
634
636
  }
635
637
  var lessonSymbolTokens = (value) => value.match(/\b[A-Za-z][A-Za-z0-9_$]*(?:[./:-][A-Za-z0-9_$]+)*/g) ?? [];
@@ -648,10 +650,11 @@ function scoreLessonEvidence(query, lesson) {
648
650
  if (queriedSymbols.some((symbol) => !contentSymbols.has(symbol))) return null;
649
651
  const exactSubject = hasExactLessonSubject(query, lesson);
650
652
  if (!exactSubject && !hasQueryMemoryAlignment(query, content, 2)) return null;
651
- const queryTerms = meaningfulTerms(query);
652
- const contentTerms = new Set(meaningfulTerms(content));
653
+ const lessonTerms = (value) => [...new Set(meaningfulTerms(value).map((term) => term === "\uBC84\uC804" || term === "versions" ? "version" : term))];
654
+ const queryTerms = lessonTerms(query);
655
+ const contentTerms = new Set(lessonTerms(content));
653
656
  const overlap = queryTerms.filter((term) => contentTerms.has(term)).length;
654
- if (!exactSubject && overlap < Math.min(3, queryTerms.length)) return null;
657
+ if (!exactSubject && (queryTerms.length === 0 || overlap < Math.min(3, queryTerms.length))) return null;
655
658
  const coverage = exactSubject ? 1 : overlap / Math.max(1, Math.min(queryTerms.length, 8));
656
659
  const anchors = identifierAnchors(query);
657
660
  const lowered = content.toLowerCase();