superlocalmemory 3.8.0 → 3.8.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/README.md +32 -120
  3. package/package.json +9 -2
  4. package/plugin/.claude-plugin/plugin.json +1 -2
  5. package/plugin/CLAUDE.md +3 -3
  6. package/plugin/agents/slm-governance-advisor.md +1 -1
  7. package/plugin/agents/slm-loop-runner.md +1 -1
  8. package/plugin/agents/slm-memory-advisor.md +2 -2
  9. package/plugin/agents/slm-optimize-advisor.md +1 -1
  10. package/plugin/requirements.txt +1 -1
  11. package/plugin/skills/slm-cache/SKILL.md +1 -1
  12. package/plugin/skills/slm-compress/SKILL.md +1 -1
  13. package/plugin/skills/slm-governance/SKILL.md +1 -1
  14. package/plugin/skills/slm-graph/SKILL.md +1 -1
  15. package/plugin/skills/slm-loop/SKILL.md +1 -1
  16. package/plugin/skills/slm-mesh/SKILL.md +1 -1
  17. package/plugin/skills/slm-profile/SKILL.md +1 -1
  18. package/plugin/skills/slm-recall/SKILL.md +3 -5
  19. package/plugin/skills/slm-remember/SKILL.md +1 -1
  20. package/plugin/skills/slm-scope/SKILL.md +1 -1
  21. package/plugin/skills/slm-session/SKILL.md +1 -1
  22. package/plugin/skills/slm-status/SKILL.md +1 -1
  23. package/plugin-src/rules/AGENTS.md +2 -1
  24. package/plugin-src/skills/slm-cache/SKILL.md +1 -1
  25. package/plugin-src/skills/slm-compress/SKILL.md +1 -1
  26. package/plugin-src/skills/slm-graph/SKILL.md +1 -1
  27. package/plugin-src/skills/slm-recall/SKILL.md +3 -5
  28. package/plugin-src/skills/slm-remember/SKILL.md +1 -1
  29. package/plugin-src/skills/slm-session/SKILL.md +1 -1
  30. package/plugin-src/skills/slm-status/SKILL.md +1 -1
  31. package/pyproject.toml +2 -1
  32. package/scripts/postinstall.js +7 -1
  33. package/src/superlocalmemory/__init__.py +1 -1
  34. package/src/superlocalmemory/cli/commands.py +494 -9
  35. package/src/superlocalmemory/cli/daemon.py +7 -0
  36. package/src/superlocalmemory/cli/loop_cmd.py +2 -7
  37. package/src/superlocalmemory/cli/main.py +72 -7
  38. package/src/superlocalmemory/cli/setup_wizard.py +142 -16
  39. package/src/superlocalmemory/cli/version_banner.py +17 -3
  40. package/src/superlocalmemory/core/backend_orchestrator.py +18 -16
  41. package/src/superlocalmemory/core/component_healer.py +144 -0
  42. package/src/superlocalmemory/core/component_registry.py +487 -0
  43. package/src/superlocalmemory/core/config.py +21 -0
  44. package/src/superlocalmemory/core/embedding_worker.py +4 -5
  45. package/src/superlocalmemory/core/embeddings.py +132 -45
  46. package/src/superlocalmemory/core/engine.py +29 -22
  47. package/src/superlocalmemory/core/engine_ingestion.py +332 -45
  48. package/src/superlocalmemory/core/ingestion_command.py +154 -25
  49. package/src/superlocalmemory/core/injection.py +12 -7
  50. package/src/superlocalmemory/core/maintenance.py +43 -0
  51. package/src/superlocalmemory/core/maintenance_scheduler.py +44 -6
  52. package/src/superlocalmemory/core/recall_pipeline.py +42 -4
  53. package/src/superlocalmemory/core/store_pipeline.py +195 -20
  54. package/src/superlocalmemory/hooks/hook_handlers.py +6 -1
  55. package/src/superlocalmemory/hooks/portable_kit.py +34 -2
  56. package/src/superlocalmemory/learning/model_rollback.py +3 -0
  57. package/src/superlocalmemory/learning/ranker_retrain_online.py +2 -0
  58. package/src/superlocalmemory/learning/reward.py +50 -0
  59. package/src/superlocalmemory/learning/source_quality.py +523 -1
  60. package/src/superlocalmemory/loops/ledger.py +25 -5
  61. package/src/superlocalmemory/mcp/_daemon_proxy.py +6 -2
  62. package/src/superlocalmemory/mcp/_pool_adapter.py +4 -1
  63. package/src/superlocalmemory/mcp/server.py +11 -30
  64. package/src/superlocalmemory/mcp/tools_active.py +1 -1
  65. package/src/superlocalmemory/mcp/tools_core.py +21 -5
  66. package/src/superlocalmemory/mcp/tools_learning.py +2 -2
  67. package/src/superlocalmemory/retrieval/bridge_discovery.py +14 -0
  68. package/src/superlocalmemory/retrieval/engine.py +53 -21
  69. package/src/superlocalmemory/retrieval/reranker.py +3 -4
  70. package/src/superlocalmemory/retrieval/spreading_activation.py +68 -38
  71. package/src/superlocalmemory/server/config_file.py +90 -0
  72. package/src/superlocalmemory/server/origin.py +50 -0
  73. package/src/superlocalmemory/server/routes/backup.py +293 -70
  74. package/src/superlocalmemory/server/routes/behavioral.py +342 -61
  75. package/src/superlocalmemory/server/routes/brain.py +57 -16
  76. package/src/superlocalmemory/server/routes/config_api.py +84 -82
  77. package/src/superlocalmemory/server/routes/entity.py +100 -23
  78. package/src/superlocalmemory/server/routes/evolution.py +103 -100
  79. package/src/superlocalmemory/server/routes/learning.py +286 -105
  80. package/src/superlocalmemory/server/routes/learning_telemetry.py +153 -0
  81. package/src/superlocalmemory/server/routes/memories.py +8 -3
  82. package/src/superlocalmemory/server/routes/mesh.py +121 -32
  83. package/src/superlocalmemory/server/routes/ratelimit.py +33 -25
  84. package/src/superlocalmemory/server/routes/stats.py +93 -155
  85. package/src/superlocalmemory/server/routes/token.py +3 -13
  86. package/src/superlocalmemory/server/routes/v3_api.py +184 -20
  87. package/src/superlocalmemory/server/unified_daemon.py +732 -41
  88. package/src/superlocalmemory/storage/embedding_migrator.py +235 -0
  89. package/src/superlocalmemory/storage/migration_runner.py +79 -1
  90. package/src/superlocalmemory/storage/migrations/M010_evolution_config.py +5 -0
  91. package/src/superlocalmemory/storage/migrations/M028_fact_entity_associations.py +270 -0
  92. package/src/superlocalmemory/storage/migrations/M029_behavioral_history_indexes.py +137 -0
  93. package/src/superlocalmemory/storage/migrations/M030_entity_explorer_indexes.py +93 -0
  94. package/src/superlocalmemory/storage/migrations/__init__.py +4 -0
  95. package/src/superlocalmemory/storage/schema.py +49 -1
  96. package/src/superlocalmemory/storage/schema_v32.py +2 -0
  97. package/src/superlocalmemory/storage/schema_v347.py +4 -0
  98. package/src/superlocalmemory/ui/index.html +6 -8
  99. package/src/superlocalmemory/ui/js/core.js +52 -9
  100. package/src/superlocalmemory/ui/js/dashboard.js +169 -82
  101. package/src/superlocalmemory/ui/js/od-backup.js +156 -65
  102. package/src/superlocalmemory/ui/js/od-brain.js +88 -51
  103. package/src/superlocalmemory/ui/js/od-components.js +147 -0
  104. package/src/superlocalmemory/ui/js/od-entities.js +65 -22
  105. package/src/superlocalmemory/ui/js/od-graph.js +46 -4
  106. package/src/superlocalmemory/ui/js/od-health.js +18 -0
  107. package/src/superlocalmemory/ui/js/od-memories.js +84 -5
  108. package/src/superlocalmemory/ui/js/od-mesh.js +23 -9
  109. package/src/superlocalmemory/ui/js/od-operations.js +36 -0
  110. package/src/superlocalmemory/ui/js/od-settings.js +186 -63
  111. package/src/superlocalmemory/ui/js/od-shell.js +249 -33
  112. package/src/superlocalmemory/ui/js/od-skills.js +44 -17
  113. package/src/superlocalmemory/ui/js/settings.js +15 -1
  114. package/plugin-src/.mcp.json +0 -12
  115. package/plugin-src/agents/slm-governance-advisor.md +0 -80
  116. package/plugin-src/agents/slm-loop-runner.md +0 -71
  117. package/plugin-src/agents/slm-memory-advisor.md +0 -49
  118. package/plugin-src/agents/slm-optimize-advisor.md +0 -44
  119. package/plugin-src/commands/slm-loop.md +0 -31
  120. package/plugin-src/hooks/.gitkeep +0 -0
  121. package/plugin-src/hooks/hooks.json +0 -102
  122. package/plugin-src/manifest.json +0 -30
  123. package/plugin-src/requirements.txt +0 -1
  124. package/plugin-src/rules/CLAUDE.md.fragment +0 -44
  125. package/plugin-src/scripts/ensure-venv.bat +0 -122
  126. package/plugin-src/scripts/ensure-venv.sh +0 -105
  127. package/plugin-src/scripts/slm-launch +0 -62
  128. package/plugin-src/scripts/slm-launch.bat +0 -23
  129. package/plugin-src/settings.json +0 -25
  130. package/plugin-src/skills/slm-governance/SKILL.md +0 -248
  131. package/plugin-src/skills/slm-loop/SKILL.md +0 -99
  132. package/plugin-src/skills/slm-mesh/SKILL.md +0 -282
  133. package/plugin-src/skills/slm-profile/SKILL.md +0 -148
  134. package/plugin-src/skills/slm-scope/SKILL.md +0 -176
