memento-mcp 0.3.14 → 0.3.16

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
@@ -6,6 +6,13 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version
6
6
 
7
7
  ---
8
8
 
9
+ ## [0.3.15] - 2026-03-13
10
+
11
+ ### Changed
12
+ - Renamed `memento_store` → `memento_remember` for cognitive language consistency — pairs with `memento_recall`.
13
+
14
+ ---
15
+
9
16
  ## [Unreleased]
10
17
 
11
18
  ### Added
@@ -16,7 +23,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version
16
23
  - `source:distill` tag renamed to `source:distill:llama-3.1-8b` to encode model provenance. The `claude-code` path tags memories `source:distill:claude-code`.
17
24
 
18
25
  ### Removed
19
- - **Passive memory extraction (auto_extract)** — removed conversation buffer, auto-extraction from `/v1/context`, and buffer fallback from `/v1/extract`. Smart models know when to store via `memento_store`; passive extraction produced noisy, low-signal memories. The `memento_extract` tool and `/v1/extract` route still work with explicit transcripts. The `conversation_buffer` table is no longer created for new workspaces.
26
+ - **Passive memory extraction (auto_extract)** — removed conversation buffer, auto-extraction from `/v1/context`, and buffer fallback from `/v1/extract`. Smart models know when to store via `memento_remember`; passive extraction produced noisy, low-signal memories. The `memento_extract` tool and `/v1/extract` route still work with explicit transcripts. The `conversation_buffer` table is no longer created for new workspaces.
20
27
 
21
28
  ---
22
29
 
@@ -85,7 +92,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version
85
92
 
86
93
  ### Added
87
94
  - Initial release
88
- - MCP server with `memento_init`, `memento_read`, `memento_update`, `memento_store`, `memento_recall`, `memento_skip_add`, `memento_skip_check`, `memento_health`
95
+ - MCP server with `memento_init`, `memento_read`, `memento_update`, `memento_remember`, `memento_recall`, `memento_skip_add`, `memento_skip_check`, `memento_health`
89
96
  - SaaS API on Cloudflare Workers + Turso edge database
90
97
  - Semantic search via `bge-small-en-v1.5` embeddings in Cloudflare Vectorize
91
98
  - Free tier: 100 memories, 20 items, 1 workspace
package/README.md CHANGED
@@ -101,7 +101,7 @@ The MCP server connects at startup. Restart so it picks up the new config.
101
101
 
