memorix 0.9.14 → 0.9.15

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.9.15] — 2026-02-26
6
+
7
+ ### Fixed
8
+ - **Feedback visibility** — Hook auto-stores were silent. Now returns `systemMessage` to the agent after each save, e.g. `🟢 Memorix saved: Updated auth.ts [what-changed]`. Gives Codex-like visibility into what memorix is recording.
9
+ - **File-modifying tools always store** — Write/Edit/MultiEdit tool events were rejected when content lacked pattern keywords (e.g., writing utility functions with no "error"/"fix" keywords). Now file-modifying tools always store if content > 100 chars, classified as `what-changed` by default.
10
+ - **PreCompact low-quality spam** — PreCompact events stored empty/minimal observations with no meaningful content. Now requires `MIN_STORE_LENGTH` (100 chars) to store.
11
+ - **Normalizer prompt extraction** — `normalizeClaude` only extracted `prompt` for `user_prompt` events. Now extracts for all events (PreCompact, etc.), preserving context that would otherwise be lost.
12
+
5
13
  ## [0.9.14] — 2026-02-26
6
14
 
7
15
  ### Fixed
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=flat-square&color=blue" alt="npm downloads"></a>
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="License"></a>
10
10
  <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="GitHub stars"></a>
11
- <img src="https://img.shields.io/badge/tests-503%20passed-brightgreen?style=flat-square" alt="Tests">
11
+ <img src="https://img.shields.io/badge/tests-505%20passed-brightgreen?style=flat-square" alt="Tests">
12
12
  </p>
13
13
  <p align="center">
14
14
  <img src="https://img.shields.io/badge/Works%20with-Cursor-orange?style=flat-square" alt="Cursor">
package/README.zh-CN.md CHANGED
@@ -8,7 +8,7 @@
8
8
  <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=flat-square&color=blue" alt="npm downloads"></a>
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="License"></a>
10
10
  <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="GitHub stars"></a>
11
- <img src="https://img.shields.io/badge/tests-503%20passed-brightgreen?style=flat-square" alt="Tests">
11
+ <img src="https://img.shields.io/badge/tests-505%20passed-brightgreen?style=flat-square" alt="Tests">
12
12
  </p>
13
13
  <p align="center">
14
14
  <img src="https://img.shields.io/badge/Works%20with-Cursor-orange?style=flat-square" alt="Cursor">
package/dist/cli/index.js CHANGED
@@ -43369,8 +43369,8 @@ function normalizeClaude(payload, event) {
43369
43369
  result.filePath = toolInput?.file_path ?? toolInput?.filePath;
43370
43370
  }
43371
43371
  }
43372
- if (event === "user_prompt") {
43373
- result.userPrompt = payload.prompt ?? "";
43372
+ if (payload.prompt) {
43373
+ result.userPrompt = payload.prompt;
43374
43374
  }
43375
43375
  return result;
43376
43376
  }
@@ -43826,7 +43826,8 @@ function generateTitle(input, patternType) {
43826
43826
  }
43827
43827
  function buildObservation(input, content) {
43828
43828
  const pattern = detectBestPattern(content);
43829
- const obsType = pattern ? patternToObservationType(pattern.type) : "discovery";
43829
+ const fallbackType = input.filePath ? "what-changed" : "discovery";
43830
+ const obsType = pattern ? patternToObservationType(pattern.type) : fallbackType;
43830
43831
  return {
43831
43832
  entityName: deriveEntityName(input),
43832
43833
  type: obsType,
@@ -43926,11 +43927,16 @@ ${lines.join("\n")}`;
43926
43927
  }
43927
43928
  };
43928
43929
  }
43929
- case "pre_compact":
43930
+ case "pre_compact": {
43931
+ const compactContent = extractContent(input);
43932
+ if (compactContent.length < MIN_STORE_LENGTH) {
43933
+ return { observation: null, output: defaultOutput };
43934
+ }
43930
43935
  return {
43931
- observation: buildObservation(input, extractContent(input)),
43936
+ observation: buildObservation(input, compactContent),
43932
43937
  output: defaultOutput
43933
43938
  };
43939
+ }
43934
43940
  case "session_end":
43935
43941
  return {
43936
43942
  observation: buildObservation(input, extractContent(input)),
@@ -43996,6 +44002,16 @@ ${lines.join("\n")}`;
43996
44002
  if (toolContent.length < MIN_STORE_LENGTH) {
43997
44003
  return { observation: null, output: defaultOutput };
43998
44004
  }
44005
+ const isFileModifyingTool = /^(write|edit|multi_?edit|multiedittool|create|patch|insert)/i.test(
44006
+ input.toolName ?? ""
44007
+ );
44008
+ if (isFileModifyingTool) {
44009
+ markTriggered(toolKey);
44010
+ return {
44011
+ observation: buildObservation(input, toolContent),
44012
+ output: defaultOutput
44013
+ };
44014
+ }
43999
44015
  const toolPattern = detectBestPattern(toolContent);
44000
44016
  if (!toolPattern && toolContent.length < 200) {
44001
44017
  return { observation: null, output: defaultOutput };
@@ -44056,6 +44072,20 @@ async function runHook() {
44056
44072
  const dataDir = await getProjectDataDir2(project.id);
44057
44073
  await initObservations2(dataDir);
44058
44074
  await storeObservation2({ ...observation, projectId: project.id });
44075
+ const TYPE_EMOJI = {
44076
+ "gotcha": "\u{1F534}",
44077
+ "decision": "\u{1F7E4}",
44078
+ "problem-solution": "\u{1F7E1}",
44079
+ "trade-off": "\u2696\uFE0F",
44080
+ "discovery": "\u{1F7E3}",
44081
+ "how-it-works": "\u{1F535}",
44082
+ "what-changed": "\u{1F7E2}",
44083
+ "why-it-exists": "\u{1F7E0}",
44084
+ "session-request": "\u{1F3AF}"
44085
+ };
44086
+ const emoji2 = TYPE_EMOJI[observation.type] ?? "\u{1F4DD}";
44087
+ output.systemMessage = (output.systemMessage ?? "") + `
44088
+ ${emoji2} Memorix saved: ${observation.title} [${observation.type}]`;
44059
44089
  } catch {
44060
44090
  }
44061
44091
  }