claude-memory-layer 2.4.2 → 2.4.3

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.
@@ -179,7 +179,7 @@ function emptyLatencyAggregate() {
179
179
  return { count: 0, failedCount: 0, totalMs: 0, maxMs: 0 };
180
180
  }
181
181
  function runtimeVersion() {
182
- const value = "2.4.2"?.trim();
182
+ const value = "2.4.3"?.trim();
183
183
  return sanitizeRuntimeVersion(value || "development");
184
184
  }
185
185
  function sanitizeRuntimeVersion(value) {
@@ -18874,6 +18874,14 @@ function scoreGraduatedEvidence(query, candidate) {
18874
18874
  function isExplicitlyProhibitedLessonQuery(query) {
18875
18875
  return /\b(?:do[ -]+not|don't|never)\b|(?:^|[.!?;]\s*)(?:please\s+)?(?:skip|omit|ignore)\b|(?:사용|적용|실행|호출|설치|활성화|재시도)(?:\s*금지|하지\s*(?:않|말))|건너뛰|무시(?:해|하|할)|지\s*마(?:라|세요|십시오)?(?:[.!?\s]|$)/iu.test(query);
18876
18876
  }
18877
+ function lessonScoringQuery(query) {
18878
+ const korean = /^(?:도구\s*호출|파일\s*(?:수정|변경))(?:(?:\s*[/·,]\s*|\s*(?:및|와|과)\s*)(?:도구\s*호출|파일\s*(?:수정|변경)))*(?:은|는|을|를)?\s*(?:하지\s*마(?:세요|십시오|라)|금지)$/u;
18879
+ 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;
18880
+ return query.split(/(?<=[.!?;])(?=\s)|[\r\n]+/u).filter((clause) => {
18881
+ const statement = clause.trim().replace(/[.!?;]$/, "").trim();
18882
+ return !korean.test(statement) && !english.test(statement);
18883
+ }).join(" ");
18884
+ }
18877
18885
  var lessonSymbolTokens = (value) => value.match(/\b[A-Za-z][A-Za-z0-9_$]*(?:[./:-][A-Za-z0-9_$]+)*/g) ?? [];
18878
18886
  function hasExactLessonSubject(query, lesson) {
18879
18887
  const anchors = [...new Set(lessonSymbolTokens(query).filter((token) => /[a-z][A-Z]|[_$./:-]|\d/.test(token)))];
@@ -18882,7 +18890,8 @@ function hasExactLessonSubject(query, lesson) {
18882
18890
  return lessonSymbolTokens([lesson.name, lesson.trigger ?? ""].join(" ")).includes(anchors[0]);
18883
18891
  }
18884
18892
  function scoreLessonEvidence(query, lesson) {
18885
- if (isExplicitlyProhibitedLessonQuery(query)) return null;
18893
+ query = lessonScoringQuery(query);
18894
+ if (!query.trim() || isExplicitlyProhibitedLessonQuery(query)) return null;
18886
18895
  const content = formatLessonContent(lesson);
18887
18896
  const queriedSymbols = lessonSymbolTokens(query).filter((token) => /[a-z][A-Z]/.test(token));
18888
18897
  const contentSymbols = new Set(lessonSymbolTokens(content));