prism-mcp-server 14.0.0 → 15.1.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/README.md +34 -2
- package/dist/storage/synalux.js +26 -0
- package/dist/tools/ledgerHandlers.js +16 -9
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 🧠 Prism Coder
|
|
2
2
|
|
|
3
|
+
🌐 **Read in your language:** 🇬🇧 English · [🇪🇸 Español](docs/i18n/README_es.md) · [🇫🇷 Français](docs/i18n/README_fr.md) · [🇵🇹 Português](docs/i18n/README_pt.md) · [🇷🇴 Română](docs/i18n/README_ro.md) · [🇺🇦 Українська](docs/i18n/README_uk.md) · [🇷🇺 Русский](docs/i18n/README_ru.md) · [🇩🇪 Deutsch](docs/i18n/README_de.md) · [🇯🇵 日本語](docs/i18n/README_ja.md) · [🇰🇷 한국어](docs/i18n/README_ko.md) · [🇨🇳 中文](docs/i18n/README_zh.md) · [🇸🇦 العربية](docs/i18n/README_ar.md)
|
|
4
|
+
|
|
3
5
|
**Persistent memory + tool-calling intelligence for AI agents.** *(formerly Prism MCP)*
|
|
4
6
|
|
|
5
7
|
A Model Context Protocol server that gives Claude, Cursor, and other AI tools a Mind Palace — long-term memory that survives across sessions, with semantic search, cognitive routing, a visual dashboard, and the open-weights `prism-coder:7b` / `prism-coder:14b` LLM fleet for offline tool-calling (BFCL Gold Certified, 100 % JSON validity).
|
|
@@ -11,8 +13,6 @@ A Model Context Protocol server that gives Claude, Cursor, and other AI tools a
|
|
|
11
13
|
|
|
12
14
|
> **Renamed in v14.0.0:** the project is now **Prism Coder** to cover both the Mind Palace memory server *and* the `prism-coder:7b` / `prism-coder:14b` LLM fleet on HuggingFace + Ollama. The npm package stays `prism-mcp-server` so existing install URLs and `mcp.json` entries keep working — the `prism-coder` binary has been the canonical entry point since v12.
|
|
13
15
|
|
|
14
|
-
🌐 **Translations:** [Español](docs/i18n/README_es.md) · [Français](docs/i18n/README_fr.md) · [Português](docs/i18n/README_pt.md) · [Română](docs/i18n/README_ro.md) · [Українська](docs/i18n/README_uk.md) · [Русский](docs/i18n/README_ru.md) · [Deutsch](docs/i18n/README_de.md) · [日本語](docs/i18n/README_ja.md) · [한국어](docs/i18n/README_ko.md) · [中文](docs/i18n/README_zh.md) · [العربية](docs/i18n/README_ar.md)
|
|
15
|
-
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
## What Prism Coder does
|
|
@@ -26,6 +26,20 @@ Ask "what did I decide about the auth flow last month?" and get the answer with
|
|
|
26
26
|
### 🧬 Cognitive routing
|
|
27
27
|
Different memory types live in different stores: episodic (what happened), semantic (what's true), procedural (how to do X). The router picks where to store and where to retrieve.
|
|
28
28
|
|
|
29
|
+
### 🔄 Proactive session drift detection *(new in v15)*
|
|
30
|
+
Your AI agent can now detect when it has drifted from your original goals — mid-session, automatically — and self-correct before you notice the problem.
|
|
31
|
+
|
|
32
|
+
Three direct Prism calls:
|
|
33
|
+
1. **`session_save_ledger`** — snapshot current state
|
|
34
|
+
2. **`session_cognitive_route`** — compare current work against original goals, returns `on_track / minor_drift / major_drift`
|
|
35
|
+
3. **`session_compact_ledger`** — if drifted, compress and reload only what matters
|
|
36
|
+
|
|
37
|
+
When major drift is detected, the alert routes to the **Synalux portal** so it's visible across sessions and devices — not just in the current conversation.
|
|
38
|
+
|
|
39
|
+
**Real example it caught:** A training session promised BFCL ≥90% for three AI models. The agent spent 3 hours debugging audio bugs instead. The drift check surfaced: "Training goal unmet. Layer3 corpus missing from all training sets. 0 BFCL scores measured." The session immediately re-aligned.
|
|
40
|
+
|
|
41
|
+
No scripts. No cron. No hooks. Three tool calls, Prism handles the rest.
|
|
42
|
+
|
|
29
43
|
### 🛡 Local-first
|
|
30
44
|
Free tier runs entirely on your machine — SQLite, local embedding model, no API keys, no cloud. Paid tier adds cloud sync via Synalux portal.
|
|
31
45
|
|
|
@@ -80,6 +94,23 @@ More setup details in [`docs/SETUP_GEMINI.md`](docs/SETUP_GEMINI.md).
|
|
|
80
94
|
|
|
81
95
|
(35+ tools total — full TypeScript signatures in `src/tools/`. Architecture overview in [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md).)
|
|
82
96
|
|
|
97
|
+
<details>
|
|
98
|
+
<summary>🔄 How Prism handles context compaction and context loss</summary>
|
|
99
|
+
|
|
100
|
+
The LLM context window is treated as ephemeral scratch space. All durable state lives in Prism's persistent store (SQLite / Supabase). Context compaction is a non-event.
|
|
101
|
+
|
|
102
|
+
**Boot protocol** — every session (including post-compaction) begins with a mandatory `session_load_context` call, enforced via `CLAUDE.md`. The agent is fully oriented before writing a single byte of response.
|
|
103
|
+
|
|
104
|
+
**Two persistent stores:**
|
|
105
|
+
- `session_save_ledger` — immutable append-only work log (decisions, files changed, summaries)
|
|
106
|
+
- `session_save_handoff` — versioned live-state snapshot (current task, TODOs, open context)
|
|
107
|
+
|
|
108
|
+
**Ledger compaction** (`session_compact_ledger`) — when a project exceeds a threshold (default: 50 entries), Prism summarizes old entries via LLM into a rollup row, soft-archives originals, and links them via `spawned_from` graph edges. Runs on a 12-hour background scheduler.
|
|
109
|
+
|
|
110
|
+
→ Full details: [`docs/COMPACTION.md`](docs/COMPACTION.md)
|
|
111
|
+
|
|
112
|
+
</details>
|
|
113
|
+
|
|
83
114
|
---
|
|
84
115
|
|
|
85
116
|
## Plans
|
|
@@ -152,6 +183,7 @@ See [`docs/WOW_FEATURES.md`](docs/WOW_FEATURES.md) for the algorithm catalogue.
|
|
|
152
183
|
|
|
153
184
|
**Detailed docs in this repo:**
|
|
154
185
|
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — system architecture, memory routing, HRR
|
|
186
|
+
- [`docs/COMPACTION.md`](docs/COMPACTION.md) — how Prism handles LLM context compaction and ledger compaction
|
|
155
187
|
- [`docs/SETUP_GEMINI.md`](docs/SETUP_GEMINI.md) — Gemini configuration
|
|
156
188
|
- [`docs/self-improving-agent.md`](docs/self-improving-agent.md) — adversarial eval / anti-sycophancy
|
|
157
189
|
- [`docs/rfcs/`](docs/rfcs/) — design RFCs
|
package/dist/storage/synalux.js
CHANGED
|
@@ -269,4 +269,30 @@ export class SynaluxStorage extends SupabaseStorage {
|
|
|
269
269
|
const results = Array.isArray(result.results) ? result.results : [];
|
|
270
270
|
return { count, results };
|
|
271
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Fetch skill content from Synalux portal (paid-tier single source of truth).
|
|
274
|
+
* Returns a map of { skillName → SKILL.md content } for all names that exist.
|
|
275
|
+
* Missing skills are absent from the map — caller falls back to local SQLite.
|
|
276
|
+
*
|
|
277
|
+
* Uses a public GET (no auth required) since skill content is not sensitive
|
|
278
|
+
* and the route is already in synalux-private/portal at /api/v1/skills/content.
|
|
279
|
+
*/
|
|
280
|
+
async fetchSkillContent(names) {
|
|
281
|
+
if (names.length === 0)
|
|
282
|
+
return {};
|
|
283
|
+
const url = `${this.baseUrl}/api/v1/skills/content?names=${encodeURIComponent(names.join(","))}`;
|
|
284
|
+
try {
|
|
285
|
+
const res = await fetch(url, {
|
|
286
|
+
headers: { Accept: "application/json" },
|
|
287
|
+
signal: AbortSignal.timeout(3_000),
|
|
288
|
+
});
|
|
289
|
+
if (!res.ok)
|
|
290
|
+
return {};
|
|
291
|
+
const body = await res.json();
|
|
292
|
+
return typeof body.skills === "object" && body.skills !== null ? body.skills : {};
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
return {};
|
|
296
|
+
}
|
|
297
|
+
}
|
|
272
298
|
}
|
|
@@ -30,7 +30,7 @@ import { getCurrentGitState, getGitDrift } from "../utils/git.js";
|
|
|
30
30
|
import { getSetting, getAllSettings } from "../storage/configStorage.js";
|
|
31
31
|
import { mergeHandoff, dbToHandoffSchema, sanitizeForMerge } from "../utils/crdtMerge.js";
|
|
32
32
|
import { resolveProject } from "../utils/projectResolver.js";
|
|
33
|
-
import { PRISM_USER_ID, PRISM_AUTO_CAPTURE, PRISM_CAPTURE_PORTS } from "../config.js";
|
|
33
|
+
import { PRISM_USER_ID, PRISM_AUTO_CAPTURE, PRISM_CAPTURE_PORTS, SYNALUX_CONFIGURED } from "../config.js";
|
|
34
34
|
import { captureLocalEnvironment } from "../utils/autoCapture.js";
|
|
35
35
|
import { fireCaptionAsync } from "../utils/imageCaptioner.js";
|
|
36
36
|
import { isSessionSaveLedgerArgs, isSessionSaveHandoffArgs, isSessionLoadContextArgs, isMemoryHistoryArgs, isMemoryCheckoutArgs, // v2.2.0: health check type guard
|
|
@@ -798,23 +798,30 @@ export async function sessionLoadContextHandler(args) {
|
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
// ─── Project-Aware Skill Injection ──────────────────────────
|
|
801
|
-
//
|
|
802
|
-
//
|
|
803
|
-
//
|
|
804
|
-
// continues to be stored in this server's settings under skill:<name>
|
|
805
|
-
// — synalux owns the WHICH, this server owns the WHAT, no duplication
|
|
806
|
-
// of the routing config in three repos.
|
|
801
|
+
// Routing (WHICH skills): always from Synalux /api/v1/skills/routing.
|
|
802
|
+
// Content (WHAT): paid tier → Synalux /api/v1/skills/content (batch fetch,
|
|
803
|
+
// single source of truth). Free tier / offline → local SQLite fallback.
|
|
807
804
|
const { resolveSkillsForProject } = await import("./skillRouting.js");
|
|
808
805
|
const skillsToLoad = await resolveSkillsForProject(project);
|
|
806
|
+
// Paid tier: batch-fetch all skill content from Synalux portal in one request.
|
|
807
|
+
let synaluxContent = {};
|
|
808
|
+
if (SYNALUX_CONFIGURED && storage && typeof storage.fetchSkillContent === "function") {
|
|
809
|
+
const missing = skillsToLoad.filter(n => !loadedSkills.includes(n));
|
|
810
|
+
synaluxContent = await storage
|
|
811
|
+
.fetchSkillContent(missing).catch(() => ({}));
|
|
812
|
+
debugLog(`[session_load_context] Synalux skill content fetched: ${Object.keys(synaluxContent).join(", ") || "none"}`);
|
|
813
|
+
}
|
|
809
814
|
for (const skillName of skillsToLoad) {
|
|
810
815
|
if (loadedSkills.includes(skillName))
|
|
811
816
|
continue;
|
|
812
|
-
|
|
817
|
+
// Prefer Synalux content (always up-to-date); fall back to local SQLite.
|
|
818
|
+
const content = synaluxContent[skillName] || await getSetting(`skill:${skillName}`, "");
|
|
813
819
|
if (content && content.trim()) {
|
|
820
|
+
const source = synaluxContent[skillName] ? "synalux" : "local";
|
|
814
821
|
skillBlock += `\n\n[📜 SKILL: ${skillName}]\n${content.trim()}`;
|
|
815
822
|
loadedSkills.push(skillName);
|
|
816
823
|
skillLoaded = true;
|
|
817
|
-
debugLog(`[session_load_context] Skill "${skillName}" loaded for project="${project}"`);
|
|
824
|
+
debugLog(`[session_load_context] Skill "${skillName}" loaded (${source}) for project="${project}"`);
|
|
818
825
|
}
|
|
819
826
|
}
|
|
820
827
|
// ─── Memory-Based Skill Discovery ──────────────────────────
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prism-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.1.0",
|
|
4
4
|
"mcpName": "io.github.dcostenco/prism-coder",
|
|
5
5
|
"description": "Prism Coder — Cognitive memory + tool-calling intelligence for AI agents. Mind Palace persistent memory (BFCL Gold Certified, 100% Tool-Call Accuracy, 54 Agent Skills, Zero-Search HDC/HRR retrieval, HIPAA-hardened local-first storage, SLERP-optimized GRPO alignment) plus the prism-coder:7b / 14b open-weights LLM fleet.",
|
|
6
6
|
"module": "index.ts",
|
|
@@ -117,6 +117,11 @@
|
|
|
117
117
|
"optional": true
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
+
"overrides": {
|
|
121
|
+
"hono": "^4.12.18",
|
|
122
|
+
"fast-uri": "^3.1.2",
|
|
123
|
+
"ip-address": "^10.2.0"
|
|
124
|
+
},
|
|
120
125
|
"dependencies": {
|
|
121
126
|
"@anthropic-ai/sdk": "^0.92.0",
|
|
122
127
|
"@google/generative-ai": "^0.24.1",
|