context-mode 1.0.94 → 1.0.95

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.
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Claude Code plugins by Mert Koseoğlu",
9
- "version": "1.0.94"
9
+ "version": "1.0.95"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "context-mode",
14
14
  "source": "./",
15
15
  "description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
16
- "version": "1.0.94",
16
+ "version": "1.0.95",
17
17
  "author": {
18
18
  "name": "Mert Koseoğlu"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-mode",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.",
5
5
  "author": {
6
6
  "name": "Mert Koseoğlu",
@@ -3,7 +3,7 @@
3
3
  "name": "Context Mode",
4
4
  "kind": "tool",
5
5
  "description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
6
- "version": "1.0.94",
6
+ "version": "1.0.95",
7
7
  "sandbox": {
8
8
  "mode": "permissive",
9
9
  "filesystem_access": "full",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-mode",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
5
5
  "author": {
6
6
  "name": "Mert Koseoğlu",
@@ -96,6 +96,16 @@ export interface FullReport {
96
96
  compact_count: number;
97
97
  resume_ready: boolean;
98
98
  };
99
+ /** Persistent project memory — all events across all sessions */
100
+ projectMemory: {
101
+ total_events: number;
102
+ session_count: number;
103
+ by_category: Array<{
104
+ category: string;
105
+ count: number;
106
+ label: string;
107
+ }>;
108
+ };
99
109
  }
100
110
  /** Human-readable labels for event categories. */
101
111
  export declare const categoryLabels: Record<string, string>;
@@ -155,8 +165,7 @@ export declare class AnalyticsEngine {
155
165
  * - Before/After comparison bar is the HERO — one glance = "wow"
156
166
  * - "tokens saved" is the number people share
157
167
  * - Per-tool breakdown shows what each tool SAVED, sorted by impact
158
- * - Session memory: one line, reframed as value
168
+ * - Project memory: category bars showing persistent data across sessions
159
169
  * - No: Pct column, category tables, tips, jargon
160
- * - Under 22 lines for heavy sessions, under 10 for fresh
161
170
  */
162
171
  export declare function formatReport(report: FullReport, version?: string, latestVersion?: string | null): string;
@@ -199,6 +199,16 @@ export class AnalyticsEngine {
199
199
  : "",
200
200
  why: categoryHints[row.category] || "Survives context resets",
201
201
  }));
202
+ // ── Project-wide persistent memory (all sessions, no session_id filter) ──
203
+ const projectTotals = this.db.prepare("SELECT COUNT(*) as cnt, COUNT(DISTINCT session_id) as sessions FROM session_events").get();
204
+ const projectByCategory = this.db.prepare("SELECT category, COUNT(*) as cnt FROM session_events GROUP BY category ORDER BY cnt DESC").all();
205
+ const projectMemoryByCategory = projectByCategory
206
+ .filter((row) => row.cnt > 0)
207
+ .map((row) => ({
208
+ category: row.category,
209
+ count: row.cnt,
210
+ label: categoryLabels[row.category] || row.category,
211
+ }));
202
212
  return {
203
213
  savings: {
204
214
  processed_kb: Math.round(totalProcessed / 1024 * 10) / 10,
@@ -223,6 +233,11 @@ export class AnalyticsEngine {
223
233
  compact_count: compactCount,
224
234
  resume_ready: resumeReady,
225
235
  },
236
+ projectMemory: {
237
+ total_events: projectTotals.cnt,
238
+ session_count: projectTotals.sessions,
239
+ by_category: projectMemoryByCategory,
240
+ },
226
241
  };
227
242
  }
228
243
  }
@@ -266,6 +281,24 @@ function dataBar(bytes, maxBytes, width = 40) {
266
281
  const filled = Math.max(1, Math.round((bytes / maxBytes) * width));
267
282
  return "█".repeat(Math.min(filled, width)) + "░".repeat(Math.max(0, width - filled));
268
283
  }
284
+ /**
285
+ * Render project memory section with category bars.
286
+ * Shows persistent event data across all sessions.
287
+ */
288
+ function renderProjectMemory(pm) {
289
+ if (pm.total_events === 0)
290
+ return [];
291
+ const out = [];
292
+ out.push("");
293
+ const sessionLabel = pm.session_count === 1 ? "1 session" : `${pm.session_count} sessions`;
294
+ out.push(`${fmtNum(pm.total_events)} events remembered across ${sessionLabel} \u2014 searchable after compact & restart`);
295
+ out.push("");
296
+ const maxCount = pm.by_category.length > 0 ? pm.by_category[0].count : 1;
297
+ for (const cat of pm.by_category) {
298
+ out.push(` ${cat.label.padEnd(18)} ${String(cat.count).padStart(5)} ${dataBar(cat.count, maxCount, 30)}`);
299
+ }
300
+ return out;
301
+ }
269
302
  /**
270
303
  * Render a FullReport as a visual savings dashboard designed for screenshotting.
271
304
  *
@@ -273,9 +306,8 @@ function dataBar(bytes, maxBytes, width = 40) {
273
306
  * - Before/After comparison bar is the HERO — one glance = "wow"
274
307
  * - "tokens saved" is the number people share
275
308
  * - Per-tool breakdown shows what each tool SAVED, sorted by impact
276
- * - Session memory: one line, reframed as value
309
+ * - Project memory: category bars showing persistent data across sessions
277
310
  * - No: Pct column, category tables, tips, jargon
278
- * - Under 22 lines for heavy sessions, under 10 for fresh
279
311
  */
280
312
  export function formatReport(report, version, latestVersion) {
281
313
  const lines = [];
@@ -297,6 +329,8 @@ export function formatReport(report, version, latestVersion) {
297
329
  else {
298
330
  lines.push(`${kb(totalReturned)} entered context | 0 tokens saved`);
299
331
  }
332
+ // Project memory
333
+ lines.push(...renderProjectMemory(report.projectMemory));
300
334
  // Footer
301
335
  lines.push("");
302
336
  const versionStr = version ? `v${version}` : "context-mode";
@@ -342,36 +376,8 @@ export function formatReport(report, version, latestVersion) {
342
376
  lines.push(` ${name.padEnd(22)} ${String(t.calls).padStart(4)} calls ${kb(t.estimatedSaved).padStart(8)} saved`);
343
377
  }
344
378
  }
345
- // ── Session memory — business-friendly ──
346
- if (report.continuity.total_events > 0) {
347
- lines.push("");
348
- const cats = report.continuity.by_category;
349
- // Pick the top 3-4 most impactful categories for a human-readable summary
350
- const highlights = [];
351
- const fileCount = cats.find(c => c.category === "file")?.count;
352
- const gitCount = cats.find(c => c.category === "git")?.count;
353
- const promptCount = cats.find(c => c.category === "prompt")?.count;
354
- const errorCount = cats.find(c => c.category === "error")?.count;
355
- const taskCount = cats.find(c => c.category === "task")?.count;
356
- if (fileCount)
357
- highlights.push(`${fileCount} files`);
358
- if (gitCount)
359
- highlights.push(`${gitCount} git ops`);
360
- if (promptCount)
361
- highlights.push(`${promptCount} prompts`);
362
- if (errorCount)
363
- highlights.push(`${errorCount} errors`);
364
- if (taskCount)
365
- highlights.push(`${taskCount} tasks`);
366
- const summary = highlights.length > 0 ? ` · ${highlights.join(", ")}` : "";
367
- if (report.continuity.compact_count > 0) {
368
- lines.push(`${fmtNum(report.continuity.total_events)} events remembered across ${report.continuity.compact_count} compaction${report.continuity.compact_count !== 1 ? "s" : ""}${summary}`);
369
- lines.push("Zero knowledge lost — picks up exactly where you left off.");
370
- }
371
- else {
372
- lines.push(`${fmtNum(report.continuity.total_events)} events tracked${summary}`);
373
- }
374
- }
379
+ // ── Project memory — persistent across sessions ──
380
+ lines.push(...renderProjectMemory(report.projectMemory));
375
381
  // ── Footer ──
376
382
  lines.push("");
377
383
  const versionStr = version ? `v${version}` : "context-mode";