prism-mcp-server 6.5.0 → 6.5.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 CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Smithery](https://img.shields.io/badge/Smithery-listed-6B4FBB)](https://smithery.ai)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
9
- [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
9
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
10
10
 
11
11
  **Your AI agent forgets everything between sessions. Prism fixes that.**
12
12
 
@@ -33,7 +33,7 @@ Works with **Claude Desktop · Claude Code · Cursor · Windsurf · Cline · Gem
33
33
  - [Architecture](#architecture)
34
34
  - [Scientific Foundation](#-scientific-foundation)
35
35
  - [Product Roadmap](#-product-roadmap)
36
- - [Limitations](#limitations)
36
+ - [Troubleshooting FAQ](#-troubleshooting-faq)
37
37
 
38
38
  ---
39
39
 
@@ -395,6 +395,10 @@ Soft/hard delete (Art. 17), full export in JSON, Markdown, or Obsidian vault `.z
395
395
 
396
396
  ## 🆕 What's New
397
397
 
398
+ ### v6.5.1 — Dashboard Project-Load Hotfix ✅
399
+ - 🩹 **Project Selector Recovery** — Fixed a startup path where the dashboard selector could stay stuck on "Loading projects..." when Supabase env vars were unresolved placeholders.
400
+ - 🔄 **Safe Backend Fallback** — If Supabase is requested but env is invalid/unresolved, Prism now auto-falls back to local SQLite so `/api/projects` and dashboard boot remain operational.
401
+
398
402
  ### v6.5 — HDC Cognitive Routing ✅
399
403
  > **Current stable release.** The Mind Palace gains a brain-inspired routing engine.
400
404
 
@@ -743,9 +747,21 @@ Full Superposed Memory (SDM) + Hyperdimensional Computing (HDC/VSA) becomes the
743
747
  - **v7.x: Affect-Tagged Memory** — Recall prioritization improves by weighting memories with affective/contextual valence, making surfaced context more behaviorally useful.
744
748
  - **v8+: Zero-Search Retrieval** — Direct vector-addressed recall (“just ask the vector”) reduces retrieval indirection and moves Prism toward truly native associative memory.
745
749
 
746
- ---
747
750
 
748
- ## Limitations
751
+ ## ❓ Troubleshooting FAQ
752
+
753
+ **Q: Why is the dashboard project selector stuck on "Loading projects..."?**
754
+ A: This usually means Supabase env values are unresolved placeholders (for example `${SUPABASE_URL}`) or invalid. As of v6.5.1 Prism auto-falls back to local SQLite, but you should still fix env values for cloud mode.
755
+
756
+ **Q: Why is semantic search quality weak or inconsistent?**
757
+ A: Check embedding provider configuration and key availability. Missing embedding credentials reduce semantic recall quality and can shift behavior toward keyword-heavy matches.
758
+
759
+ **Q: How do I delete a bad memory entry?**
760
+ A: Use `session_forget_memory` for targeted soft/hard deletion. For manual cleanup and merge workflows, use the dashboard graph editor.
761
+
762
+ **Q: How do I verify the install quickly?**
763
+ A: Run `npm run build && npm test`, then open the Mind Palace dashboard (`localhost:3000`) and confirm projects load plus Graph Health renders.
764
+
749
765
 
750
766
  - **LLM-dependent features require an API key.** Semantic search, Morning Briefings, auto-compaction, and VLM captioning need a `GOOGLE_API_KEY` (Gemini) or equivalent provider key. Without one, Prism falls back to keyword-only search (FTS5).
751
767
  - **Auto-load is model- and client-dependent.** Session auto-loading relies on both the LLM following system prompt instructions *and* the MCP client completing tool registration before the model's first turn. Prism provides platform-specific [Setup Guides](#-setup-guides) and a server-side fallback (v5.2.1) that auto-pushes context after 10 seconds.
package/dist/config.js CHANGED
@@ -73,38 +73,39 @@ export const PRISM_STORAGE = process.env.PRISM_STORAGE || "supabase";
73
73
  // When both SUPABASE_URL and SUPABASE_KEY are set, session memory tools
74
74
  // are registered. These tools allow AI agents to persist and recover
75
75
  // context between sessions.
76
- export const SUPABASE_URL = process.env.SUPABASE_URL;
77
- export const SUPABASE_KEY = process.env.SUPABASE_KEY;
78
- /**
79
- * SESSION_MEMORY_ENABLED — Master toggle for session persistence tools.
80
- *
81
- * Hardcoded to `true` since v3.0. This flag was originally used to gate
82
- * session memory tools when Supabase credentials were optional. Now that
83
- * session memory is a core feature (both SQLite and Supabase backends),
84
- * it is always enabled.
85
- *
86
- * The flag is kept (rather than removed) because several modules import
87
- * it for conditional registration of MCP tools. Removing it would require
88
- * a broader refactor with no functional benefit.
89
- */
90
- export const SESSION_MEMORY_ENABLED = true;
91
- // Note: debug() is defined at the bottom of this file; these lines
92
- // execute at import time after the full module is loaded by Node.
93
- if (!SESSION_MEMORY_ENABLED) {
94
- console.error("Info: Session memory disabled (set PRISM_STORAGE=local or configure Supabase)");
76
+ function sanitizeEnv(value) {
77
+ if (!value)
78
+ return undefined;
79
+ const trimmed = value.trim();
80
+ // Treat unresolved template placeholders as unset (e.g. "${SUPABASE_URL}")
81
+ if (!trimmed || trimmed.includes("${"))
82
+ return undefined;
83
+ return trimmed;
95
84
  }
96
- // ─── Optional: Multi-Tenant User ID ──────────────────────────
97
- // REVIEWER NOTE: When multiple users share the same Supabase instance,
98
- // PRISM_USER_ID isolates their data. Each user sets a unique ID in their
99
- // Claude Desktop config. All queries are scoped to this user_id.
100
- //
101
- // Defaults to "default" for backward compatibility — existing single-user
102
- // installations work without any config changes.
103
- //
104
- // For enterprise: use a stable unique identifier (UUID, email hash, etc.)
105
- // For personal use: any unique string works (e.g., "alice", "bob")
85
+ function isHttpUrl(value) {
86
+ try {
87
+ const parsed = new URL(value);
88
+ return parsed.protocol === "http:" || parsed.protocol === "https:";
89
+ }
90
+ catch {
91
+ return false;
92
+ }
93
+ }
94
+ export const SUPABASE_URL = sanitizeEnv(process.env.SUPABASE_URL);
95
+ export const SUPABASE_KEY = sanitizeEnv(process.env.SUPABASE_KEY);
96
+ export const SUPABASE_CONFIGURED = !!SUPABASE_URL &&
97
+ !!SUPABASE_KEY &&
98
+ isHttpUrl(SUPABASE_URL);
99
+ if (process.env.SUPABASE_URL && !SUPABASE_URL) {
100
+ console.error("Warning: SUPABASE_URL appears unresolved/empty (e.g. template placeholder). Falling back to local storage unless explicitly fixed.");
101
+ }
102
+ if (SUPABASE_URL && !isHttpUrl(SUPABASE_URL)) {
103
+ console.error("Warning: SUPABASE_URL is not a valid http(s) URL. Falling back to local storage.");
104
+ }
105
+ // Session memory remains core-enabled in both local and Supabase modes.
106
+ export const SESSION_MEMORY_ENABLED = true;
107
+ // Optional multi-tenant scope ID (used by storage queries and handoffs).
106
108
  export const PRISM_USER_ID = process.env.PRISM_USER_ID || "default";
107
- // Multi-tenant info logged at debug level in startServer()
108
109
  // ─── v2.1: Auto-Capture Feature ─────────────────────────────
109
110
  // REVIEWER NOTE: Automatically captures HTML snapshots of local dev servers
110
111
  // when handoffs are saved. Prevents UI context loss between sessions.
@@ -841,12 +841,7 @@ export function renderDashboardHTML(version) {
841
841
  <span style="font-size:0.75rem; color:var(--text-muted); font-weight:600;">Active Recall</span>
842
842
  <button id="testMeBtn" onclick="triggerTestMe()" class="btn-modern" style="padding:0.3rem 0.6rem; font-size:0.75rem; background:var(--accent-teal); border-color:var(--accent-teal);" title="Generate 3 quiz questions using AI">📝 Test Me</button>
843
843
  </div>
844
- <div style="display:flex; justify-content:space-between; align-items:center; margin-top:0.8rem;">
845
- <span style="font-size:0.75rem; color:var(--text-muted); font-weight:600;">Cognitive Route (v6.5)</span>
846
- <button id="cognitiveRouteBtn" onclick="triggerCognitiveRoute()" class="btn-modern" style="padding:0.3rem 0.6rem; font-size:0.75rem; background:var(--accent-blue); border-color:var(--accent-blue);" title="Resolve concept route and explain why it surfaced">🧭 Route</button>
847
- </div>
848
844
  <div id="testMeContainer" style="margin-top:0.8rem; display:flex; flex-direction:column; gap:0.5rem;"></div>
849
-
850
845
  <div style="display:flex; justify-content:space-between; align-items:center; margin-top:0.8rem;">
851
846
  <span style="font-size:0.75rem; color:var(--text-muted); font-weight:600;">Cognitive Route (v6.5)</span>
852
847
  <button id="cognitiveRouteBtn" onclick="triggerCognitiveRoute()" class="btn-modern" style="padding:0.3rem 0.6rem; font-size:0.75rem; background:var(--accent-blue); border-color:var(--accent-blue);" title="Resolve concept route and explain why it surfaced">🧭 Route</button>
@@ -2443,6 +2438,7 @@ Example:\n## Dev Rules\n- Always write tests first\n- Use TypeScript strict mode
2443
2438
  }
2444
2439
  }
2445
2440
 
2441
+ async function triggerTestMe() {
2446
2442
  var input = document.getElementById('nodeEditorInput');
2447
2443
  var oldId = input.dataset.oldId;
2448
2444
  var _gpf = document.getElementById('graphProjectFilter');
@@ -1,15 +1,4 @@
1
- /**
2
- * Storage Factory (v2.0 — Step 1)
3
- *
4
- * Unified entry point for storage initialization.
5
- * Routes between Supabase (cloud) and SQLite (local) based on
6
- * the PRISM_STORAGE environment variable.
7
- *
8
- * Usage in server.ts:
9
- * const storage = await getStorage();
10
- * // Pass `storage` to all session memory handlers
11
- */
12
- import { PRISM_STORAGE as ENV_PRISM_STORAGE } from "../config.js";
1
+ import { PRISM_STORAGE as ENV_PRISM_STORAGE, SUPABASE_CONFIGURED } from "../config.js";
13
2
  import { debugLog } from "../utils/logger.js";
14
3
  import { SupabaseStorage } from "./supabase.js";
15
4
  import { getSetting } from "./configStorage.js";
@@ -20,16 +9,22 @@ export let activeStorageBackend = "local";
20
9
  *
21
10
  * On first call: creates and initializes the appropriate backend.
22
11
  * On subsequent calls: returns the cached instance.
23
- *
24
- * @throws Error if PRISM_STORAGE=local (not yet implemented in Step 1)
25
- * @throws Error if PRISM_STORAGE=supabase but Supabase is not configured
26
12
  */
27
13
  export async function getStorage() {
28
14
  if (storageInstance)
29
15
  return storageInstance;
30
16
  // Use environment variable if explicitly set, otherwise fall back to db config
31
17
  const envStorage = process.env.PRISM_STORAGE;
32
- activeStorageBackend = envStorage || await getSetting("PRISM_STORAGE", ENV_PRISM_STORAGE);
18
+ const requestedBackend = (envStorage || await getSetting("PRISM_STORAGE", ENV_PRISM_STORAGE));
19
+ // Guardrail: if Supabase is requested but credentials are unresolved/invalid,
20
+ // transparently fall back to local mode to keep dashboard + core tools usable.
21
+ if (requestedBackend === "supabase" && !SUPABASE_CONFIGURED) {
22
+ activeStorageBackend = "local";
23
+ console.error("[Prism Storage] Supabase backend requested but SUPABASE_URL/SUPABASE_KEY are invalid or unresolved. Falling back to local storage.");
24
+ }
25
+ else {
26
+ activeStorageBackend = requestedBackend;
27
+ }
33
28
  debugLog(`[Prism Storage] Initializing backend: ${activeStorageBackend}`);
34
29
  if (activeStorageBackend === "local") {
35
30
  const { SqliteStorage } = await import("./sqlite.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prism-mcp-server",
3
- "version": "6.5.0",
3
+ "version": "6.5.2",
4
4
  "mcpName": "io.github.dcostenco/prism-mcp",
5
5
  "description": "The Mind Palace for AI Agents — persistent memory (SQLite/Supabase), behavioral learning & IDE rules sync, multimodal VLM image captioning, pluggable LLM providers (OpenAI/Anthropic/Gemini/Ollama), OpenTelemetry distributed tracing, GDPR export, multi-agent Hivemind sync, time travel, visual Mind Palace dashboard. Zero-config local mode.",
6
6
  "module": "index.ts",