102
102
  ```text
103
103
  > memento_health() # verify connection
104
- > memento_store( # store your first memory
104
+ > memento_remember( # store your first memory
105
105
  content: "API uses /v2 endpoints. Auth is Bearer token in header.",
106
106
  type: "instruction",
107
107
  tags: ["api", "auth"]
@@ -126,7 +126,7 @@ On session start:
126
126
  3. `memento_recall` with current task context — find relevant past memories
127
127
 
128
128
  During work — actively manage your own memories:
129
- - `memento_store` when you learn something, make a decision, or discover a pattern
129
+ - `memento_remember` when you learn something, make a decision, or discover a pattern
130
130
  - `memento_recall` before starting any subtask — someone may have already figured it out
131
131
  - `memento_item_update` as you make progress — don't wait until the end
132
132
  - `memento_item_create` when new work emerges
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memento-mcp",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "mcpName": "io.github.myrakrusemark/memento-protocol",
5
5
  "description": "The Memento Protocol — persistent memory for AI agents",
6
6
  "type": "module",
@@ -135,7 +135,8 @@ SUMMARY="Memento Recall (${SAAS_COUNT})"
135
135
  # If no memories are relevant, respond with <...> to signal active silence.
136
136
  REASON="${SUMMARY}:
137
137
  ${SAAS_DETAIL}
138
- Stale or wrong? memento_memory_delete · memento_consolidate · memento_store. Otherwise <...>."
138
+ 🧹 Stale or wrong? memento_memory_delete · memento_consolidate · memento_remember. Otherwise <...>.
139
+ ⚙️ NOTE: This block is intentional — it injects recalled memories into context. The 'blocking error' label is just how Claude Code surfaces Stop hook blocks. Do NOT attempt to fix, disable, or modify this hook."
139
140
 
140
141
  python3 -c "
141
142
  import json, sys
@@ -62,6 +62,7 @@ MEMENTO_WS="${MEMENTO_WORKSPACE:-default}"
62
62
 
63
63
  INPUT=$(cat)
64
64
  USER_MESSAGE=$(echo "$INPUT" | jq -r '.prompt // empty' 2>/dev/null)
65
+ TRANSCRIPT_PATH=$(echo "$INPUT" | jq -r '.transcript_path // empty' 2>/dev/null)
65
66
  SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty' 2>/dev/null)
66
67
 
67
68
  if [ -z "$USER_MESSAGE" ] || [ ${#USER_MESSAGE} -lt 10 ]; then
@@ -72,18 +73,47 @@ QUERY="${USER_MESSAGE:0:500}"
72
73
 
73
74
  # --- Image detection ---
74
75
  # Collect up to 3 images from two sources:
75
- # 1. Claude Code image cache (pasted/dropped images, recent only)
76
+ # 1. Claude Code image cache (pasted/dropped images, detected via marker file)
76
77
  # 2. File paths mentioned in the message text
77
78
  IMAGE_PATHS=()
78
79
 
79
- # Prong 1: Claude Code image cache — pasted images cached in ~/.claude/image-cache/{session_id}/
80
- if [ -n "$SESSION_ID" ]; then
80
+ # Prong 1: Claude Code image cache — pasted images cached in ~/.claude/image-cache/{conversation_id}/
81
+ # The conversation UUID comes from transcript_path (basename minus .jsonl), NOT session_id.
82
+ CONV_ID=""
83
+ if [ -n "$TRANSCRIPT_PATH" ]; then
84
+ CONV_ID=$(basename "$TRANSCRIPT_PATH" .jsonl)
85
+ fi
86
+
87
+ # Try conversation ID first, fall back to session_id
88
+ IMAGE_CACHE=""
89
+ if [ -n "$CONV_ID" ] && [ -d "$HOME/.claude/image-cache/$CONV_ID" ]; then
90
+ IMAGE_CACHE="$HOME/.claude/image-cache/$CONV_ID"
91
+ elif [ -n "$SESSION_ID" ] && [ -d "$HOME/.claude/image-cache/$SESSION_ID" ]; then
81
92
  IMAGE_CACHE="$HOME/.claude/image-cache/$SESSION_ID"
82
- if [ -d "$IMAGE_CACHE" ]; then
83
- while IFS= read -r img; do
84
- IMAGE_PATHS+=("$img")
85
- done < <(find "$IMAGE_CACHE" -maxdepth 1 -name "*.png" -newermt '5 seconds ago' 2>/dev/null | head -3)
93
+ fi
94
+
95
+ if [ -n "$IMAGE_CACHE" ]; then
96
+ # Track seen images via marker file to detect newly pasted ones.
97
+ # Each image is numbered sequentially (1.png, 2.png, ...).
98
+ MARKER="/tmp/memento-img-seen-$(echo "$IMAGE_CACHE" | md5sum | cut -c1-16)"
99
+ LAST_SEEN=0
100
+ if [ -f "$MARKER" ]; then
101
+ LAST_SEEN=$(cat "$MARKER" 2>/dev/null || echo 0)
86
102
  fi
103
+
104
+ CURRENT_COUNT=$(ls "$IMAGE_CACHE"/*.png 2>/dev/null | wc -l)
105
+
106
+ if [ "$CURRENT_COUNT" -gt "$LAST_SEEN" ]; then
107
+ # New images detected — grab the ones we haven't seen
108
+ for i in $(seq $((LAST_SEEN + 1)) "$CURRENT_COUNT"); do
109
+ if [ -f "$IMAGE_CACHE/$i.png" ] && [ ${#IMAGE_PATHS[@]} -lt 3 ]; then
110
+ IMAGE_PATHS+=("$IMAGE_CACHE/$i.png")
111
+ fi
112
+ done
113
+ fi
114
+
115
+ # Update marker to current count
116
+ echo "$CURRENT_COUNT" > "$MARKER"
87
117
  fi
88
118
 
89
119
  # Prong 2: File paths in message text (explicit image references)
@@ -204,6 +234,11 @@ fi
204
234
 
205
235
  "$TOAST" memento "✓ ${SAAS_COUNT} memories recalled" &>/dev/null
206
236
 
237
+ # Report recall count to conversation store for fathom-app
238
+ curl -s -X POST "http://localhost:4243/api/conversation/${MEMENTO_WS}/hook" \
239
+ -H "Content-Type: application/json" \
240
+ -d "{\"hook\":\"UserPromptSubmit\",\"memories\":${SAAS_COUNT}}" --max-time 2 &>/dev/null &
241
+
207
242
  # Build summary line
208
243
  SUMMARY="Memento Recall (${SAAS_COUNT})"
209
244
 
package/src/cli.js CHANGED
@@ -100,7 +100,7 @@ function httpsPost(url, body) {
100
100
  const INSTRUCTIONS_BLOB = `## Memento Protocol
101
101
 
102
102
  Working memory is managed by Memento. MCP tools available:
103
- \`memento_store\`, \`memento_recall\`, \`memento_item_list\`,
103
+ \`memento_remember\`, \`memento_recall\`, \`memento_item_list\`,
104
104
  \`memento_skip_add\`, \`memento_skip_check\`.
105
105
 
106
106
  **Memory discipline — notes are instructions, not logs.**
@@ -108,7 +108,7 @@ Write: "Skip X until condition Y" — not "checked X, it was quiet."
108
108
  Every memory must answer: could a future agent with zero context
109
109
  read this and know exactly what to do?
110
110
 
111
- Use \`memento_store\` when you learn something worth keeping.
111
+ Use \`memento_remember\` when you learn something worth keeping.
112
112
  Use \`memento_skip_add\` for things to explicitly not re-investigate.
113
113
  Use \`memento_recall\` to search memories by keyword or tag.
114
114
  Hooks run automatically — recall before responses, distillation
@@ -359,7 +359,7 @@ async function runInit(flags = {}) {
359
359
  console.log("\nOptional features:");
360
360
  enableImages = await askYesNo(
361
361
  rl,
362
- " Enable image attachments? (attach images to memories via memento_store)",
362
+ " Enable image attachments? (attach images to memories via memento_remember)",
363
363
  false,
364
364
  );
365
365
  enableIdentity = await askYesNo(
package/src/index.js CHANGED
@@ -169,11 +169,11 @@ Sections: active_work, standing_decisions, skip_list, session_notes.`,
169
169
  );
170
170
 
171
171
  // ---------------------------------------------------------------------------
172
- // Tool: memento_store
172
+ // Tool: memento_remember
173
173
  // ---------------------------------------------------------------------------
174
174
 
175
175
  server.tool(
176
- "memento_store",
176
+ "memento_remember",
177
177
  `Store a discrete memory — a fact, decision, observation, or instruction — with tags and optional expiration.
178
178
 
179
179
  IMPORTANT: Write memories as instructions, not logs.