memtrace 0.1.38 → 0.1.45

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.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/bin/memtrace.js +102 -14
  3. package/install.js +21 -181
  4. package/installer/dist/commands/doctor.d.ts +16 -0
  5. package/installer/dist/commands/doctor.js +86 -0
  6. package/installer/dist/commands/install.d.ts +9 -0
  7. package/installer/dist/commands/install.js +104 -0
  8. package/installer/dist/commands/picker.d.ts +6 -0
  9. package/installer/dist/commands/picker.js +22 -0
  10. package/installer/dist/fs-safe.d.ts +21 -0
  11. package/installer/dist/fs-safe.js +35 -0
  12. package/installer/dist/index.d.ts +2 -0
  13. package/installer/dist/index.js +52 -0
  14. package/installer/dist/skills.d.ts +17 -0
  15. package/installer/dist/skills.js +64 -0
  16. package/installer/dist/transformers/claude.d.ts +41 -0
  17. package/installer/dist/transformers/claude.js +400 -0
  18. package/installer/dist/transformers/cursor.d.ts +7 -0
  19. package/installer/dist/transformers/cursor.js +84 -0
  20. package/installer/dist/transformers/index.d.ts +7 -0
  21. package/installer/dist/transformers/index.js +7 -0
  22. package/installer/dist/transformers/types.d.ts +39 -0
  23. package/installer/dist/transformers/types.js +1 -0
  24. package/installer/dist/utils.d.ts +5 -0
  25. package/installer/dist/utils.js +22 -0
  26. package/installer/package.json +49 -0
  27. package/installer/skills/commands/memtrace-api-topology.md +65 -0
  28. package/installer/skills/commands/memtrace-cochange.md +76 -0
  29. package/installer/skills/commands/memtrace-evolution.md +135 -0
  30. package/installer/skills/commands/memtrace-graph.md +117 -0
  31. package/installer/skills/commands/memtrace-impact.md +64 -0
  32. package/installer/skills/commands/memtrace-index.md +66 -0
  33. package/installer/skills/commands/memtrace-quality.md +69 -0
  34. package/installer/skills/commands/memtrace-relationships.md +73 -0
  35. package/installer/skills/commands/memtrace-search.md +67 -0
  36. package/installer/skills/workflows/memtrace-change-impact-analysis.md +85 -0
  37. package/installer/skills/workflows/memtrace-codebase-exploration.md +108 -0
  38. package/installer/skills/workflows/memtrace-episode-replay.md +100 -0
  39. package/installer/skills/workflows/memtrace-first.md +120 -0
  40. package/installer/skills/workflows/memtrace-incident-investigation.md +125 -0
  41. package/installer/skills/workflows/memtrace-refactoring-guide.md +116 -0
  42. package/installer/skills/workflows/memtrace-session-continuity.md +98 -0
  43. package/package.json +7 -2
  44. package/skills/commands/memtrace-api-topology.md +3 -0
  45. package/skills/commands/memtrace-cochange.md +3 -0
  46. package/skills/commands/memtrace-evolution.md +3 -0
  47. package/skills/commands/memtrace-graph.md +54 -4
  48. package/skills/commands/memtrace-impact.md +3 -0
  49. package/skills/commands/memtrace-index.md +3 -0
  50. package/skills/commands/memtrace-quality.md +3 -0
  51. package/skills/commands/memtrace-relationships.md +3 -0
  52. package/skills/commands/memtrace-search.md +18 -13
  53. package/skills/workflows/memtrace-first.md +12 -0
  54. package/uninstall.js +22 -28
@@ -29,19 +29,24 @@ Find code using hybrid BM25 full-text + semantic vector search with Reciprocal R
29
29
 
30
30
  ### 2. Execute the search
31
31
 
32
- **find_code parameters:**
33
- - `query` — natural-language or exact text (required)
34
- - `repo_id` — scope to a single repo (optional; omit to search all)
35
- - `kind` — filter by symbol type: Function, Class, Method, Interface, APIEndpoint, APICall
36
- - `limit` — max results (default 10)
37
- - `as_of` — ISO-8601 timestamp for time-travel search
38
-
39
- **find_symbol parameters:**
40
- - `name` — exact or partial symbol name (required)
41
- - `fuzzy` — enable Levenshtein correction (default false)
42
- - `repo_id` — scope to a single repo (optional)
43
- - `kind` — filter by symbol type
44
- - `file_path` — filter by file path substring
32
+ > **Parameter types:** numbers must be JSON numbers, not strings. `limit: 20` is correct; `limit: "20"` returns `MCP error -32602: expected usize`.
33
+
34
+ **`find_code` parameters:**
35
+ - `query` — string, required. Natural-language or exact text.
36
+ - `repo_id` — string, optional. Scope to a single repo (omit to search all).
37
+ - `kind` — string, optional. Filter by symbol type: `"Function"`, `"Class"`, `"Method"`, `"Interface"`, `"APIEndpoint"`, `"APICall"`.
38
+ - `limit` — **integer**, optional. Max results. Default `20`, capped at `100`.
39
+ - `as_of` — string, optional. ISO-8601 timestamp for time-travel search (e.g. `"2026-04-01T00:00:00Z"`).
40
+ - `file_path` — string, optional. File path or directory substring to constrain results (e.g. `"cli/commands"` or `"auth.py"`).
41
+
42
+ **`find_symbol` parameters:**
43
+ - `name` — string, required. Exact or partial symbol name (e.g. `"ValidateToken"`).
44
+ - `fuzzy` — boolean, optional. Enable Levenshtein correction. Default `false`.
45
+ - `edit_distance` — **integer**, optional. Maximum Levenshtein edit distance for fuzzy search. Default `2`, capped at `2`.
46
+ - `repo_id` — string, optional. Scope to a single repo.
47
+ - `kind` — string, optional. Filter by symbol type (e.g. `"Function"`, `"Class"`, `"Variable"`).
48
+ - `file_path` — string, optional. Filter by file path substring.
49
+ - `limit` — **integer**, optional. Max results. Default `10`, capped at `50`.
45
50
 
