@strvmarv/total-recall 0.6.8-beta.7 → 0.7.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "total-recall",
3
3
  "description": "Multi-tiered memory and knowledge base with semantic search, auto-compaction, and built-in evaluation. Works across Claude Code, Copilot CLI, OpenCode, Cline, and Cursor.",
4
- "version": "0.6.8-beta.7",
4
+ "version": "0.7.1",
5
5
  "author": {
6
6
  "name": "strvmarv"
7
7
  },
package/CONTRIBUTING.md CHANGED
@@ -271,11 +271,11 @@ npx vitest run src/importers/my-tool.test.ts
271
271
  Once the MCP server is running and connected to your coding assistant, use the eval commands:
272
272
 
273
273
  ```
274
- /total-recall eval # Live retrieval metrics for current session
275
- /total-recall eval --benchmark # Run synthetic benchmark suite
276
- /total-recall eval --snapshot baseline # Save current config as a named baseline
277
- /total-recall eval --compare baseline # Compare current config against saved baseline
278
- /total-recall eval --grow # Add real query misses to benchmark suite
274
+ /total-recall:commands eval # Live retrieval metrics for current session
275
+ /total-recall:commands eval --benchmark # Run synthetic benchmark suite
276
+ /total-recall:commands eval --snapshot baseline # Save current config as a named baseline
277
+ /total-recall:commands eval --compare baseline # Compare current config against saved baseline
278
+ /total-recall:commands eval --grow # Add real query misses to benchmark suite
279
279
  ```
280
280
 
281
281
  A PR that changes retrieval logic, scoring, or compaction thresholds must include a `--benchmark` run showing no regression against the `baseline` snapshot.
@@ -289,7 +289,7 @@ Before opening a pull request:
289
289
  1. **Tests pass** — `npm test` exits 0 with no failures
290
290
  2. **Type checker clean** — `npm run typecheck` exits 0
291
291
  3. **Build succeeds** — `npm run build` exits 0
292
- 4. **Benchmark does not regress** — run `/total-recall eval --compare baseline` and include the output in your PR description if you changed retrieval, scoring, or compaction logic
292
+ 4. **Benchmark does not regress** — run `/total-recall:commands eval --compare baseline` and include the output in your PR description if you changed retrieval, scoring, or compaction logic
293
293
  5. **New behavior is tested** — new importers, parsers, and content types all require corresponding test files
294
294
 
295
295
  If you're adding a new host tool importer, include the `detect()` logic rationale in your PR description — false positives will silently corrupt imports for users who don't have the tool installed.
package/README.md CHANGED
@@ -165,44 +165,46 @@ All state lives in `~/.total-recall/total-recall.db`. The embedding model is bun
165
165
 
166
166
  ## Commands
167
167
 
168
- All commands use `/total-recall <subcommand>`:
168
+ All commands are routed through the `/total-recall:commands` skill:
169
169
 
170
170
  | Command | MCP Tool | Description |
171
171
  |---|---|---|
172
- | `/total-recall help` | — | Show command reference table |
173
- | `/total-recall status` | `status` | Dashboard overview |
174
- | `/total-recall search <query>` | `memory_search` | Semantic search across all tiers |
175
- | `/total-recall store <content>` | `memory_store` | Manually store a memory |
172
+ | `/total-recall:commands help` | — | Show command reference table |
173
+ | `/total-recall:commands status` | `status` | Dashboard overview |
174
+ | `/total-recall:commands search <query>` | `memory_search` | Semantic search across all tiers |
175
+ | `/total-recall:commands store <content>` | `memory_store` | Manually store a memory |
176
176
  | — | `memory_get` | Retrieve a specific entry by ID |
177
177
  | — | `memory_update` | Update an existing entry's content, tags, or project |
