prism-mcp-server 20.21.23 → 20.21.24
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 +9 -0
- package/dist/storage/sqlite.js +10 -4
- package/dist/storage/synalux.js +63 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,15 @@ or by re-enabling after each run.
|
|
|
164
164
|
<details>
|
|
165
165
|
<summary>Release history (optional)</summary>
|
|
166
166
|
|
|
167
|
+
## What's New in v20.21.24
|
|
168
|
+
|
|
169
|
+
- Synalux cloud preserves initial importance and handles votes, graduated
|
|
170
|
+
insights, and stale-score decay through the authenticated Portal API.
|
|
171
|
+
- Voting rejects inactive or inaccessible records; decay preserves archived
|
|
172
|
+
history. Existing scores remain unchanged.
|
|
173
|
+
- Graph importance thresholds use stored scores. Automatic retrieval ranking
|
|
174
|
+
and access tracking do not automatically turn ordinary memories into high-score rules.
|
|
175
|
+
|
|
167
176
|
## What's New in v20.21.23
|
|
168
177
|
|
|
169
178
|
- Factory routes suitable bounded implementation prompts and executes only the
|
package/dist/storage/sqlite.js
CHANGED
|
@@ -2279,7 +2279,8 @@ export class SqliteStorage {
|
|
|
2279
2279
|
AND importance > 0
|
|
2280
2280
|
AND event_type != 'session'
|
|
2281
2281
|
AND created_at < datetime('now', '-30 days')
|
|
2282
|
-
AND deleted_at IS NULL
|
|
2282
|
+
AND deleted_at IS NULL
|
|
2283
|
+
AND archived_at IS NULL`,
|
|
2283
2284
|
args: [project, userId],
|
|
2284
2285
|
});
|
|
2285
2286
|
const decayed = decayResult.rowsAffected || 0;
|
|
@@ -2296,12 +2297,16 @@ export class SqliteStorage {
|
|
|
2296
2297
|
// Entries reaching importance >= 7 are considered "graduated"
|
|
2297
2298
|
// and will appear prominently in behavioral warnings.
|
|
2298
2299
|
async adjustImportance(id, delta, userId) {
|
|
2299
|
-
await this.db.execute({
|
|
2300
|
+
const result = await this.db.execute({
|
|
2300
2301
|
sql: `UPDATE session_ledger
|
|
2301
2302
|
SET importance = MAX(0, importance + ?)
|
|
2302
|
-
WHERE id = ? AND user_id =
|
|
2303
|
+
WHERE id = ? AND user_id = ?
|
|
2304
|
+
AND deleted_at IS NULL
|
|
2305
|
+
AND archived_at IS NULL`,
|
|
2303
2306
|
args: [delta, id, userId],
|
|
2304
2307
|
});
|
|
2308
|
+
if (result.rowsAffected !== 1)
|
|
2309
|
+
throw new Error('Memory entry not found');
|
|
2305
2310
|
debugLog(`[SqliteStorage] Adjusted importance for ${id} by ${delta > 0 ? "+" : ""}${delta}`);
|
|
2306
2311
|
}
|
|
2307
2312
|
// ─── v4.2: Graduated Insights Query ──────────────────────────
|
|
@@ -2350,7 +2355,8 @@ export class SqliteStorage {
|
|
|
2350
2355
|
AND event_type != 'session'
|
|
2351
2356
|
AND created_at < datetime('now', '-' || ? || ' days')
|
|
2352
2357
|
AND (last_accessed_at IS NULL OR last_accessed_at < datetime('now', '-' || ? || ' days'))
|
|
2353
|
-
AND deleted_at IS NULL
|
|
2358
|
+
AND deleted_at IS NULL
|
|
2359
|
+
AND archived_at IS NULL`,
|
|
2354
2360
|
args: [project, userId, decayDays, decayDays],
|
|
2355
2361
|
});
|
|
2356
2362
|
const decayed = result.rowsAffected || 0;
|
package/dist/storage/synalux.js
CHANGED
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
*
|
|
20
20
|
* Methods migrated to portal:
|
|
21
21
|
* - saveLedger → POST /api/v1/prism/memory action=save_ledger
|
|
22
|
+
* - adjustImportance → POST /api/v1/prism/memory action=adjust_importance
|
|
23
|
+
* - getGraduatedInsights → POST /api/v1/prism/memory action=graduated_insights
|
|
24
|
+
* - decayImportance → POST /api/v1/prism/memory action=decay_importance
|
|
22
25
|
* - saveHandoff → POST /api/v1/prism/memory action=save_handoff
|
|
23
26
|
* - saveHistorySnapshot → POST /api/v1/prism/memory action=save_history_snapshot
|
|
24
27
|
* - loadContext → POST /api/v1/prism/memory action=load_context
|
|
@@ -281,9 +284,69 @@ export class SynaluxStorage extends SupabaseStorage {
|
|
|
281
284
|
role: entry.role,
|
|
282
285
|
event_type: entry.event_type,
|
|
283
286
|
confidence_score: entry.confidence_score,
|
|
287
|
+
importance: entry.importance,
|
|
284
288
|
});
|
|
285
289
|
return result.entry ?? result;
|
|
286
290
|
}
|
|
291
|
+
// Portal derives the owner and workspace from the authenticated account.
|
|
292
|
+
async adjustImportance(id, delta, _userId) {
|
|
293
|
+
if (delta !== 1 && delta !== -1) {
|
|
294
|
+
throw new Error("Importance vote delta must be 1 or -1");
|
|
295
|
+
}
|
|
296
|
+
const entryId = id.toLowerCase();
|
|
297
|
+
const result = await this.portalPost("/api/v1/prism/memory", {
|
|
298
|
+
action: "adjust_importance", id: entryId, delta,
|
|
299
|
+
});
|
|
300
|
+
const entry = result.entry;
|
|
301
|
+
if (!entry || entry.id !== entryId || typeof entry.importance !== "number"
|
|
302
|
+
|| !Number.isInteger(entry.importance) || entry.importance < 0) {
|
|
303
|
+
throw new Error("Importance vote contract drift: updated entry is required");
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async getGraduatedInsights(project, _userId, minImportance = 7) {
|
|
307
|
+
const entries = [];
|
|
308
|
+
const seen = new Set();
|
|
309
|
+
let offset = 0;
|
|
310
|
+
let total;
|
|
311
|
+
while (true) {
|
|
312
|
+
const result = await this.portalPost("/api/v1/prism/memory", {
|
|
313
|
+
action: "graduated_insights", project, min_importance: minImportance, offset,
|
|
314
|
+
});
|
|
315
|
+
const page = result.page;
|
|
316
|
+
if (!Array.isArray(result.insights) || !page || !Number.isSafeInteger(page.total)
|
|
317
|
+
|| page.total < 0 || typeof page.has_more !== "boolean"
|
|
318
|
+
|| (total !== undefined && total !== page.total)) {
|
|
319
|
+
throw new Error("Graduated insight contract drift or list changed; retry");
|
|
320
|
+
}
|
|
321
|
+
total = page.total;
|
|
322
|
+
for (const row of result.insights) {
|
|
323
|
+
if (!row || typeof row.id !== "string" || seen.has(row.id) || row.project !== project.trim()
|
|
324
|
+
|| typeof row.summary !== "string" || !Number.isInteger(row.importance)
|
|
325
|
+
|| row.importance < minImportance) {
|
|
326
|
+
throw new Error("Invalid graduated insight response");
|
|
327
|
+
}
|
|
328
|
+
seen.add(row.id);
|
|
329
|
+
entries.push(row);
|
|
330
|
+
}
|
|
331
|
+
if (!page.has_more) {
|
|
332
|
+
if (entries.length !== total)
|
|
333
|
+
throw new Error("Graduated insight read is incomplete");
|
|
334
|
+
return entries;
|
|
335
|
+
}
|
|
336
|
+
if (!Number.isSafeInteger(page.next_offset) || page.next_offset !== entries.length || entries.length <= offset) {
|
|
337
|
+
throw new Error("Graduated insight pagination did not advance");
|
|
338
|
+
}
|
|
339
|
+
offset = page.next_offset;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async decayImportance(project, _userId, decayDays) {
|
|
343
|
+
const result = await this.portalPost("/api/v1/prism/memory", {
|
|
344
|
+
action: "decay_importance", project, days: decayDays,
|
|
345
|
+
});
|
|
346
|
+
if (!Number.isSafeInteger(result.decayed) || result.decayed < 0) {
|
|
347
|
+
throw new Error("Importance decay contract drift: updated count is required");
|
|
348
|
+
}
|
|
349
|
+
}
|
|
287
350
|
// ─── Handoff ─────────────────────────────────────────────────
|
|
288
351
|
async saveHandoff(handoff, expectedVersion) {
|
|
289
352
|
const result = await this.portalPost("/api/v1/prism/memory", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prism-mcp-server",
|
|
3
|
-
"version": "20.21.
|
|
3
|
+
"version": "20.21.24",
|
|
4
4
|
"mcpName": "io.github.dcostenco/prism-coder",
|
|
5
5
|
"description": "Persistent session memory for AI coding agents that never leaves your machine — including the on-device model that reasons over it. Restores your prior decisions, open TODOs, and changed files across sessions; adds associative recall of related past work, semantic drift detection, and local inference. Local-first by default. Works with Claude Code, Cursor, and Codex.",
|
|
6
6
|
"module": "index.ts",
|