sessionmem 1.3.0 → 1.5.0
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/.github/sessionmem-logo.svg +57 -0
- package/CHANGELOG.md +128 -0
- package/CONTRIBUTING.md +130 -0
- package/README.md +292 -108
- package/SECURITY.md +33 -0
- package/dist/adapters/diagnostics.js +109 -0
- package/dist/adapters/generic.js +6 -2
- package/dist/adapters/global/antigravity.js +4 -1
- package/dist/adapters/global/claudeCode.js +19 -4
- package/dist/adapters/global/codex.js +7 -6
- package/dist/adapters/global/qcoder.js +4 -1
- package/dist/adapters/ide/cline.js +3 -0
- package/dist/adapters/ide/cursor.js +3 -0
- package/dist/adapters/ide/installer.js +17 -5
- package/dist/adapters/ide/windsurf.js +3 -0
- package/dist/adapters/installedHosts.js +51 -0
- package/dist/cli/commands/dedupe.js +1 -1
- package/dist/cli/commands/doctor.js +146 -0
- package/dist/cli/commands/entities.js +27 -0
- package/dist/cli/commands/history.js +23 -0
- package/dist/cli/commands/import.js +15 -44
- package/dist/cli/commands/ingestHook.js +4 -78
- package/dist/cli/commands/install.js +37 -59
- package/dist/cli/commands/list.js +3 -0
- package/dist/cli/commands/run.js +10 -12
- package/dist/cli/commands/scan.js +16 -0
- package/dist/cli/commands/search.js +9 -4
- package/dist/cli/commands/team.js +7 -3
- package/dist/cli/commands/ui.js +67 -0
- package/dist/cli/commands/uninstall.js +2 -1
- package/dist/cli/commands/watch.js +48 -0
- package/dist/cli/context.js +8 -6
- package/dist/cli/index.js +48 -7
- package/dist/cli/projectId.js +1 -2
- package/dist/cli/transcriptSweep.js +182 -0
- package/dist/core/api/contracts.js +1 -0
- package/dist/core/api/memoryCoreService.js +8 -0
- package/dist/core/api/sessionLifecycleService.js +13 -1
- package/dist/core/capture/toolEvent.js +82 -0
- package/dist/core/config/policyConfig.js +5 -1
- package/dist/core/extract/factClaims.js +97 -0
- package/dist/core/extract/knowledge.js +127 -0
- package/dist/core/injection/tokenBudget.js +10 -2
- package/dist/core/retrieve/retrieveMemories.js +20 -4
- package/dist/core/schema/migrations/012_transcript_checkpoints.sql +4 -0
- package/dist/core/schema/migrations/013_fts_porter.sql +32 -0
- package/dist/core/schema/migrations/014_memory_entities.sql +19 -0
- package/dist/core/schema/migrations/015_memory_supersessions.sql +41 -0
- package/dist/core/schema/runMigrations.js +55 -5
- package/dist/core/storage/db.js +31 -9
- package/dist/core/storage/knowledgeRepo.js +67 -0
- package/dist/core/storage/memoryRepo.js +45 -12
- package/dist/core/storage/memorySearchRepo.js +30 -20
- package/dist/core/storage/supersessionRepo.js +101 -0
- package/dist/core/summarize/cloudSummarizer.js +3 -8
- package/dist/core/summarize/summaryShape.js +1 -1
- package/dist/ui/assets.js +181 -0
- package/dist/ui/server.js +147 -0
- package/docs/REGISTRY_LISTING.md +88 -0
- package/docs/architecture.md +77 -0
- package/docs/benchmark.md +122 -0
- package/docs/cloud-summarization.md +57 -0
- package/docs/migration.md +44 -0
- package/docs/privacy-and-retention.md +139 -0
- package/docs/team-mode.md +117 -0
- package/docs/troubleshooting.md +126 -0
- package/docs/typescript-upgrade.md +48 -0
- package/package.json +25 -13
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
This guide covers install failures, adapter (MCP host) issues, and `better-sqlite3` native-build failures. Configuration lives in `~/.sessionmem/config.json`.
|
|
4
|
+
|
|
5
|
+
## Run offline diagnostics
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
sessionmem doctor
|
|
9
|
+
sessionmem doctor --adapter claude-code # select one host explicitly
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Doctor prints PASS or FAIL and a fix hint for each problem. Any failed check
|
|
13
|
+
returns a nonzero exit status. It checks:
|
|
14
|
+
|
|
15
|
+
- **Memory store:** the selected database exists, opens, and passes SQLite's quick integrity check. It does not create a missing database.
|
|
16
|
+
- **Schema:** all bundled migrations have been applied. It reports pending or unrecognized migrations without changing the schema.
|
|
17
|
+
- **Hooks, per host:** Claude Code's SessionStart, SessionEnd, and PostToolUse commands, types, matchers, and enabled state match the current version's definitions. Other hosts report that lifecycle hooks are not required.
|
|
18
|
+
- **Adapter wiring, per host:** the installed MCP entry matches the installer, its local command starts, the server version matches, and the expected tools and stats response work. This tests the configured server process without starting the coding agent itself.
|
|
19
|
+
- **Recall:** the real memory service writes and retrieves a canary in a separate temporary project. The transaction is rolled back on success or failure, including index and access-count changes.
|
|
20
|
+
|
|
21
|
+
For Codex, the wiring check supports the installer-generated TOML command and
|
|
22
|
+
args. Custom Codex launch settings require manual verification.
|
|
23
|
+
|
|
24
|
+
All checks work offline, including when cloud summarization is enabled. Doctor
|
|
25
|
+
does not summarize sessions or sync shared memories. It honors `SESSIONMEM_DB_PATH`
|
|
26
|
+
and the same host overrides as install. Keep those environment settings when
|
|
27
|
+
running a suggested repair.
|
|
28
|
+
|
|
29
|
+
Safe repair commands printed by doctor include:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
sessionmem ping # initialize a missing store / apply pending migrations
|
|
33
|
+
sessionmem install --adapter claude-code # repair MCP registration and hook definitions
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Re-run doctor after repair. A corrupt store, a database from a newer version,
|
|
37
|
+
globally disabled hooks, or missing filesystem permissions needs the indicated
|
|
38
|
+
manual repair first; doctor does not delete data or downgrade a schema.
|
|
39
|
+
|
|
40
|
+
## Install failures
|
|
41
|
+
|
|
42
|
+
### `config.json` not written
|
|
43
|
+
|
|
44
|
+
`sessionmem install` creates `~/.sessionmem/config.json` only if the file is missing. It leaves an existing config unchanged. To restore defaults, move or delete the old file and re-run `sessionmem install`. To change individual settings, use `sessionmem config set`.
|
|
45
|
+
|
|
46
|
+
### Adapter not detected
|
|
47
|
+
|
|
48
|
+
`install` discovers installed hosts from executables on the machine, including
|
|
49
|
+
from a plain terminal. Automatic discovery currently supports Claude Code on
|
|
50
|
+
`PATH`, `~/.local/bin/claude`, or `~/.claude/local/claude` (including Windows
|
|
51
|
+
executable extensions). It does not rely on an active agent session or treat a
|
|
52
|
+
leftover config directory as proof that the host is installed.
|
|
53
|
+
|
|
54
|
+
If no supported host is found, install exits nonzero before creating files. Put
|
|
55
|
+
Claude Code on `PATH` or select a host with `sessionmem install --adapter <name>`.
|
|
56
|
+
Use the flag for other adapters, such as `--adapter cline` or `--adapter windsurf`,
|
|
57
|
+
and for automation. Run `sessionmem doctor --adapter <name>` afterward. The
|
|
58
|
+
`SESSIONMEM_ADAPTER` environment variable is also supported; the flag wins.
|
|
59
|
+
|
|
60
|
+
### Command not found
|
|
61
|
+
|
|
62
|
+
If `sessionmem` is not on your `PATH` after `npm install -g sessionmem`, your npm global bin directory is not on `PATH`. Add npm's global prefix `bin` to your shell `PATH`, or invoke via `npx sessionmem`.
|
|
63
|
+
|
|
64
|
+
## Adapter issues
|
|
65
|
+
|
|
66
|
+
Each MCP host uses its own adapter. If the server starts but memories are missing, check the host's configuration:
|
|
67
|
+
|
|
68
|
+
- **Claude Code**: if memories are not injected at session start, run `sessionmem doctor --adapter claude-code`. Re-run `sessionmem install --adapter claude-code` to refresh the registration in `~/.claude.json` and all three hooks in `~/.claude/settings.json`, then restart the agent.
|
|
69
|
+
- **Cursor**: run `sessionmem doctor --adapter cursor`, repair registration with `sessionmem install --adapter cursor`, and restart Cursor so it reloads MCP servers.
|
|
70
|
+
- **Generic MCP host**: for any other MCP-compatible host, ensure the host is configured to launch `sessionmem run` as the MCP server command. If the host starts but no memory appears, check that the working directory matches the project whose memories you expect.
|
|
71
|
+
|
|
72
|
+
If commands hang after the host loads, run `sessionmem doctor --adapter <name>`
|
|
73
|
+
to check the configured MCP command as well as local database access. A missing
|
|
74
|
+
`sessionmem` executable, stale server version, or failed MCP response fails the
|
|
75
|
+
adapter wiring check. Fix `PATH` for the environment that starts your host too.
|
|
76
|
+
|
|
77
|
+
## "0 sessions" / no session data recorded
|
|
78
|
+
|
|
79
|
+
If `sessionmem savings` reports no session data or `sessionmem stats` shows `sessions: 0`, check the following.
|
|
80
|
+
|
|
81
|
+
### The hooks are not installed
|
|
82
|
+
|
|
83
|
+
Session events are captured by a `PostToolUse` hook that `sessionmem install` registers in `~/.claude/settings.json`. If you installed sessionmem before the auto-ingest hook existed, that hook is missing. Re-run `sessionmem install` (it is idempotent) and restart your editor, then confirm the entry exists:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
sessionmem install
|
|
87
|
+
sessionmem stats # check the session_events counter after a few tool calls
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
To watch the hook work in real time, run your host with `SESSIONMEM_DEBUG=1`; the hook then reports each ingest to stderr, including the project id it wrote to.
|
|
91
|
+
|
|
92
|
+
### Memory is keyed to the repository
|
|
93
|
+
|
|
94
|
+
A project's memories are keyed by its **repository root**, the nearest directory containing `.git`. All subdirectories in one repository share the same memory bucket.
|
|
95
|
+
|
|
96
|
+
Outside a repository, the id falls back to the exact working directory. Two different directories that are not in a repository are two different projects, so running `sessionmem stats` from a different folder than the one your host session used will show an empty store. Either run from inside the repository, or pin the id explicitly:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
export SESSIONMEM_PROJECT_ID=my-project
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Use `sessionmem browse` to list every project that has memories along with its id; the current project is marked.
|
|
103
|
+
|
|
104
|
+
### Not enough events to summarize
|
|
105
|
+
|
|
106
|
+
`handleSessionEnd` only writes a session summary once at least 3 events were captured. A very short session is skipped by design and reports `not enough session events to summarize`.
|
|
107
|
+
|
|
108
|
+
## `better-sqlite3` native-build failures
|
|
109
|
+
|
|
110
|
+
`sessionmem` stores memories in SQLite via `better-sqlite3`, which is a **native** module compiled for your platform and Node version. Most install-time crashes come from this native build.
|
|
111
|
+
|
|
112
|
+
### node-gyp build errors
|
|
113
|
+
|
|
114
|
+
If `npm install` fails compiling `better-sqlite3` with `node-gyp` errors, your toolchain is incomplete:
|
|
115
|
+
|
|
116
|
+
- **Windows**: install the Visual Studio Build Tools (MSVC C++ workload). `node-gyp` needs an MSVC compiler; without it the native build fails.
|
|
117
|
+
- **macOS**: install the Xcode Command Line Tools (`xcode-select --install`).
|
|
118
|
+
- **Linux**: install `build-essential` (or your distro's equivalent: a C/C++ compiler, `make`, and `python3`).
|
|
119
|
+
|
|
120
|
+
### ABI mismatch (Node 20 vs 22)
|
|
121
|
+
|
|
122
|
+
`better-sqlite3` is compiled against a specific Node ABI. If you switch Node versions (for example from Node 20 to Node 22), a prebuilt or previously compiled binary can fail to load with a module-version / ABI mismatch error. Rebuild the native module against your current Node by reinstalling, or run `npm rebuild better-sqlite3`. If you use a Node version manager, make sure you reinstall after switching versions.
|
|
123
|
+
|
|
124
|
+
### Confirming the build
|
|
125
|
+
|
|
126
|
+
After a successful build, `sessionmem stats` (or any command that touches the database) will run without a native-load error. A native-build failure typically surfaces immediately as a "cannot find module" or "was compiled against a different Node.js version" error the first time the database is opened.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# TypeScript 7 upgrade status
|
|
2
|
+
|
|
3
|
+
The supported development toolchain currently uses TypeScript 6.0.3. Do not
|
|
4
|
+
force TypeScript 7 into the dependency tree or disable peer dependency checks.
|
|
5
|
+
This is a tooling compatibility issue, not an application type error.
|
|
6
|
+
|
|
7
|
+
## Why Dependabot PR #21 fails
|
|
8
|
+
|
|
9
|
+
PR #21 upgrades `typescript` from 6.0.3 to 7.0.2. On every CI platform, `npm ci`
|
|
10
|
+
fails with `ERESOLVE` before lint, typecheck, build, or tests run:
|
|
11
|
+
|
|
12
|
+
- The PR's typescript-eslint 8.62.1 requires `typescript >=4.8.4 <6.1.0`.
|
|
13
|
+
- The latest published typescript-eslint checked for this review, 8.71.2,
|
|
14
|
+
still has that peer requirement. Updating the linter alone does not fix it.
|
|
15
|
+
- A separate scratch installation forced to TypeScript 7.0.2 plus
|
|
16
|
+
typescript-eslint 8.71.2 fails on import with
|
|
17
|
+
`Error: typescript-eslint does not support TS 7.0.`
|
|
18
|
+
- TypeScript 7's root export provides version information, not the previous
|
|
19
|
+
compiler API: `createSourceFile` and `SyntaxKind` are both undefined.
|
|
20
|
+
The new `typescript/unstable/*` APIs are not drop-in replacements for tools
|
|
21
|
+
that consume TypeScript 6's API.
|
|
22
|
+
|
|
23
|
+
The standalone TypeScript 7.0.2 compiler successfully typechecks this repository
|
|
24
|
+
with `tsc --noEmit -p tsconfig.json`. That does not make the whole toolchain
|
|
25
|
+
compatible: ESLint imports typescript-eslint from `eslint.config.mjs`, so bypassing
|
|
26
|
+
npm's peer checks still leaves lint broken. No application or tsconfig change
|
|
27
|
+
can supply the missing upstream API.
|
|
28
|
+
|
|
29
|
+
## Upgrade criteria
|
|
30
|
+
|
|
31
|
+
Keep TypeScript 6 until typescript-eslint explicitly supports the selected
|
|
32
|
+
TypeScript 7 release and its import/parser work with that compiler. Dependabot
|
|
33
|
+
continues TypeScript 6 updates; TypeScript 7+ version updates are temporarily
|
|
34
|
+
ignored to avoid recreating a known failing PR. Remove that ignore when support
|
|
35
|
+
lands, update TypeScript and typescript-eslint together, regenerate the lockfile
|
|
36
|
+
with normal peer resolution, and run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm ci
|
|
40
|
+
npm run build
|
|
41
|
+
npm run typecheck
|
|
42
|
+
npm run lint
|
|
43
|
+
npm test
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
All CI operating systems and Node versions, including packaged-install smoke
|
|
47
|
+
tests and the security job, must pass before accepting the upgrade. Revisit
|
|
48
|
+
[PR #21](https://github.com/catfish-1234/sessionmem/pull/21) at that point.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sessionmem",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local-first MCP memory layer for coding agents across Claude Code, Codex, Cursor, Cline, Windsurf, and other MCP-compatible hosts.",
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
},
|
|
13
13
|
"mcpName": "io.github.catfish-1234/sessionmem",
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
15
|
+
"dist",
|
|
16
|
+
"docs",
|
|
17
|
+
"CHANGELOG.md",
|
|
18
|
+
"SECURITY.md",
|
|
19
|
+
"CONTRIBUTING.md",
|
|
20
|
+
".github/sessionmem-logo.svg"
|
|
16
21
|
],
|
|
17
22
|
"publishConfig": {
|
|
18
23
|
"access": "public"
|
|
@@ -28,24 +33,31 @@
|
|
|
28
33
|
"lint": "eslint .",
|
|
29
34
|
"typecheck": "tsc --noEmit",
|
|
30
35
|
"benchmark": "node scripts/benchmark.mjs",
|
|
31
|
-
"version": "node scripts/sync-version.mjs && git add package/package.json .claude-plugin/plugin.json server.json",
|
|
36
|
+
"version": "node scripts/sync-version.mjs && git add package/package.json .claude-plugin/plugin.json server.json Dockerfile",
|
|
32
37
|
"postversion": "npm run build"
|
|
33
38
|
},
|
|
34
39
|
"dependencies": {
|
|
35
|
-
"@anthropic-ai/sdk": "^0.
|
|
36
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
37
|
-
"better-sqlite3": "^12.
|
|
38
|
-
"commander": "^
|
|
40
|
+
"@anthropic-ai/sdk": "^0.135.0",
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
42
|
+
"better-sqlite3": "^12.11.1",
|
|
43
|
+
"commander": "^14.0.3",
|
|
39
44
|
"js-tiktoken": "^1.0.21",
|
|
40
|
-
"zod": "^4.
|
|
45
|
+
"zod": "^4.6.7"
|
|
41
46
|
},
|
|
42
47
|
"devDependencies": {
|
|
43
48
|
"@eslint/js": "^10.0.1",
|
|
44
|
-
"@types/better-sqlite3": "^
|
|
45
|
-
"eslint": "^10.
|
|
46
|
-
"globals": "^17.
|
|
49
|
+
"@types/better-sqlite3": "^9.6.0",
|
|
50
|
+
"eslint": "^10.12.0",
|
|
51
|
+
"globals": "^17.13.0",
|
|
47
52
|
"typescript": "^6.0.3",
|
|
48
|
-
"typescript-eslint": "^8.
|
|
53
|
+
"typescript-eslint": "^8.71.2",
|
|
49
54
|
"vitest": "^4.1.8"
|
|
50
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": "^20.19.0 || >=22.13.0"
|
|
58
|
+
},
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/catfish-1234/sessionmem/issues"
|
|
61
|
+
},
|
|
62
|
+
"homepage": "https://github.com/catfish-1234/sessionmem#readme"
|
|
51
63
|
}
|