178
- | `/total-recall forget <query>` | `memory_search` + `memory_delete` | Find and delete entries |
179
- | `/total-recall inspect <id>` | `memory_inspect` | Deep dive on single entry with compaction history |
180
- | `/total-recall promote <id>` | `memory_promote` | Move entry to higher tier |
181
- | `/total-recall demote <id>` | `memory_demote` | Move entry to lower tier |
182
- | `/total-recall history` | `memory_history` | Show recent tier movements |
183
- | `/total-recall lineage <id>` | `memory_lineage` | Show compaction ancestry |
184
- | `/total-recall export` | `memory_export` | Export to portable JSON format |
185
- | `/total-recall import <file>` | `memory_import` | Import from export file |
186
- | `/total-recall ingest <path>` | `kb_ingest_file` / `kb_ingest_dir` | Add files/dirs to knowledge base |
187
- | `/total-recall kb search <query>` | `kb_search` | Search knowledge base |
188
- | `/total-recall kb list` | `kb_list_collections` | List KB collections |
189
- | `/total-recall kb refresh <id>` | `kb_refresh` | Re-ingest a collection |
190
- | `/total-recall kb remove <id>` | `kb_remove` | Remove KB entry |
178
+ | `/total-recall:commands forget <query>` | `memory_search` + `memory_delete` | Find and delete entries |
179
+ | `/total-recall:commands inspect <id>` | `memory_inspect` | Deep dive on single entry with compaction history |
180
+ | `/total-recall:commands promote <id>` | `memory_promote` | Move entry to higher tier |
181
+ | `/total-recall:commands demote <id>` | `memory_demote` | Move entry to lower tier |
182
+ | `/total-recall:commands history` | `memory_history` | Show recent tier movements |
183
+ | `/total-recall:commands lineage <id>` | `memory_lineage` | Show compaction ancestry |
184
+ | `/total-recall:commands export` | `memory_export` | Export to portable JSON format |
185
+ | `/total-recall:commands import <file>` | `memory_import` | Import from export file |
186
+ | `/total-recall:commands ingest <path>` | `kb_ingest_file` / `kb_ingest_dir` | Add files/dirs to knowledge base |
187
+ | `/total-recall:commands kb search <query>` | `kb_search` | Search knowledge base |
188
+ | `/total-recall:commands kb list` | `kb_list_collections` | List KB collections |
189
+ | `/total-recall:commands kb refresh <id>` | `kb_refresh` | Re-ingest a collection |
190
+ | `/total-recall:commands kb remove <id>` | `kb_remove` | Remove KB entry |
191
191
  | — | `kb_summarize` | Generate summary for a KB collection |
192
- | `/total-recall compact` | `compact_now` | Force compaction |
192
+ | `/total-recall:commands compact` | `compact_now` | Force compaction |
193
193
  | — | `session_start` | Initialize session: sync imports, assemble hot tier |
194
194
  | — | `session_end` | End session: run compaction |
195
195
  | — | `session_context` | Get current hot tier entries as context |
196
- | `/total-recall eval` | `eval_report` | Retrieval quality metrics (filterable by config snapshot) |
197
- | `/total-recall eval --benchmark` | `eval_benchmark` | Run synthetic benchmark |
198
- | `/total-recall eval --compare <name>` | `eval_compare` | Compare metrics between two config snapshots |
199
- | `/total-recall eval --snapshot <name>` | `eval_snapshot` | Manually create a named config snapshot |
200
- | `/total-recall eval --grow` | `eval_grow` | Review and accept/reject benchmark candidates from retrieval misses |
201
- | `/total-recall config get <key>` | `config_get` | Read config value |
202
- | `/total-recall config set <key> <val>` | `config_set` | Update config |
203
- | `/total-recall import-host` | `import_host` | Import from host tools |
196
+ | `/total-recall:commands eval` | `eval_report` | Retrieval quality metrics (filterable by config snapshot) |
197
+ | `/total-recall:commands eval --benchmark` | `eval_benchmark` | Run synthetic benchmark |
198
+ | `/total-recall:commands eval --compare <name>` | `eval_compare` | Compare metrics between two config snapshots |
199
+ | `/total-recall:commands eval --snapshot <name>` | `eval_snapshot` | Manually create a named config snapshot |
200
+ | `/total-recall:commands eval --grow` | `eval_grow` | Review and accept/reject benchmark candidates from retrieval misses |
201
+ | `/total-recall:commands config get <key>` | `config_get` | Read config value |
202
+ | `/total-recall:commands config set <key> <val>` | `config_set` | Update config |
203
+ | `/total-recall:commands import-host` | `import_host` | Import from host tools |
204
204
 
205
- Memory capture, retrieval, and compaction run automatically in the background — see the "Automatic Behavior" section of the `/total-recall` skill.
205
+ Memory capture, retrieval, and compaction run automatically in the background — see the "Automatic Behavior" section of the `/total-recall:commands` skill.
206
+
207
+ > **Note:** `/total-recall:commands` is implemented as a Claude Code skill (at `skills/commands/SKILL.md`), not as a slash-command file under `commands/`. The skill handles all `<subcommand>` arguments internally.
206
208
 
207
209
  ---
208
210
 
@@ -214,7 +216,7 @@ Memory capture, retrieval, and compaction run automatically in the background
214
216
  | Copilot CLI | Full | Auto-import from existing Copilot memory files |
215
217
  | OpenCode | MCP | Configure MCP server in opencode config |
216
218
  | Cline | MCP | Configure MCP server in Cline settings |