46
51
  **Success criteria:** Results include `file_path`, `start_line`, `kind`, and relevance `score`.
47
52
 
@@ -16,6 +16,18 @@ Memtrace is the memory layer of the codebase. It has the full knowledge graph: e
16
16
 
17
17
  **97% better accuracy. 83% fewer wasted tokens. No exceptions.**
18
18
 
19
+ ## Parameter Types — Read This Before Calling Any Tool
20
+
21
+ All memtrace MCP tools are **strictly typed**. Pass JSON numbers (not strings) for integer parameters.
22
+
23
+ | Parameter | Correct | WRONG (fails with MCP error -32602) |
24
+ |---|---|---|
25
+ | `limit`, `min_size`, `depth`, `max_depth`, `last_n` | `limit: 20` | `limit: "20"` |
26
+ | `repo_id`, `branch`, `name`, `symbol_name`, `query` | `repo_id: "my-repo"` | `repo_id: my-repo` (unquoted) |
27
+ | `fuzzy`, `include_tests`, `invalidate` | `fuzzy: true` | `fuzzy: "true"` |
28
+
29
+ If you see `failed to deserialize parameters: invalid type: string "N", expected usize`, remove the quotes from the number and retry.
30
+
19
31
  ## Check Indexing First (Once Per Session)
20
32
 
21
33
  ```
package/uninstall.js CHANGED
@@ -4,7 +4,7 @@
4
4
  const os = require("os");
5
5
  const path = require("path");
6
6
  const fs = require("fs");
7
- const { execSync } = require("child_process");
7
+ const { execSync, spawnSync } = require("child_process");
8
8
 
9
9
  // ── Constants ─────────────────────────────────────────────────────────────────
10
10
 
@@ -140,38 +140,32 @@ function tryClaudeCliUninstall() {
140
140
 
141
141
  // ── Main uninstall logic ───────────────────────────────────────────────────
142
142
 
143
+ function legacyCleanup() {
144
+ try { removeSkills(); } catch (e) { console.warn(`memtrace: skill removal failed: ${e.message}`); }
145
+ try { tryClaudeCliUninstall(); } catch { /* silent */ }
146
+ try { removePlugin(); } catch (e) { console.warn(`memtrace: plugin removal failed: ${e.message}`); }
147
+ try { removeMcpServer(); } catch (e) { console.warn(`memtrace: MCP server removal failed: ${e.message}`); }
148
+ }
149
+
143
150
  function run() {
144
151
  console.log("memtrace: cleaning up...");
145
152
 
146
- // 1. Remove skills
147
- try {
148
- removeSkills();
149
- } catch (e) {
150
- console.warn(`memtrace: skill removal failed: ${e.message}`);
151
- }
152
-
153
- // 2. Try Claude CLI uninstall, then manual cleanup
154
- try {
155
- tryClaudeCliUninstall();
156
- } catch (e) {
157
- // silent
158
- }
159
-
160
- // 3. Remove plugin + marketplace from settings
161
- try {
162
- removePlugin();
163
- } catch (e) {
164
- console.warn(`memtrace: plugin removal failed: ${e.message}`);
165
- }
166
-
167
- // 4. Remove MCP server from settings
168
- try {
169
- removeMcpServer();
170
- } catch (e) {
171
- console.warn(`memtrace: MCP server removal failed: ${e.message}`);
153
+ // Try delegating to the compiled installer (handles ALL agents via registry)
154
+ const bundled = path.join(__dirname, "installer", "dist", "index.js");
155
+ if (fs.existsSync(bundled)) {
156
+ const result = spawnSync(process.execPath, [bundled, "uninstall"], {
157
+ stdio: "inherit",
158
+ });
159
+ if (result.status !== 0) {
160
+ console.warn(`memtrace: installer uninstall exited ${result.status}; falling back to legacy cleanup`);
161
+ legacyCleanup();
162
+ }
163
+ } else {
164
+ // No bundled installer — use legacy JS-only cleanup (Claude-only)
165
+ legacyCleanup();
172
166
  }
173
167
 
174
- // 5. Clean up ~/.memtrace/ (the persisted uninstall script itself)
168
+ // Always clean up ~/.memtrace/
175
169
  try {
176
170
  const memtraceDir = path.join(os.homedir(), ".memtrace");
177
171
  if (fs.existsSync(memtraceDir)) {