memindex 1.3.0 → 1.4.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.
Files changed (43) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.qoder-plugin/plugin.json +1 -1
  5. package/README.md +84 -41
  6. package/dist/bug-report/index.js +55 -55
  7. package/dist/npx-cli/index.js +392 -323
  8. package/dist/opencode-plugin/index.js +34 -34
  9. package/dist/pi-extension/index.js +6 -6
  10. package/integrations/dsh/lib/index.js +24 -24
  11. package/integrations/dsh/package.json +1 -1
  12. package/integrations/hermes/memindex/client.py +11 -6
  13. package/integrations/omp/hooks/memindex.ts +5 -1
  14. package/integrations/openclaw/TESTING.md +1 -1
  15. package/integrations/openclaw/dist/index.js +9 -9
  16. package/integrations/openclaw/e2e-verify.sh +8 -1
  17. package/integrations/openclaw/openclaw.plugin.json +1 -1
  18. package/integrations/openclaw/src/index.test.ts +3 -1
  19. package/integrations/openclaw/src/index.ts +15 -5
  20. package/package.json +1 -1
  21. package/plugin/.claude-plugin/plugin.json +1 -1
  22. package/plugin/.codex-plugin/plugin.json +1 -1
  23. package/plugin/.qoder-plugin/plugin.json +1 -1
  24. package/plugin/hooks.json +1 -13
  25. package/plugin/package.json +1 -1
  26. package/plugin/scripts/context-generator.cjs +48 -47
  27. package/plugin/scripts/context-generator.cjs.map +3 -3
  28. package/plugin/scripts/mcp-server.cjs +77 -77
  29. package/plugin/scripts/mcp-server.cjs.map +2 -2
  30. package/plugin/scripts/statusline.cjs +1 -0
  31. package/plugin/scripts/transcript-watcher.cjs +34 -34
  32. package/plugin/scripts/transcript-watcher.cjs.map +3 -3
  33. package/plugin/scripts/worker-service.cjs +561 -550
  34. package/plugin/scripts/worker-service.cjs.map +3 -3
  35. package/plugin/skills/cloud-sync/SKILL.md +5 -2
  36. package/plugin/skills/mode-creator/SKILL.md +1 -1
  37. package/plugin/skills/timeline-report/SKILL.md +8 -5
  38. package/plugin/skills/weekly-digests/SKILL.md +5 -2
  39. package/plugin/sqlite/SessionStore.js +93 -93
  40. package/plugin/sqlite/SessionStore.js.map +2 -2
  41. package/plugin/ui/tv.html +55 -28
  42. package/plugin/ui/viewer-bundle.js +22 -15
  43. package/plugin/ui/viewer.html +72 -0
@@ -34,7 +34,10 @@ Resolve the worker port and query the always-registered status route:
34
34
 
35
35
  ```bash
36
36
  PORT="${MEMINDEX_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(38700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.memindex','settings.json'),'utf-8'));process.stdout.write(String(s.MEMINDEX_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
37
- curl -s "http://127.0.0.1:${PORT}/api/sync/status"
37
+ # memcurl sends the install secret without putting it in the command line
38
+ memcurl() { printf 'X-Memindex-Secret: %s
39
+ ' "$(cat "${MEMINDEX_DATA_DIR:-$HOME/.memindex}/worker-secret")" | curl -H @- "$@"; }
40
+ memcurl -s "http://127.0.0.1:${PORT}/api/sync/status"
38
41
  ```
39
42
 
40
43
  - `configured: true` and `hub.reachable: true` → the worker completed an
@@ -69,7 +72,7 @@ Once the settings are saved, poll the status route every five seconds for up to
69
72
  30 seconds. If the worker was not restarted, restart it first:
70
73
 
71
74
  ```bash
72
- curl -s -X POST "http://127.0.0.1:${PORT}/api/admin/restart"
75
+ memcurl -s -X POST "http://127.0.0.1:${PORT}/api/admin/restart"
73
76
  ```
74
77
 
75
78
  Success means `configured: true`, `hub.reachable: true`, and `lastError: null`.
@@ -105,7 +105,7 @@ Verify all of the following:
105
105
  1. Restart reports a new healthy worker and exits successfully.
106
106
  2. The installed file exists under the resolved data directory.
107
107
  3. `settings.json` names the intended `MEMINDEX_MODE` without displaying secrets.
108
- 4. Request full startup context with the `session_start_context` MCP tool when available. Otherwise call `/api/context/inject?project=mode-creator-verification&full=true` on the configured local worker.
108
+ 4. Request full startup context with the `session_start_context` MCP tool when available. Otherwise call `/api/context/inject?project=mode-creator-verification&full=true` on the configured local worker, sending the `X-Memindex-Secret` header (the contents of `worker-secret` in the data directory).
109
109
  5. Startup context contains `Mode: <mode name> (<mode id>)`.
110
110
 
111
111
  If the worker falls back to `code`, inspect the worker log for a mode validation or lookup error, repair the mode, and repeat the restart. Do not describe a fallback as successful activation.
@@ -26,6 +26,9 @@ The memindex worker must be running. The project must have memindex observations
26
26
 