217
- | Cursor | Full | MCP server + `.cursor-plugin/` wrapper |
219
+ | Cursor | Full | MCP server + `.cursor-plugin/` wrapper (SessionStart only; run `/total-recall:commands compact` manually — Cursor has no SessionEnd hook) |
218
220
  | Hermes | Full | Auto-import from Hermes memory files |
219
221
 
220
222
  ---
@@ -6,7 +6,7 @@
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/session-start/run.sh\"",
9
+ "command": "bash \"$CURSOR_PLUGIN_ROOT/hooks/session-start/run.sh\"",
10
10
  "async": false
11
11
  }
12
12
  ]
@@ -1,9 +1,31 @@
1
1
  #!/usr/bin/env bash
2
2
  # total-recall SessionEnd hook
3
- # Triggers compaction and session cleanup via MCP tools
3
+ # Injects the session-end directive fragment as additionalContext.
4
+ #
5
+ # The directive lives in skills/commands/session-end.md so it stays
6
+ # in one place — the same file can be referenced by the SKILL.md and is
7
+ # not duplicated in this shell script. If the fragment is missing we
8
+ # exit 0 silently rather than blocking session end.
9
+ #
10
+ # Payload is plain text (no <IMPORTANT>/XML wrappers) — it is already
11
+ # injected inside a system-reminder block by the host, and nested markup
12
+ # is redundant / inconsistently handled across hosts. Tool references in
13
+ # the fragment use functional names (e.g. "session_context MCP tool")
14
+ # instead of hardcoded mcp__ prefixes, because each host namespaces
15
+ # plugin MCP tools differently.
4
16
 
5
17
  set -euo pipefail
6
18
 
19
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20
+ PLUGIN_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
21
+ FRAGMENT_FILE="$PLUGIN_ROOT/skills/commands/session-end.md"
22
+
23
+ if [ ! -f "$FRAGMENT_FILE" ]; then
24
+ exit 0
25
+ fi
26
+
27
+ FRAGMENT_CONTENT=$(cat "$FRAGMENT_FILE")
28
+
7
29
  # Escape string for JSON embedding using bash parameter substitution