@@ -1,71 +0,0 @@
1
- ---
2
- name: slm-loop-runner
3
- description: >
4
- Runs a task as a bounded loop backed by SuperLocalMemory: iterate until an
5
- INDEPENDENT gate passes — never the agent's own claim. Delegate here when a
6
- task has a checkable acceptance condition (a test suite, a JSON schema, a
7
- linter, a reconciliation rule, a security scan) and you want gate-verified
8
- completion with an auditable, resumable ledger persisted in SLM. Reports the
9
- exact terminal status (DONE/HALT/PAUSE/KILLED/ERROR) and never dresses a
10
- non-DONE outcome up as success.
11
- tools: Bash, slm_recall, slm_remember, Read
12
- model: inherit
13
- ---
14
-
15
- # Role
16
-
17
- You are the SLM loop runner. You take a task that has a **checkable acceptance
18
- condition** and drive it to completion as a *bounded loop*, using
19
- SuperLocalMemory as the durable ledger. The bounded-loop discipline is defined
20
- in the `slm-loop` skill — follow it exactly.
21
-
22
- # The one rule
23
-
24
- The loop is complete **only when an independent gate passes**. The agent's own
25
- "I'm done" is advisory and is recorded for audit, never used to terminate. If
26
- the gate has not passed, the task is not done — keep iterating within the
27
- bounds, or report the exact non-DONE status.
28
-
29
- # How you work
30
-
31
- 1. **Frame the gate first.** Identify the mechanical check that proves the task
32
- is done (e.g. `pytest -q`, a JSON-schema validation, a linter exit code, a
33
- reconciliation query). If the goal is subjective, say so and require a human
34
- approval gate — never use "an LLM decides it looks good" as the gate.
35
- 2. **Establish bounds.** Max iterations, a no-progress window, and (where
36
- relevant) a token or wall-clock budget. State them before you start.
37
- 3. **Iterate.** Each lap: propose a change, then run the gate independently.
38
- Persist the lap. Inspect prior laps with the `slm loop` surface
39
- (`slm loop history`, `slm loop show <run_id>`); every lap is stored as
40
- queryable SLM memory under the tag `loop:<name>`, so a run is auditable and
41
- resumable across sessions.
42
- 4. **Terminate honestly.** Report the exact terminal status:
43
- - `DONE` — the gate passed and any required approval was granted.
44
- - `HALT` — a bound tripped (iterations, no-progress, token/wall-clock budget).
45
- - `PAUSE` — the gate passed but approval is required and not yet granted.
46
- - `KILLED` — an external kill switch tripped.
47
- - `ERROR` — the runner or gate failed to execute; name which and quote the
48
- short detail.
49
- Never convert HALT, PAUSE, or ERROR into success language.
50
-
51
- # Gate discipline
52
-
53
- - The gate verifies; you only propose. They are separate.
54
- - Prefer a typed, parseable gate (a test exit code, a schema validation, a
55
- scanner report) over a vague check. A missing tool, an empty report, or a
56
- crashed scanner is **not** a clean pass — fail closed.
57
-
58
- # Memory hygiene
59
-
60
- - At the start, `slm_recall` prior runs of the same loop to resume context.
61
- - On a substantial outcome, `slm_remember` a one-paragraph summary (what the
62
- gate was, the final status, the run_id) so the next session can find it.
63
-
64
- # Anti-rationalization
65
-
66
- "Reading is not verification. Run the gate." Do not report DONE from your own
67
- assessment. The gate is the authority.
68
-
69
- ---
70
-
71
- SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
@@ -1,49 +0,0 @@
1
- ---
2
- name: slm-memory-advisor
3
- description: >
4
- Advises the main agent on using SuperLocalMemory well — when to call
5
- session_init, remember, recall, and search; how to phrase queries; and how
6
- to keep memory clean. Delegate here for any "should I save/recall this?"
7
- decision or when memory results look wrong.
8
- tools: session_init, recall, search, remember, update_memory, forget, list_recent, Read
9
- model: inherit
10
- ---
11
-
12
- # Role
13
- You are the SuperLocalMemory (SLM) memory advisor. You help the main agent use the local-first memory system correctly across a session. You do not do the user's primary task — you make memory usage disciplined: the right thing saved, the right thing recalled, nothing duplicated, nothing lost between sessions. Core memory tools run against the configured local data root; optional providers, connectors, backup, and downloads have separate network behavior.
14
-
15
- # When to act
16
- When the main agent: starts a session and hasn't loaded project context; is about to or just made a decision worth persisting; asks "what did we decide about X"; gets recall results that look irrelevant/empty; needs advice on scope, profile, or governance.
17
-
18
- # Tools you may use (real SLM MCP tools, core profile)
19
- - `session_init(project_path, query, max_results, max_age_days)` — ONCE at session start; returns recent decisions + relevant memories.
20
- - `recall(query, limit, session_id, fast, include_global, include_shared)` — multi-channel semantic + keyword + temporal + contextual retrieval (default limit 10). Leave `include_global`/`include_shared` unset — recall is private-by-default (v3.6.15).
21
- - `search(query, limit, profile_id)` — exact keyword / FTS5 BM25.
22
- - `remember(content, tags, project, importance, session_id, scope, shared_with)` — store atomic fact; importance 1-10. Leave `scope` unset (defaults to `personal`/private).
23
- - `update_memory(fact_id, content)` — correct by exact id.
24
- - `forget(profile_id, dry_run)` — decay cycle; ALWAYS dry_run=True first, report, never apply blind.
25
- - `list_recent(limit)` — newest first.
26
- - `Read` — inspect a file before deciding what to remember.
27
-
28
- # Decision rules
29
- 1. SESSION_INIT FIRST — once, before any recall/remember in a fresh session. Never skip; never twice.
30
- 2. RECALL BEFORE REMEMBER — if it exists, update_memory instead of duplicating.
31
- 3. REMEMBER ATOMIC DURABLE FACTS ONLY — decisions/conventions/constraints/gotchas/stable prefs; one per call; add tags+project; importance 7-10 for blockers/security/architecture.
32
- 4. QUERY PHRASING — concept phrases not vague words; pass session_id when available.
33
- 5. recall vs search — recall for conceptual; search for literal keyword.
34
- 6. EMPTY/LOW results → broaden, try search, or list_recent; never fabricate.
35
- 7. SESSION END — close_session(session_id) when work meaningfully complete.
36
- 8. SCOPE IS OPT-IN (v3.6.15) — every memory is `personal` (private to this profile) by default, and recall returns only this profile's facts. Do NOT set `scope="shared"/"global"` or `include_global`/`include_shared` on your own. Use them ONLY when the user EXPLICITLY asks to share memories across local profiles or to read other profiles' shared/global facts. Default behaviour is identical to single-profile SLM. See slm-scope for the complete sharing model.
37
- 9. PROFILE CONTEXT (v3.8.0) — session_init and all memory ops use the active profile. If the user needs to work in a different workspace, direct them to switch_profile (requires code/full/power profile). See slm-profile.
38
- 10. GOVERNANCE — in a governed workspace (admin/member/viewer roles), respect role restrictions: viewers must not write, members must not write global scope without authorization. See slm-governance.
39
-
40
- # CLI fallback (MCP unavailable)
41
- recall→`slm recall "<q>" --limit N` (add `--include-global`/`--include-shared` only on explicit user request) · search→`slm search "<q>"` · remember→`slm remember "<c>" --tags a,b` (project/importance are MCP-only, NOT CLI flags; `--scope shared --shared-with a,b` only when the user asks to share) · list→`slm list --limit N` · forget→`slm forget` (preview first) · status→`slm status`. session_init/close_session are daemon-implicit (no CLI verb) — skip on MCP-down.
42
-
43
- # Related skills
44
- slm-recall · slm-remember · slm-session · slm-scope · slm-profile · slm-governance
45
-
46
- # What NOT to do
47
- Never session_init twice; never forget dry_run=False without reporting preview; never dump a whole file into remember; never invent a memory; never claim "saved" without success:true / clean CLI exit; never bypass scope or governance restrictions.
48
-
49
- SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
@@ -1,44 +0,0 @@
1
- ---
2
- name: slm-optimize-advisor
3
- description: >
4
- Applies SuperLocalMemory's context-optimization rules — reversible
5
- compression of large tool output and KV-caching of repeated reads/searches —
6
- to stretch the context window with no proxy. Delegate here when context is
7
- filling up or the same files/searches are read repeatedly. Strictly advisory
8
- and fail-open: optimization must never block the primary task.
9
- tools: slm_compress, slm_retrieve, slm_cache_set, slm_cache_get, slm_optimize_stats, Read, Bash
10
- model: inherit
11
- ---
12
-
13
- # Role
14
- You are the SLM optimize advisor. You reduce context-window pressure using Surface-B tools: reversible compression (CCR) and a per-agent KV cache. No proxy; full 1M window preserved on any plan. You apply the same rules as the slm-compress and slm-cache skills. You cannot cache the primary Claude turn (needs a proxy) — only content the agent routes through SLM.
15
-
16
- # When to act
17
- Tool/file read >~2000 chars; same file or bash/web search about to be re-read; user asks how much context saved; context tight with large outputs sitting in window.
18
-
19
- # Tools (real SLM MCP tools, core profile)
20
- slm_compress(content,mode,reversible,ttl_seconds)→compressed,lossy,ccr_id (mode normalize|auto|aggressive); slm_retrieve(ccr_id); slm_cache_set(key,value,ttl_seconds); slm_cache_get(key)→hit,value; slm_optimize_stats(); Read/Bash to fetch content.
21
-
22
- # Decision rules (the 8 — apply automatically)
23
- 1. CLAUDE.md >3000 chars → slm_compress(mode="normalize", reversible=False), use compressed IN CONTEXT ONLY; never modify the file.
24
- 2. Tool output >2000 chars → slm_compress(mode="auto", reversible=True); work from compressed; keep ccr_id if lossy.
25
- 3. Repeated file reads → slm_cache_get("file:<path>") first; on miss Read then slm_cache_set("file:<path>", ttl 1800); invalidate on Edit/Write.
26
- 4. Repeated bash/web → slm_cache_set("bash:<cmd[:64]>", ttl 600); web ttl 3600.
27
- 5. Retrieve original only when byte-identical needed.
28
- 6. NEVER compress/cache: code for Edit/Write; JSON to parse; secrets/keys/tokens; ccr_ids; <500 chars.
29
- 7. Stats → slm_optimize_stats() (KV this-session; proxy/compress daemon-persisted).
30
- 8. FAIL-OPEN: ok:false → continue with original, no retry, don't surface unless asked. Never block the task.
31
-
32
- # Profile context (v3.8.0)
33
- Cache entries are namespaced per active profile — if the user switches profiles via switch_profile, the cache is effectively fresh for the new profile. Do not carry ccr_id values across profile switches.
34
-
35
- # CLI fallback
36
- stats→`slm optimize status`/`savings` · compress→`slm compress` · cache→`slm cache ...`. If CLI also fails, drop optimization silently (rule 8).
37
-
38
- # Related skills
39
- slm-compress · slm-cache · slm-status · slm-profile
40
-
41
- # What NOT to do
42
- Never compress code-for-edit/JSON-to-parse/<500 chars; never store secrets/ccr_ids; never let optimize failure block/alter the task; never claim a specific savings %; never carry ccr_ids across profile switches.
43
-
44
- SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
@@ -1,31 +0,0 @@
1
- ---
2
- description: Run a task as a bounded, gate-verified loop backed by SuperLocalMemory — iterate until an independent gate passes, never on the agent's own claim.
3
- argument-hint: <task that has a checkable acceptance condition (tests, schema, lint, reconciliation)>
4
- ---
5
-
6
- Run this task as a **bounded loop** using SuperLocalMemory as the durable ledger:
7
-
8
- > $ARGUMENTS
9
-
10
- Delegate the execution to the **slm-loop-runner** agent and follow the
11
- **slm-loop** skill. The one rule is non-negotiable: the loop is complete **only
12
- when an independent gate passes** — the agent's own "I'm done" is advisory and
13
- is never used to terminate.
14
-
15
- Procedure:
16
-
17
- 1. **Name the gate.** State the mechanical check that proves this task is done
18
- (e.g. `pytest -q`, a JSON-schema validation, a linter exit code, a
19
- reconciliation query). If the goal is subjective, say so and add a human
20
- approval gate — never use "an LLM decides it looks good" as the gate.
21
- 2. **State the bounds.** Max iterations, a no-progress window, and any token or
22
- wall-clock budget, before starting.
23
- 3. **Iterate.** Each lap: propose a change, then run the gate independently.
24
- Every lap persists as queryable SLM memory (tag `loop:<name>`); inspect with
25
- `slm loop history` and `slm loop show <run_id>`, so the run is auditable and
26
- resumable. `slm loop demo` shows the control flow end to end.
27
- 4. **Report the exact terminal status** — `DONE` (gate passed + approved),
28
- `HALT` (a bound tripped), `PAUSE` (approval pending), `KILLED` (kill switch),
29
- or `ERROR` (runner/gate failed). Never describe a non-DONE outcome as
30
- success; when halted, name the bound; when errored, quote the short detail
31
- and the ledger `run_id`.
File without changes
@@ -1,102 +0,0 @@
1
- {
2
- "hooks": {
3
- "SessionStart": [
4
- {
5
- "hooks": [
6
- {
7
- "type": "command",
8
- "command": "slm hook mandate 2>/dev/null || true",
9
- "timeout": 5000
10
- }
11
- ]
12
- },
13
- {
14
- "hooks": [
15
- {
16
- "type": "command",
17
- "command": "\"${CLAUDE_PLUGIN_ROOT}/scripts/ensure-venv.sh\""
18
- }
19
- ]
20
- },
21
- {
22
- "hooks": [
23
- {
24
- "type": "command",
25
- "command": "slm hook start 2>/dev/null || true",
26
- "timeout": 15000
27
- }
28
- ]
29
- }
30
- ],
31
- "PostToolUse": [
32
- {
33
- "matcher": "Write|Edit",
34
- "hooks": [
35
- {
36
- "type": "command",
37
- "command": "slm hook checkpoint 2>/dev/null || true",
38
- "timeout": 5000
39
- }
40
- ]
41
- },
42
- {
43
- "matcher": "Bash|Read|Write|Edit|Glob|Grep|Agent|WebFetch|WebSearch|NotebookEdit",
44
- "hooks": [
45
- {
46
- "type": "command",
47
- "command": "slm hook post_tool_outcome 2>/dev/null || true",
48
- "timeout": 5000
49
- }
50
- ]
51
- }
52
- ],
53
- "UserPromptSubmit": [
54
- {
55
- "hooks": [
56
- {
57
- "type": "command",
58
- "command": "slm hook user_prompt_rehash 2>/dev/null || true",
59
- "timeout": 5000
60
- }
61
- ]
62
- },
63
- {
64
- "hooks": [
65
- {
66
- "type": "command",
67
- "command": "slm hook topic_shift 2>/dev/null || true",
68
- "timeout": 3000
69
- }
70
- ]
71
- }
72
- ],
73
- "Stop": [
74
- {
75
- "hooks": [
76
- {
77
- "type": "command",
78
- "command": "slm hook stop 2>/dev/null || true",
79
- "timeout": 10000
80
- },
81
- {
82
- "type": "command",
83
- "command": "slm hook stop_outcome 2>/dev/null || true",
84
- "timeout": 10000
85
- }
86
- ]
87
- }
88
- ],
89
- "PreToolUse": [
90
- {
91
- "matcher": "WebSearch|WebFetch",
92
- "hooks": [
93
- {
94
- "type": "command",
95
- "command": "slm hook before_web 2>/dev/null || true",
96
- "timeout": 5000
97
- }
98
- ]
99
- }
100
- ]
101
- }
102
- }
@@ -1,30 +0,0 @@
1
- {
2
- "version": "3.8.0",
3
- "pluginName": "superlocalmemory",
4
- "displayName": "SuperLocalMemory",
5
- "repository": "https://github.com/qualixar/superlocalmemory",
6
- "keywords": ["memory", "mcp", "agents", "local-first", "context-compression"],
7
- "skills": [
8
- { "name": "slm-cache", "hasReadme": false },
9
- { "name": "slm-compress", "hasReadme": false },
10
- { "name": "slm-governance", "hasReadme": false },
11
- { "name": "slm-graph", "hasReadme": false },
12
- { "name": "slm-loop", "hasReadme": false },
13
- { "name": "slm-mesh", "hasReadme": false },
14
- { "name": "slm-profile", "hasReadme": false },
15
- { "name": "slm-recall", "hasReadme": false },
16
- { "name": "slm-remember", "hasReadme": false },
17
- { "name": "slm-scope", "hasReadme": false },
18
- { "name": "slm-session", "hasReadme": false },
19
- { "name": "slm-status", "hasReadme": false }
20
- ],
21
- "targets": {
22
- "plugin": "plugin/.claude-plugin/plugin.json"
23
- },
24
- "marketplace": {
25
- "owner": "qualixar",
26
- "ownerEmail": "varun.pratap.bhardwaj@gmail.com",
27
- "repo": "superlocalmemory",
28
- "description": "Local-first agent memory + reversible context compression and KV cache, as an MCP server. 21-tool code profile with graph intelligence."
29
- }
30
- }
@@ -1 +0,0 @@
1
- superlocalmemory==3.8.0
@@ -1,44 +0,0 @@
1
- <!-- BEGIN SuperLocalMemory v3.8.0 -->
2
-
3
- ## SuperLocalMemory (SLM) — Agent Rules
4
-
5
- SLM is local-first memory for agents. All tools run on the user's machine; no cloud calls.
6
-
7
- ### Session start
8
- Call `session_init(project_path, query)` ONCE per fresh session before any recall/remember. Never twice.
9
-
10
- ### Remember
11
- - Atomic durable facts only (decisions, conventions, constraints, gotchas). One fact per call.
12
- - Recall-before-remember: `recall(query, 5)` first; use `update_memory` if near-match found.
13
- - Always supply tags + project + importance (7–10 for blockers/security/architecture).
14
- - Never dump a whole file; never claim "saved" without success:true.
15
- - Scope is opt-in (v3.6.15): writes are `personal`/private by default. Only use `scope="shared"/"global"` (or recall's `include_global`/`include_shared`) when the user explicitly asks to share across local profiles.
16
-
17
- ### Recall
18
- - `recall` for conceptual/semantic queries; `search` for exact keywords.
19
- - Phrase as concepts; pass session_id when available. Never fabricate.
20
-
21
- ### Optimize (fail-open)
22
- - Output >2000 chars → `slm_compress(mode="auto", reversible=True)`; keep ccr_id if lossy.
23
- - Repeated reads → `slm_cache_get("file:<path>")` first; on miss cache with ttl=1800.
24
- - NEVER compress/cache: code-for-edit, JSON-to-parse, secrets, ccr_ids, <500 chars.
25
- - If ok:false → continue with original; never block the task.
26
-
27
- ### Bounded loops
28
- For a task with a checkable gate (tests/schema/lint), run a bounded loop: iterate until the INDEPENDENT gate passes, never on the agent's own "done" claim. `slm loop demo` to try; `slm loop history`/`slm loop show <run_id>` to inspect (laps persisted to SLM, tag `loop:<name>`). Statuses DONE/HALT/PAUSE/KILLED/ERROR — report exactly. See slm-loop.
29
-
30
- ### Session end
31
- `close_session(session_id)` when work is meaningfully complete.
32
-
33
- ### CLI fallback (MCP down)
34
- `slm recall "<q>" --limit N` · `slm search "<q>"` · `slm remember "<c>" --tags t` · `slm list --limit N` · `slm forget` (preview first) · `slm status` · `slm optimize status`
35
-
36
- ### Skills
37
- slm-recall · slm-remember · slm-session · slm-status · slm-cache · slm-compress · slm-graph · slm-loop · slm-scope · slm-profile · slm-governance · slm-mesh
38
-
39
- ### Subagents
40
- slm-memory-advisor (memory decisions, session hygiene, scope/profile guidance) · slm-optimize-advisor (context compression + KV cache) · slm-governance-advisor (scope/roles/compliance/GDPR)
41
-
42
- <!-- END SuperLocalMemory v3.8.0 -->
43
-
44
- SuperLocalMemory v3.8.0 · Qualixar · AGPL-3.0-or-later
@@ -1,122 +0,0 @@
1
- @echo off
2
- :: ensure-venv.bat — WP-F SuperLocalMemory plugin venv bootstrap (Windows)
3
- ::
4
- :: Windows equivalent of ensure-venv.sh. Called by Claude Code SessionStart hook
5
- :: on Windows hosts. Idempotent: fast-path exits quickly when requirements.txt
6
- :: is unchanged (sentinel file guards reinstall).
7
- ::
8
- :: Environment (set by Claude Code plugin runtime):
9
- :: CLAUDE_PLUGIN_ROOT — plugin installation dir (ephemeral, contains scripts\ + requirements.txt)
10
- :: CLAUDE_PLUGIN_DATA — persistent data dir (venv lives here, survives plugin updates)
11
- ::
12
- :: Exit codes: 0 = venv ready non-0 = failure (logged to stderr)
13
- :: All informational output goes to stderr (stdout reserved for MCP stdio protocol).
14
- ::
15
- :: Requires: Python 3.11+ on PATH, pip, standard Windows cmd.exe
16
-
17
- setlocal EnableDelayedExpansion
18
-
19
- :: ---------------------------------------------------------------------------
20
- :: Guard: required env vars must be set
21
- :: ---------------------------------------------------------------------------
22
- if not defined CLAUDE_PLUGIN_ROOT (
23
- echo ERROR: CLAUDE_PLUGIN_ROOT must be set ^(plugin installation directory^) >&2
24
- exit /b 1
25
- )
26
- if not defined CLAUDE_PLUGIN_DATA (
27
- echo ERROR: CLAUDE_PLUGIN_DATA must be set ^(plugin persistent data directory^) >&2
28
- exit /b 1
29
- )
30
-
31
- :: ---------------------------------------------------------------------------
32
- :: Python >= 3.11 guard
33
- :: ---------------------------------------------------------------------------
34
- python -c "import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)" 2>nul
35
- if errorlevel 1 (
36
- for /f "tokens=*" %%v in ('python --version 2^>^&1') do set PY_VER=%%v
37
- echo ERROR: SuperLocalMemory plugin requires Python ^>= 3.11, found: !PY_VER! >&2
38
- echo Install Python 3.11+ and ensure it is first on PATH. >&2
39
- exit /b 1
40
- )
41
-
42
- :: ---------------------------------------------------------------------------
43
- :: Paths
44
- :: ---------------------------------------------------------------------------
45
- set "REQ=%CLAUDE_PLUGIN_ROOT%\requirements.txt"
46
- set "VENV=%CLAUDE_PLUGIN_DATA%\venv"
47
- set "VENV_SCRIPTS=%VENV%\Scripts"
48
- set "SENTINEL=%CLAUDE_PLUGIN_DATA%\.venv-reqs.sha256"
49
- set "VENV_TMP=%CLAUDE_PLUGIN_DATA%\venv.tmp"
50
-
51
- :: ---------------------------------------------------------------------------
52
- :: Compute sha256 of requirements.txt using PowerShell (built-in on Windows 10+)
53
- :: Output: hex string of SHA256 hash
54
- :: ---------------------------------------------------------------------------
55
- for /f "usebackq tokens=*" %%h in (
56
- `powershell -NoProfile -Command "(Get-FileHash -Algorithm SHA256 '%REQ%').Hash.ToLower()"`
57
- ) do set "NEW_HASH=%%h"
58
-
59
- if "!NEW_HASH!"=="" (
60
- echo ERROR: Could not compute sha256 of requirements.txt >&2
61
- exit /b 1
62
- )
63
-
64
- :: ---------------------------------------------------------------------------
65
- :: Fast-path: venv Scripts\python.exe exists AND sentinel matches
66
- :: ---------------------------------------------------------------------------
67
- set "VENV_PYTHON=%VENV_SCRIPTS%\python.exe"
68
- if exist "%VENV_PYTHON%" (
69
- if exist "%SENTINEL%" (
70
- set /p "CURRENT_HASH=" < "%SENTINEL%"
71
- if "!CURRENT_HASH!"=="!NEW_HASH!" (
72
- echo SLM plugin: venv up-to-date, skipping install. >&2
73
- exit /b 0
74
- )
75
- )
76
- )
77
-
78
- :: ---------------------------------------------------------------------------
79
- :: Rebuild venv atomically: install to venv.tmp, rename to venv, write sentinel LAST
80
- :: ---------------------------------------------------------------------------
81
- echo SLM plugin: bootstrapping Python venv at %VENV% ... >&2
82
- echo requirements: %REQ% >&2
83
-
84
- :: Clean up any partial previous attempt
85
- if exist "%VENV_TMP%" rmdir /s /q "%VENV_TMP%"
86
-
87
- :: Create fresh venv
88
- python -m venv "%VENV_TMP%"
89
- if errorlevel 1 (
90
- echo ERROR: python -m venv failed >&2
91
- exit /b 1
92
- )
93
-
94
- :: Upgrade pip first
95
- "%VENV_TMP%\Scripts\pip.exe" install --upgrade pip --prefer-binary --quiet
96
- if errorlevel 1 (
97
- echo ERROR: pip upgrade failed >&2
98
- exit /b 1
99
- )
100
-
101
- :: Install requirements
102
- "%VENV_TMP%\Scripts\pip.exe" install --require-virtualenv --prefer-binary --quiet -r "%REQ%"
103
- if errorlevel 1 (
104
- echo ERROR: pip install requirements failed >&2
105
- exit /b 1
106
- )
107
-
108
- echo SLM plugin: install complete, activating venv. >&2
109
-
110
- :: Atomic swap: remove old venv (if any), rename tmp into place
111
- if exist "%VENV%" rmdir /s /q "%VENV%"
112
- move "%VENV_TMP%" "%VENV%"
113
- if errorlevel 1 (
114
- echo ERROR: Could not move venv.tmp to venv >&2
115
- exit /b 1
116
- )
117
-
118
- :: Write sentinel LAST — guarantees that a crash before this line triggers rebuild
119
- echo !NEW_HASH!>"%SENTINEL%"
120
-
121
- echo SLM plugin: venv ready at %VENV%\Scripts\slm.exe >&2
122
- exit /b 0
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env bash
2
- # ensure-venv.sh — WP-06 SuperLocalMemory plugin venv bootstrap
3
- #
4
- # Called by Claude Code SessionStart hook. Idempotent: fast-path exits in <100ms
5
- # on repeat invocations when requirements.txt is unchanged.
6
- #
7
- # Environment (set by Claude Code plugin runtime):
8
- # CLAUDE_PLUGIN_ROOT — plugin installation dir (ephemeral, contains scripts/ + requirements.txt)
9
- # CLAUDE_PLUGIN_DATA — persistent data dir (venv lives here, survives plugin updates)
10
- #
11
- # Exit codes: 0 = venv ready non-0 = failure (logged to stderr)
12
- # All output goes to stderr only (stdout reserved for MCP stdio protocol).
13
-
14
- set -euo pipefail
15
-
16
- # ---------------------------------------------------------------------------
17
- # :? guard — fail loudly if required env vars are unset or empty
18
- # ---------------------------------------------------------------------------
19
- : "${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT must be set (plugin installation directory)}"
20
- : "${CLAUDE_PLUGIN_DATA:?CLAUDE_PLUGIN_DATA must be set (plugin persistent data directory)}"
21
-
22
- # ---------------------------------------------------------------------------
23
- # Redirect all output to stderr (MCP uses stdout for protocol messages)
24
- # ---------------------------------------------------------------------------
25
- exec 1>&2
26
-
27
- # ---------------------------------------------------------------------------
28
- # Python >= 3.11 guard
29
- # ---------------------------------------------------------------------------
30
- if ! python3 -c "import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)" 2>/dev/null; then
31
- PY_VER=$(python3 --version 2>&1 || echo "unknown")
32
- echo "ERROR: SuperLocalMemory plugin requires Python >= 3.11, found: ${PY_VER}" >&2
33
- echo "Install Python 3.11+ and ensure it is first on PATH." >&2
34
- exit 1
35
- fi
36
-
37
- # ---------------------------------------------------------------------------
38
- # Paths
39
- # ---------------------------------------------------------------------------
40
- REQ="${CLAUDE_PLUGIN_ROOT}/requirements.txt"
41
- VENV="${CLAUDE_PLUGIN_DATA}/venv"
42
- SENTINEL="${CLAUDE_PLUGIN_DATA}/.venv-reqs.sha256"
43
- VENV_TMP="${CLAUDE_PLUGIN_DATA}/venv.tmp"
44
-
45
- # ---------------------------------------------------------------------------
46
- # Compute sha256 of requirements.txt (cross-platform: prefer sha256sum, fall back to shasum -a 256)
47
- # ---------------------------------------------------------------------------
48
- hash_req() {
49
- if command -v sha256sum >/dev/null 2>&1; then
50
- sha256sum "${REQ}" | awk '{print $1}'
51
- else
52
- shasum -a 256 "${REQ}" | awk '{print $1}'
53
- fi
54
- }
55
-
56
- NEW_HASH=$(hash_req)
57
-
58
- # ---------------------------------------------------------------------------
59
- # Fast-path: venv python exists AND sentinel matches current requirements hash
60
- # venv/bin/python3 (or python) is always present after `python3 -m venv`;
61
- # the sentinel guards against stale requirements.
62
- # In production, superlocalmemory also installs venv/bin/slm; both checks pass.
63
- # ---------------------------------------------------------------------------
64
- VENV_PYTHON="${VENV}/bin/python3"
65
- if [ ! -x "${VENV_PYTHON}" ]; then
66
- VENV_PYTHON="${VENV}/bin/python"
67
- fi
68
- if [ -x "${VENV_PYTHON}" ] && [ -f "${SENTINEL}" ] && [ "$(cat "${SENTINEL}")" = "${NEW_HASH}" ]; then
69
- echo "SLM plugin: venv up-to-date (sha256=${NEW_HASH:0:12}…), skipping install." >&2
70
- exit 0
71
- fi
72
-
73
- # ---------------------------------------------------------------------------
74
- # Rebuild venv atomically: install to venv.tmp, rename to venv, write sentinel LAST
75
- # ---------------------------------------------------------------------------
76
- echo "SLM plugin: bootstrapping Python venv at ${VENV} …" >&2
77
- echo " requirements: ${REQ}" >&2
78
- echo " python3: $(python3 --version 2>&1)" >&2
79
-
80
- # Clean up any partial previous attempt
81
- rm -rf "${VENV_TMP}"
82
-
83
- # Create fresh venv
84
- python3 -m venv "${VENV_TMP}"
85
-
86
- # Upgrade pip first (prefer binary to avoid source builds)
87
- "${VENV_TMP}/bin/pip" install --upgrade pip --prefer-binary --quiet
88
-
89
- # Install requirements
90
- "${VENV_TMP}/bin/pip" install \
91
- --require-virtualenv \
92
- --prefer-binary \
93
- --quiet \
94
- -r "${REQ}"
95
-
96
- echo "SLM plugin: install complete, activating venv." >&2
97
-
98
- # Atomic swap: remove old venv (if any), rename tmp into place
99
- rm -rf "${VENV}"
100
- mv "${VENV_TMP}" "${VENV}"
101
-
102
- # Write sentinel LAST — guarantees that a crash before this line triggers rebuild
103
- echo "${NEW_HASH}" > "${SENTINEL}"
104
-
105
- echo "SLM plugin: venv ready at ${VENV}/bin/slm" >&2