27
27
  ```bash
28
28
  WORKER_PORT="${MEMINDEX_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(38700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.memindex','settings.json'),'utf-8'));process.stdout.write(String(s.MEMINDEX_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
29
+ # memcurl sends the install secret without putting it in the command line
30
+ memcurl() { printf 'X-Memindex-Secret: %s
31
+ ' "$(cat "${MEMINDEX_DATA_DIR:-$HOME/.memindex}/worker-secret")" | curl -H @- "$@"; }
29
32
  ```
30
33
 
31
34
  This honors `MEMINDEX_WORKER_PORT` env, then `~/.memindex/settings.json`, then falls back to the per-UID default `38700 + (uid % 100)` — matching how the worker itself picks its port. Required for multi-account setups (#2101) and any user who has overridden the default port (#2103).
@@ -58,7 +61,7 @@ If a worktree is detected, use `$parent_project` (the basename of the parent rep
58
61
  Use Bash to fetch the complete timeline from the memindex worker API:
59
62
 
60
63
  ```bash
61
- curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true"
64
+ memcurl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true"
62
65
  ```
63
66
 
64
67
  This returns the entire compressed timeline -- every observation, session boundary, and summary across the project's full history. The response is pre-formatted markdown optimized for LLM consumption.
@@ -68,7 +71,7 @@ This returns the entire compressed timeline -- every observation, session bounda
68
71
  - Medium project (1,000-10,000 observations): ~50-300K tokens
69
72
  - Large project (10,000-35,000 observations): ~300-750K tokens
70
73
 
71
- If the response is empty or returns an error, the worker may not be running or the project name may be wrong. Try `curl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify the worker is healthy.
74
+ If the response is empty or returns an error, the worker may not be running or the project name may be wrong. Try `memcurl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify the worker is healthy.
72
75
 
73
76
  ### Step 3: Estimate Token Count
74
77
 
@@ -195,15 +198,15 @@ Tell the user:
195
198
 
196
199
  ## Error Handling
197
200
 
198
- - **Empty timeline:** "No observations found for project 'X'. Check the project name with: `curl -s \"http://localhost:${WORKER_PORT}/api/search?query=*&limit=1\"`"
201
+ - **Empty timeline:** "No observations found for project 'X'. Check the project name with: `memcurl -s \"http://localhost:${WORKER_PORT}/api/search?query=*&limit=1\"`"
199
202
  - **Worker not running:** "The memindex worker is not responding on port ${WORKER_PORT}. Start it with your usual method or check `ps aux | grep worker-service`."
200
- - **Timeline too large:** For projects with 50,000+ observations, the timeline may exceed context limits. Suggest using date range filtering: `curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=X&full=true"` -- the current endpoint returns all observations; for extremely large projects, the user may want to analyze in time-windowed segments.
203
+ - **Timeline too large:** For projects with 50,000+ observations, the timeline may exceed context limits. Suggest using date range filtering: `memcurl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=X&full=true"` -- the current endpoint returns all observations; for extremely large projects, the user may want to analyze in time-windowed segments.
201
204
 
202
205
  ## Example
203
206
 
204
207
  User: "Write a journey report for the tokyo project"
205
208
 
206
- 1. Fetch: `curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=tokyo&full=true"`
209
+ 1. Fetch: `memcurl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=tokyo&full=true"`
207
210
  2. Estimate: "Timeline fetched: ~34,722 observations, estimated ~718K tokens. Proceed?"
208
211
  3. User confirms
209
212
  4. Deploy analysis agent with full timeline
@@ -32,6 +32,9 @@ If the user wants a single sweeping report, use `timeline-report` instead. This
32
32
 
33
33
  ```bash
34
34
  WORKER_PORT="${MEMINDEX_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(38700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.memindex','settings.json'),'utf-8'));process.stdout.write(String(s.MEMINDEX_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
35
+ # memcurl sends the install secret without putting it in the command line
36
+ memcurl() { printf 'X-Memindex-Secret: %s
37
+ ' "$(cat "${MEMINDEX_DATA_DIR:-$HOME/.memindex}/worker-secret")" | curl -H @- "$@"; }
35
38
  ```
36
39
 
37
40
  ## Workflow
@@ -55,7 +58,7 @@ echo "$parent_project"
55
58
 
56
59
  ```bash
57
60
  mkdir -p .scratch
58
- curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true" \
61
+ memcurl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true" \
59
62
  > .scratch/cm-timeline.md
60
63
  wc -l .scratch/cm-timeline.md
61
64
  ```
@@ -229,7 +232,7 @@ These rules emerged from running the pipeline end-to-end. Encode them every time
229
232
 
230
233
  ## Error Handling
231
234
 
232
- - **Empty timeline**: project name wrong, or worker not running. `curl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify.
235
+ - **Empty timeline**: project name wrong, or worker not running. `memcurl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify.
233
236
  - **Worker not running**: start it via your usual method or check `ps aux | grep worker-service`.
234
237
  - **Subagent returns malformed carry-forward**: extract the carry-forward block by regex (` ```carry-forward ... ``` `) and pass forward verbatim. If missing, ask the agent to retry with the explicit instruction "your reply MUST include the carry-forward block fenced as ```carry-forward ... ``` at the very end."
235
238
  - **One agent fails mid-pipeline**: retry that week with the same carry-forward. Don't skip — the chain breaks.