open-mem 0.14.1 → 0.14.2
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/README.md +57 -0
- package/dist/claude-code.js +88 -87
- package/dist/cursor.js +88 -87
- package/dist/daemon/manager.d.ts +33 -5
- package/dist/daemon/manager.d.ts.map +1 -1
- package/dist/daemon/pid.d.ts +23 -0
- package/dist/daemon/pid.d.ts.map +1 -1
- package/dist/daemon.js +35 -34
- package/dist/db/advisory-lock.d.ts +40 -0
- package/dist/db/advisory-lock.d.ts.map +1 -0
- package/dist/db/database.d.ts +37 -4
- package/dist/db/database.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -98
- package/dist/maintenance.js +48 -45
- package/dist/mcp.js +72 -71
- package/dist/platform-worker.d.ts.map +1 -1
- package/dist/runtime/queue-runtime.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -104,6 +104,63 @@ export OPEN_MEM_DASHBOARD=true
|
|
|
104
104
|
|
|
105
105
|
Six pages: Timeline, Sessions, Search, Stats, Operations, Settings. The Settings page doubles as a config control plane — preview changes, apply them, roll back if needed.
|
|
106
106
|
|
|
107
|
+
## SQLite resiliency contracts
|
|
108
|
+
|
|
109
|
+
open-mem now uses a fail-safe multi-process model for SQLite. Startup and routine operations are non-destructive by default.
|
|
110
|
+
|
|
111
|
+
- **No destructive startup recovery**: if DB setup or pragma initialization fails, open-mem returns an error and does not delete `.db`, `-wal`, or `-shm` files.
|
|
112
|
+
- **Coordinated writes**: mutating operations use advisory lock coordination plus SQLite write-lock semantics to reduce cross-process contention.
|
|
113
|
+
- **Daemon-aware workers**: platform workers check daemon liveness on startup. With a healthy daemon they run in `enqueue-only` mode and signal `PROCESS_NOW`; if daemon is unavailable they automatically fall back to `in-process` mode.
|
|
114
|
+
- **Safe maintenance defaults**: `reset-db` runs a preflight process check and is blocked when daemon/workers are active unless explicit `--force` is provided.
|
|
115
|
+
|
|
116
|
+
### Maintenance safety workflow
|
|
117
|
+
|
|
118
|
+
Use SQLite-native maintenance first:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Non-destructive WAL checkpoint
|
|
122
|
+
bunx open-mem-maintenance sqlite checkpoint --project /path/to/project --mode PASSIVE
|
|
123
|
+
|
|
124
|
+
# Non-destructive integrity check
|
|
125
|
+
bunx open-mem-maintenance sqlite integrity --project /path/to/project --max-errors 10
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
If a full reset is required:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Safe-by-default reset (blocked when active processes are detected)
|
|
132
|
+
bunx open-mem-maintenance reset-db --project /path/to/project
|
|
133
|
+
|
|
134
|
+
# If blocked, follow CLI remediation exactly:
|
|
135
|
+
# 1) Stop daemon and platform workers for this project.
|
|
136
|
+
# 2) Retry reset-db after processes exit.
|
|
137
|
+
# 3) To override (destructive), rerun with --force.
|
|
138
|
+
|
|
139
|
+
# Project-scoped stop sequence (PID file based)
|
|
140
|
+
PROJECT=/path/to/project
|
|
141
|
+
for pid_file in \
|
|
142
|
+
"$PROJECT/.open-mem/worker.pid" \
|
|
143
|
+
"$PROJECT/.open-mem/platform-worker-claude.pid" \
|
|
144
|
+
"$PROJECT/.open-mem/platform-worker-cursor.pid"; do
|
|
145
|
+
if [ -f "$pid_file" ]; then
|
|
146
|
+
kill "$(cat "$pid_file")" 2>/dev/null || true
|
|
147
|
+
fi
|
|
148
|
+
done
|
|
149
|
+
|
|
150
|
+
# Retry safe reset after processes exit
|
|
151
|
+
bunx open-mem-maintenance reset-db --project "$PROJECT"
|
|
152
|
+
|
|
153
|
+
# Explicit destructive override (only after stopping daemon/workers)
|
|
154
|
+
bunx open-mem-maintenance reset-db --project /path/to/project --force
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
For platform workers, `{"command":"health"}` (or HTTP `GET /v1/health`) reports `status.queue.mode`:
|
|
158
|
+
|
|
159
|
+
- `enqueue-only`: daemon is healthy; worker enqueues and signals `PROCESS_NOW`.
|
|
160
|
+
- `in-process`: local fallback mode when daemon is unavailable, dies, or signaling fails.
|
|
161
|
+
|
|
162
|
+
Migration note: previous workflows that relied on destructive reset during startup or ad-hoc `rm -rf .open-mem/` should move to the maintenance CLI flow above so active process checks and force intent are explicit.
|
|
163
|
+
|
|
107
164
|
## Documentation
|
|
108
165
|
|
|
109
166
|
- [Getting Started](docs/getting-started.md) — installation and first steps
|