8
30
  escape_for_json() {
9
31
  local s="$1"
@@ -15,9 +37,14 @@ escape_for_json() {
15
37
  printf '%s' "$s"
16
38
  }
17
39
 
18
- session_context="<IMPORTANT>\n**IMMEDIATE ACTION REQUIRED — SESSION ENDING:**\n\n1. Call \`mcp__total-recall__session_context\` to get current hot tier entries\n2. If there are 2+ hot entries, launch the \`compactor\` agent (subagent_type: \`total-recall:compactor\`) with the entries as input, then execute its decisions:\n - \`carry_forward\`: leave in hot tier (no action)\n - \`promote\` with \`summary\`: call \`memory_store\` with the summary in warm tier, then \`memory_delete\` the source entries\n - \`promote\` without \`summary\`: call \`memory_promote\` for each entry to warm tier\n - \`discard\`: call \`memory_delete\` with the reason\n3. Call \`mcp__total-recall__session_end\` for final bookkeeping\n\nDo this silently — do not announce memory operations.\n</IMPORTANT>"
40
+ session_context=$(escape_for_json "$FRAGMENT_CONTENT")
19
41
 
20
- # Platform-aware JSON output
42
+ # Platform-aware JSON output:
43
+ # - Cursor: additional_context (snake_case) — note: Cursor 1.7 has no
44
+ # SessionEnd hook, so this branch is unreachable today but kept for
45
+ # forward compatibility
46
+ # - Claude Code: hookSpecificOutput.additionalContext (nested)
47
+ # - Copilot CLI / others: additionalContext (top-level, SDK standard)
21
48
  if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
22
49
  printf '{\n "additional_context": "%s"\n}\n' "$session_context"
23
50
  elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
@@ -6,7 +6,7 @@ set -euo pipefail
6
6
 
7
7
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
8
  PLUGIN_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
9
- SKILL_FILE="$PLUGIN_ROOT/skills/total-recall/SKILL.md"
9
+ SKILL_FILE="$PLUGIN_ROOT/skills/commands/SKILL.md"
10
10
 
11
11
  if [ ! -f "$SKILL_FILE" ]; then
12
12
  exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strvmarv/total-recall",
3
- "version": "0.6.8-beta.7",
3
+ "version": "0.7.1",
4
4
  "description": "Multi-tiered memory and knowledge base plugin for TUI coding assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: total-recall
3
- description: Manage total-recall memory system. Subcommands: help, status, search, store, forget, inspect, promote, demote, history, lineage, export, import, ingest, kb, compact, eval, config. Also governs automatic memory capture, retrieval, and compaction.
2
+ name: commands
3
+ description: Manage the total-recall memory system and govern automatic capture, retrieval, and compaction. Use when the user invokes /total-recall:commands, asks to search/store/forget memories, inspect tiers, manage the knowledge base, run eval, or configure total-recall.
4
4
  ---
5
5
 
6
- **IMMEDIATE ACTION REQUIRED — before responding to the user's first message, call the `mcp__total-recall__session_start` MCP tool. This syncs host imports and loads hot tier context. If `session_start` has already run server-side, the call returns cached results instantly.**
6
+ **IMMEDIATE ACTION REQUIRED — before responding to the user's first message, call the total-recall `session_start` MCP tool. This syncs host imports and loads hot tier context. If `session_start` has already run server-side, the call returns cached results instantly.**
7
7
 
8
8
  # total-recall
9
9
 
@@ -46,14 +46,7 @@ On each user message that is a question or task request:
46
46
 
47
47
  ### Session End
48
48
 
49
- 1. Call `session_context` to get current hot tier entries
50
- 2. If there are 2+ hot entries, launch the `compactor` agent with the entries as input
51
- 3. Parse the agent's JSON decisions and execute them:
52
- - `carry_forward`: leave in hot tier (no action needed)
53
- - `promote` with `summary`: call `memory_store` with the summary in warm tier, then `memory_delete` the source entries
54
- - `promote` without `summary`: call `memory_promote` for each entry to warm tier
55
- - `discard`: call `memory_delete` with the reason
56
- 4. Call `session_end` for final bookkeeping
49
+ At session end, follow the directive in [`session-end.md`](session-end.md) it is the single source of truth, injected verbatim by the SessionEnd hook (`hooks/session-end/run.sh`).
57
50
 
58
51
  ### Rules
59
52
 
@@ -66,7 +59,7 @@ On each user message that is a question or task request:
66
59
 
67
60
  ## Commands
68
61
 
69
- `/total-recall <subcommand> [args]`
62
+ `/total-recall:commands <subcommand> [args]`
70
63
 
71
64
  ### help
72
65
 
@@ -106,7 +99,7 @@ Call the `status` MCP tool. Format as a dashboard showing:
106
99
 
107
100
  ### search <query>
108
101
 
109
- Call `memory_search` with the query, all tiers enabled, top_k=10. Format results grouped by tier, showing: content preview, similarity score, source, tags. Offer actions: `/total-recall promote <id>` or `/total-recall forget <id>`.
102
+ Call `memory_search` with the query, all tiers enabled, top_k=10. Format results grouped by tier, showing: content preview, similarity score, source, tags. Offer actions: `/total-recall:commands promote <id>` or `/total-recall:commands forget <id>`.
110
103
 
111
104
  ### store <content>
112
105
 
@@ -0,0 +1,11 @@
1
+ **IMMEDIATE ACTION REQUIRED — SESSION ENDING:**
2
+
3
+ 1. Call the total-recall `session_context` MCP tool to get current hot tier entries
4
+ 2. If there are 2+ hot entries, launch the `total-recall:compactor` agent with the entries as input, then execute its decisions:
5
+ - `carry_forward`: leave in hot tier (no action)
6
+ - `promote` with `summary`: call `memory_store` with the summary in warm tier, then `memory_delete` the source entries
7
+ - `promote` without `summary`: call `memory_promote` for each entry to warm tier
8
+ - `discard`: call `memory_delete` with the reason
9
+ 3. Call the total-recall `session_end` MCP tool for final bookkeeping
10
+
11
+ Do this silently — do not announce memory operations.
@@ -9,7 +9,7 @@ This skill ensures the total-recall memory system is active for this session.
9
9
 
10
10
  ## Immediate Action
11
11
 
12
- 1. Call the `mcp__total-recall__session_start` MCP tool now (if it already ran server-side, it returns cached results instantly)
12
+ 1. Call the total-recall `session_start` MCP tool now (if it already ran server-side, it returns cached results instantly)
13
13
  2. **Announce startup** using the returned data:
14
14
  - Report tier summary: hot, warm, cold, KB counts from `tierSummary`
15
15
  - If `lastSessionAge` is present, mention when the last session was
@@ -56,7 +56,7 @@ On each user message that is a question or task request:
56
56
  ### Session End
57
57
 
58
58
  1. Call `session_context` to get current hot tier entries
59
- 2. If there are 2+ hot entries, launch the `compactor` agent with the entries as input
59
+ 2. If there are 2+ hot entries, launch the `total-recall:compactor` agent with the entries as input
60
60
  3. Parse the agent's JSON decisions and execute them
61
61
  4. Call `session_end` for final bookkeeping
62
62