context-mode 0.5.20 → 0.5.22

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.
@@ -13,7 +13,7 @@
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 10 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
16
- "version": "0.5.20",
16
+ "version": "0.5.22",
17
17
  "author": {
18
18
  "name": "Mert Koseoğlu"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-mode",
3
- "version": "0.5.20",
3
+ "version": "0.5.22",
4
4
  "description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 10 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
5
5
  "author": {
6
6
  "name": "Mert Koseoğlu",
package/build/server.js CHANGED
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { PolyglotExecutor } from "./executor.js";
6
6
  import { ContentStore } from "./store.js";
7
7
  import { detectRuntimes, getRuntimeSummary, getAvailableLanguages, hasBunRuntime, } from "./runtime.js";
8
- const VERSION = "0.5.20";
8
+ const VERSION = "0.5.22";
9
9
  const runtimes = detectRuntimes();
10
10
  const available = getAvailableLanguages(runtimes);
11
11
  const server = new McpServer({
package/build/store.js CHANGED
@@ -7,10 +7,21 @@
7
7
  * Use for documentation, API references, and any content where
8
8
  * you need EXACT text later — not summaries.
9
9
  */
10
- import Database from "better-sqlite3";
10
+ import { createRequire } from "node:module";
11
11
  import { readFileSync } from "node:fs";
12
12
  import { tmpdir } from "node:os";
13
13
  import { join } from "node:path";
14
+ // Lazy-load better-sqlite3 — only when ContentStore is first used.
15
+ // This lets the MCP server start instantly even if the native module
16
+ // isn't installed yet (marketplace first-run scenario).
17
+ let _Database = null;
18
+ function loadDatabase() {
19
+ if (!_Database) {
20
+ const require = createRequire(import.meta.url);
21
+ _Database = require("better-sqlite3");
22
+ }
23
+ return _Database;
24
+ }
14
25
  // ─────────────────────────────────────────────────────────
15
26
  // Constants
16
27
  // ─────────────────────────────────────────────────────────
@@ -48,6 +59,7 @@ function sanitizeQuery(query) {
48
59
  export class ContentStore {
49
60
  #db;
50
61
  constructor(dbPath) {
62
+ const Database = loadDatabase();
51
63
  const path = dbPath ?? join(tmpdir(), `context-mode-${process.pid}.db`);
52
64
  this.#db = new Database(path, { timeout: 5000 });
53
65
  this.#db.pragma("journal_mode = WAL");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-mode",
3
- "version": "0.5.20",
3
+ "version": "0.5.22",
4
4
  "type": "module",
5
5
  "description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
6
6
  "author": "Mert Koseoğlu",
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "files": [
29
29
  "build",
30
+ "server.bundle.mjs",
30
31
  "skills",
31
32
  ".claude-plugin",
32
33
  ".mcp.json",
@@ -36,6 +37,7 @@
36
37
  ],
37
38
  "scripts": {
38
39
  "build": "tsc",
40
+ "bundle": "esbuild src/server.ts --bundle --platform=node --target=node18 --format=esm --outfile=server.bundle.mjs --external:better-sqlite3 --minify",
39
41
  "prepublishOnly": "npm run build",
40
42
  "dev": "npx tsx src/server.ts",
41
43
  "setup": "npx tsx src/cli.ts setup",
@@ -59,6 +61,7 @@
59
61
  "devDependencies": {
60
62
  "@types/better-sqlite3": "^7.6.13",
61
63
  "@types/node": "^22.19.11",
64
+ "esbuild": "^0.27.3",
62
65
  "tsx": "^4.21.0",
63
66
  "typescript": "^5.7.0"
64
67
  }